6 static inline enum opid_state
7 opid_disassemble_operand(uint64_t insn
,
9 struct opid_operand
*operand
);
11 #include "opid-dis-gen.c"
13 static inline enum opid_state
14 opid_disassemble_operands(struct opid_ctx
*ctx
, uint64_t insn
) {
15 for (size_t id
= 0; ((id
!= OPID_OPERANDS
) && ctx
->record
->operands
[id
]); ++id
) {
16 enum opid_state state
;
18 state
= opid_disassemble_operand(insn
,
19 ctx
->record
->operands
[id
],
21 if (state
!= OPID_SUCCESS
) {
22 if (state
== OPID_ERROR_OPERAND_0
)
23 state
= (enum opid_state
)((size_t)state
+ id
);
32 opid_disassemble(struct opid_ctx
*ctx
, uint64_t insn
) {
33 ctx
->record
= opid_lookup_insn(insn
);
35 if (ctx
->record
== NULL
)
36 return OPID_ERROR_LOOKUP
;
38 return opid_disassemble_operands(ctx
, insn
);