/* Populates @insn->modrm and updates @insn->next_byte to point past the ModRM byte, if any. If necessary, first collects the preceding bytes (prefixes and opcode(s)). No effect if @insn->modrm.got is already 1.  */
void insn_get_modrm(struct insn *insn)
/* Populates @insn->modrm and updates @insn->next_byte to point past the ModRM byte, if any. If necessary, first collects the preceding bytes (prefixes and opcode(s)). No effect if @insn->modrm.got is already 1.  */
void insn_get_modrm(struct insn *insn)
{
	struct insn_field *modrm = &insn->modrm;
	insn_byte_t pfx, mod;
	if (modrm->got)
		return;
	if (!insn->opcode.got)
		insn_get_opcode(insn);
	if (inat_has_modrm(insn->attr)) {
		mod = get_next(insn_byte_t, insn);
		modrm->value = mod;
		modrm->nbytes = 1;
		if (inat_is_group(insn->attr)) {
			pfx = insn_last_prefix(insn);
			insn->attr = inat_get_group_attribute(mod, pfx,
							      insn->attr);
		}
	}
	if (insn->x86_64 && inat_is_force64(insn->attr))
		insn->opnd_bytes = 8;
	modrm->got = 1;
}