Debian Codegraph @

arch/X86/X86Mapping.c

raw symbols SCIP
1 /* Capstone Disassembly Engine */cxx . . $ `<file>/arch/X86/X86Mapping.c`/
2 /* By Nguyen Anh Quynh <[email protected]>, 2013-2019 */
3
4 #ifdef CAPSTONE_HAS_X86cxx . . $ `<built-in>:420:9`!
5
6 #if defined(CAPSTONE_HAS_OSXKERNEL)
7 #include <Availability.h>
8 #endif
9
10 #include <string.h>
11 #ifndef CAPSTONE_HAS_OSXKERNEL
12 #include <stdlib.h>
13 #endif
14
15 #include "X86Mapping.h"cxx . . $ `<file>/arch/X86/X86Mapping.h`/
16 #include "X86DisassemblerDecoder.h"cxx . . $ `<file>/arch/X86/X86DisassemblerDecoder.h`/
17
18 #include "../../utils.h"cxx . . $ `<file>/utils.h`/
19
20
21 const uint64_tcxx . . $ uint64_t# arch_maskscxx . . $ arch_masks.[9] = {
22 0, 0xff,
23 0xffff, // 16bit
24 0,
25 0xffffffff, // 32bit
26 0, 0, 0,
27 0xffffffffffffffffLL // 64bit
28 };
29
30 static const x86_regcxx . . $ x86_reg# sib_base_mapcxx . . $ sib_base_map.[] = {
31 X86_REG_INVALIDcxx . . $ X86_REG_INVALID.,
32 #define ENTRYcxx . . $ `arch/X86/X86Mapping.c:32:9`!(x) X86_REG_##x,
33 ALL_SIB_BASEScxx . . $ `arch/X86/X86DisassemblerDecoder.h:394:9`!
34 #undef ENTRYcxx . . $ `arch/X86/X86Mapping.c:32:9`!
35 };
36
37 // Fill-ins to make the compiler happy. These constants are never actually
38 // assigned; they are just filler to make an automatically-generated switch
39 // statement work.
40 enumcxx . . $ $anonymous_type_12e7ede1dbea823d_0# {
41 X86_REG_BX_SIcxx . . $ X86_REG_BX_SI. = 500,
42 X86_REG_BX_DIcxx . . $ X86_REG_BX_DI. = 501,
43 X86_REG_BP_SIcxx . . $ X86_REG_BP_SI. = 502,
44 X86_REG_BP_DIcxx . . $ X86_REG_BP_DI. = 503,
45 X86_REG_sibcxx . . $ X86_REG_sib. = 504,
46 X86_REG_sib64cxx . . $ X86_REG_sib64. = 505
47 };
48
49 static const x86_regcxx . . $ x86_reg# sib_index_mapcxx . . $ sib_index_map.[] = {
50 X86_REG_INVALIDcxx . . $ X86_REG_INVALID.,
51 #define ENTRYcxx . . $ `arch/X86/X86Mapping.c:51:9`!(x) X86_REG_##x,
52 ALL_EA_BASEScxx . . $ `arch/X86/X86DisassemblerDecoder.h:389:9`!
53 REGS_XMMcxx . . $ `arch/X86/X86DisassemblerDecoder.h:226:9`!
54 REGS_YMMcxx . . $ `arch/X86/X86DisassemblerDecoder.h:261:9`!
55 REGS_ZMMcxx . . $ `arch/X86/X86DisassemblerDecoder.h:295:9`!
56 #undef ENTRYcxx . . $ `arch/X86/X86Mapping.c:51:9`!
57 };
58
59 static const x86_regcxx . . $ x86_reg# segment_mapcxx . . $ segment_map.[] = {
60 X86_REG_INVALIDcxx . . $ X86_REG_INVALID.,
61 X86_REG_CScxx . . $ X86_REG_CS.,
62 X86_REG_SScxx . . $ X86_REG_SS.,
63 X86_REG_DScxx . . $ X86_REG_DS.,
64 X86_REG_EScxx . . $ X86_REG_ES.,
65 X86_REG_FScxx . . $ X86_REG_FS.,
66 X86_REG_GScxx . . $ X86_REG_GS.,
67 };
68
69 x86_regcxx . . $ x86_reg# x86_map_sib_basecxx . . $ x86_map_sib_base(37ad6efd5b145422).(int r)
70 {
71 return sib_base_mapcxx . . $ sib_base_map.[r];
72 }
73
74 x86_regcxx . . $ x86_reg# x86_map_sib_indexcxx . . $ x86_map_sib_index(37ad6efd5b145422).(int r)
75 {
76 return sib_index_mapcxx . . $ sib_index_map.[r];
77 }
78
79 x86_regcxx . . $ x86_reg# x86_map_segmentcxx . . $ x86_map_segment(37ad6efd5b145422).(int r)
80 {
81 return segment_mapcxx . . $ segment_map.[r];
82 }
83
84 #ifndef CAPSTONE_DIET
85 static const name_mapcxx . . $ name_map# reg_name_mapscxx . . $ reg_name_maps.[] = {
86 { X86_REG_INVALIDcxx . . $ X86_REG_INVALID., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`! },
87
88 { X86_REG_AHcxx . . $ X86_REG_AH., "ah" },
89 { X86_REG_ALcxx . . $ X86_REG_AL., "al" },
90 { X86_REG_AXcxx . . $ X86_REG_AX., "ax" },
91 { X86_REG_BHcxx . . $ X86_REG_BH., "bh" },
92 { X86_REG_BLcxx . . $ X86_REG_BL., "bl" },
93 { X86_REG_BPcxx . . $ X86_REG_BP., "bp" },
94 { X86_REG_BPLcxx . . $ X86_REG_BPL., "bpl" },
95 { X86_REG_BXcxx . . $ X86_REG_BX., "bx" },
96 { X86_REG_CHcxx . . $ X86_REG_CH., "ch" },
97 { X86_REG_CLcxx . . $ X86_REG_CL., "cl" },
98 { X86_REG_CScxx . . $ X86_REG_CS., "cs" },
99 { X86_REG_CXcxx . . $ X86_REG_CX., "cx" },
100 { X86_REG_DHcxx . . $ X86_REG_DH., "dh" },
101 { X86_REG_DIcxx . . $ X86_REG_DI., "di" },
102 { X86_REG_DILcxx . . $ X86_REG_DIL., "dil" },
103 { X86_REG_DLcxx . . $ X86_REG_DL., "dl" },
104 { X86_REG_DScxx . . $ X86_REG_DS., "ds" },
105 { X86_REG_DXcxx . . $ X86_REG_DX., "dx" },
106 { X86_REG_EAXcxx . . $ X86_REG_EAX., "eax" },
107 { X86_REG_EBPcxx . . $ X86_REG_EBP., "ebp" },
108 { X86_REG_EBXcxx . . $ X86_REG_EBX., "ebx" },
109 { X86_REG_ECXcxx . . $ X86_REG_ECX., "ecx" },
110 { X86_REG_EDIcxx . . $ X86_REG_EDI., "edi" },
111 { X86_REG_EDXcxx . . $ X86_REG_EDX., "edx" },
112 { X86_REG_EFLAGScxx . . $ X86_REG_EFLAGS., "flags" },
113 { X86_REG_EIPcxx . . $ X86_REG_EIP., "eip" },
114 { X86_REG_EIZcxx . . $ X86_REG_EIZ., "eiz" },
115 { X86_REG_EScxx . . $ X86_REG_ES., "es" },
116 { X86_REG_ESIcxx . . $ X86_REG_ESI., "esi" },
117 { X86_REG_ESPcxx . . $ X86_REG_ESP., "esp" },
118 { X86_REG_FPSWcxx . . $ X86_REG_FPSW., "fpsw" },
119 { X86_REG_FScxx . . $ X86_REG_FS., "fs" },
120 { X86_REG_GScxx . . $ X86_REG_GS., "gs" },
121 { X86_REG_IPcxx . . $ X86_REG_IP., "ip" },
122 { X86_REG_RAXcxx . . $ X86_REG_RAX., "rax" },
123 { X86_REG_RBPcxx . . $ X86_REG_RBP., "rbp" },
124 { X86_REG_RBXcxx . . $ X86_REG_RBX., "rbx" },
125 { X86_REG_RCXcxx . . $ X86_REG_RCX., "rcx" },
126 { X86_REG_RDIcxx . . $ X86_REG_RDI., "rdi" },
127 { X86_REG_RDXcxx . . $ X86_REG_RDX., "rdx" },
128 { X86_REG_RIPcxx . . $ X86_REG_RIP., "rip" },
129 { X86_REG_RIZcxx . . $ X86_REG_RIZ., "riz" },
130 { X86_REG_RSIcxx . . $ X86_REG_RSI., "rsi" },
131 { X86_REG_RSPcxx . . $ X86_REG_RSP., "rsp" },
132 { X86_REG_SIcxx . . $ X86_REG_SI., "si" },
133 { X86_REG_SILcxx . . $ X86_REG_SIL., "sil" },
134 { X86_REG_SPcxx . . $ X86_REG_SP., "sp" },
135 { X86_REG_SPLcxx . . $ X86_REG_SPL., "spl" },
136 { X86_REG_SScxx . . $ X86_REG_SS., "ss" },
137 { X86_REG_CR0cxx . . $ X86_REG_CR0., "cr0" },
138 { X86_REG_CR1cxx . . $ X86_REG_CR1., "cr1" },
139 { X86_REG_CR2cxx . . $ X86_REG_CR2., "cr2" },
140 { X86_REG_CR3cxx . . $ X86_REG_CR3., "cr3" },
141 { X86_REG_CR4cxx . . $ X86_REG_CR4., "cr4" },
142 { X86_REG_CR5cxx . . $ X86_REG_CR5., "cr5" },
143 { X86_REG_CR6cxx . . $ X86_REG_CR6., "cr6" },
144 { X86_REG_CR7cxx . . $ X86_REG_CR7., "cr7" },
145 { X86_REG_CR8cxx . . $ X86_REG_CR8., "cr8" },
146 { X86_REG_CR9cxx . . $ X86_REG_CR9., "cr9" },
147 { X86_REG_CR10cxx . . $ X86_REG_CR10., "cr10" },
148 { X86_REG_CR11cxx . . $ X86_REG_CR11., "cr11" },
149 { X86_REG_CR12cxx . . $ X86_REG_CR12., "cr12" },
150 { X86_REG_CR13cxx . . $ X86_REG_CR13., "cr13" },
151 { X86_REG_CR14cxx . . $ X86_REG_CR14., "cr14" },
152 { X86_REG_CR15cxx . . $ X86_REG_CR15., "cr15" },
153 { X86_REG_DR0cxx . . $ X86_REG_DR0., "dr0" },
154 { X86_REG_DR1cxx . . $ X86_REG_DR1., "dr1" },
155 { X86_REG_DR2cxx . . $ X86_REG_DR2., "dr2" },
156 { X86_REG_DR3cxx . . $ X86_REG_DR3., "dr3" },
157 { X86_REG_DR4cxx . . $ X86_REG_DR4., "dr4" },
158 { X86_REG_DR5cxx . . $ X86_REG_DR5., "dr5" },
159 { X86_REG_DR6cxx . . $ X86_REG_DR6., "dr6" },
160 { X86_REG_DR7cxx . . $ X86_REG_DR7., "dr7" },
161 { X86_REG_DR8cxx . . $ X86_REG_DR8., "dr8" },
162 { X86_REG_DR9cxx . . $ X86_REG_DR9., "dr9" },
163 { X86_REG_DR10cxx . . $ X86_REG_DR10., "dr10" },
164 { X86_REG_DR11cxx . . $ X86_REG_DR11., "dr11" },
165 { X86_REG_DR12cxx . . $ X86_REG_DR12., "dr12" },
166 { X86_REG_DR13cxx . . $ X86_REG_DR13., "dr13" },
167 { X86_REG_DR14cxx . . $ X86_REG_DR14., "dr14" },
168 { X86_REG_DR15cxx . . $ X86_REG_DR15., "dr15" },
169 { X86_REG_FP0cxx . . $ X86_REG_FP0., "fp0" },
170 { X86_REG_FP1cxx . . $ X86_REG_FP1., "fp1" },
171 { X86_REG_FP2cxx . . $ X86_REG_FP2., "fp2" },
172 { X86_REG_FP3cxx . . $ X86_REG_FP3., "fp3" },
173 { X86_REG_FP4cxx . . $ X86_REG_FP4., "fp4" },
174 { X86_REG_FP5cxx . . $ X86_REG_FP5., "fp5" },
175 { X86_REG_FP6cxx . . $ X86_REG_FP6., "fp6" },
176 { X86_REG_FP7cxx . . $ X86_REG_FP7., "fp7" },
177 { X86_REG_K0cxx . . $ X86_REG_K0., "k0" },
178 { X86_REG_K1cxx . . $ X86_REG_K1., "k1" },
179 { X86_REG_K2cxx . . $ X86_REG_K2., "k2" },
180 { X86_REG_K3cxx . . $ X86_REG_K3., "k3" },
181 { X86_REG_K4cxx . . $ X86_REG_K4., "k4" },
182 { X86_REG_K5cxx . . $ X86_REG_K5., "k5" },
183 { X86_REG_K6cxx . . $ X86_REG_K6., "k6" },
184 { X86_REG_K7cxx . . $ X86_REG_K7., "k7" },
185 { X86_REG_MM0cxx . . $ X86_REG_MM0., "mm0" },
186 { X86_REG_MM1cxx . . $ X86_REG_MM1., "mm1" },
187 { X86_REG_MM2cxx . . $ X86_REG_MM2., "mm2" },
188 { X86_REG_MM3cxx . . $ X86_REG_MM3., "mm3" },
189 { X86_REG_MM4cxx . . $ X86_REG_MM4., "mm4" },
190 { X86_REG_MM5cxx . . $ X86_REG_MM5., "mm5" },
191 { X86_REG_MM6cxx . . $ X86_REG_MM6., "mm6" },
192 { X86_REG_MM7cxx . . $ X86_REG_MM7., "mm7" },
193 { X86_REG_R8cxx . . $ X86_REG_R8., "r8" },
194 { X86_REG_R9cxx . . $ X86_REG_R9., "r9" },
195 { X86_REG_R10cxx . . $ X86_REG_R10., "r10" },
196 { X86_REG_R11cxx . . $ X86_REG_R11., "r11" },
197 { X86_REG_R12cxx . . $ X86_REG_R12., "r12" },
198 { X86_REG_R13cxx . . $ X86_REG_R13., "r13" },
199 { X86_REG_R14cxx . . $ X86_REG_R14., "r14" },
200 { X86_REG_R15cxx . . $ X86_REG_R15., "r15" },
201 { X86_REG_ST0cxx . . $ X86_REG_ST0., "st(0)" },
202 { X86_REG_ST1cxx . . $ X86_REG_ST1., "st(1)" },
203 { X86_REG_ST2cxx . . $ X86_REG_ST2., "st(2)" },
204 { X86_REG_ST3cxx . . $ X86_REG_ST3., "st(3)" },
205 { X86_REG_ST4cxx . . $ X86_REG_ST4., "st(4)" },
206 { X86_REG_ST5cxx . . $ X86_REG_ST5., "st(5)" },
207 { X86_REG_ST6cxx . . $ X86_REG_ST6., "st(6)" },
208 { X86_REG_ST7cxx . . $ X86_REG_ST7., "st(7)" },
209 { X86_REG_XMM0cxx . . $ X86_REG_XMM0., "xmm0" },
210 { X86_REG_XMM1cxx . . $ X86_REG_XMM1., "xmm1" },
211 { X86_REG_XMM2cxx . . $ X86_REG_XMM2., "xmm2" },
212 { X86_REG_XMM3cxx . . $ X86_REG_XMM3., "xmm3" },
213 { X86_REG_XMM4cxx . . $ X86_REG_XMM4., "xmm4" },
214 { X86_REG_XMM5cxx . . $ X86_REG_XMM5., "xmm5" },
215 { X86_REG_XMM6cxx . . $ X86_REG_XMM6., "xmm6" },
216 { X86_REG_XMM7cxx . . $ X86_REG_XMM7., "xmm7" },
217 { X86_REG_XMM8cxx . . $ X86_REG_XMM8., "xmm8" },
218 { X86_REG_XMM9cxx . . $ X86_REG_XMM9., "xmm9" },
219 { X86_REG_XMM10cxx . . $ X86_REG_XMM10., "xmm10" },
220 { X86_REG_XMM11cxx . . $ X86_REG_XMM11., "xmm11" },
221 { X86_REG_XMM12cxx . . $ X86_REG_XMM12., "xmm12" },
222 { X86_REG_XMM13cxx . . $ X86_REG_XMM13., "xmm13" },
223 { X86_REG_XMM14cxx . . $ X86_REG_XMM14., "xmm14" },
224 { X86_REG_XMM15cxx . . $ X86_REG_XMM15., "xmm15" },
225 { X86_REG_XMM16cxx . . $ X86_REG_XMM16., "xmm16" },
226 { X86_REG_XMM17cxx . . $ X86_REG_XMM17., "xmm17" },
227 { X86_REG_XMM18cxx . . $ X86_REG_XMM18., "xmm18" },
228 { X86_REG_XMM19cxx . . $ X86_REG_XMM19., "xmm19" },
229 { X86_REG_XMM20cxx . . $ X86_REG_XMM20., "xmm20" },
230 { X86_REG_XMM21cxx . . $ X86_REG_XMM21., "xmm21" },
231 { X86_REG_XMM22cxx . . $ X86_REG_XMM22., "xmm22" },
232 { X86_REG_XMM23cxx . . $ X86_REG_XMM23., "xmm23" },
233 { X86_REG_XMM24cxx . . $ X86_REG_XMM24., "xmm24" },
234 { X86_REG_XMM25cxx . . $ X86_REG_XMM25., "xmm25" },
235 { X86_REG_XMM26cxx . . $ X86_REG_XMM26., "xmm26" },
236 { X86_REG_XMM27cxx . . $ X86_REG_XMM27., "xmm27" },
237 { X86_REG_XMM28cxx . . $ X86_REG_XMM28., "xmm28" },
238 { X86_REG_XMM29cxx . . $ X86_REG_XMM29., "xmm29" },
239 { X86_REG_XMM30cxx . . $ X86_REG_XMM30., "xmm30" },
240 { X86_REG_XMM31cxx . . $ X86_REG_XMM31., "xmm31" },
241 { X86_REG_YMM0cxx . . $ X86_REG_YMM0., "ymm0" },
242 { X86_REG_YMM1cxx . . $ X86_REG_YMM1., "ymm1" },
243 { X86_REG_YMM2cxx . . $ X86_REG_YMM2., "ymm2" },
244 { X86_REG_YMM3cxx . . $ X86_REG_YMM3., "ymm3" },
245 { X86_REG_YMM4cxx . . $ X86_REG_YMM4., "ymm4" },
246 { X86_REG_YMM5cxx . . $ X86_REG_YMM5., "ymm5" },
247 { X86_REG_YMM6cxx . . $ X86_REG_YMM6., "ymm6" },
248 { X86_REG_YMM7cxx . . $ X86_REG_YMM7., "ymm7" },
249 { X86_REG_YMM8cxx . . $ X86_REG_YMM8., "ymm8" },
250 { X86_REG_YMM9cxx . . $ X86_REG_YMM9., "ymm9" },
251 { X86_REG_YMM10cxx . . $ X86_REG_YMM10., "ymm10" },
252 { X86_REG_YMM11cxx . . $ X86_REG_YMM11., "ymm11" },
253 { X86_REG_YMM12cxx . . $ X86_REG_YMM12., "ymm12" },
254 { X86_REG_YMM13cxx . . $ X86_REG_YMM13., "ymm13" },
255 { X86_REG_YMM14cxx . . $ X86_REG_YMM14., "ymm14" },
256 { X86_REG_YMM15cxx . . $ X86_REG_YMM15., "ymm15" },
257 { X86_REG_YMM16cxx . . $ X86_REG_YMM16., "ymm16" },
258 { X86_REG_YMM17cxx . . $ X86_REG_YMM17., "ymm17" },
259 { X86_REG_YMM18cxx . . $ X86_REG_YMM18., "ymm18" },
260 { X86_REG_YMM19cxx . . $ X86_REG_YMM19., "ymm19" },
261 { X86_REG_YMM20cxx . . $ X86_REG_YMM20., "ymm20" },
262 { X86_REG_YMM21cxx . . $ X86_REG_YMM21., "ymm21" },
263 { X86_REG_YMM22cxx . . $ X86_REG_YMM22., "ymm22" },
264 { X86_REG_YMM23cxx . . $ X86_REG_YMM23., "ymm23" },
265 { X86_REG_YMM24cxx . . $ X86_REG_YMM24., "ymm24" },
266 { X86_REG_YMM25cxx . . $ X86_REG_YMM25., "ymm25" },
267 { X86_REG_YMM26cxx . . $ X86_REG_YMM26., "ymm26" },
268 { X86_REG_YMM27cxx . . $ X86_REG_YMM27., "ymm27" },
269 { X86_REG_YMM28cxx . . $ X86_REG_YMM28., "ymm28" },
270 { X86_REG_YMM29cxx . . $ X86_REG_YMM29., "ymm29" },
271 { X86_REG_YMM30cxx . . $ X86_REG_YMM30., "ymm30" },
272 { X86_REG_YMM31cxx . . $ X86_REG_YMM31., "ymm31" },
273 { X86_REG_ZMM0cxx . . $ X86_REG_ZMM0., "zmm0" },
274 { X86_REG_ZMM1cxx . . $ X86_REG_ZMM1., "zmm1" },
275 { X86_REG_ZMM2cxx . . $ X86_REG_ZMM2., "zmm2" },
276 { X86_REG_ZMM3cxx . . $ X86_REG_ZMM3., "zmm3" },
277 { X86_REG_ZMM4cxx . . $ X86_REG_ZMM4., "zmm4" },
278 { X86_REG_ZMM5cxx . . $ X86_REG_ZMM5., "zmm5" },
279 { X86_REG_ZMM6cxx . . $ X86_REG_ZMM6., "zmm6" },
280 { X86_REG_ZMM7cxx . . $ X86_REG_ZMM7., "zmm7" },
281 { X86_REG_ZMM8cxx . . $ X86_REG_ZMM8., "zmm8" },
282 { X86_REG_ZMM9cxx . . $ X86_REG_ZMM9., "zmm9" },
283 { X86_REG_ZMM10cxx . . $ X86_REG_ZMM10., "zmm10" },
284 { X86_REG_ZMM11cxx . . $ X86_REG_ZMM11., "zmm11" },
285 { X86_REG_ZMM12cxx . . $ X86_REG_ZMM12., "zmm12" },
286 { X86_REG_ZMM13cxx . . $ X86_REG_ZMM13., "zmm13" },
287 { X86_REG_ZMM14cxx . . $ X86_REG_ZMM14., "zmm14" },
288 { X86_REG_ZMM15cxx . . $ X86_REG_ZMM15., "zmm15" },
289 { X86_REG_ZMM16cxx . . $ X86_REG_ZMM16., "zmm16" },
290 { X86_REG_ZMM17cxx . . $ X86_REG_ZMM17., "zmm17" },
291 { X86_REG_ZMM18cxx . . $ X86_REG_ZMM18., "zmm18" },
292 { X86_REG_ZMM19cxx . . $ X86_REG_ZMM19., "zmm19" },
293 { X86_REG_ZMM20cxx . . $ X86_REG_ZMM20., "zmm20" },
294 { X86_REG_ZMM21cxx . . $ X86_REG_ZMM21., "zmm21" },
295 { X86_REG_ZMM22cxx . . $ X86_REG_ZMM22., "zmm22" },
296 { X86_REG_ZMM23cxx . . $ X86_REG_ZMM23., "zmm23" },
297 { X86_REG_ZMM24cxx . . $ X86_REG_ZMM24., "zmm24" },
298 { X86_REG_ZMM25cxx . . $ X86_REG_ZMM25., "zmm25" },
299 { X86_REG_ZMM26cxx . . $ X86_REG_ZMM26., "zmm26" },
300 { X86_REG_ZMM27cxx . . $ X86_REG_ZMM27., "zmm27" },
301 { X86_REG_ZMM28cxx . . $ X86_REG_ZMM28., "zmm28" },
302 { X86_REG_ZMM29cxx . . $ X86_REG_ZMM29., "zmm29" },
303 { X86_REG_ZMM30cxx . . $ X86_REG_ZMM30., "zmm30" },
304 { X86_REG_ZMM31cxx . . $ X86_REG_ZMM31., "zmm31" },
305 { X86_REG_R8Bcxx . . $ X86_REG_R8B., "r8b" },
306 { X86_REG_R9Bcxx . . $ X86_REG_R9B., "r9b" },
307 { X86_REG_R10Bcxx . . $ X86_REG_R10B., "r10b" },
308 { X86_REG_R11Bcxx . . $ X86_REG_R11B., "r11b" },
309 { X86_REG_R12Bcxx . . $ X86_REG_R12B., "r12b" },
310 { X86_REG_R13Bcxx . . $ X86_REG_R13B., "r13b" },
311 { X86_REG_R14Bcxx . . $ X86_REG_R14B., "r14b" },
312 { X86_REG_R15Bcxx . . $ X86_REG_R15B., "r15b" },
313 { X86_REG_R8Dcxx . . $ X86_REG_R8D., "r8d" },
314 { X86_REG_R9Dcxx . . $ X86_REG_R9D., "r9d" },
315 { X86_REG_R10Dcxx . . $ X86_REG_R10D., "r10d" },
316 { X86_REG_R11Dcxx . . $ X86_REG_R11D., "r11d" },
317 { X86_REG_R12Dcxx . . $ X86_REG_R12D., "r12d" },
318 { X86_REG_R13Dcxx . . $ X86_REG_R13D., "r13d" },
319 { X86_REG_R14Dcxx . . $ X86_REG_R14D., "r14d" },
320 { X86_REG_R15Dcxx . . $ X86_REG_R15D., "r15d" },
321 { X86_REG_R8Wcxx . . $ X86_REG_R8W., "r8w" },
322 { X86_REG_R9Wcxx . . $ X86_REG_R9W., "r9w" },
323 { X86_REG_R10Wcxx . . $ X86_REG_R10W., "r10w" },
324 { X86_REG_R11Wcxx . . $ X86_REG_R11W., "r11w" },
325 { X86_REG_R12Wcxx . . $ X86_REG_R12W., "r12w" },
326 { X86_REG_R13Wcxx . . $ X86_REG_R13W., "r13w" },
327 { X86_REG_R14Wcxx . . $ X86_REG_R14W., "r14w" },
328 { X86_REG_R15Wcxx . . $ X86_REG_R15W., "r15w" },
329
330 { X86_REG_BND0cxx . . $ X86_REG_BND0., "bnd0" },
331 { X86_REG_BND1cxx . . $ X86_REG_BND1., "bnd1" },
332 { X86_REG_BND2cxx . . $ X86_REG_BND2., "bnd2" },
333 { X86_REG_BND3cxx . . $ X86_REG_BND3., "bnd3" },
334 };
335 #endif
336
337 // register size in non-64bit mode
338 const uint8_tcxx . . $ uint8_t# regsize_map_32cxx . . $ regsize_map_32. [] = {
339 0, // { X86_REG_INVALID, NULL },
340 1, // { X86_REG_AH, "ah" },
341 1, // { X86_REG_AL, "al" },
342 2, // { X86_REG_AX, "ax" },
343 1, // { X86_REG_BH, "bh" },
344 1, // { X86_REG_BL, "bl" },
345 2, // { X86_REG_BP, "bp" },
346 1, // { X86_REG_BPL, "bpl" },
347 2, // { X86_REG_BX, "bx" },
348 1, // { X86_REG_CH, "ch" },
349 1, // { X86_REG_CL, "cl" },
350 2, // { X86_REG_CS, "cs" },
351 2, // { X86_REG_CX, "cx" },
352 1, // { X86_REG_DH, "dh" },
353 2, // { X86_REG_DI, "di" },
354 1, // { X86_REG_DIL, "dil" },
355 1, // { X86_REG_DL, "dl" },
356 2, // { X86_REG_DS, "ds" },
357 2, // { X86_REG_DX, "dx" },
358 4, // { X86_REG_EAX, "eax" },
359 4, // { X86_REG_EBP, "ebp" },
360 4, // { X86_REG_EBX, "ebx" },
361 4, // { X86_REG_ECX, "ecx" },
362 4, // { X86_REG_EDI, "edi" },
363 4, // { X86_REG_EDX, "edx" },
364 4, // { X86_REG_EFLAGS, "flags" },
365 4, // { X86_REG_EIP, "eip" },
366 4, // { X86_REG_EIZ, "eiz" },
367 2, // { X86_REG_ES, "es" },
368 4, // { X86_REG_ESI, "esi" },
369 4, // { X86_REG_ESP, "esp" },
370 10, // { X86_REG_FPSW, "fpsw" },
371 2, // { X86_REG_FS, "fs" },
372 2, // { X86_REG_GS, "gs" },
373 2, // { X86_REG_IP, "ip" },
374 8, // { X86_REG_RAX, "rax" },
375 8, // { X86_REG_RBP, "rbp" },
376 8, // { X86_REG_RBX, "rbx" },
377 8, // { X86_REG_RCX, "rcx" },
378 8, // { X86_REG_RDI, "rdi" },
379 8, // { X86_REG_RDX, "rdx" },
380 8, // { X86_REG_RIP, "rip" },
381 8, // { X86_REG_RIZ, "riz" },
382 8, // { X86_REG_RSI, "rsi" },
383 8, // { X86_REG_RSP, "rsp" },
384 2, // { X86_REG_SI, "si" },
385 1, // { X86_REG_SIL, "sil" },
386 2, // { X86_REG_SP, "sp" },
387 1, // { X86_REG_SPL, "spl" },
388 2, // { X86_REG_SS, "ss" },
389 4, // { X86_REG_CR0, "cr0" },
390 4, // { X86_REG_CR1, "cr1" },
391 4, // { X86_REG_CR2, "cr2" },
392 4, // { X86_REG_CR3, "cr3" },
393 4, // { X86_REG_CR4, "cr4" },
394 8, // { X86_REG_CR5, "cr5" },
395 8, // { X86_REG_CR6, "cr6" },
396 8, // { X86_REG_CR7, "cr7" },
397 8, // { X86_REG_CR8, "cr8" },
398 8, // { X86_REG_CR9, "cr9" },
399 8, // { X86_REG_CR10, "cr10" },
400 8, // { X86_REG_CR11, "cr11" },
401 8, // { X86_REG_CR12, "cr12" },
402 8, // { X86_REG_CR13, "cr13" },
403 8, // { X86_REG_CR14, "cr14" },
404 8, // { X86_REG_CR15, "cr15" },
405 4, // { X86_REG_DR0, "dr0" },
406 4, // { X86_REG_DR1, "dr1" },
407 4, // { X86_REG_DR2, "dr2" },
408 4, // { X86_REG_DR3, "dr3" },
409 4, // { X86_REG_DR4, "dr4" },
410 4, // { X86_REG_DR5, "dr5" },
411 4, // { X86_REG_DR6, "dr6" },
412 4, // { X86_REG_DR7, "dr7" },
413 4, // { X86_REG_DR8, "dr8" },
414 4, // { X86_REG_DR9, "dr9" },
415 4, // { X86_REG_DR10, "dr10" },
416 4, // { X86_REG_DR11, "dr11" },
417 4, // { X86_REG_DR12, "dr12" },
418 4, // { X86_REG_DR13, "dr13" },
419 4, // { X86_REG_DR14, "dr14" },
420 4, // { X86_REG_DR15, "dr15" },
421 10, // { X86_REG_FP0, "fp0" },
422 10, // { X86_REG_FP1, "fp1" },
423 10, // { X86_REG_FP2, "fp2" },
424 10, // { X86_REG_FP3, "fp3" },
425 10, // { X86_REG_FP4, "fp4" },
426 10, // { X86_REG_FP5, "fp5" },
427 10, // { X86_REG_FP6, "fp6" },
428 10, // { X86_REG_FP7, "fp7" },
429 2, // { X86_REG_K0, "k0" },
430 2, // { X86_REG_K1, "k1" },
431 2, // { X86_REG_K2, "k2" },
432 2, // { X86_REG_K3, "k3" },
433 2, // { X86_REG_K4, "k4" },
434 2, // { X86_REG_K5, "k5" },
435 2, // { X86_REG_K6, "k6" },
436 2, // { X86_REG_K7, "k7" },
437 8, // { X86_REG_MM0, "mm0" },
438 8, // { X86_REG_MM1, "mm1" },
439 8, // { X86_REG_MM2, "mm2" },
440 8, // { X86_REG_MM3, "mm3" },
441 8, // { X86_REG_MM4, "mm4" },
442 8, // { X86_REG_MM5, "mm5" },
443 8, // { X86_REG_MM6, "mm6" },
444 8, // { X86_REG_MM7, "mm7" },
445 8, // { X86_REG_R8, "r8" },
446 8, // { X86_REG_R9, "r9" },
447 8, // { X86_REG_R10, "r10" },
448 8, // { X86_REG_R11, "r11" },
449 8, // { X86_REG_R12, "r12" },
450 8, // { X86_REG_R13, "r13" },
451 8, // { X86_REG_R14, "r14" },
452 8, // { X86_REG_R15, "r15" },
453 10, // { X86_REG_ST0, "st0" },
454 10, // { X86_REG_ST1, "st1" },
455 10, // { X86_REG_ST2, "st2" },
456 10, // { X86_REG_ST3, "st3" },
457 10, // { X86_REG_ST4, "st4" },
458 10, // { X86_REG_ST5, "st5" },
459 10, // { X86_REG_ST6, "st6" },
460 10, // { X86_REG_ST7, "st7" },
461 16, // { X86_REG_XMM0, "xmm0" },
462 16, // { X86_REG_XMM1, "xmm1" },
463 16, // { X86_REG_XMM2, "xmm2" },
464 16, // { X86_REG_XMM3, "xmm3" },
465 16, // { X86_REG_XMM4, "xmm4" },
466 16, // { X86_REG_XMM5, "xmm5" },
467 16, // { X86_REG_XMM6, "xmm6" },
468 16, // { X86_REG_XMM7, "xmm7" },
469 16, // { X86_REG_XMM8, "xmm8" },
470 16, // { X86_REG_XMM9, "xmm9" },
471 16, // { X86_REG_XMM10, "xmm10" },
472 16, // { X86_REG_XMM11, "xmm11" },
473 16, // { X86_REG_XMM12, "xmm12" },
474 16, // { X86_REG_XMM13, "xmm13" },
475 16, // { X86_REG_XMM14, "xmm14" },
476 16, // { X86_REG_XMM15, "xmm15" },
477 16, // { X86_REG_XMM16, "xmm16" },
478 16, // { X86_REG_XMM17, "xmm17" },
479 16, // { X86_REG_XMM18, "xmm18" },
480 16, // { X86_REG_XMM19, "xmm19" },
481 16, // { X86_REG_XMM20, "xmm20" },
482 16, // { X86_REG_XMM21, "xmm21" },
483 16, // { X86_REG_XMM22, "xmm22" },
484 16, // { X86_REG_XMM23, "xmm23" },
485 16, // { X86_REG_XMM24, "xmm24" },
486 16, // { X86_REG_XMM25, "xmm25" },
487 16, // { X86_REG_XMM26, "xmm26" },
488 16, // { X86_REG_XMM27, "xmm27" },
489 16, // { X86_REG_XMM28, "xmm28" },
490 16, // { X86_REG_XMM29, "xmm29" },
491 16, // { X86_REG_XMM30, "xmm30" },
492 16, // { X86_REG_XMM31, "xmm31" },
493 32, // { X86_REG_YMM0, "ymm0" },
494 32, // { X86_REG_YMM1, "ymm1" },
495 32, // { X86_REG_YMM2, "ymm2" },
496 32, // { X86_REG_YMM3, "ymm3" },
497 32, // { X86_REG_YMM4, "ymm4" },
498 32, // { X86_REG_YMM5, "ymm5" },
499 32, // { X86_REG_YMM6, "ymm6" },
500 32, // { X86_REG_YMM7, "ymm7" },
501 32, // { X86_REG_YMM8, "ymm8" },
502 32, // { X86_REG_YMM9, "ymm9" },
503 32, // { X86_REG_YMM10, "ymm10" },
504 32, // { X86_REG_YMM11, "ymm11" },
505 32, // { X86_REG_YMM12, "ymm12" },
506 32, // { X86_REG_YMM13, "ymm13" },
507 32, // { X86_REG_YMM14, "ymm14" },
508 32, // { X86_REG_YMM15, "ymm15" },
509 32, // { X86_REG_YMM16, "ymm16" },
510 32, // { X86_REG_YMM17, "ymm17" },
511 32, // { X86_REG_YMM18, "ymm18" },
512 32, // { X86_REG_YMM19, "ymm19" },
513 32, // { X86_REG_YMM20, "ymm20" },
514 32, // { X86_REG_YMM21, "ymm21" },
515 32, // { X86_REG_YMM22, "ymm22" },
516 32, // { X86_REG_YMM23, "ymm23" },
517 32, // { X86_REG_YMM24, "ymm24" },
518 32, // { X86_REG_YMM25, "ymm25" },
519 32, // { X86_REG_YMM26, "ymm26" },
520 32, // { X86_REG_YMM27, "ymm27" },
521 32, // { X86_REG_YMM28, "ymm28" },
522 32, // { X86_REG_YMM29, "ymm29" },
523 32, // { X86_REG_YMM30, "ymm30" },
524 32, // { X86_REG_YMM31, "ymm31" },
525 64, // { X86_REG_ZMM0, "zmm0" },
526 64, // { X86_REG_ZMM1, "zmm1" },
527 64, // { X86_REG_ZMM2, "zmm2" },
528 64, // { X86_REG_ZMM3, "zmm3" },
529 64, // { X86_REG_ZMM4, "zmm4" },
530 64, // { X86_REG_ZMM5, "zmm5" },
531 64, // { X86_REG_ZMM6, "zmm6" },
532 64, // { X86_REG_ZMM7, "zmm7" },
533 64, // { X86_REG_ZMM8, "zmm8" },
534 64, // { X86_REG_ZMM9, "zmm9" },
535 64, // { X86_REG_ZMM10, "zmm10" },
536 64, // { X86_REG_ZMM11, "zmm11" },
537 64, // { X86_REG_ZMM12, "zmm12" },
538 64, // { X86_REG_ZMM13, "zmm13" },
539 64, // { X86_REG_ZMM14, "zmm14" },
540 64, // { X86_REG_ZMM15, "zmm15" },
541 64, // { X86_REG_ZMM16, "zmm16" },
542 64, // { X86_REG_ZMM17, "zmm17" },
543 64, // { X86_REG_ZMM18, "zmm18" },
544 64, // { X86_REG_ZMM19, "zmm19" },
545 64, // { X86_REG_ZMM20, "zmm20" },
546 64, // { X86_REG_ZMM21, "zmm21" },
547 64, // { X86_REG_ZMM22, "zmm22" },
548 64, // { X86_REG_ZMM23, "zmm23" },
549 64, // { X86_REG_ZMM24, "zmm24" },
550 64, // { X86_REG_ZMM25, "zmm25" },
551 64, // { X86_REG_ZMM26, "zmm26" },
552 64, // { X86_REG_ZMM27, "zmm27" },
553 64, // { X86_REG_ZMM28, "zmm28" },
554 64, // { X86_REG_ZMM29, "zmm29" },
555 64, // { X86_REG_ZMM30, "zmm30" },
556 64, // { X86_REG_ZMM31, "zmm31" },
557 1, // { X86_REG_R8B, "r8b" },
558 1, // { X86_REG_R9B, "r9b" },
559 1, // { X86_REG_R10B, "r10b" },
560 1, // { X86_REG_R11B, "r11b" },
561 1, // { X86_REG_R12B, "r12b" },
562 1, // { X86_REG_R13B, "r13b" },
563 1, // { X86_REG_R14B, "r14b" },
564 1, // { X86_REG_R15B, "r15b" },
565 4, // { X86_REG_R8D, "r8d" },
566 4, // { X86_REG_R9D, "r9d" },
567 4, // { X86_REG_R10D, "r10d" },
568 4, // { X86_REG_R11D, "r11d" },
569 4, // { X86_REG_R12D, "r12d" },
570 4, // { X86_REG_R13D, "r13d" },
571 4, // { X86_REG_R14D, "r14d" },
572 4, // { X86_REG_R15D, "r15d" },
573 2, // { X86_REG_R8W, "r8w" },
574 2, // { X86_REG_R9W, "r9w" },
575 2, // { X86_REG_R10W, "r10w" },
576 2, // { X86_REG_R11W, "r11w" },
577 2, // { X86_REG_R12W, "r12w" },
578 2, // { X86_REG_R13W, "r13w" },
579 2, // { X86_REG_R14W, "r14w" },
580 2, // { X86_REG_R15W, "r15w" },
581 16, // { X86_REG_BND0, "bnd0" },
582 16, // { X86_REG_BND1, "bnd0" },
583 16, // { X86_REG_BND2, "bnd0" },
584 16, // { X86_REG_BND3, "bnd0" },
585 };
586
587 // register size in 64bit mode
588 const uint8_tcxx . . $ uint8_t# regsize_map_64cxx . . $ regsize_map_64. [] = {
589 0, // { X86_REG_INVALID, NULL },
590 1, // { X86_REG_AH, "ah" },
591 1, // { X86_REG_AL, "al" },
592 2, // { X86_REG_AX, "ax" },
593 1, // { X86_REG_BH, "bh" },
594 1, // { X86_REG_BL, "bl" },
595 2, // { X86_REG_BP, "bp" },
596 1, // { X86_REG_BPL, "bpl" },
597 2, // { X86_REG_BX, "bx" },
598 1, // { X86_REG_CH, "ch" },
599 1, // { X86_REG_CL, "cl" },
600 2, // { X86_REG_CS, "cs" },
601 2, // { X86_REG_CX, "cx" },
602 1, // { X86_REG_DH, "dh" },
603 2, // { X86_REG_DI, "di" },
604 1, // { X86_REG_DIL, "dil" },
605 1, // { X86_REG_DL, "dl" },
606 2, // { X86_REG_DS, "ds" },
607 2, // { X86_REG_DX, "dx" },
608 4, // { X86_REG_EAX, "eax" },
609 4, // { X86_REG_EBP, "ebp" },
610 4, // { X86_REG_EBX, "ebx" },
611 4, // { X86_REG_ECX, "ecx" },
612 4, // { X86_REG_EDI, "edi" },
613 4, // { X86_REG_EDX, "edx" },
614 8, // { X86_REG_EFLAGS, "flags" },
615 4, // { X86_REG_EIP, "eip" },
616 4, // { X86_REG_EIZ, "eiz" },
617 2, // { X86_REG_ES, "es" },
618 4, // { X86_REG_ESI, "esi" },
619 4, // { X86_REG_ESP, "esp" },
620 10, // { X86_REG_FPSW, "fpsw" },
621 2, // { X86_REG_FS, "fs" },
622 2, // { X86_REG_GS, "gs" },
623 2, // { X86_REG_IP, "ip" },
624 8, // { X86_REG_RAX, "rax" },
625 8, // { X86_REG_RBP, "rbp" },
626 8, // { X86_REG_RBX, "rbx" },
627 8, // { X86_REG_RCX, "rcx" },
628 8, // { X86_REG_RDI, "rdi" },
629 8, // { X86_REG_RDX, "rdx" },
630 8, // { X86_REG_RIP, "rip" },
631 8, // { X86_REG_RIZ, "riz" },
632 8, // { X86_REG_RSI, "rsi" },
633 8, // { X86_REG_RSP, "rsp" },
634 2, // { X86_REG_SI, "si" },
635 1, // { X86_REG_SIL, "sil" },
636 2, // { X86_REG_SP, "sp" },
637 1, // { X86_REG_SPL, "spl" },
638 2, // { X86_REG_SS, "ss" },
639 8, // { X86_REG_CR0, "cr0" },
640 8, // { X86_REG_CR1, "cr1" },
641 8, // { X86_REG_CR2, "cr2" },
642 8, // { X86_REG_CR3, "cr3" },
643 8, // { X86_REG_CR4, "cr4" },
644 8, // { X86_REG_CR5, "cr5" },
645 8, // { X86_REG_CR6, "cr6" },
646 8, // { X86_REG_CR7, "cr7" },
647 8, // { X86_REG_CR8, "cr8" },
648 8, // { X86_REG_CR9, "cr9" },
649 8, // { X86_REG_CR10, "cr10" },
650 8, // { X86_REG_CR11, "cr11" },
651 8, // { X86_REG_CR12, "cr12" },
652 8, // { X86_REG_CR13, "cr13" },
653 8, // { X86_REG_CR14, "cr14" },
654 8, // { X86_REG_CR15, "cr15" },
655 8, // { X86_REG_DR0, "dr0" },
656 8, // { X86_REG_DR1, "dr1" },
657 8, // { X86_REG_DR2, "dr2" },
658 8, // { X86_REG_DR3, "dr3" },
659 8, // { X86_REG_DR4, "dr4" },
660 8, // { X86_REG_DR5, "dr5" },
661 8, // { X86_REG_DR6, "dr6" },
662 8, // { X86_REG_DR7, "dr7" },
663 8, // { X86_REG_DR8, "dr8" },
664 8, // { X86_REG_DR9, "dr9" },
665 8, // { X86_REG_DR10, "dr10" },
666 8, // { X86_REG_DR11, "dr11" },
667 8, // { X86_REG_DR12, "dr12" },
668 8, // { X86_REG_DR13, "dr13" },
669 8, // { X86_REG_DR14, "dr14" },
670 8, // { X86_REG_DR15, "dr15" },
671 10, // { X86_REG_FP0, "fp0" },
672 10, // { X86_REG_FP1, "fp1" },
673 10, // { X86_REG_FP2, "fp2" },
674 10, // { X86_REG_FP3, "fp3" },
675 10, // { X86_REG_FP4, "fp4" },
676 10, // { X86_REG_FP5, "fp5" },
677 10, // { X86_REG_FP6, "fp6" },
678 10, // { X86_REG_FP7, "fp7" },
679 2, // { X86_REG_K0, "k0" },
680 2, // { X86_REG_K1, "k1" },
681 2, // { X86_REG_K2, "k2" },
682 2, // { X86_REG_K3, "k3" },
683 2, // { X86_REG_K4, "k4" },
684 2, // { X86_REG_K5, "k5" },
685 2, // { X86_REG_K6, "k6" },
686 2, // { X86_REG_K7, "k7" },
687 8, // { X86_REG_MM0, "mm0" },
688 8, // { X86_REG_MM1, "mm1" },
689 8, // { X86_REG_MM2, "mm2" },
690 8, // { X86_REG_MM3, "mm3" },
691 8, // { X86_REG_MM4, "mm4" },
692 8, // { X86_REG_MM5, "mm5" },
693 8, // { X86_REG_MM6, "mm6" },
694 8, // { X86_REG_MM7, "mm7" },
695 8, // { X86_REG_R8, "r8" },
696 8, // { X86_REG_R9, "r9" },
697 8, // { X86_REG_R10, "r10" },
698 8, // { X86_REG_R11, "r11" },
699 8, // { X86_REG_R12, "r12" },
700 8, // { X86_REG_R13, "r13" },
701 8, // { X86_REG_R14, "r14" },
702 8, // { X86_REG_R15, "r15" },
703 10, // { X86_REG_ST0, "st0" },
704 10, // { X86_REG_ST1, "st1" },
705 10, // { X86_REG_ST2, "st2" },
706 10, // { X86_REG_ST3, "st3" },
707 10, // { X86_REG_ST4, "st4" },
708 10, // { X86_REG_ST5, "st5" },
709 10, // { X86_REG_ST6, "st6" },
710 10, // { X86_REG_ST7, "st7" },
711 16, // { X86_REG_XMM0, "xmm0" },
712 16, // { X86_REG_XMM1, "xmm1" },
713 16, // { X86_REG_XMM2, "xmm2" },
714 16, // { X86_REG_XMM3, "xmm3" },
715 16, // { X86_REG_XMM4, "xmm4" },
716 16, // { X86_REG_XMM5, "xmm5" },
717 16, // { X86_REG_XMM6, "xmm6" },
718 16, // { X86_REG_XMM7, "xmm7" },
719 16, // { X86_REG_XMM8, "xmm8" },
720 16, // { X86_REG_XMM9, "xmm9" },
721 16, // { X86_REG_XMM10, "xmm10" },
722 16, // { X86_REG_XMM11, "xmm11" },
723 16, // { X86_REG_XMM12, "xmm12" },
724 16, // { X86_REG_XMM13, "xmm13" },
725 16, // { X86_REG_XMM14, "xmm14" },
726 16, // { X86_REG_XMM15, "xmm15" },
727 16, // { X86_REG_XMM16, "xmm16" },
728 16, // { X86_REG_XMM17, "xmm17" },
729 16, // { X86_REG_XMM18, "xmm18" },
730 16, // { X86_REG_XMM19, "xmm19" },
731 16, // { X86_REG_XMM20, "xmm20" },
732 16, // { X86_REG_XMM21, "xmm21" },
733 16, // { X86_REG_XMM22, "xmm22" },
734 16, // { X86_REG_XMM23, "xmm23" },
735 16, // { X86_REG_XMM24, "xmm24" },
736 16, // { X86_REG_XMM25, "xmm25" },
737 16, // { X86_REG_XMM26, "xmm26" },
738 16, // { X86_REG_XMM27, "xmm27" },
739 16, // { X86_REG_XMM28, "xmm28" },
740 16, // { X86_REG_XMM29, "xmm29" },
741 16, // { X86_REG_XMM30, "xmm30" },
742 16, // { X86_REG_XMM31, "xmm31" },
743 32, // { X86_REG_YMM0, "ymm0" },
744 32, // { X86_REG_YMM1, "ymm1" },
745 32, // { X86_REG_YMM2, "ymm2" },
746 32, // { X86_REG_YMM3, "ymm3" },
747 32, // { X86_REG_YMM4, "ymm4" },
748 32, // { X86_REG_YMM5, "ymm5" },
749 32, // { X86_REG_YMM6, "ymm6" },
750 32, // { X86_REG_YMM7, "ymm7" },
751 32, // { X86_REG_YMM8, "ymm8" },
752 32, // { X86_REG_YMM9, "ymm9" },
753 32, // { X86_REG_YMM10, "ymm10" },
754 32, // { X86_REG_YMM11, "ymm11" },
755 32, // { X86_REG_YMM12, "ymm12" },
756 32, // { X86_REG_YMM13, "ymm13" },
757 32, // { X86_REG_YMM14, "ymm14" },
758 32, // { X86_REG_YMM15, "ymm15" },
759 32, // { X86_REG_YMM16, "ymm16" },
760 32, // { X86_REG_YMM17, "ymm17" },
761 32, // { X86_REG_YMM18, "ymm18" },
762 32, // { X86_REG_YMM19, "ymm19" },
763 32, // { X86_REG_YMM20, "ymm20" },
764 32, // { X86_REG_YMM21, "ymm21" },
765 32, // { X86_REG_YMM22, "ymm22" },
766 32, // { X86_REG_YMM23, "ymm23" },
767 32, // { X86_REG_YMM24, "ymm24" },
768 32, // { X86_REG_YMM25, "ymm25" },
769 32, // { X86_REG_YMM26, "ymm26" },
770 32, // { X86_REG_YMM27, "ymm27" },
771 32, // { X86_REG_YMM28, "ymm28" },
772 32, // { X86_REG_YMM29, "ymm29" },
773 32, // { X86_REG_YMM30, "ymm30" },
774 32, // { X86_REG_YMM31, "ymm31" },
775 64, // { X86_REG_ZMM0, "zmm0" },
776 64, // { X86_REG_ZMM1, "zmm1" },
777 64, // { X86_REG_ZMM2, "zmm2" },
778 64, // { X86_REG_ZMM3, "zmm3" },
779 64, // { X86_REG_ZMM4, "zmm4" },
780 64, // { X86_REG_ZMM5, "zmm5" },
781 64, // { X86_REG_ZMM6, "zmm6" },
782 64, // { X86_REG_ZMM7, "zmm7" },
783 64, // { X86_REG_ZMM8, "zmm8" },
784 64, // { X86_REG_ZMM9, "zmm9" },
785 64, // { X86_REG_ZMM10, "zmm10" },
786 64, // { X86_REG_ZMM11, "zmm11" },
787 64, // { X86_REG_ZMM12, "zmm12" },
788 64, // { X86_REG_ZMM13, "zmm13" },
789 64, // { X86_REG_ZMM14, "zmm14" },
790 64, // { X86_REG_ZMM15, "zmm15" },
791 64, // { X86_REG_ZMM16, "zmm16" },
792 64, // { X86_REG_ZMM17, "zmm17" },
793 64, // { X86_REG_ZMM18, "zmm18" },
794 64, // { X86_REG_ZMM19, "zmm19" },
795 64, // { X86_REG_ZMM20, "zmm20" },
796 64, // { X86_REG_ZMM21, "zmm21" },
797 64, // { X86_REG_ZMM22, "zmm22" },
798 64, // { X86_REG_ZMM23, "zmm23" },
799 64, // { X86_REG_ZMM24, "zmm24" },
800 64, // { X86_REG_ZMM25, "zmm25" },
801 64, // { X86_REG_ZMM26, "zmm26" },
802 64, // { X86_REG_ZMM27, "zmm27" },
803 64, // { X86_REG_ZMM28, "zmm28" },
804 64, // { X86_REG_ZMM29, "zmm29" },
805 64, // { X86_REG_ZMM30, "zmm30" },
806 64, // { X86_REG_ZMM31, "zmm31" },
807 1, // { X86_REG_R8B, "r8b" },
808 1, // { X86_REG_R9B, "r9b" },
809 1, // { X86_REG_R10B, "r10b" },
810 1, // { X86_REG_R11B, "r11b" },
811 1, // { X86_REG_R12B, "r12b" },
812 1, // { X86_REG_R13B, "r13b" },
813 1, // { X86_REG_R14B, "r14b" },
814 1, // { X86_REG_R15B, "r15b" },
815 4, // { X86_REG_R8D, "r8d" },
816 4, // { X86_REG_R9D, "r9d" },
817 4, // { X86_REG_R10D, "r10d" },
818 4, // { X86_REG_R11D, "r11d" },
819 4, // { X86_REG_R12D, "r12d" },
820 4, // { X86_REG_R13D, "r13d" },
821 4, // { X86_REG_R14D, "r14d" },
822 4, // { X86_REG_R15D, "r15d" },
823 2, // { X86_REG_R8W, "r8w" },
824 2, // { X86_REG_R9W, "r9w" },
825 2, // { X86_REG_R10W, "r10w" },
826 2, // { X86_REG_R11W, "r11w" },
827 2, // { X86_REG_R12W, "r12w" },
828 2, // { X86_REG_R13W, "r13w" },
829 2, // { X86_REG_R14W, "r14w" },
830 2, // { X86_REG_R15W, "r15w" },
831 16, // { X86_REG_BND0, "bnd0" },
832 16, // { X86_REG_BND1, "bnd0" },
833 16, // { X86_REG_BND2, "bnd0" },
834 16, // { X86_REG_BND3, "bnd0" },
835 };
836
837 const char *X86_reg_namecxx . . $ X86_reg_name(efd1348d9ae5172e).(cshcxx . . $ csh# handle, unsigned int reg)
838 {
839 #ifndef CAPSTONE_DIET
840 cs_structcxx . . $ cs_struct# *ud = (cs_structcxx . . $ cs_struct# *)handle;
841
842 if (reg >= ARR_SIZEcxx . . $ `utils.h:24:9`!(reg_name_maps))
843 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!;
844
845 if (reg == X86_REG_EFLAGScxx . . $ X86_REG_EFLAGS.) {
846 if (ud->modecxx . . $ cs_struct#mode. & CS_MODE_32cxx . . $ CS_MODE_32.)
847 return "eflags";
848 if (ud->modecxx . . $ cs_struct#mode. & CS_MODE_64cxx . . $ CS_MODE_64.)
849 return "rflags";
850 }
851
852 return reg_name_mapscxx . . $ reg_name_maps.[reg].namecxx . . $ name_map#name.;
853 #else
854 return NULL;
855 #endif
856 }
857
858 #ifndef CAPSTONE_DIET
859 static const char * const insn_name_mapscxx . . $ insn_name_maps.[] = {
860 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!, // X86_INS_INVALID
861 #ifndef CAPSTONE_X86_REDUCE
862 #include "X86MappingInsnName.inc"cxx . . $ `<file>/arch/X86/X86MappingInsnName.inc`/
863 #else
864 #include "X86MappingInsnName_reduce.inc"
865 #endif
866 };
867 #endif
868
869 // NOTE: insn_name_maps[] is sorted in order
870 const char *X86_insn_namecxx . . $ X86_insn_name(efd1348d9ae5172e).(cshcxx . . $ csh# handle, unsigned int id)
871 {
872 #ifndef CAPSTONE_DIET
873 if (id >= ARR_SIZEcxx . . $ `utils.h:24:9`!(insn_name_maps))
874 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!;
875
876 return insn_name_mapscxx . . $ insn_name_maps.[id];
877 #else
878 return NULL;
879 #endif
880 }
881
882 #ifndef CAPSTONE_DIET
883 static const name_mapcxx . . $ name_map# group_name_mapscxx . . $ group_name_maps.[] = {
884 // generic groups
885 { X86_GRP_INVALIDcxx . . $ X86_GRP_INVALID., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`! },
886 { X86_GRP_JUMPcxx . . $ X86_GRP_JUMP., "jump" },
887 { X86_GRP_CALLcxx . . $ X86_GRP_CALL., "call" },
888 { X86_GRP_RETcxx . . $ X86_GRP_RET., "ret" },
889 { X86_GRP_INTcxx . . $ X86_GRP_INT., "int" },
890 { X86_GRP_IRETcxx . . $ X86_GRP_IRET., "iret" },
891 { X86_GRP_PRIVILEGEcxx . . $ X86_GRP_PRIVILEGE., "privilege" },
892 { X86_GRP_BRANCH_RELATIVEcxx . . $ X86_GRP_BRANCH_RELATIVE., "branch_relative" },
893
894 // architecture-specific groups
895 { X86_GRP_VMcxx . . $ X86_GRP_VM., "vm" },
896 { X86_GRP_3DNOWcxx . . $ X86_GRP_3DNOW., "3dnow" },
897 { X86_GRP_AEScxx . . $ X86_GRP_AES., "aes" },
898 { X86_GRP_ADXcxx . . $ X86_GRP_ADX., "adx" },
899 { X86_GRP_AVXcxx . . $ X86_GRP_AVX., "avx" },
900 { X86_GRP_AVX2cxx . . $ X86_GRP_AVX2., "avx2" },
901 { X86_GRP_AVX512cxx . . $ X86_GRP_AVX512., "avx512" },
902 { X86_GRP_BMIcxx . . $ X86_GRP_BMI., "bmi" },
903 { X86_GRP_BMI2cxx . . $ X86_GRP_BMI2., "bmi2" },
904 { X86_GRP_CMOVcxx . . $ X86_GRP_CMOV., "cmov" },
905 { X86_GRP_F16Ccxx . . $ X86_GRP_F16C., "fc16" },
906 { X86_GRP_FMAcxx . . $ X86_GRP_FMA., "fma" },
907 { X86_GRP_FMA4cxx . . $ X86_GRP_FMA4., "fma4" },
908 { X86_GRP_FSGSBASEcxx . . $ X86_GRP_FSGSBASE., "fsgsbase" },
909 { X86_GRP_HLEcxx . . $ X86_GRP_HLE., "hle" },
910 { X86_GRP_MMXcxx . . $ X86_GRP_MMX., "mmx" },
911 { X86_GRP_MODE32cxx . . $ X86_GRP_MODE32., "mode32" },
912 { X86_GRP_MODE64cxx . . $ X86_GRP_MODE64., "mode64" },
913 { X86_GRP_RTMcxx . . $ X86_GRP_RTM., "rtm" },
914 { X86_GRP_SHAcxx . . $ X86_GRP_SHA., "sha" },
915 { X86_GRP_SSE1cxx . . $ X86_GRP_SSE1., "sse1" },
916 { X86_GRP_SSE2cxx . . $ X86_GRP_SSE2., "sse2" },
917 { X86_GRP_SSE3cxx . . $ X86_GRP_SSE3., "sse3" },
918 { X86_GRP_SSE41cxx . . $ X86_GRP_SSE41., "sse41" },
919 { X86_GRP_SSE42cxx . . $ X86_GRP_SSE42., "sse42" },
920 { X86_GRP_SSE4Acxx . . $ X86_GRP_SSE4A., "sse4a" },
921 { X86_GRP_SSSE3cxx . . $ X86_GRP_SSSE3., "ssse3" },
922 { X86_GRP_PCLMULcxx . . $ X86_GRP_PCLMUL., "pclmul" },
923 { X86_GRP_XOPcxx . . $ X86_GRP_XOP., "xop" },
924 { X86_GRP_CDIcxx . . $ X86_GRP_CDI., "cdi" },
925 { X86_GRP_ERIcxx . . $ X86_GRP_ERI., "eri" },
926 { X86_GRP_TBMcxx . . $ X86_GRP_TBM., "tbm" },
927 { X86_GRP_16BITMODEcxx . . $ X86_GRP_16BITMODE., "16bitmode" },
928 { X86_GRP_NOT64BITMODEcxx . . $ X86_GRP_NOT64BITMODE., "not64bitmode" },
929 { X86_GRP_SGXcxx . . $ X86_GRP_SGX., "sgx" },
930 { X86_GRP_DQIcxx . . $ X86_GRP_DQI., "dqi" },
931 { X86_GRP_BWIcxx . . $ X86_GRP_BWI., "bwi" },
932 { X86_GRP_PFIcxx . . $ X86_GRP_PFI., "pfi" },
933 { X86_GRP_VLXcxx . . $ X86_GRP_VLX., "vlx" },
934 { X86_GRP_SMAPcxx . . $ X86_GRP_SMAP., "smap" },
935 { X86_GRP_NOVLXcxx . . $ X86_GRP_NOVLX., "novlx" },
936 { X86_GRP_FPUcxx . . $ X86_GRP_FPU., "fpu" },
937 };
938 #endif
939
940 const char *X86_group_namecxx . . $ X86_group_name(efd1348d9ae5172e).(cshcxx . . $ csh# handle, unsigned int id)
941 {
942 #ifndef CAPSTONE_DIET
943 return id2namecxx . . $ id2name(92d4aec78e87b576).(group_name_mapscxx . . $ group_name_maps., ARR_SIZEcxx . . $ `utils.h:24:9`!(group_name_maps), id);
944 #else
945 return NULL;
946 #endif
947 }
948
949 #define GET_INSTRINFO_ENUMcxx . . $ `arch/X86/X86Mapping.c:949:9`!
950 #ifdef CAPSTONE_X86_REDUCE
951 #include "X86GenInstrInfo_reduce.inc"
952
953 const insn_map_x86 insns[] = { // reduce x86 instructions
954 #include "X86MappingInsn_reduce.inc"
955 };
956 #else
957 #include "X86GenInstrInfo.inc"cxx . . $ `<file>/arch/X86/X86GenInstrInfo.inc`/
958
959 const insn_map_x86cxx . . $ insn_map_x86# insnscxx . . $ insns.[] = { // full x86 instructions
960 #include "X86MappingInsn.inc"cxx . . $ `<file>/arch/X86/X86MappingInsn.inc`/
961 };
962 #endif
963
964 #ifndef CAPSTONE_DIET
965 // in arr, replace r1 = r2
966 static void arr_replacecxx . . $ arr_replace(901d075bf66533e1).(uint16_tcxx . . $ uint16_t# *arr, uint8_tcxx . . $ uint8_t# max, x86_regcxx . . $ x86_reg# r1, x86_regcxx . . $ x86_reg# r2)
967 {
968 uint8_tcxx . . $ uint8_t# i;
969
970 for(i = 0; i < max; i++) {
971 if (arr[i] == r1) {
972 arr[i] = r2;
973 break;
974 }
975 }
976 }
977 #endif
978
979 // O(1) lookup with per-handle table. Used by functions that have a cs_struct *.
980 static inline unsigned int find_insn_hcxx . . $ find_insn_h(a4c73a42272bdcc6).(cs_structcxx . . $ cs_struct# *h, unsigned int id)
981 {
982 if (h && h->x86_insn_lutcxx . . $ cs_struct#x86_insn_lut. && id <= h->x86_insn_lut_maxcxx . . $ cs_struct#x86_insn_lut_max.)
983 return (unsigned int)(int16_tcxx . . $ int16_t#)h->x86_insn_lutcxx . . $ cs_struct#x86_insn_lut.[id];
984
985 return find_insncxx . . $ find_insn(2141b656ce2cc063).(id);
986 }
987
988 // Fallback find_insn for callers without a cs_struct * (e.g., the decoder).
989 // Uses binary search since no per-handle table is available.
990 unsigned int find_insncxx . . $ find_insn(2141b656ce2cc063).(unsigned int id)
991 {
992 unsigned int left, right, m;
993 unsigned int max = ARR_SIZEcxx . . $ `utils.h:24:9`!(insns);
994
995 right = max - 1;
996
997 if (id < insnscxx . . $ insns.[0].idcxx . . $ insn_map_x86#id. || id > insnscxx . . $ insns.[right].idcxx . . $ insn_map_x86#id.)
998 return -1;
999
1000 left = 0;
1001
1002 while(left <= right) {
1003 m = (left + right) / 2;
1004 if (id == insnscxx . . $ insns.[m].idcxx . . $ insn_map_x86#id.) {
1005 return m;
1006 }
1007
1008 if (id < insnscxx . . $ insns.[m].idcxx . . $ insn_map_x86#id.)
1009 right = m - 1;
1010 else
1011 left = m + 1;
1012 }
1013
1014 return -1;
1015 }
1016
1017 // given internal insn id, return public instruction info
1018 void X86_get_insn_idcxx . . $ X86_get_insn_id(b32a94ba649bfb5a).(cs_structcxx . . $ cs_struct# *h, cs_insncxx . . $ cs_insn# *insn, unsigned int id)
1019 {
1020 unsigned int i = find_insn_hcxx . . $ find_insn_h(a4c73a42272bdcc6).(h, id);
1021 if (i != -1) {
1022 insn->idcxx . . $ cs_insn#id. = insnscxx . . $ insns.[i].mapidcxx . . $ insn_map_x86#mapid.;
1023
1024 if (h->detailcxx . . $ cs_struct#detail.) {
1025 #ifndef CAPSTONE_DIET
1026 memcpycxx . . $ memcpy(cc817cb175f282d).(insn->detailcxx . . $ cs_insn#detail.->regs_readcxx . . $ cs_detail#regs_read., insnscxx . . $ insns.[i].regs_usecxx . . $ insn_map_x86#regs_use., sizeof(insnscxx . . $ insns.[i].regs_usecxx . . $ insn_map_x86#regs_use.));
1027 insn->detailcxx . . $ cs_insn#detail.->regs_read_countcxx . . $ cs_detail#regs_read_count. = (uint8_tcxx . . $ uint8_t#)count_positivecxx . . $ count_positive(ad0aaa07bfcd0593).(insnscxx . . $ insns.[i].regs_usecxx . . $ insn_map_x86#regs_use.);
1028
1029 // special cases when regs_write[] depends on arch
1030 switch(id) {
1031 default:
1032 memcpycxx . . $ memcpy(cc817cb175f282d).(insn->detailcxx . . $ cs_insn#detail.->regs_writecxx . . $ cs_detail#regs_write., insnscxx . . $ insns.[i].regs_modcxx . . $ insn_map_x86#regs_mod., sizeof(insnscxx . . $ insns.[i].regs_modcxx . . $ insn_map_x86#regs_mod.));
1033 insn->detailcxx . . $ cs_insn#detail.->regs_write_countcxx . . $ cs_detail#regs_write_count. = (uint8_tcxx . . $ uint8_t#)count_positivecxx . . $ count_positive(ad0aaa07bfcd0593).(insnscxx . . $ insns.[i].regs_modcxx . . $ insn_map_x86#regs_mod.);
1034 break;
1035 case X86_RDTSCcxx . . $ X86_RDTSC.:
1036 if (h->modecxx . . $ cs_struct#mode. == CS_MODE_64cxx . . $ CS_MODE_64.) {
1037 memcpycxx . . $ memcpy(cc817cb175f282d).(insn->detailcxx . . $ cs_insn#detail.->regs_writecxx . . $ cs_detail#regs_write., insnscxx . . $ insns.[i].regs_modcxx . . $ insn_map_x86#regs_mod., sizeof(insnscxx . . $ insns.[i].regs_modcxx . . $ insn_map_x86#regs_mod.));
1038 insn->detailcxx . . $ cs_insn#detail.->regs_write_countcxx . . $ cs_detail#regs_write_count. = (uint8_tcxx . . $ uint8_t#)count_positivecxx . . $ count_positive(ad0aaa07bfcd0593).(insnscxx . . $ insns.[i].regs_modcxx . . $ insn_map_x86#regs_mod.);
1039 } else {
1040 insn->detailcxx . . $ cs_insn#detail.->regs_writecxx . . $ cs_detail#regs_write.[0] = X86_REG_EAXcxx . . $ X86_REG_EAX.;
1041 insn->detailcxx . . $ cs_insn#detail.->regs_writecxx . . $ cs_detail#regs_write.[1] = X86_REG_EDXcxx . . $ X86_REG_EDX.;
1042 insn->detailcxx . . $ cs_insn#detail.->regs_write_countcxx . . $ cs_detail#regs_write_count. = 2;
1043 }
1044 break;
1045 case X86_RDTSCPcxx . . $ X86_RDTSCP.:
1046 if (h->modecxx . . $ cs_struct#mode. == CS_MODE_64cxx . . $ CS_MODE_64.) {
1047 memcpycxx . . $ memcpy(cc817cb175f282d).(insn->detailcxx . . $ cs_insn#detail.->regs_writecxx . . $ cs_detail#regs_write., insnscxx . . $ insns.[i].regs_modcxx . . $ insn_map_x86#regs_mod., sizeof(insnscxx . . $ insns.[i].regs_modcxx . . $ insn_map_x86#regs_mod.));
1048 insn->detailcxx . . $ cs_insn#detail.->regs_write_countcxx . . $ cs_detail#regs_write_count. = (uint8_tcxx . . $ uint8_t#)count_positivecxx . . $ count_positive(ad0aaa07bfcd0593).(insnscxx . . $ insns.[i].regs_modcxx . . $ insn_map_x86#regs_mod.);
1049 } else {
1050 insn->detailcxx . . $ cs_insn#detail.->regs_writecxx . . $ cs_detail#regs_write.[0] = X86_REG_EAXcxx . . $ X86_REG_EAX.;
1051 insn->detailcxx . . $ cs_insn#detail.->regs_writecxx . . $ cs_detail#regs_write.[1] = X86_REG_ECXcxx . . $ X86_REG_ECX.;
1052 insn->detailcxx . . $ cs_insn#detail.->regs_writecxx . . $ cs_detail#regs_write.[2] = X86_REG_EDXcxx . . $ X86_REG_EDX.;
1053 insn->detailcxx . . $ cs_insn#detail.->regs_write_countcxx . . $ cs_detail#regs_write_count. = 3;
1054 }
1055 break;
1056 }
1057
1058 switch(insn->idcxx . . $ cs_insn#id.) {
1059 default:
1060 break;
1061
1062 case X86_INS_LOOPcxx . . $ X86_INS_LOOP.:
1063 case X86_INS_LOOPEcxx . . $ X86_INS_LOOPE.:
1064 case X86_INS_LOOPNEcxx . . $ X86_INS_LOOPNE.:
1065 switch(h->modecxx . . $ cs_struct#mode.) {
1066 default: break;
1067 case CS_MODE_16cxx . . $ CS_MODE_16.:
1068 insn->detailcxx . . $ cs_insn#detail.->regs_readcxx . . $ cs_detail#regs_read.[0] = X86_REG_CXcxx . . $ X86_REG_CX.;
1069 insn->detailcxx . . $ cs_insn#detail.->regs_read_countcxx . . $ cs_detail#regs_read_count. = 1;
1070 insn->detailcxx . . $ cs_insn#detail.->regs_writecxx . . $ cs_detail#regs_write.[0] = X86_REG_CXcxx . . $ X86_REG_CX.;
1071 insn->detailcxx . . $ cs_insn#detail.->regs_write_countcxx . . $ cs_detail#regs_write_count. = 1;
1072 break;
1073 case CS_MODE_32cxx . . $ CS_MODE_32.:
1074 insn->detailcxx . . $ cs_insn#detail.->regs_readcxx . . $ cs_detail#regs_read.[0] = X86_REG_ECXcxx . . $ X86_REG_ECX.;
1075 insn->detailcxx . . $ cs_insn#detail.->regs_read_countcxx . . $ cs_detail#regs_read_count. = 1;
1076 insn->detailcxx . . $ cs_insn#detail.->regs_writecxx . . $ cs_detail#regs_write.[0] = X86_REG_ECXcxx . . $ X86_REG_ECX.;
1077 insn->detailcxx . . $ cs_insn#detail.->regs_write_countcxx . . $ cs_detail#regs_write_count. = 1;
1078 break;
1079 case CS_MODE_64cxx . . $ CS_MODE_64.:
1080 insn->detailcxx . . $ cs_insn#detail.->regs_readcxx . . $ cs_detail#regs_read.[0] = X86_REG_RCXcxx . . $ X86_REG_RCX.;
1081 insn->detailcxx . . $ cs_insn#detail.->regs_read_countcxx . . $ cs_detail#regs_read_count. = 1;
1082 insn->detailcxx . . $ cs_insn#detail.->regs_writecxx . . $ cs_detail#regs_write.[0] = X86_REG_RCXcxx . . $ X86_REG_RCX.;
1083 insn->detailcxx . . $ cs_insn#detail.->regs_write_countcxx . . $ cs_detail#regs_write_count. = 1;
1084 break;
1085 }
1086
1087 // LOOPE & LOOPNE also read EFLAGS
1088 if (insn->idcxx . . $ cs_insn#id. != X86_INS_LOOPcxx . . $ X86_INS_LOOP.) {
1089 insn->detailcxx . . $ cs_insn#detail.->regs_readcxx . . $ cs_detail#regs_read.[1] = X86_REG_EFLAGScxx . . $ X86_REG_EFLAGS.;
1090 insn->detailcxx . . $ cs_insn#detail.->regs_read_countcxx . . $ cs_detail#regs_read_count. = 2;
1091 }
1092
1093 break;
1094
1095 case X86_INS_LODSBcxx . . $ X86_INS_LODSB.:
1096 case X86_INS_LODSDcxx . . $ X86_INS_LODSD.:
1097 case X86_INS_LODSQcxx . . $ X86_INS_LODSQ.:
1098 case X86_INS_LODSWcxx . . $ X86_INS_LODSW.:
1099 switch(h->modecxx . . $ cs_struct#mode.) {
1100 default:
1101 break;
1102 case CS_MODE_16cxx . . $ CS_MODE_16.:
1103 arr_replacecxx . . $ arr_replace(901d075bf66533e1).(insn->detailcxx . . $ cs_insn#detail.->regs_readcxx . . $ cs_detail#regs_read., insn->detailcxx . . $ cs_insn#detail.->regs_read_countcxx . . $ cs_detail#regs_read_count., X86_REG_ESIcxx . . $ X86_REG_ESI., X86_REG_SIcxx . . $ X86_REG_SI.);
1104 arr_replacecxx . . $ arr_replace(901d075bf66533e1).(insn->detailcxx . . $ cs_insn#detail.->regs_writecxx . . $ cs_detail#regs_write., insn->detailcxx . . $ cs_insn#detail.->regs_write_countcxx . . $ cs_detail#regs_write_count., X86_REG_ESIcxx . . $ X86_REG_ESI., X86_REG_SIcxx . . $ X86_REG_SI.);
1105 break;
1106 case CS_MODE_64cxx . . $ CS_MODE_64.:
1107 arr_replacecxx . . $ arr_replace(901d075bf66533e1).(insn->detailcxx . . $ cs_insn#detail.->regs_readcxx . . $ cs_detail#regs_read., insn->detailcxx . . $ cs_insn#detail.->regs_read_countcxx . . $ cs_detail#regs_read_count., X86_REG_ESIcxx . . $ X86_REG_ESI., X86_REG_RSIcxx . . $ X86_REG_RSI.);
1108 arr_replacecxx . . $ arr_replace(901d075bf66533e1).(insn->detailcxx . . $ cs_insn#detail.->regs_writecxx . . $ cs_detail#regs_write., insn->detailcxx . . $ cs_insn#detail.->regs_write_countcxx . . $ cs_detail#regs_write_count., X86_REG_ESIcxx . . $ X86_REG_ESI., X86_REG_RSIcxx . . $ X86_REG_RSI.);
1109 break;
1110 }
1111 break;
1112
1113 case X86_INS_SCASBcxx . . $ X86_INS_SCASB.:
1114 case X86_INS_SCASWcxx . . $ X86_INS_SCASW.:
1115 case X86_INS_SCASQcxx . . $ X86_INS_SCASQ.:
1116 case X86_INS_STOSBcxx . . $ X86_INS_STOSB.:
1117 case X86_INS_STOSDcxx . . $ X86_INS_STOSD.:
1118 case X86_INS_STOSQcxx . . $ X86_INS_STOSQ.:
1119 case X86_INS_STOSWcxx . . $ X86_INS_STOSW.:
1120 switch(h->modecxx . . $ cs_struct#mode.) {
1121 default:
1122 break;
1123 case CS_MODE_16cxx . . $ CS_MODE_16.:
1124 arr_replacecxx . . $ arr_replace(901d075bf66533e1).(insn->detailcxx . . $ cs_insn#detail.->regs_readcxx . . $ cs_detail#regs_read., insn->detailcxx . . $ cs_insn#detail.->regs_read_countcxx . . $ cs_detail#regs_read_count., X86_REG_EDIcxx . . $ X86_REG_EDI., X86_REG_DIcxx . . $ X86_REG_DI.);
1125 arr_replacecxx . . $ arr_replace(901d075bf66533e1).(insn->detailcxx . . $ cs_insn#detail.->regs_writecxx . . $ cs_detail#regs_write., insn->detailcxx . . $ cs_insn#detail.->regs_write_countcxx . . $ cs_detail#regs_write_count., X86_REG_EDIcxx . . $ X86_REG_EDI., X86_REG_DIcxx . . $ X86_REG_DI.);
1126 break;
1127 case CS_MODE_64cxx . . $ CS_MODE_64.:
1128 arr_replacecxx . . $ arr_replace(901d075bf66533e1).(insn->detailcxx . . $ cs_insn#detail.->regs_readcxx . . $ cs_detail#regs_read., insn->detailcxx . . $ cs_insn#detail.->regs_read_countcxx . . $ cs_detail#regs_read_count., X86_REG_EDIcxx . . $ X86_REG_EDI., X86_REG_RDIcxx . . $ X86_REG_RDI.);
1129 arr_replacecxx . . $ arr_replace(901d075bf66533e1).(insn->detailcxx . . $ cs_insn#detail.->regs_writecxx . . $ cs_detail#regs_write., insn->detailcxx . . $ cs_insn#detail.->regs_write_countcxx . . $ cs_detail#regs_write_count., X86_REG_EDIcxx . . $ X86_REG_EDI., X86_REG_RDIcxx . . $ X86_REG_RDI.);
1130 break;
1131 }
1132 break;
1133
1134 case X86_INS_CMPSBcxx . . $ X86_INS_CMPSB.:
1135 case X86_INS_CMPSDcxx . . $ X86_INS_CMPSD.:
1136 case X86_INS_CMPSQcxx . . $ X86_INS_CMPSQ.:
1137 case X86_INS_CMPSWcxx . . $ X86_INS_CMPSW.:
1138 case X86_INS_MOVSBcxx . . $ X86_INS_MOVSB.:
1139 case X86_INS_MOVSWcxx . . $ X86_INS_MOVSW.:
1140 case X86_INS_MOVSDcxx . . $ X86_INS_MOVSD.:
1141 case X86_INS_MOVSQcxx . . $ X86_INS_MOVSQ.:
1142 switch(h->modecxx . . $ cs_struct#mode.) {
1143 default:
1144 break;
1145 case CS_MODE_16cxx . . $ CS_MODE_16.:
1146 arr_replacecxx . . $ arr_replace(901d075bf66533e1).(insn->detailcxx . . $ cs_insn#detail.->regs_readcxx . . $ cs_detail#regs_read., insn->detailcxx . . $ cs_insn#detail.->regs_read_countcxx . . $ cs_detail#regs_read_count., X86_REG_EDIcxx . . $ X86_REG_EDI., X86_REG_DIcxx . . $ X86_REG_DI.);
1147 arr_replacecxx . . $ arr_replace(901d075bf66533e1).(insn->detailcxx . . $ cs_insn#detail.->regs_writecxx . . $ cs_detail#regs_write., insn->detailcxx . . $ cs_insn#detail.->regs_write_countcxx . . $ cs_detail#regs_write_count., X86_REG_EDIcxx . . $ X86_REG_EDI., X86_REG_DIcxx . . $ X86_REG_DI.);
1148 arr_replacecxx . . $ arr_replace(901d075bf66533e1).(insn->detailcxx . . $ cs_insn#detail.->regs_readcxx . . $ cs_detail#regs_read., insn->detailcxx . . $ cs_insn#detail.->regs_read_countcxx . . $ cs_detail#regs_read_count., X86_REG_ESIcxx . . $ X86_REG_ESI., X86_REG_SIcxx . . $ X86_REG_SI.);
1149 arr_replacecxx . . $ arr_replace(901d075bf66533e1).(insn->detailcxx . . $ cs_insn#detail.->regs_writecxx . . $ cs_detail#regs_write., insn->detailcxx . . $ cs_insn#detail.->regs_write_countcxx . . $ cs_detail#regs_write_count., X86_REG_ESIcxx . . $ X86_REG_ESI., X86_REG_SIcxx . . $ X86_REG_SI.);
1150 break;
1151 case CS_MODE_64cxx . . $ CS_MODE_64.:
1152 arr_replacecxx . . $ arr_replace(901d075bf66533e1).(insn->detailcxx . . $ cs_insn#detail.->regs_readcxx . . $ cs_detail#regs_read., insn->detailcxx . . $ cs_insn#detail.->regs_read_countcxx . . $ cs_detail#regs_read_count., X86_REG_EDIcxx . . $ X86_REG_EDI., X86_REG_RDIcxx . . $ X86_REG_RDI.);
1153 arr_replacecxx . . $ arr_replace(901d075bf66533e1).(insn->detailcxx . . $ cs_insn#detail.->regs_writecxx . . $ cs_detail#regs_write., insn->detailcxx . . $ cs_insn#detail.->regs_write_countcxx . . $ cs_detail#regs_write_count., X86_REG_EDIcxx . . $ X86_REG_EDI., X86_REG_RDIcxx . . $ X86_REG_RDI.);
1154 arr_replacecxx . . $ arr_replace(901d075bf66533e1).(insn->detailcxx . . $ cs_insn#detail.->regs_readcxx . . $ cs_detail#regs_read., insn->detailcxx . . $ cs_insn#detail.->regs_read_countcxx . . $ cs_detail#regs_read_count., X86_REG_ESIcxx . . $ X86_REG_ESI., X86_REG_RSIcxx . . $ X86_REG_RSI.);
1155 arr_replacecxx . . $ arr_replace(901d075bf66533e1).(insn->detailcxx . . $ cs_insn#detail.->regs_writecxx . . $ cs_detail#regs_write., insn->detailcxx . . $ cs_insn#detail.->regs_write_countcxx . . $ cs_detail#regs_write_count., X86_REG_ESIcxx . . $ X86_REG_ESI., X86_REG_RSIcxx . . $ X86_REG_RSI.);
1156 break;
1157 }
1158 break;
1159
1160 case X86_INS_RETcxx . . $ X86_INS_RET.:
1161 switch(h->modecxx . . $ cs_struct#mode.) {
1162 case CS_MODE_16cxx . . $ CS_MODE_16.:
1163 insn->detailcxx . . $ cs_insn#detail.->regs_writecxx . . $ cs_detail#regs_write.[0] = X86_REG_SPcxx . . $ X86_REG_SP.;
1164 insn->detailcxx . . $ cs_insn#detail.->regs_readcxx . . $ cs_detail#regs_read.[0] = X86_REG_SPcxx . . $ X86_REG_SP.;
1165 break;
1166 case CS_MODE_32cxx . . $ CS_MODE_32.:
1167 insn->detailcxx . . $ cs_insn#detail.->regs_writecxx . . $ cs_detail#regs_write.[0] = X86_REG_ESPcxx . . $ X86_REG_ESP.;
1168 insn->detailcxx . . $ cs_insn#detail.->regs_readcxx . . $ cs_detail#regs_read.[0] = X86_REG_ESPcxx . . $ X86_REG_ESP.;
1169 break;
1170 default: // 64-bit
1171 insn->detailcxx . . $ cs_insn#detail.->regs_writecxx . . $ cs_detail#regs_write.[0] = X86_REG_RSPcxx . . $ X86_REG_RSP.;
1172 insn->detailcxx . . $ cs_insn#detail.->regs_readcxx . . $ cs_detail#regs_read.[0] = X86_REG_RSPcxx . . $ X86_REG_RSP.;
1173 break;
1174 }
1175 insn->detailcxx . . $ cs_insn#detail.->regs_write_countcxx . . $ cs_detail#regs_write_count. = 1;
1176 insn->detailcxx . . $ cs_insn#detail.->regs_read_countcxx . . $ cs_detail#regs_read_count. = 1;
1177 break;
1178 }
1179
1180 memcpycxx . . $ memcpy(cc817cb175f282d).(insn->detailcxx . . $ cs_insn#detail.->groupscxx . . $ cs_detail#groups., insnscxx . . $ insns.[i].groupscxx . . $ insn_map_x86#groups., sizeof(insnscxx . . $ insns.[i].groupscxx . . $ insn_map_x86#groups.));
1181 insn->detailcxx . . $ cs_insn#detail.->groups_countcxx . . $ cs_detail#groups_count. = (uint8_tcxx . . $ uint8_t#)count_positive8cxx . . $ count_positive8(ca1608e2c87725e2).(insnscxx . . $ insns.[i].groupscxx . . $ insn_map_x86#groups.);
1182
1183 if (insnscxx . . $ insns.[i].branchcxx . . $ insn_map_x86#branch. || insnscxx . . $ insns.[i].indirect_branchcxx . . $ insn_map_x86#indirect_branch.) {
1184 // this insn also belongs to JUMP group. add JUMP group
1185 insn->detailcxx . . $ cs_insn#detail.->groupscxx . . $ cs_detail#groups.[insn->detailcxx . . $ cs_insn#detail.->groups_countcxx . . $ cs_detail#groups_count.] = X86_GRP_JUMPcxx . . $ X86_GRP_JUMP.;
1186 insn->detailcxx . . $ cs_insn#detail.->groups_countcxx . . $ cs_detail#groups_count.++;
1187 }
1188
1189 switch (insnscxx . . $ insns.[i].idcxx . . $ insn_map_x86#id.) {
1190 case X86_OUT8ircxx . . $ X86_OUT8ir.:
1191 case X86_OUT16ircxx . . $ X86_OUT16ir.:
1192 case X86_OUT32ircxx . . $ X86_OUT32ir.:
1193 if (insn->detailcxx . . $ cs_insn#detail.->x86cxx . . $ cs_detail#$anonymous_type_0#x86..operandscxx . . $ cs_x86#operands.[0].immcxx . . $ cs_x86_op#$anonymous_type_0#imm. == -78) {
1194 // Writing to port 0xb2 causes an SMI on most platforms
1195 // See: http://cs.gmu.edu/~tr-admin/papers/GMU-CS-TR-2011-8.pdf
1196 insn->detailcxx . . $ cs_insn#detail.->groupscxx . . $ cs_detail#groups.[insn->detailcxx . . $ cs_insn#detail.->groups_countcxx . . $ cs_detail#groups_count.] = X86_GRP_INTcxx . . $ X86_GRP_INT.;
1197 insn->detailcxx . . $ cs_insn#detail.->groups_countcxx . . $ cs_detail#groups_count.++;
1198 }
1199 break;
1200
1201 default:
1202 break;
1203 }
1204 #endif
1205 }
1206 }
1207 }
1208
1209 // map special instructions with accumulate registers.
1210 // this is needed because LLVM embeds these register names into AsmStrs[],
1211 // but not separately in operands
1212 struct insn_regcxx . . $ insn_reg# {
1213 uint16_tcxx . . $ uint16_t# insncxx . . $ insn_reg#insn.;
1214 x86_regcxx . . $ x86_reg# regcxx . . $ insn_reg#reg.;
1215 enum cs_ac_typecxx . . $ cs_ac_type# accesscxx . . $ insn_reg#access.;
1216 };
1217
1218 struct insn_reg2cxx . . $ insn_reg2# {
1219 uint16_tcxx . . $ uint16_t# insncxx . . $ insn_reg2#insn.;
1220 x86_regcxx . . $ x86_reg# reg1cxx . . $ insn_reg2#reg1., reg2cxx . . $ insn_reg2#reg2.;
1221 enum cs_ac_typecxx . . $ cs_ac_type# access1cxx . . $ insn_reg2#access1., access2cxx . . $ insn_reg2#access2.;
1222 };
1223
1224 static inline uint16_tcxx . . $ uint16_t# pack_insn_regcxx . . $ pack_insn_reg(b314288478b32687).(x86_regcxx . . $ x86_reg# reg, enum cs_ac_typecxx . . $ cs_ac_type# access)
1225 {
1226 return (uint16_tcxx . . $ uint16_t#)(((unsigned int)access << 12) |
1227 ((unsigned int)reg & 0x0fff));
1228 }
1229
1230 static inline x86_regcxx . . $ x86_reg# unpack_insn_regcxx . . $ unpack_insn_reg(c78860bfcb27f01b).(uint16_tcxx . . $ uint16_t# val, enum cs_ac_typecxx . . $ cs_ac_type# *access)
1231 {
1232 if (access)
1233 *access = (enum cs_ac_typecxx . . $ cs_ac_type#)(val >> 12);
1234 return (x86_regcxx . . $ x86_reg#)(val & 0x0fff);
1235 }
1236
1237 static const struct insn_regcxx . . $ insn_reg# insn_regs_attcxx . . $ insn_regs_att.[] = {
1238 { X86_INSBcxx . . $ X86_INSB., X86_REG_DXcxx . . $ X86_REG_DX., CS_AC_READcxx . . $ CS_AC_READ. },
1239 { X86_INSLcxx . . $ X86_INSL., X86_REG_DXcxx . . $ X86_REG_DX., CS_AC_READcxx . . $ CS_AC_READ. },
1240 { X86_INSWcxx . . $ X86_INSW., X86_REG_DXcxx . . $ X86_REG_DX., CS_AC_READcxx . . $ CS_AC_READ. },
1241 { X86_MOV16o16acxx . . $ X86_MOV16o16a., X86_REG_AXcxx . . $ X86_REG_AX., CS_AC_READcxx . . $ CS_AC_READ. },
1242 { X86_MOV16o32acxx . . $ X86_MOV16o32a., X86_REG_AXcxx . . $ X86_REG_AX., CS_AC_READcxx . . $ CS_AC_READ. },
1243 { X86_MOV16o64acxx . . $ X86_MOV16o64a., X86_REG_AXcxx . . $ X86_REG_AX., CS_AC_READcxx . . $ CS_AC_READ. },
1244 { X86_MOV32o16acxx . . $ X86_MOV32o16a., X86_REG_EAXcxx . . $ X86_REG_EAX., CS_AC_READcxx . . $ CS_AC_READ. },
1245 { X86_MOV32o32acxx . . $ X86_MOV32o32a., X86_REG_EAXcxx . . $ X86_REG_EAX., CS_AC_READcxx . . $ CS_AC_READ. },
1246 { X86_MOV32o64acxx . . $ X86_MOV32o64a., X86_REG_EAXcxx . . $ X86_REG_EAX., CS_AC_READcxx . . $ CS_AC_READ. },
1247 { X86_MOV64o32acxx . . $ X86_MOV64o32a., X86_REG_RAXcxx . . $ X86_REG_RAX., CS_AC_READcxx . . $ CS_AC_READ. },
1248 { X86_MOV64o64acxx . . $ X86_MOV64o64a., X86_REG_RAXcxx . . $ X86_REG_RAX., CS_AC_READcxx . . $ CS_AC_READ. },
1249 { X86_MOV8o16acxx . . $ X86_MOV8o16a., X86_REG_ALcxx . . $ X86_REG_AL., CS_AC_READcxx . . $ CS_AC_READ. },
1250 { X86_MOV8o32acxx . . $ X86_MOV8o32a., X86_REG_ALcxx . . $ X86_REG_AL., CS_AC_READcxx . . $ CS_AC_READ. },
1251 { X86_MOV8o64acxx . . $ X86_MOV8o64a., X86_REG_ALcxx . . $ X86_REG_AL., CS_AC_READcxx . . $ CS_AC_READ. },
1252 { X86_OUT16ircxx . . $ X86_OUT16ir., X86_REG_AXcxx . . $ X86_REG_AX., CS_AC_READcxx . . $ CS_AC_READ. },
1253 { X86_OUT32ircxx . . $ X86_OUT32ir., X86_REG_EAXcxx . . $ X86_REG_EAX., CS_AC_READcxx . . $ CS_AC_READ. },
1254 { X86_OUT8ircxx . . $ X86_OUT8ir., X86_REG_ALcxx . . $ X86_REG_AL., CS_AC_READcxx . . $ CS_AC_READ. },
1255 { X86_POPDS16cxx . . $ X86_POPDS16., X86_REG_DScxx . . $ X86_REG_DS., CS_AC_WRITEcxx . . $ CS_AC_WRITE. },
1256 { X86_POPDS32cxx . . $ X86_POPDS32., X86_REG_DScxx . . $ X86_REG_DS., CS_AC_WRITEcxx . . $ CS_AC_WRITE. },
1257 { X86_POPES16cxx . . $ X86_POPES16., X86_REG_EScxx . . $ X86_REG_ES., CS_AC_WRITEcxx . . $ CS_AC_WRITE. },
1258 { X86_POPES32cxx . . $ X86_POPES32., X86_REG_EScxx . . $ X86_REG_ES., CS_AC_WRITEcxx . . $ CS_AC_WRITE. },
1259 { X86_POPFS16cxx . . $ X86_POPFS16., X86_REG_FScxx . . $ X86_REG_FS., CS_AC_WRITEcxx . . $ CS_AC_WRITE. },
1260 { X86_POPFS32cxx . . $ X86_POPFS32., X86_REG_FScxx . . $ X86_REG_FS., CS_AC_WRITEcxx . . $ CS_AC_WRITE. },
1261 { X86_POPFS64cxx . . $ X86_POPFS64., X86_REG_FScxx . . $ X86_REG_FS., CS_AC_WRITEcxx . . $ CS_AC_WRITE. },
1262 { X86_POPGS16cxx . . $ X86_POPGS16., X86_REG_GScxx . . $ X86_REG_GS., CS_AC_WRITEcxx . . $ CS_AC_WRITE. },
1263 { X86_POPGS32cxx . . $ X86_POPGS32., X86_REG_GScxx . . $ X86_REG_GS., CS_AC_WRITEcxx . . $ CS_AC_WRITE. },
1264 { X86_POPGS64cxx . . $ X86_POPGS64., X86_REG_GScxx . . $ X86_REG_GS., CS_AC_WRITEcxx . . $ CS_AC_WRITE. },
1265 { X86_POPSS16cxx . . $ X86_POPSS16., X86_REG_SScxx . . $ X86_REG_SS., CS_AC_WRITEcxx . . $ CS_AC_WRITE. },
1266 { X86_POPSS32cxx . . $ X86_POPSS32., X86_REG_SScxx . . $ X86_REG_SS., CS_AC_WRITEcxx . . $ CS_AC_WRITE. },
1267 { X86_PUSHCS16cxx . . $ X86_PUSHCS16., X86_REG_CScxx . . $ X86_REG_CS., CS_AC_READcxx . . $ CS_AC_READ. },
1268 { X86_PUSHCS32cxx . . $ X86_PUSHCS32., X86_REG_CScxx . . $ X86_REG_CS., CS_AC_READcxx . . $ CS_AC_READ. },
1269 { X86_PUSHDS16cxx . . $ X86_PUSHDS16., X86_REG_DScxx . . $ X86_REG_DS., CS_AC_READcxx . . $ CS_AC_READ. },
1270 { X86_PUSHDS32cxx . . $ X86_PUSHDS32., X86_REG_DScxx . . $ X86_REG_DS., CS_AC_READcxx . . $ CS_AC_READ. },
1271 { X86_PUSHES16cxx . . $ X86_PUSHES16., X86_REG_EScxx . . $ X86_REG_ES., CS_AC_READcxx . . $ CS_AC_READ. },
1272 { X86_PUSHES32cxx . . $ X86_PUSHES32., X86_REG_EScxx . . $ X86_REG_ES., CS_AC_READcxx . . $ CS_AC_READ. },
1273 { X86_PUSHFS16cxx . . $ X86_PUSHFS16., X86_REG_FScxx . . $ X86_REG_FS., CS_AC_READcxx . . $ CS_AC_READ. },
1274 { X86_PUSHFS32cxx . . $ X86_PUSHFS32., X86_REG_FScxx . . $ X86_REG_FS., CS_AC_READcxx . . $ CS_AC_READ. },
1275 { X86_PUSHFS64cxx . . $ X86_PUSHFS64., X86_REG_FScxx . . $ X86_REG_FS., CS_AC_READcxx . . $ CS_AC_READ. },
1276 { X86_PUSHGS16cxx . . $ X86_PUSHGS16., X86_REG_GScxx . . $ X86_REG_GS., CS_AC_READcxx . . $ CS_AC_READ. },
1277 { X86_PUSHGS32cxx . . $ X86_PUSHGS32., X86_REG_GScxx . . $ X86_REG_GS., CS_AC_READcxx . . $ CS_AC_READ. },
1278 { X86_PUSHGS64cxx . . $ X86_PUSHGS64., X86_REG_GScxx . . $ X86_REG_GS., CS_AC_READcxx . . $ CS_AC_READ. },
1279 { X86_PUSHSS16cxx . . $ X86_PUSHSS16., X86_REG_SScxx . . $ X86_REG_SS., CS_AC_READcxx . . $ CS_AC_READ. },
1280 { X86_PUSHSS32cxx . . $ X86_PUSHSS32., X86_REG_SScxx . . $ X86_REG_SS., CS_AC_READcxx . . $ CS_AC_READ. },
1281 { X86_RCL16rCLcxx . . $ X86_RCL16rCL., X86_REG_CLcxx . . $ X86_REG_CL., CS_AC_READcxx . . $ CS_AC_READ. },
1282 { X86_RCL32rCLcxx . . $ X86_RCL32rCL., X86_REG_CLcxx . . $ X86_REG_CL., CS_AC_READcxx . . $ CS_AC_READ. },
1283 { X86_RCL64rCLcxx . . $ X86_RCL64rCL., X86_REG_CLcxx . . $ X86_REG_CL., CS_AC_READcxx . . $ CS_AC_READ. },
1284 { X86_RCL8rCLcxx . . $ X86_RCL8rCL., X86_REG_CLcxx . . $ X86_REG_CL., CS_AC_READcxx . . $ CS_AC_READ. },
1285 { X86_RCR16rCLcxx . . $ X86_RCR16rCL., X86_REG_CLcxx . . $ X86_REG_CL., CS_AC_READcxx . . $ CS_AC_READ. },
1286 { X86_RCR32rCLcxx . . $ X86_RCR32rCL., X86_REG_CLcxx . . $ X86_REG_CL., CS_AC_READcxx . . $ CS_AC_READ. },
1287 { X86_RCR64rCLcxx . . $ X86_RCR64rCL., X86_REG_CLcxx . . $ X86_REG_CL., CS_AC_READcxx . . $ CS_AC_READ. },
1288 { X86_RCR8rCLcxx . . $ X86_RCR8rCL., X86_REG_CLcxx . . $ X86_REG_CL., CS_AC_READcxx . . $ CS_AC_READ. },
1289 { X86_ROL16rCLcxx . . $ X86_ROL16rCL., X86_REG_CLcxx . . $ X86_REG_CL., CS_AC_READcxx . . $ CS_AC_READ. },
1290 { X86_ROL32rCLcxx . . $ X86_ROL32rCL., X86_REG_CLcxx . . $ X86_REG_CL., CS_AC_READcxx . . $ CS_AC_READ. },
1291 { X86_ROL64rCLcxx . . $ X86_ROL64rCL., X86_REG_CLcxx . . $ X86_REG_CL., CS_AC_READcxx . . $ CS_AC_READ. },
1292 { X86_ROL8rCLcxx . . $ X86_ROL8rCL., X86_REG_CLcxx . . $ X86_REG_CL., CS_AC_READcxx . . $ CS_AC_READ. },
1293 { X86_ROR16rCLcxx . . $ X86_ROR16rCL., X86_REG_CLcxx . . $ X86_REG_CL., CS_AC_READcxx . . $ CS_AC_READ. },
1294 { X86_ROR32rCLcxx . . $ X86_ROR32rCL., X86_REG_CLcxx . . $ X86_REG_CL., CS_AC_READcxx . . $ CS_AC_READ. },
1295 { X86_ROR64rCLcxx . . $ X86_ROR64rCL., X86_REG_CLcxx . . $ X86_REG_CL., CS_AC_READcxx . . $ CS_AC_READ. },
1296 { X86_ROR8rCLcxx . . $ X86_ROR8rCL., X86_REG_CLcxx . . $ X86_REG_CL., CS_AC_READcxx . . $ CS_AC_READ. },
1297 { X86_SAL16rCLcxx . . $ X86_SAL16rCL., X86_REG_CLcxx . . $ X86_REG_CL., CS_AC_READcxx . . $ CS_AC_READ. },
1298 { X86_SAL32rCLcxx . . $ X86_SAL32rCL., X86_REG_CLcxx . . $ X86_REG_CL., CS_AC_READcxx . . $ CS_AC_READ. },
1299 { X86_SAL64rCLcxx . . $ X86_SAL64rCL., X86_REG_CLcxx . . $ X86_REG_CL., CS_AC_READcxx . . $ CS_AC_READ. },
1300 { X86_SAL8rCLcxx . . $ X86_SAL8rCL., X86_REG_CLcxx . . $ X86_REG_CL., CS_AC_READcxx . . $ CS_AC_READ. },
1301 { X86_SAR16rCLcxx . . $ X86_SAR16rCL., X86_REG_CLcxx . . $ X86_REG_CL., CS_AC_READcxx . . $ CS_AC_READ. },
1302 { X86_SAR32rCLcxx . . $ X86_SAR32rCL., X86_REG_CLcxx . . $ X86_REG_CL., CS_AC_READcxx . . $ CS_AC_READ. },
1303 { X86_SAR64rCLcxx . . $ X86_SAR64rCL., X86_REG_CLcxx . . $ X86_REG_CL., CS_AC_READcxx . . $ CS_AC_READ. },
1304 { X86_SAR8rCLcxx . . $ X86_SAR8rCL., X86_REG_CLcxx . . $ X86_REG_CL., CS_AC_READcxx . . $ CS_AC_READ. },
1305 { X86_SHL16rCLcxx . . $ X86_SHL16rCL., X86_REG_CLcxx . . $ X86_REG_CL., CS_AC_READcxx . . $ CS_AC_READ. },
1306 { X86_SHL32rCLcxx . . $ X86_SHL32rCL., X86_REG_CLcxx . . $ X86_REG_CL., CS_AC_READcxx . . $ CS_AC_READ. },
1307 { X86_SHL64rCLcxx . . $ X86_SHL64rCL., X86_REG_CLcxx . . $ X86_REG_CL., CS_AC_READcxx . . $ CS_AC_READ. },
1308 { X86_SHL8rCLcxx . . $ X86_SHL8rCL., X86_REG_CLcxx . . $ X86_REG_CL., CS_AC_READcxx . . $ CS_AC_READ. },
1309 { X86_SHLD16mrCLcxx . . $ X86_SHLD16mrCL., X86_REG_CLcxx . . $ X86_REG_CL., CS_AC_READcxx . . $ CS_AC_READ. },
1310 { X86_SHLD16rrCLcxx . . $ X86_SHLD16rrCL., X86_REG_CLcxx . . $ X86_REG_CL., CS_AC_READcxx . . $ CS_AC_READ. },
1311 { X86_SHLD32mrCLcxx . . $ X86_SHLD32mrCL., X86_REG_CLcxx . . $ X86_REG_CL., CS_AC_READcxx . . $ CS_AC_READ. },
1312 { X86_SHLD32rrCLcxx . . $ X86_SHLD32rrCL., X86_REG_CLcxx . . $ X86_REG_CL., CS_AC_READcxx . . $ CS_AC_READ. },
1313 { X86_SHLD64mrCLcxx . . $ X86_SHLD64mrCL., X86_REG_CLcxx . . $ X86_REG_CL., CS_AC_READcxx . . $ CS_AC_READ. },
1314 { X86_SHLD64rrCLcxx . . $ X86_SHLD64rrCL., X86_REG_CLcxx . . $ X86_REG_CL., CS_AC_READcxx . . $ CS_AC_READ. },
1315 { X86_SHR16rCLcxx . . $ X86_SHR16rCL., X86_REG_CLcxx . . $ X86_REG_CL., CS_AC_READcxx . . $ CS_AC_READ. },
1316 { X86_SHR32rCLcxx . . $ X86_SHR32rCL., X86_REG_CLcxx . . $ X86_REG_CL., CS_AC_READcxx . . $ CS_AC_READ. },
1317 { X86_SHR64rCLcxx . . $ X86_SHR64rCL., X86_REG_CLcxx . . $ X86_REG_CL., CS_AC_READcxx . . $ CS_AC_READ. },
1318 { X86_SHR8rCLcxx . . $ X86_SHR8rCL., X86_REG_CLcxx . . $ X86_REG_CL., CS_AC_READcxx . . $ CS_AC_READ. },
1319 { X86_SHRD16mrCLcxx . . $ X86_SHRD16mrCL., X86_REG_CLcxx . . $ X86_REG_CL., CS_AC_READcxx . . $ CS_AC_READ. },
1320 { X86_SHRD16rrCLcxx . . $ X86_SHRD16rrCL., X86_REG_CLcxx . . $ X86_REG_CL., CS_AC_READcxx . . $ CS_AC_READ. },
1321 { X86_SHRD32mrCLcxx . . $ X86_SHRD32mrCL., X86_REG_CLcxx . . $ X86_REG_CL., CS_AC_READcxx . . $ CS_AC_READ. },
1322 { X86_SHRD32rrCLcxx . . $ X86_SHRD32rrCL., X86_REG_CLcxx . . $ X86_REG_CL., CS_AC_READcxx . . $ CS_AC_READ. },
1323 { X86_SHRD64mrCLcxx . . $ X86_SHRD64mrCL., X86_REG_CLcxx . . $ X86_REG_CL., CS_AC_READcxx . . $ CS_AC_READ. },
1324 { X86_SHRD64rrCLcxx . . $ X86_SHRD64rrCL., X86_REG_CLcxx . . $ X86_REG_CL., CS_AC_READcxx . . $ CS_AC_READ. },
1325 { X86_XCHG16arcxx . . $ X86_XCHG16ar., X86_REG_AXcxx . . $ X86_REG_AX., CS_AC_WRITEcxx . . $ CS_AC_WRITE. | CS_AC_READcxx . . $ CS_AC_READ. },
1326 { X86_XCHG32arcxx . . $ X86_XCHG32ar., X86_REG_EAXcxx . . $ X86_REG_EAX., CS_AC_WRITEcxx . . $ CS_AC_WRITE. | CS_AC_READcxx . . $ CS_AC_READ. },
1327 { X86_XCHG64arcxx . . $ X86_XCHG64ar., X86_REG_RAXcxx . . $ X86_REG_RAX., CS_AC_WRITEcxx . . $ CS_AC_WRITE. | CS_AC_READcxx . . $ CS_AC_READ. },
1328 };
1329
1330 static const struct insn_regcxx . . $ insn_reg# insn_regs_att_extracxx . . $ insn_regs_att_extra.[] = {
1331 // dummy entry, to avoid empty array
1332 { 0, 0 },
1333 #ifndef CAPSTONE_X86_REDUCE
1334 { X86_ADD_FrST0cxx . . $ X86_ADD_FrST0., X86_REG_ST0cxx . . $ X86_REG_ST0., CS_AC_READcxx . . $ CS_AC_READ. },
1335 { X86_DIVR_FrST0cxx . . $ X86_DIVR_FrST0., X86_REG_ST0cxx . . $ X86_REG_ST0., CS_AC_READcxx . . $ CS_AC_READ. },
1336 { X86_DIV_FrST0cxx . . $ X86_DIV_FrST0., X86_REG_ST0cxx . . $ X86_REG_ST0., CS_AC_READcxx . . $ CS_AC_READ. },
1337 { X86_FNSTSW16rcxx . . $ X86_FNSTSW16r., X86_REG_AXcxx . . $ X86_REG_AX., CS_AC_READcxx . . $ CS_AC_READ. },
1338 { X86_MUL_FrST0cxx . . $ X86_MUL_FrST0., X86_REG_ST0cxx . . $ X86_REG_ST0., CS_AC_READcxx . . $ CS_AC_READ. },
1339 { X86_SKINITcxx . . $ X86_SKINIT., X86_REG_EAXcxx . . $ X86_REG_EAX., CS_AC_READcxx . . $ CS_AC_READ. },
1340 { X86_SUBR_FrST0cxx . . $ X86_SUBR_FrST0., X86_REG_ST0cxx . . $ X86_REG_ST0., CS_AC_READcxx . . $ CS_AC_READ. },
1341 { X86_SUB_FrST0cxx . . $ X86_SUB_FrST0., X86_REG_ST0cxx . . $ X86_REG_ST0., CS_AC_READcxx . . $ CS_AC_READ. },
1342 { X86_VMLOAD32cxx . . $ X86_VMLOAD32., X86_REG_EAXcxx . . $ X86_REG_EAX., CS_AC_READcxx . . $ CS_AC_READ. },
1343 { X86_VMLOAD64cxx . . $ X86_VMLOAD64., X86_REG_RAXcxx . . $ X86_REG_RAX., CS_AC_READcxx . . $ CS_AC_READ. },
1344 { X86_VMRUN32cxx . . $ X86_VMRUN32., X86_REG_EAXcxx . . $ X86_REG_EAX., CS_AC_READcxx . . $ CS_AC_READ. },
1345 { X86_VMRUN64cxx . . $ X86_VMRUN64., X86_REG_RAXcxx . . $ X86_REG_RAX., CS_AC_READcxx . . $ CS_AC_READ. },
1346 { X86_VMSAVE32cxx . . $ X86_VMSAVE32., X86_REG_EAXcxx . . $ X86_REG_EAX., CS_AC_READcxx . . $ CS_AC_READ. },
1347 { X86_VMSAVE64cxx . . $ X86_VMSAVE64., X86_REG_RAXcxx . . $ X86_REG_RAX., CS_AC_READcxx . . $ CS_AC_READ. },
1348 #endif
1349 };
1350
1351 static const struct insn_regcxx . . $ insn_reg# insn_regs_intelcxx . . $ insn_regs_intel.[] = {
1352 { X86_ADC16i16cxx . . $ X86_ADC16i16., X86_REG_AXcxx . . $ X86_REG_AX., CS_AC_WRITEcxx . . $ CS_AC_WRITE. | CS_AC_READcxx . . $ CS_AC_READ. },
1353 { X86_ADC32i32cxx . . $ X86_ADC32i32., X86_REG_EAXcxx . . $ X86_REG_EAX., CS_AC_WRITEcxx . . $ CS_AC_WRITE. | CS_AC_READcxx . . $ CS_AC_READ. },
1354 { X86_ADC64i32cxx . . $ X86_ADC64i32., X86_REG_RAXcxx . . $ X86_REG_RAX., CS_AC_WRITEcxx . . $ CS_AC_WRITE. | CS_AC_READcxx . . $ CS_AC_READ. },
1355 { X86_ADC8i8cxx . . $ X86_ADC8i8., X86_REG_ALcxx . . $ X86_REG_AL., CS_AC_WRITEcxx . . $ CS_AC_WRITE. | CS_AC_READcxx . . $ CS_AC_READ. },
1356 { X86_ADD16i16cxx . . $ X86_ADD16i16., X86_REG_AXcxx . . $ X86_REG_AX., CS_AC_WRITEcxx . . $ CS_AC_WRITE. | CS_AC_READcxx . . $ CS_AC_READ. },
1357 { X86_ADD32i32cxx . . $ X86_ADD32i32., X86_REG_EAXcxx . . $ X86_REG_EAX., CS_AC_WRITEcxx . . $ CS_AC_WRITE. | CS_AC_READcxx . . $ CS_AC_READ. },
1358 { X86_ADD64i32cxx . . $ X86_ADD64i32., X86_REG_RAXcxx . . $ X86_REG_RAX., CS_AC_WRITEcxx . . $ CS_AC_WRITE. | CS_AC_READcxx . . $ CS_AC_READ. },
1359 { X86_ADD8i8cxx . . $ X86_ADD8i8., X86_REG_ALcxx . . $ X86_REG_AL., CS_AC_WRITEcxx . . $ CS_AC_WRITE. | CS_AC_READcxx . . $ CS_AC_READ. },
1360 { X86_AND16i16cxx . . $ X86_AND16i16., X86_REG_AXcxx . . $ X86_REG_AX., CS_AC_WRITEcxx . . $ CS_AC_WRITE. | CS_AC_READcxx . . $ CS_AC_READ. },
1361 { X86_AND32i32cxx . . $ X86_AND32i32., X86_REG_EAXcxx . . $ X86_REG_EAX., CS_AC_WRITEcxx . . $ CS_AC_WRITE. | CS_AC_READcxx . . $ CS_AC_READ. },
1362 { X86_AND64i32cxx . . $ X86_AND64i32., X86_REG_RAXcxx . . $ X86_REG_RAX., CS_AC_WRITEcxx . . $ CS_AC_WRITE. | CS_AC_READcxx . . $ CS_AC_READ. },
1363 { X86_AND8i8cxx . . $ X86_AND8i8., X86_REG_ALcxx . . $ X86_REG_AL., CS_AC_WRITEcxx . . $ CS_AC_WRITE. | CS_AC_READcxx . . $ CS_AC_READ. },
1364 { X86_CMP16i16cxx . . $ X86_CMP16i16., X86_REG_AXcxx . . $ X86_REG_AX., CS_AC_WRITEcxx . . $ CS_AC_WRITE. | CS_AC_READcxx . . $ CS_AC_READ. },
1365 { X86_CMP32i32cxx . . $ X86_CMP32i32., X86_REG_EAXcxx . . $ X86_REG_EAX., CS_AC_WRITEcxx . . $ CS_AC_WRITE. | CS_AC_READcxx . . $ CS_AC_READ. },
1366 { X86_CMP64i32cxx . . $ X86_CMP64i32., X86_REG_RAXcxx . . $ X86_REG_RAX., CS_AC_WRITEcxx . . $ CS_AC_WRITE. | CS_AC_READcxx . . $ CS_AC_READ. },
1367 { X86_CMP8i8cxx . . $ X86_CMP8i8., X86_REG_ALcxx . . $ X86_REG_AL., CS_AC_WRITEcxx . . $ CS_AC_WRITE. | CS_AC_READcxx . . $ CS_AC_READ. },
1368 { X86_IN16ricxx . . $ X86_IN16ri., X86_REG_AXcxx . . $ X86_REG_AX., CS_AC_WRITEcxx . . $ CS_AC_WRITE. },
1369 { X86_IN32ricxx . . $ X86_IN32ri., X86_REG_EAXcxx . . $ X86_REG_EAX., CS_AC_WRITEcxx . . $ CS_AC_WRITE. },
1370 { X86_IN8ricxx . . $ X86_IN8ri., X86_REG_ALcxx . . $ X86_REG_AL., CS_AC_WRITEcxx . . $ CS_AC_WRITE. },
1371 { X86_LODSBcxx . . $ X86_LODSB., X86_REG_ALcxx . . $ X86_REG_AL., CS_AC_WRITEcxx . . $ CS_AC_WRITE. },
1372 { X86_LODSLcxx . . $ X86_LODSL., X86_REG_EAXcxx . . $ X86_REG_EAX., CS_AC_WRITEcxx . . $ CS_AC_WRITE. },
1373 { X86_LODSQcxx . . $ X86_LODSQ., X86_REG_RAXcxx . . $ X86_REG_RAX., CS_AC_WRITEcxx . . $ CS_AC_WRITE. },
1374 { X86_LODSWcxx . . $ X86_LODSW., X86_REG_AXcxx . . $ X86_REG_AX., CS_AC_WRITEcxx . . $ CS_AC_WRITE. },
1375 { X86_MOV16ao16cxx . . $ X86_MOV16ao16., X86_REG_AXcxx . . $ X86_REG_AX., CS_AC_WRITEcxx . . $ CS_AC_WRITE. }, // 16-bit A1 1020 // mov ax, word ptr [0x2010]
1376 { X86_MOV16ao32cxx . . $ X86_MOV16ao32., X86_REG_AXcxx . . $ X86_REG_AX., CS_AC_WRITEcxx . . $ CS_AC_WRITE. }, // 32-bit A1 10203040 // mov ax, word ptr [0x40302010]
1377 { X86_MOV16ao64cxx . . $ X86_MOV16ao64., X86_REG_AXcxx . . $ X86_REG_AX., CS_AC_WRITEcxx . . $ CS_AC_WRITE. }, // 64-bit 66 A1 1020304050607080 // movabs ax, word ptr [0x8070605040302010]
1378 { X86_MOV32ao16cxx . . $ X86_MOV32ao16., X86_REG_EAXcxx . . $ X86_REG_EAX., CS_AC_WRITEcxx . . $ CS_AC_WRITE. }, // 32-bit 67 A1 1020 // mov eax, dword ptr [0x2010]
1379 { X86_MOV32ao32cxx . . $ X86_MOV32ao32., X86_REG_EAXcxx . . $ X86_REG_EAX., CS_AC_WRITEcxx . . $ CS_AC_WRITE. }, // 32-bit A1 10203040 // mov eax, dword ptr [0x40302010]
1380 { X86_MOV32ao64cxx . . $ X86_MOV32ao64., X86_REG_EAXcxx . . $ X86_REG_EAX., CS_AC_WRITEcxx . . $ CS_AC_WRITE. }, // 64-bit A1 1020304050607080 // movabs eax, dword ptr [0x8070605040302010]
1381 { X86_MOV64ao32cxx . . $ X86_MOV64ao32., X86_REG_RAXcxx . . $ X86_REG_RAX., CS_AC_WRITEcxx . . $ CS_AC_WRITE. }, // 64-bit 48 8B04 10203040 // mov rax, qword ptr [0x40302010]
1382 { X86_MOV64ao64cxx . . $ X86_MOV64ao64., X86_REG_RAXcxx . . $ X86_REG_RAX., CS_AC_WRITEcxx . . $ CS_AC_WRITE. }, // 64-bit 48 A1 1020304050607080 // movabs rax, qword ptr [0x8070605040302010]
1383 { X86_MOV8ao16cxx . . $ X86_MOV8ao16., X86_REG_ALcxx . . $ X86_REG_AL., CS_AC_WRITEcxx . . $ CS_AC_WRITE. }, // 16-bit A0 1020 // mov al, byte ptr [0x2010]
1384 { X86_MOV8ao32cxx . . $ X86_MOV8ao32., X86_REG_ALcxx . . $ X86_REG_AL., CS_AC_WRITEcxx . . $ CS_AC_WRITE. }, // 32-bit A0 10203040 // mov al, byte ptr [0x40302010]
1385 { X86_MOV8ao64cxx . . $ X86_MOV8ao64., X86_REG_ALcxx . . $ X86_REG_AL., CS_AC_WRITEcxx . . $ CS_AC_WRITE. }, // 64-bit 66 A0 1020304050607080 // movabs al, byte ptr [0x8070605040302010]
1386 { X86_OR16i16cxx . . $ X86_OR16i16., X86_REG_AXcxx . . $ X86_REG_AX., CS_AC_WRITEcxx . . $ CS_AC_WRITE. | CS_AC_READcxx . . $ CS_AC_READ. },
1387 { X86_OR32i32cxx . . $ X86_OR32i32., X86_REG_EAXcxx . . $ X86_REG_EAX., CS_AC_WRITEcxx . . $ CS_AC_WRITE. | CS_AC_READcxx . . $ CS_AC_READ. },
1388 { X86_OR64i32cxx . . $ X86_OR64i32., X86_REG_RAXcxx . . $ X86_REG_RAX., CS_AC_WRITEcxx . . $ CS_AC_WRITE. | CS_AC_READcxx . . $ CS_AC_READ. },
1389 { X86_OR8i8cxx . . $ X86_OR8i8., X86_REG_ALcxx . . $ X86_REG_AL., CS_AC_WRITEcxx . . $ CS_AC_WRITE. | CS_AC_READcxx . . $ CS_AC_READ. },
1390 { X86_OUTSBcxx . . $ X86_OUTSB., X86_REG_DXcxx . . $ X86_REG_DX., CS_AC_WRITEcxx . . $ CS_AC_WRITE. },
1391 { X86_OUTSLcxx . . $ X86_OUTSL., X86_REG_DXcxx . . $ X86_REG_DX., CS_AC_WRITEcxx . . $ CS_AC_WRITE. },
1392 { X86_OUTSWcxx . . $ X86_OUTSW., X86_REG_DXcxx . . $ X86_REG_DX., CS_AC_WRITEcxx . . $ CS_AC_WRITE. },
1393 { X86_POPDS16cxx . . $ X86_POPDS16., X86_REG_DScxx . . $ X86_REG_DS., CS_AC_WRITEcxx . . $ CS_AC_WRITE. },
1394 { X86_POPDS32cxx . . $ X86_POPDS32., X86_REG_DScxx . . $ X86_REG_DS., CS_AC_WRITEcxx . . $ CS_AC_WRITE. },
1395 { X86_POPES16cxx . . $ X86_POPES16., X86_REG_EScxx . . $ X86_REG_ES., CS_AC_WRITEcxx . . $ CS_AC_WRITE. },
1396 { X86_POPES32cxx . . $ X86_POPES32., X86_REG_EScxx . . $ X86_REG_ES., CS_AC_WRITEcxx . . $ CS_AC_WRITE. },
1397 { X86_POPFS16cxx . . $ X86_POPFS16., X86_REG_FScxx . . $ X86_REG_FS., CS_AC_WRITEcxx . . $ CS_AC_WRITE. },
1398 { X86_POPFS32cxx . . $ X86_POPFS32., X86_REG_FScxx . . $ X86_REG_FS., CS_AC_WRITEcxx . . $ CS_AC_WRITE. },
1399 { X86_POPFS64cxx . . $ X86_POPFS64., X86_REG_FScxx . . $ X86_REG_FS., CS_AC_WRITEcxx . . $ CS_AC_WRITE. },
1400 { X86_POPGS16cxx . . $ X86_POPGS16., X86_REG_GScxx . . $ X86_REG_GS., CS_AC_WRITEcxx . . $ CS_AC_WRITE. },
1401 { X86_POPGS32cxx . . $ X86_POPGS32., X86_REG_GScxx . . $ X86_REG_GS., CS_AC_WRITEcxx . . $ CS_AC_WRITE. },
1402 { X86_POPGS64cxx . . $ X86_POPGS64., X86_REG_GScxx . . $ X86_REG_GS., CS_AC_WRITEcxx . . $ CS_AC_WRITE. },
1403 { X86_POPSS16cxx . . $ X86_POPSS16., X86_REG_SScxx . . $ X86_REG_SS., CS_AC_WRITEcxx . . $ CS_AC_WRITE. },
1404 { X86_POPSS32cxx . . $ X86_POPSS32., X86_REG_SScxx . . $ X86_REG_SS., CS_AC_WRITEcxx . . $ CS_AC_WRITE. },
1405 { X86_PUSHCS16cxx . . $ X86_PUSHCS16., X86_REG_CScxx . . $ X86_REG_CS., CS_AC_READcxx . . $ CS_AC_READ. },
1406 { X86_PUSHCS32cxx . . $ X86_PUSHCS32., X86_REG_CScxx . . $ X86_REG_CS., CS_AC_READcxx . . $ CS_AC_READ. },
1407 { X86_PUSHDS16cxx . . $ X86_PUSHDS16., X86_REG_DScxx . . $ X86_REG_DS., CS_AC_READcxx . . $ CS_AC_READ. },
1408 { X86_PUSHDS32cxx . . $ X86_PUSHDS32., X86_REG_DScxx . . $ X86_REG_DS., CS_AC_READcxx . . $ CS_AC_READ. },
1409 { X86_PUSHES16cxx . . $ X86_PUSHES16., X86_REG_EScxx . . $ X86_REG_ES., CS_AC_READcxx . . $ CS_AC_READ. },
1410 { X86_PUSHES32cxx . . $ X86_PUSHES32., X86_REG_EScxx . . $ X86_REG_ES., CS_AC_READcxx . . $ CS_AC_READ. },
1411 { X86_PUSHFS16cxx . . $ X86_PUSHFS16., X86_REG_FScxx . . $ X86_REG_FS., CS_AC_READcxx . . $ CS_AC_READ. },
1412 { X86_PUSHFS32cxx . . $ X86_PUSHFS32., X86_REG_FScxx . . $ X86_REG_FS., CS_AC_READcxx . . $ CS_AC_READ. },
1413 { X86_PUSHFS64cxx . . $ X86_PUSHFS64., X86_REG_FScxx . . $ X86_REG_FS., CS_AC_READcxx . . $ CS_AC_READ. },
1414 { X86_PUSHGS16cxx . . $ X86_PUSHGS16., X86_REG_GScxx . . $ X86_REG_GS., CS_AC_READcxx . . $ CS_AC_READ. },
1415 { X86_PUSHGS32cxx . . $ X86_PUSHGS32., X86_REG_GScxx . . $ X86_REG_GS., CS_AC_READcxx . . $ CS_AC_READ. },
1416 { X86_PUSHGS64cxx . . $ X86_PUSHGS64., X86_REG_GScxx . . $ X86_REG_GS., CS_AC_READcxx . . $ CS_AC_READ. },
1417 { X86_PUSHSS16cxx . . $ X86_PUSHSS16., X86_REG_SScxx . . $ X86_REG_SS., CS_AC_READcxx . . $ CS_AC_READ. },
1418 { X86_PUSHSS32cxx . . $ X86_PUSHSS32., X86_REG_SScxx . . $ X86_REG_SS., CS_AC_READcxx . . $ CS_AC_READ. },
1419 { X86_SBB16i16cxx . . $ X86_SBB16i16., X86_REG_AXcxx . . $ X86_REG_AX., CS_AC_WRITEcxx . . $ CS_AC_WRITE. | CS_AC_READcxx . . $ CS_AC_READ. },
1420 { X86_SBB32i32cxx . . $ X86_SBB32i32., X86_REG_EAXcxx . . $ X86_REG_EAX., CS_AC_WRITEcxx . . $ CS_AC_WRITE. | CS_AC_READcxx . . $ CS_AC_READ. },
1421 { X86_SBB64i32cxx . . $ X86_SBB64i32., X86_REG_RAXcxx . . $ X86_REG_RAX., CS_AC_WRITEcxx . . $ CS_AC_WRITE. | CS_AC_READcxx . . $ CS_AC_READ. },
1422 { X86_SBB8i8cxx . . $ X86_SBB8i8., X86_REG_ALcxx . . $ X86_REG_AL., CS_AC_WRITEcxx . . $ CS_AC_WRITE. | CS_AC_READcxx . . $ CS_AC_READ. },
1423 { X86_SCASBcxx . . $ X86_SCASB., X86_REG_ALcxx . . $ X86_REG_AL., CS_AC_WRITEcxx . . $ CS_AC_WRITE. | CS_AC_READcxx . . $ CS_AC_READ. },
1424 { X86_SCASLcxx . . $ X86_SCASL., X86_REG_EAXcxx . . $ X86_REG_EAX., CS_AC_WRITEcxx . . $ CS_AC_WRITE. | CS_AC_READcxx . . $ CS_AC_READ. },
1425 { X86_SCASQcxx . . $ X86_SCASQ., X86_REG_RAXcxx . . $ X86_REG_RAX., CS_AC_WRITEcxx . . $ CS_AC_WRITE. | CS_AC_READcxx . . $ CS_AC_READ. },
1426 { X86_SCASWcxx . . $ X86_SCASW., X86_REG_AXcxx . . $ X86_REG_AX., CS_AC_WRITEcxx . . $ CS_AC_WRITE. | CS_AC_READcxx . . $ CS_AC_READ. },
1427 { X86_SUB16i16cxx . . $ X86_SUB16i16., X86_REG_AXcxx . . $ X86_REG_AX., CS_AC_WRITEcxx . . $ CS_AC_WRITE. | CS_AC_READcxx . . $ CS_AC_READ. },
1428 { X86_SUB32i32cxx . . $ X86_SUB32i32., X86_REG_EAXcxx . . $ X86_REG_EAX., CS_AC_WRITEcxx . . $ CS_AC_WRITE. | CS_AC_READcxx . . $ CS_AC_READ. },
1429 { X86_SUB64i32cxx . . $ X86_SUB64i32., X86_REG_RAXcxx . . $ X86_REG_RAX., CS_AC_WRITEcxx . . $ CS_AC_WRITE. | CS_AC_READcxx . . $ CS_AC_READ. },
1430 { X86_SUB8i8cxx . . $ X86_SUB8i8., X86_REG_ALcxx . . $ X86_REG_AL., CS_AC_WRITEcxx . . $ CS_AC_WRITE. | CS_AC_READcxx . . $ CS_AC_READ. },
1431 { X86_TEST16i16cxx . . $ X86_TEST16i16., X86_REG_AXcxx . . $ X86_REG_AX., CS_AC_WRITEcxx . . $ CS_AC_WRITE. | CS_AC_READcxx . . $ CS_AC_READ. },
1432 { X86_TEST32i32cxx . . $ X86_TEST32i32., X86_REG_EAXcxx . . $ X86_REG_EAX., CS_AC_WRITEcxx . . $ CS_AC_WRITE. | CS_AC_READcxx . . $ CS_AC_READ. },
1433 { X86_TEST64i32cxx . . $ X86_TEST64i32., X86_REG_RAXcxx . . $ X86_REG_RAX., CS_AC_WRITEcxx . . $ CS_AC_WRITE. | CS_AC_READcxx . . $ CS_AC_READ. },
1434 { X86_TEST8i8cxx . . $ X86_TEST8i8., X86_REG_ALcxx . . $ X86_REG_AL., CS_AC_WRITEcxx . . $ CS_AC_WRITE. | CS_AC_READcxx . . $ CS_AC_READ. },
1435 { X86_XOR16i16cxx . . $ X86_XOR16i16., X86_REG_AXcxx . . $ X86_REG_AX., CS_AC_WRITEcxx . . $ CS_AC_WRITE. | CS_AC_READcxx . . $ CS_AC_READ. },
1436 { X86_XOR32i32cxx . . $ X86_XOR32i32., X86_REG_EAXcxx . . $ X86_REG_EAX., CS_AC_WRITEcxx . . $ CS_AC_WRITE. | CS_AC_READcxx . . $ CS_AC_READ. },
1437 { X86_XOR64i32cxx . . $ X86_XOR64i32., X86_REG_RAXcxx . . $ X86_REG_RAX., CS_AC_WRITEcxx . . $ CS_AC_WRITE. | CS_AC_READcxx . . $ CS_AC_READ. },
1438 { X86_XOR8i8cxx . . $ X86_XOR8i8., X86_REG_ALcxx . . $ X86_REG_AL., CS_AC_WRITEcxx . . $ CS_AC_WRITE. | CS_AC_READcxx . . $ CS_AC_READ. },
1439 };
1440
1441 static const struct insn_regcxx . . $ insn_reg# insn_regs_intel_extracxx . . $ insn_regs_intel_extra.[] = {
1442 // dummy entry, to avoid empty array
1443 { 0, 0, 0 },
1444 #ifndef CAPSTONE_X86_REDUCE
1445 { X86_CMOVBE_Fcxx . . $ X86_CMOVBE_F., X86_REG_ST0cxx . . $ X86_REG_ST0., CS_AC_WRITEcxx . . $ CS_AC_WRITE. },
1446 { X86_CMOVB_Fcxx . . $ X86_CMOVB_F., X86_REG_ST0cxx . . $ X86_REG_ST0., CS_AC_WRITEcxx . . $ CS_AC_WRITE. },
1447 { X86_CMOVE_Fcxx . . $ X86_CMOVE_F., X86_REG_ST0cxx . . $ X86_REG_ST0., CS_AC_WRITEcxx . . $ CS_AC_WRITE. },
1448 { X86_CMOVNBE_Fcxx . . $ X86_CMOVNBE_F., X86_REG_ST0cxx . . $ X86_REG_ST0., CS_AC_WRITEcxx . . $ CS_AC_WRITE. },
1449 { X86_CMOVNB_Fcxx . . $ X86_CMOVNB_F., X86_REG_ST0cxx . . $ X86_REG_ST0., CS_AC_WRITEcxx . . $ CS_AC_WRITE. },
1450 { X86_CMOVNE_Fcxx . . $ X86_CMOVNE_F., X86_REG_ST0cxx . . $ X86_REG_ST0., CS_AC_WRITEcxx . . $ CS_AC_WRITE. },
1451 { X86_CMOVNP_Fcxx . . $ X86_CMOVNP_F., X86_REG_ST0cxx . . $ X86_REG_ST0., CS_AC_WRITEcxx . . $ CS_AC_WRITE. },
1452 { X86_CMOVP_Fcxx . . $ X86_CMOVP_F., X86_REG_ST0cxx . . $ X86_REG_ST0., CS_AC_WRITEcxx . . $ CS_AC_WRITE. },
1453 // { X86_COMP_FST0r, X86_REG_ST0, CS_AC_WRITE },
1454 // { X86_COM_FST0r, X86_REG_ST0, CS_AC_WRITE },
1455 { X86_FNSTSW16rcxx . . $ X86_FNSTSW16r., X86_REG_AXcxx . . $ X86_REG_AX., CS_AC_WRITEcxx . . $ CS_AC_WRITE. },
1456 { X86_SKINITcxx . . $ X86_SKINIT., X86_REG_EAXcxx . . $ X86_REG_EAX., CS_AC_WRITEcxx . . $ CS_AC_WRITE. },
1457 { X86_VMLOAD32cxx . . $ X86_VMLOAD32., X86_REG_EAXcxx . . $ X86_REG_EAX., CS_AC_WRITEcxx . . $ CS_AC_WRITE. },
1458 { X86_VMLOAD64cxx . . $ X86_VMLOAD64., X86_REG_RAXcxx . . $ X86_REG_RAX., CS_AC_WRITEcxx . . $ CS_AC_WRITE. },
1459 { X86_VMRUN32cxx . . $ X86_VMRUN32., X86_REG_EAXcxx . . $ X86_REG_EAX., CS_AC_WRITEcxx . . $ CS_AC_WRITE. },
1460 { X86_VMRUN64cxx . . $ X86_VMRUN64., X86_REG_RAXcxx . . $ X86_REG_RAX., CS_AC_WRITEcxx . . $ CS_AC_WRITE. },
1461 { X86_VMSAVE32cxx . . $ X86_VMSAVE32., X86_REG_EAXcxx . . $ X86_REG_EAX., CS_AC_READcxx . . $ CS_AC_READ. },
1462 { X86_VMSAVE64cxx . . $ X86_VMSAVE64., X86_REG_RAXcxx . . $ X86_REG_RAX., CS_AC_READcxx . . $ CS_AC_READ. },
1463 { X86_XCH_Fcxx . . $ X86_XCH_F., X86_REG_ST0cxx . . $ X86_REG_ST0., CS_AC_WRITEcxx . . $ CS_AC_WRITE. },
1464 #endif
1465 };
1466
1467 static const struct insn_reg2cxx . . $ insn_reg2# insn_regs_intel2cxx . . $ insn_regs_intel2.[] = {
1468 { X86_IN16rrcxx . . $ X86_IN16rr., X86_REG_AXcxx . . $ X86_REG_AX., X86_REG_DXcxx . . $ X86_REG_DX., CS_AC_WRITEcxx . . $ CS_AC_WRITE., CS_AC_READcxx . . $ CS_AC_READ. },
1469 { X86_IN32rrcxx . . $ X86_IN32rr., X86_REG_EAXcxx . . $ X86_REG_EAX., X86_REG_DXcxx . . $ X86_REG_DX., CS_AC_WRITEcxx . . $ CS_AC_WRITE., CS_AC_READcxx . . $ CS_AC_READ. },
1470 { X86_IN8rrcxx . . $ X86_IN8rr., X86_REG_ALcxx . . $ X86_REG_AL., X86_REG_DXcxx . . $ X86_REG_DX., CS_AC_WRITEcxx . . $ CS_AC_WRITE., CS_AC_READcxx . . $ CS_AC_READ. },
1471 { X86_INVLPGA32cxx . . $ X86_INVLPGA32., X86_REG_EAXcxx . . $ X86_REG_EAX., X86_REG_ECXcxx . . $ X86_REG_ECX., CS_AC_READcxx . . $ CS_AC_READ., CS_AC_READcxx . . $ CS_AC_READ. },
1472 { X86_INVLPGA64cxx . . $ X86_INVLPGA64., X86_REG_RAXcxx . . $ X86_REG_RAX., X86_REG_ECXcxx . . $ X86_REG_ECX., CS_AC_READcxx . . $ CS_AC_READ., CS_AC_READcxx . . $ CS_AC_READ. },
1473 { X86_OUT16rrcxx . . $ X86_OUT16rr., X86_REG_DXcxx . . $ X86_REG_DX., X86_REG_AXcxx . . $ X86_REG_AX., CS_AC_READcxx . . $ CS_AC_READ., CS_AC_READcxx . . $ CS_AC_READ. },
1474 { X86_OUT32rrcxx . . $ X86_OUT32rr., X86_REG_DXcxx . . $ X86_REG_DX., X86_REG_EAXcxx . . $ X86_REG_EAX., CS_AC_READcxx . . $ CS_AC_READ., CS_AC_READcxx . . $ CS_AC_READ. },
1475 { X86_OUT8rrcxx . . $ X86_OUT8rr., X86_REG_DXcxx . . $ X86_REG_DX., X86_REG_ALcxx . . $ X86_REG_AL., CS_AC_READcxx . . $ CS_AC_READ., CS_AC_READcxx . . $ CS_AC_READ. },
1476 };
1477
1478 static int binary_search1cxx . . $ binary_search1(8a0df44a4036df4).(const struct insn_regcxx . . $ insn_reg# *insns, unsigned int max, unsigned int id)
1479 {
1480 unsigned int first, last, mid;
1481
1482 first = 0;
1483 last = max -1;
1484
1485 if (insns[0].insncxx . . $ insn_reg#insn. > id || insns[last].insncxx . . $ insn_reg#insn. < id) {
1486 // not found
1487 return -1;
1488 }
1489
1490 while (first <= last) {
1491 mid = (first + last) / 2;
1492 if (insns[mid].insncxx . . $ insn_reg#insn. < id) {
1493 first = mid + 1;
1494 } else if (insns[mid].insncxx . . $ insn_reg#insn. == id) {
1495 return mid;
1496 } else {
1497 if (mid == 0)
1498 break;
1499 last = mid - 1;
1500 }
1501 }
1502
1503 // not found
1504 return -1;
1505 }
1506
1507 static int binary_search2cxx . . $ binary_search2(d503311975852602).(const struct insn_reg2cxx . . $ insn_reg2# *insns, unsigned int max, unsigned int id)
1508 {
1509 unsigned int first, last, mid;
1510
1511 first = 0;
1512 last = max -1;
1513
1514 if (insns[0].insncxx . . $ insn_reg2#insn. > id || insns[last].insncxx . . $ insn_reg2#insn. < id) {
1515 // not found
1516 return -1;
1517 }
1518
1519 while (first <= last) {
1520 mid = (first + last) / 2;
1521 if (insns[mid].insncxx . . $ insn_reg2#insn. < id) {
1522 first = mid + 1;
1523 } else if (insns[mid].insncxx . . $ insn_reg2#insn. == id) {
1524 return mid;
1525 } else {
1526 if (mid == 0)
1527 break;
1528 last = mid - 1;
1529 }
1530 }
1531
1532 // not found
1533 return -1;
1534 }
1535
1536 // Build per-handle O(1) lookup tables for instruction mapping.
1537 // Called from X86_global_init() during cs_open(). Each handle gets its own
1538 // copy of the lookup tables, making this thread-safe.
1539 void X86_build_lookup_tablescxx . . $ X86_build_lookup_tables(b55400182e2a5869).(cs_structcxx . . $ cs_struct# *h)
1540 {
1541 unsigned int i;
1542 unsigned int max = ARR_SIZEcxx . . $ `utils.h:24:9`!(insns);
1543 unsigned int id_max;
1544
1545 if (h->x86_insn_lutcxx . . $ cs_struct#x86_insn_lut.)
1546 return;
1547
1548 id_max = insnscxx . . $ insns.[max - 1].idcxx . . $ insn_map_x86#id.;
1549 h->x86_insn_lut_maxcxx . . $ cs_struct#x86_insn_lut_max. = id_max;
1550
1551 h->x86_insn_lutcxx . . $ cs_struct#x86_insn_lut. = (uint16_tcxx . . $ uint16_t# *)cs_mem_malloccxx . . $ cs_mem_malloc.((id_max + 1) * sizeof(uint16_tcxx . . $ uint16_t#));
1552 CS_ASSERT_RETcxx . . $ `cs_priv.h:104:9`!(h->x86_insn_lut);
1553
1554 memsetcxx . . $ memset(d1de1e4fb215f1c6).(h->x86_insn_lutcxx . . $ cs_struct#x86_insn_lut., 0xff, (id_max + 1) * sizeof(uint16_tcxx . . $ uint16_t#));
1555
1556 for (i = 0; i < max; i++) {
1557 h->x86_insn_lutcxx . . $ cs_struct#x86_insn_lut.[insnscxx . . $ insns.[i].idcxx . . $ insn_map_x86#id.] = (uint16_tcxx . . $ uint16_t#)i;
1558 }
1559
1560 // Build insn_reg lookup table (low 16 bits = Intel, high 16 bits = ATT).
1561 h->x86_insn_reg_lutcxx . . $ cs_struct#x86_insn_reg_lut. = (uint32_tcxx . . $ uint32_t# *)cs_mem_calloccxx . . $ cs_mem_calloc.(id_max + 1, sizeof(uint32_tcxx . . $ uint32_t#));
1562 CS_ASSERT_RETcxx . . $ `cs_priv.h:104:9`!(h->x86_insn_reg_lut);
1563
1564 for (i = 0; i < ARR_SIZEcxx . . $ `utils.h:24:9`!(insn_regs_intel); i++) {
1565 unsigned int insn_id = insn_regs_intelcxx . . $ insn_regs_intel.[i].insncxx . . $ insn_reg#insn.;
1566 if (insn_id <= id_max)
1567 h->x86_insn_reg_lutcxx . . $ cs_struct#x86_insn_reg_lut.[insn_id] =
1568 (h->x86_insn_reg_lutcxx . . $ cs_struct#x86_insn_reg_lut.[insn_id] & 0xffff0000) |
1569 pack_insn_regcxx . . $ pack_insn_reg(b314288478b32687).(insn_regs_intelcxx . . $ insn_regs_intel.[i].regcxx . . $ insn_reg#reg., insn_regs_intelcxx . . $ insn_regs_intel.[i].accesscxx . . $ insn_reg#access.);
1570 }
1571 for (i = 0; i < ARR_SIZEcxx . . $ `utils.h:24:9`!(insn_regs_intel_extra); i++) {
1572 unsigned int insn_id = insn_regs_intel_extracxx . . $ insn_regs_intel_extra.[i].insncxx . . $ insn_reg#insn.;
1573 if (insn_id && insn_id <= id_max &&
1574 !(h->x86_insn_reg_lutcxx . . $ cs_struct#x86_insn_reg_lut.[insn_id] & 0xffff))
1575 h->x86_insn_reg_lutcxx . . $ cs_struct#x86_insn_reg_lut.[insn_id] =
1576 (h->x86_insn_reg_lutcxx . . $ cs_struct#x86_insn_reg_lut.[insn_id] & 0xffff0000) |
1577 pack_insn_regcxx . . $ pack_insn_reg(b314288478b32687).(insn_regs_intel_extracxx . . $ insn_regs_intel_extra.[i].regcxx . . $ insn_reg#reg., insn_regs_intel_extracxx . . $ insn_regs_intel_extra.[i].accesscxx . . $ insn_reg#access.);
1578 }
1579
1580 for (i = 0; i < ARR_SIZEcxx . . $ `utils.h:24:9`!(insn_regs_att); i++) {
1581 unsigned int insn_id = insn_regs_attcxx . . $ insn_regs_att.[i].insncxx . . $ insn_reg#insn.;
1582 if (insn_id <= id_max)
1583 h->x86_insn_reg_lutcxx . . $ cs_struct#x86_insn_reg_lut.[insn_id] =
1584 (h->x86_insn_reg_lutcxx . . $ cs_struct#x86_insn_reg_lut.[insn_id] & 0x0000ffff) |
1585 ((uint32_tcxx . . $ uint32_t#)pack_insn_regcxx . . $ pack_insn_reg(b314288478b32687).(insn_regs_attcxx . . $ insn_regs_att.[i].regcxx . . $ insn_reg#reg., insn_regs_attcxx . . $ insn_regs_att.[i].accesscxx . . $ insn_reg#access.) << 16);
1586 }
1587 for (i = 0; i < ARR_SIZEcxx . . $ `utils.h:24:9`!(insn_regs_att_extra); i++) {
1588 unsigned int insn_id = insn_regs_att_extracxx . . $ insn_regs_att_extra.[i].insncxx . . $ insn_reg#insn.;
1589 if (insn_id && insn_id <= id_max &&
1590 !(h->x86_insn_reg_lutcxx . . $ cs_struct#x86_insn_reg_lut.[insn_id] >> 16))
1591 h->x86_insn_reg_lutcxx . . $ cs_struct#x86_insn_reg_lut.[insn_id] =
1592 (h->x86_insn_reg_lutcxx . . $ cs_struct#x86_insn_reg_lut.[insn_id] & 0x0000ffff) |
1593 ((uint32_tcxx . . $ uint32_t#)pack_insn_regcxx . . $ pack_insn_reg(b314288478b32687).(insn_regs_att_extracxx . . $ insn_regs_att_extra.[i].regcxx . . $ insn_reg#reg., insn_regs_att_extracxx . . $ insn_regs_att_extra.[i].accesscxx . . $ insn_reg#access.) << 16);
1594 }
1595 }
1596
1597 // return register of given instruction id
1598 // return 0 if not found
1599 // this is to handle instructions embedding accumulate registers into AsmStrs[]
1600 // Falls back to binary search when per-handle LUT is not available.
1601 x86_regcxx . . $ x86_reg# X86_insn_reg_intelcxx . . $ X86_insn_reg_intel(efe9bfc932ab5f49).(unsigned int id, enum cs_ac_typecxx . . $ cs_ac_type# *access)
1602 {
1603 // The per-handle LUT is used via X86_insn_reg_intel_h() from the printer.
1604 // This fallback uses binary search for safety.
1605 int i;
1606
1607 i = binary_search1cxx . . $ binary_search1(8a0df44a4036df4).(insn_regs_intelcxx . . $ insn_regs_intel., ARR_SIZEcxx . . $ `utils.h:24:9`!(insn_regs_intel), id);
1608 if (i != -1) {
1609 if (access) {
1610 *access = insn_regs_intelcxx . . $ insn_regs_intel.[i].accesscxx . . $ insn_reg#access.;
1611 }
1612 return insn_regs_intelcxx . . $ insn_regs_intel.[i].regcxx . . $ insn_reg#reg.;
1613 }
1614
1615 i = binary_search1cxx . . $ binary_search1(8a0df44a4036df4).(insn_regs_intel_extracxx . . $ insn_regs_intel_extra., ARR_SIZEcxx . . $ `utils.h:24:9`!(insn_regs_intel_extra), id);
1616 if (i != -1) {
1617 if (access) {
1618 *access = insn_regs_intel_extracxx . . $ insn_regs_intel_extra.[i].accesscxx . . $ insn_reg#access.;
1619 }
1620 return insn_regs_intel_extracxx . . $ insn_regs_intel_extra.[i].regcxx . . $ insn_reg#reg.;
1621 }
1622
1623 return 0;
1624 }
1625
1626 // Fast per-handle variant used from the printer (which has access to cs_struct via MCInst).
1627 x86_regcxx . . $ x86_reg# X86_insn_reg_intel_hcxx . . $ X86_insn_reg_intel_h(b0b1cdf4b49b8d60).(cs_structcxx . . $ cs_struct# *h, unsigned int id, enum cs_ac_typecxx . . $ cs_ac_type# *access)
1628 {
1629 if (h && h->x86_insn_reg_lutcxx . . $ cs_struct#x86_insn_reg_lut. && id <= h->x86_insn_lut_maxcxx . . $ cs_struct#x86_insn_lut_max.) {
1630 uint16_tcxx . . $ uint16_t# val = (uint16_tcxx . . $ uint16_t#)(h->x86_insn_reg_lutcxx . . $ cs_struct#x86_insn_reg_lut.[id] & 0xffff);
1631 if (val)
1632 return unpack_insn_regcxx . . $ unpack_insn_reg(c78860bfcb27f01b).(val, access);
1633 return 0;
1634 }
1635 return X86_insn_reg_intelcxx . . $ X86_insn_reg_intel(efe9bfc932ab5f49).(id, access);
1636 }
1637
1638 boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! X86_insn_reg_intel2cxx . . $ X86_insn_reg_intel2(4bad68c8aa453789).(unsigned int id, x86_regcxx . . $ x86_reg# *reg1, enum cs_ac_typecxx . . $ cs_ac_type# *access1, x86_regcxx . . $ x86_reg# *reg2, enum cs_ac_typecxx . . $ cs_ac_type# *access2)
1639 {
1640 int i = binary_search2cxx . . $ binary_search2(d503311975852602).(insn_regs_intel2cxx . . $ insn_regs_intel2., ARR_SIZEcxx . . $ `utils.h:24:9`!(insn_regs_intel2), id);
1641 if (i != -1) {
1642 *reg1 = insn_regs_intel2cxx . . $ insn_regs_intel2.[i].reg1cxx . . $ insn_reg2#reg1.;
1643 *reg2 = insn_regs_intel2cxx . . $ insn_regs_intel2.[i].reg2cxx . . $ insn_reg2#reg2.;
1644 if (access1)
1645 *access1 = insn_regs_intel2cxx . . $ insn_regs_intel2.[i].access1cxx . . $ insn_reg2#access1.;
1646 if (access2)
1647 *access2 = insn_regs_intel2cxx . . $ insn_regs_intel2.[i].access2cxx . . $ insn_reg2#access2.;
1648 return truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!;
1649 }
1650
1651 // not found
1652 return falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!;
1653 }
1654
1655 x86_regcxx . . $ x86_reg# X86_insn_reg_attcxx . . $ X86_insn_reg_att(efe9bfc932ab5f49).(unsigned int id, enum cs_ac_typecxx . . $ cs_ac_type# *access)
1656 {
1657 int i;
1658
1659 i = binary_search1cxx . . $ binary_search1(8a0df44a4036df4).(insn_regs_attcxx . . $ insn_regs_att., ARR_SIZEcxx . . $ `utils.h:24:9`!(insn_regs_att), id);
1660 if (i != -1) {
1661 if (access)
1662 *access = insn_regs_attcxx . . $ insn_regs_att.[i].accesscxx . . $ insn_reg#access.;
1663 return insn_regs_attcxx . . $ insn_regs_att.[i].regcxx . . $ insn_reg#reg.;
1664 }
1665
1666 i = binary_search1cxx . . $ binary_search1(8a0df44a4036df4).(insn_regs_att_extracxx . . $ insn_regs_att_extra., ARR_SIZEcxx . . $ `utils.h:24:9`!(insn_regs_att_extra), id);
1667 if (i != -1) {
1668 if (access)
1669 *access = insn_regs_att_extracxx . . $ insn_regs_att_extra.[i].accesscxx . . $ insn_reg#access.;
1670 return insn_regs_att_extracxx . . $ insn_regs_att_extra.[i].regcxx . . $ insn_reg#reg.;
1671 }
1672
1673 return 0;
1674 }
1675
1676 x86_regcxx . . $ x86_reg# X86_insn_reg_att_hcxx . . $ X86_insn_reg_att_h(b0b1cdf4b49b8d60).(cs_structcxx . . $ cs_struct# *h, unsigned int id, enum cs_ac_typecxx . . $ cs_ac_type# *access)
1677 {
1678 if (h && h->x86_insn_reg_lutcxx . . $ cs_struct#x86_insn_reg_lut. && id <= h->x86_insn_lut_maxcxx . . $ cs_struct#x86_insn_lut_max.) {
1679 uint16_tcxx . . $ uint16_t# val = (uint16_tcxx . . $ uint16_t#)(h->x86_insn_reg_lutcxx . . $ cs_struct#x86_insn_reg_lut.[id] >> 16);
1680 if (val)
1681 return unpack_insn_regcxx . . $ unpack_insn_reg(c78860bfcb27f01b).(val, access);
1682 return 0;
1683 }
1684 return X86_insn_reg_attcxx . . $ X86_insn_reg_att(efe9bfc932ab5f49).(id, access);
1685 }
1686
1687 // ATT just reuses Intel data, but with the order of registers reversed
1688 boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! X86_insn_reg_att2cxx . . $ X86_insn_reg_att2(4bad68c8aa453789).(unsigned int id, x86_regcxx . . $ x86_reg# *reg1, enum cs_ac_typecxx . . $ cs_ac_type# *access1, x86_regcxx . . $ x86_reg# *reg2, enum cs_ac_typecxx . . $ cs_ac_type# *access2)
1689 {
1690 int i = binary_search2cxx . . $ binary_search2(d503311975852602).(insn_regs_intel2cxx . . $ insn_regs_intel2., ARR_SIZEcxx . . $ `utils.h:24:9`!(insn_regs_intel2), id);
1691 if (i != -1) {
1692 *reg1 = insn_regs_intel2cxx . . $ insn_regs_intel2.[i].reg2cxx . . $ insn_reg2#reg2.;
1693 *reg2 = insn_regs_intel2cxx . . $ insn_regs_intel2.[i].reg1cxx . . $ insn_reg2#reg1.;
1694 if (access1)
1695 *access1 = insn_regs_intel2cxx . . $ insn_regs_intel2.[i].access2cxx . . $ insn_reg2#access2.;
1696 if (access2)
1697 *access2 = insn_regs_intel2cxx . . $ insn_regs_intel2.[i].access1cxx . . $ insn_reg2#access1.;
1698 return truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!;
1699 }
1700
1701 // not found
1702 return falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!;
1703 }
1704
1705 // given MCInst's id, find out if this insn is valid for REPNE prefix
1706 static boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! valid_repnecxx . . $ valid_repne(39412e1dc8bf7218).(cs_structcxx . . $ cs_struct# *h, unsigned int opcode)
1707 {
1708 unsigned int id;
1709 unsigned int i = find_insn_hcxx . . $ find_insn_h(a4c73a42272bdcc6).(h, opcode);
1710 if (i != -1) {
1711 id = insnscxx . . $ insns.[i].mapidcxx . . $ insn_map_x86#mapid.;
1712 switch(id) {
1713 default:
1714 return falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!;
1715
1716 case X86_INS_CMPSBcxx . . $ X86_INS_CMPSB.:
1717 case X86_INS_CMPSScxx . . $ X86_INS_CMPSS.:
1718 case X86_INS_CMPSWcxx . . $ X86_INS_CMPSW.:
1719 case X86_INS_CMPSQcxx . . $ X86_INS_CMPSQ.:
1720
1721 case X86_INS_SCASBcxx . . $ X86_INS_SCASB.:
1722 case X86_INS_SCASWcxx . . $ X86_INS_SCASW.:
1723 case X86_INS_SCASQcxx . . $ X86_INS_SCASQ.:
1724
1725 case X86_INS_MOVSBcxx . . $ X86_INS_MOVSB.:
1726 case X86_INS_MOVSScxx . . $ X86_INS_MOVSS.:
1727 case X86_INS_MOVSWcxx . . $ X86_INS_MOVSW.:
1728 case X86_INS_MOVSQcxx . . $ X86_INS_MOVSQ.:
1729
1730 case X86_INS_LODSBcxx . . $ X86_INS_LODSB.:
1731 case X86_INS_LODSWcxx . . $ X86_INS_LODSW.:
1732 case X86_INS_LODSDcxx . . $ X86_INS_LODSD.:
1733 case X86_INS_LODSQcxx . . $ X86_INS_LODSQ.:
1734
1735 case X86_INS_STOSBcxx . . $ X86_INS_STOSB.:
1736 case X86_INS_STOSWcxx . . $ X86_INS_STOSW.:
1737 case X86_INS_STOSDcxx . . $ X86_INS_STOSD.:
1738 case X86_INS_STOSQcxx . . $ X86_INS_STOSQ.:
1739
1740 case X86_INS_INSBcxx . . $ X86_INS_INSB.:
1741 case X86_INS_INSWcxx . . $ X86_INS_INSW.:
1742 case X86_INS_INSDcxx . . $ X86_INS_INSD.:
1743
1744 case X86_INS_OUTSBcxx . . $ X86_INS_OUTSB.:
1745 case X86_INS_OUTSWcxx . . $ X86_INS_OUTSW.:
1746 case X86_INS_OUTSDcxx . . $ X86_INS_OUTSD.:
1747
1748 return truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!;
1749
1750 case X86_INS_MOVSDcxx . . $ X86_INS_MOVSD.:
1751 if (opcode == X86_MOVSWcxx . . $ X86_MOVSW.) // REP MOVSB
1752 return truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!;
1753 return falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!;
1754
1755 case X86_INS_CMPSDcxx . . $ X86_INS_CMPSD.:
1756 if (opcode == X86_CMPSLcxx . . $ X86_CMPSL.) // REP CMPSD
1757 return truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!;
1758 return falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!;
1759
1760 case X86_INS_SCASDcxx . . $ X86_INS_SCASD.:
1761 if (opcode == X86_SCASLcxx . . $ X86_SCASL.) // REP SCASD
1762 return truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!;
1763 return falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!;
1764 }
1765 }
1766
1767 // not found
1768 return falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!;
1769 }
1770
1771 // given MCInst's id, find out if this insn is valid for BND prefix
1772 // BND prefix is valid for CALL/JMP/RET
1773 #ifndef CAPSTONE_DIET
1774 static boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! valid_bndcxx . . $ valid_bnd(39412e1dc8bf7218).(cs_structcxx . . $ cs_struct# *h, unsigned int opcode)
1775 {
1776 unsigned int id;
1777 unsigned int i = find_insn_hcxx . . $ find_insn_h(a4c73a42272bdcc6).(h, opcode);
1778 if (i != -1) {
1779 id = insnscxx . . $ insns.[i].mapidcxx . . $ insn_map_x86#mapid.;
1780 switch(id) {
1781 default:
1782 return falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!;
1783
1784 case X86_INS_JAEcxx . . $ X86_INS_JAE.:
1785 case X86_INS_JAcxx . . $ X86_INS_JA.:
1786 case X86_INS_JBEcxx . . $ X86_INS_JBE.:
1787 case X86_INS_JBcxx . . $ X86_INS_JB.:
1788 case X86_INS_JCXZcxx . . $ X86_INS_JCXZ.:
1789 case X86_INS_JECXZcxx . . $ X86_INS_JECXZ.:
1790 case X86_INS_JEcxx . . $ X86_INS_JE.:
1791 case X86_INS_JGEcxx . . $ X86_INS_JGE.:
1792 case X86_INS_JGcxx . . $ X86_INS_JG.:
1793 case X86_INS_JLEcxx . . $ X86_INS_JLE.:
1794 case X86_INS_JLcxx . . $ X86_INS_JL.:
1795 case X86_INS_JMPcxx . . $ X86_INS_JMP.:
1796 case X86_INS_JNEcxx . . $ X86_INS_JNE.:
1797 case X86_INS_JNOcxx . . $ X86_INS_JNO.:
1798 case X86_INS_JNPcxx . . $ X86_INS_JNP.:
1799 case X86_INS_JNScxx . . $ X86_INS_JNS.:
1800 case X86_INS_JOcxx . . $ X86_INS_JO.:
1801 case X86_INS_JPcxx . . $ X86_INS_JP.:
1802 case X86_INS_JRCXZcxx . . $ X86_INS_JRCXZ.:
1803 case X86_INS_JScxx . . $ X86_INS_JS.:
1804
1805 case X86_INS_CALLcxx . . $ X86_INS_CALL.:
1806 case X86_INS_RETcxx . . $ X86_INS_RET.:
1807 case X86_INS_RETFcxx . . $ X86_INS_RETF.:
1808 case X86_INS_RETFQcxx . . $ X86_INS_RETFQ.:
1809 return truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!;
1810 }
1811 }
1812
1813 // not found
1814 return falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!;
1815 }
1816 #endif
1817
1818 // return true if the opcode is XCHG [mem]
1819 static boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! xchg_memcxx . . $ xchg_mem(dfa6e707f7696010).(unsigned int opcode)
1820 {
1821 switch(opcode) {
1822 default:
1823 return falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!;
1824 case X86_XCHG8rmcxx . . $ X86_XCHG8rm.:
1825 case X86_XCHG16rmcxx . . $ X86_XCHG16rm.:
1826 case X86_XCHG32rmcxx . . $ X86_XCHG32rm.:
1827 case X86_XCHG64rmcxx . . $ X86_XCHG64rm.:
1828 return truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!;
1829 }
1830 }
1831
1832 // given MCInst's id, find out if this insn is valid for REP prefix
1833 static boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! valid_repcxx . . $ valid_rep(39412e1dc8bf7218).(cs_structcxx . . $ cs_struct# *h, unsigned int opcode)
1834 {
1835 unsigned int id;
1836 unsigned int i = find_insn_hcxx . . $ find_insn_h(a4c73a42272bdcc6).(h, opcode);
1837 if (i != -1) {
1838 id = insnscxx . . $ insns.[i].mapidcxx . . $ insn_map_x86#mapid.;
1839 switch(id) {
1840 default:
1841 return falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!;
1842
1843 case X86_INS_MOVSBcxx . . $ X86_INS_MOVSB.:
1844 case X86_INS_MOVSWcxx . . $ X86_INS_MOVSW.:
1845 case X86_INS_MOVSQcxx . . $ X86_INS_MOVSQ.:
1846
1847 case X86_INS_LODSBcxx . . $ X86_INS_LODSB.:
1848 case X86_INS_LODSWcxx . . $ X86_INS_LODSW.:
1849 case X86_INS_LODSQcxx . . $ X86_INS_LODSQ.:
1850
1851 case X86_INS_STOSBcxx . . $ X86_INS_STOSB.:
1852 case X86_INS_STOSWcxx . . $ X86_INS_STOSW.:
1853 case X86_INS_STOSQcxx . . $ X86_INS_STOSQ.:
1854
1855 case X86_INS_INSBcxx . . $ X86_INS_INSB.:
1856 case X86_INS_INSWcxx . . $ X86_INS_INSW.:
1857 case X86_INS_INSDcxx . . $ X86_INS_INSD.:
1858
1859 case X86_INS_OUTSBcxx . . $ X86_INS_OUTSB.:
1860 case X86_INS_OUTSWcxx . . $ X86_INS_OUTSW.:
1861 case X86_INS_OUTSDcxx . . $ X86_INS_OUTSD.:
1862 return truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!;
1863
1864 // following are some confused instructions, which have the same
1865 // mnemonics in 128bit media instructions. Intel is horribly crazy!
1866 case X86_INS_MOVSDcxx . . $ X86_INS_MOVSD.:
1867 if (opcode == X86_MOVSLcxx . . $ X86_MOVSL.) // REP MOVSD
1868 return truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!;
1869 return falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!;
1870
1871 case X86_INS_LODSDcxx . . $ X86_INS_LODSD.:
1872 if (opcode == X86_LODSLcxx . . $ X86_LODSL.) // REP LODSD
1873 return truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!;
1874 return falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!;
1875
1876 case X86_INS_STOSDcxx . . $ X86_INS_STOSD.:
1877 if (opcode == X86_STOSLcxx . . $ X86_STOSL.) // REP STOSD
1878 return truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!;
1879 return falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!;
1880 }
1881 }
1882
1883 // not found
1884 return falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!;
1885 }
1886
1887 // given MCInst's id, find if this is a "repz ret" instruction
1888 // gcc generates "repz ret" (f3 c3) instructions in some cases as an
1889 // optimization for AMD platforms, see:
1890 // https://gcc.gnu.org/legacy-ml/gcc-patches/2003-05/msg02117.html
1891 static boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! valid_ret_repzcxx . . $ valid_ret_repz(39412e1dc8bf7218).(cs_structcxx . . $ cs_struct# *h, unsigned int opcode)
1892 {
1893 unsigned int id;
1894 unsigned int i = find_insn_hcxx . . $ find_insn_h(a4c73a42272bdcc6).(h, opcode);
1895
1896 if (i != -1) {
1897 id = insnscxx . . $ insns.[i].mapidcxx . . $ insn_map_x86#mapid.;
1898 return id == X86_INS_RETcxx . . $ X86_INS_RET.;
1899 }
1900
1901 // not found
1902 return falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!;
1903 }
1904
1905 // given MCInst's id, find out if this insn is valid for REPE prefix
1906 static boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! valid_repecxx . . $ valid_repe(39412e1dc8bf7218).(cs_structcxx . . $ cs_struct# *h, unsigned int opcode)
1907 {
1908 unsigned int id;
1909 unsigned int i = find_insn_hcxx . . $ find_insn_h(a4c73a42272bdcc6).(h, opcode);
1910 if (i != -1) {
1911 id = insnscxx . . $ insns.[i].mapidcxx . . $ insn_map_x86#mapid.;
1912 switch(id) {
1913 default:
1914 return falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!;
1915
1916 case X86_INS_CMPSBcxx . . $ X86_INS_CMPSB.:
1917 case X86_INS_CMPSWcxx . . $ X86_INS_CMPSW.:
1918 case X86_INS_CMPSQcxx . . $ X86_INS_CMPSQ.:
1919
1920 case X86_INS_SCASBcxx . . $ X86_INS_SCASB.:
1921 case X86_INS_SCASWcxx . . $ X86_INS_SCASW.:
1922 case X86_INS_SCASQcxx . . $ X86_INS_SCASQ.:
1923 return truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!;
1924
1925 // following are some confused instructions, which have the same
1926 // mnemonics in 128bit media instructions. Intel is horribly crazy!
1927 case X86_INS_CMPSDcxx . . $ X86_INS_CMPSD.:
1928 if (opcode == X86_CMPSLcxx . . $ X86_CMPSL.) // REP CMPSD
1929 return truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!;
1930 return falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!;
1931
1932 case X86_INS_SCASDcxx . . $ X86_INS_SCASD.:
1933 if (opcode == X86_SCASLcxx . . $ X86_SCASL.) // REP SCASD
1934 return truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!;
1935 return falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!;
1936 }
1937 }
1938
1939 // not found
1940 return falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!;
1941 }
1942
1943 // Given MCInst's id, find out if this insn is valid for NOTRACK prefix.
1944 // NOTRACK prefix is valid for CALL/JMP.
1945 static boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! valid_notrackcxx . . $ valid_notrack(39412e1dc8bf7218).(cs_structcxx . . $ cs_struct# *h, unsigned int opcode)
1946 {
1947 unsigned int id;
1948 unsigned int i = find_insn_hcxx . . $ find_insn_h(a4c73a42272bdcc6).(h, opcode);
1949 if (i != -1) {
1950 id = insnscxx . . $ insns.[i].mapidcxx . . $ insn_map_x86#mapid.;
1951 switch(id) {
1952 default:
1953 return falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!;
1954 case X86_INS_CALLcxx . . $ X86_INS_CALL.:
1955 case X86_INS_JMPcxx . . $ X86_INS_JMP.:
1956 return truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!;
1957 }
1958 }
1959
1960 // not found
1961 return falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!;
1962 }
1963
1964 #ifndef CAPSTONE_DIET
1965 // add *CX register to regs_read[] & regs_write[]
1966 static void add_cxcxx . . $ add_cx(94c8a3269074abe9).(MCInstcxx . . $ MCInst# *MI)
1967 {
1968 if (MI->cshcxx . . $ MCInst#csh.->detailcxx . . $ cs_struct#detail.) {
1969 x86_regcxx . . $ x86_reg# cx;
1970
1971 if (MI->cshcxx . . $ MCInst#csh.->modecxx . . $ cs_struct#mode. & CS_MODE_16cxx . . $ CS_MODE_16.)
1972 cx = X86_REG_CXcxx . . $ X86_REG_CX.;
1973 else if (MI->cshcxx . . $ MCInst#csh.->modecxx . . $ cs_struct#mode. & CS_MODE_32cxx . . $ CS_MODE_32.)
1974 cx = X86_REG_ECXcxx . . $ X86_REG_ECX.;
1975 else // 64-bit
1976 cx = X86_REG_RCXcxx . . $ X86_REG_RCX.;
1977
1978 MI->flat_insncxx . . $ MCInst#flat_insn.->detailcxx . . $ cs_insn#detail.->regs_readcxx . . $ cs_detail#regs_read.[MI->flat_insncxx . . $ MCInst#flat_insn.->detailcxx . . $ cs_insn#detail.->regs_read_countcxx . . $ cs_detail#regs_read_count.] = cx;
1979 MI->flat_insncxx . . $ MCInst#flat_insn.->detailcxx . . $ cs_insn#detail.->regs_read_countcxx . . $ cs_detail#regs_read_count.++;
1980
1981 MI->flat_insncxx . . $ MCInst#flat_insn.->detailcxx . . $ cs_insn#detail.->regs_writecxx . . $ cs_detail#regs_write.[MI->flat_insncxx . . $ MCInst#flat_insn.->detailcxx . . $ cs_insn#detail.->regs_write_countcxx . . $ cs_detail#regs_write_count.] = cx;
1982 MI->flat_insncxx . . $ MCInst#flat_insn.->detailcxx . . $ cs_insn#detail.->regs_write_countcxx . . $ cs_detail#regs_write_count.++;
1983 }
1984 }
1985 #endif
1986
1987 // return true if we patch the mnemonic
1988 boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! X86_lockrepcxx . . $ X86_lockrep(9dc196ebf468fb30).(MCInstcxx . . $ MCInst# *MI, SStreamcxx . . $ SStream# *O)
1989 {
1990 unsigned int opcode;
1991 boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! res = falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!;
1992
1993 switch(MI->x86_prefixcxx . . $ MCInst#x86_prefix.[0]) {
1994 default:
1995 break;
1996 case 0xf0:
1997 #ifndef CAPSTONE_DIET
1998 if (MI->xAcquireReleasecxx . . $ MCInst#xAcquireRelease. == 0xf2)
1999 SStream_concatcxx . . $ SStream_concat(72515e07697b04b4).(O, "xacquire|lock|");
2000 else if (MI->xAcquireReleasecxx . . $ MCInst#xAcquireRelease. == 0xf3)
2001 SStream_concatcxx . . $ SStream_concat(72515e07697b04b4).(O, "xrelease|lock|");
2002 else
2003 SStream_concatcxx . . $ SStream_concat(72515e07697b04b4).(O, "lock|");
2004 #endif
2005 break;
2006 case 0xf2: // repne
2007 opcode = MCInst_getOpcodecxx . . $ MCInst_getOpcode(66549afbf0596d6c).(MI);
2008
2009 #ifndef CAPSTONE_DIET // only care about memonic in standard (non-diet) mode
2010 if (xchg_memcxx . . $ xchg_mem(dfa6e707f7696010).(opcode) && MI->xAcquireReleasecxx . . $ MCInst#xAcquireRelease.) {
2011 SStream_concatcxx . . $ SStream_concat(72515e07697b04b4).(O, "xacquire|");
2012 } else if (valid_repnecxx . . $ valid_repne(39412e1dc8bf7218).(MI->cshcxx . . $ MCInst#csh., opcode)) {
2013 SStream_concatcxx . . $ SStream_concat(72515e07697b04b4).(O, "repne|");
2014 add_cxcxx . . $ add_cx(94c8a3269074abe9).(MI);
2015 } else if (valid_bndcxx . . $ valid_bnd(39412e1dc8bf7218).(MI->cshcxx . . $ MCInst#csh., opcode)) {
2016 SStream_concatcxx . . $ SStream_concat(72515e07697b04b4).(O, "bnd|");
2017 } else {
2018 // invalid prefix
2019 MI->x86_prefixcxx . . $ MCInst#x86_prefix.[0] = 0;
2020
2021 // handle special cases
2022 #ifndef CAPSTONE_X86_REDUCE
2023 #if 0
2024 if (opcode == X86_MULPDrr) {
2025 MCInst_setOpcode(MI, X86_MULSDrr);
2026 SStream_concat0(O, "mulsd\t");
2027 res = true;
2028 }
2029 #endif
2030 #endif
2031 }
2032 #else // diet mode -> only patch opcode in special cases
2033 if (!valid_repne(MI->csh, opcode)) {
2034 MI->x86_prefix[0] = 0;
2035 }
2036 #ifndef CAPSTONE_X86_REDUCE
2037 #if 0
2038 // handle special cases
2039 if (opcode == X86_MULPDrr) {
2040 MCInst_setOpcode(MI, X86_MULSDrr);
2041 }
2042 #endif
2043 #endif
2044 #endif
2045 break;
2046
2047 case 0xf3:
2048 opcode = MCInst_getOpcodecxx . . $ MCInst_getOpcode(66549afbf0596d6c).(MI);
2049
2050 #ifndef CAPSTONE_DIET // only care about memonic in standard (non-diet) mode
2051 if (xchg_memcxx . . $ xchg_mem(dfa6e707f7696010).(opcode) && MI->xAcquireReleasecxx . . $ MCInst#xAcquireRelease.) {
2052 SStream_concatcxx . . $ SStream_concat(72515e07697b04b4).(O, "xrelease|");
2053 } else if (valid_repcxx . . $ valid_rep(39412e1dc8bf7218).(MI->cshcxx . . $ MCInst#csh., opcode)) {
2054 SStream_concatcxx . . $ SStream_concat(72515e07697b04b4).(O, "rep|");
2055 add_cxcxx . . $ add_cx(94c8a3269074abe9).(MI);
2056 } else if (valid_repecxx . . $ valid_repe(39412e1dc8bf7218).(MI->cshcxx . . $ MCInst#csh., opcode)) {
2057 SStream_concatcxx . . $ SStream_concat(72515e07697b04b4).(O, "repe|");
2058 add_cxcxx . . $ add_cx(94c8a3269074abe9).(MI);
2059 } else if (valid_ret_repzcxx . . $ valid_ret_repz(39412e1dc8bf7218).(MI->cshcxx . . $ MCInst#csh., opcode)) {
2060 SStream_concatcxx . . $ SStream_concat(72515e07697b04b4).(O, "repz|");
2061 } else {
2062 // invalid prefix
2063 MI->x86_prefixcxx . . $ MCInst#x86_prefix.[0] = 0;
2064
2065 // handle special cases
2066 #ifndef CAPSTONE_X86_REDUCE
2067 #if 0
2068 // FIXME: remove this special case?
2069 if (opcode == X86_MULPDrr) {
2070 MCInst_setOpcode(MI, X86_MULSSrr);
2071 SStream_concat0(O, "mulss\t");
2072 res = true;
2073 }
2074 #endif
2075 #endif
2076 }
2077 #else // diet mode -> only patch opcode in special cases
2078 if (!valid_rep(MI->csh, opcode) && !valid_repe(MI->csh, opcode)) {
2079 MI->x86_prefix[0] = 0;
2080 }
2081 #ifndef CAPSTONE_X86_REDUCE
2082 #if 0
2083 // handle special cases
2084 // FIXME: remove this special case?
2085 if (opcode == X86_MULPDrr) {
2086 MCInst_setOpcode(MI, X86_MULSSrr);
2087 }
2088 #endif
2089 #endif
2090 #endif
2091 break;
2092 }
2093
2094 switch(MI->x86_prefixcxx . . $ MCInst#x86_prefix.[1]) {
2095 default:
2096 break;
2097 case 0x3e:
2098 opcode = MCInst_getOpcodecxx . . $ MCInst_getOpcode(66549afbf0596d6c).(MI);
2099 if (valid_notrackcxx . . $ valid_notrack(39412e1dc8bf7218).(MI->cshcxx . . $ MCInst#csh., opcode)) {
2100 SStream_concatcxx . . $ SStream_concat(72515e07697b04b4).(O, "notrack|");
2101 }
2102 break;
2103 }
2104
2105 // copy normalized prefix[] back to x86.prefix[]
2106 if (MI->cshcxx . . $ MCInst#csh.->detailcxx . . $ cs_struct#detail.)
2107 memcpycxx . . $ memcpy(cc817cb175f282d).(MI->flat_insncxx . . $ MCInst#flat_insn.->detailcxx . . $ cs_insn#detail.->x86cxx . . $ cs_detail#$anonymous_type_0#x86..prefixcxx . . $ cs_x86#prefix., MI->x86_prefixcxx . . $ MCInst#x86_prefix., ARR_SIZEcxx . . $ `utils.h:24:9`!(MI->x86_prefix));
2108
2109 return res;
2110 }
2111
2112 void op_addRegcxx . . $ op_addReg(cff03ea8bb8460e7).(MCInstcxx . . $ MCInst# *MI, int reg)
2113 {
2114 if (MI->cshcxx . . $ MCInst#csh.->detailcxx . . $ cs_struct#detail.) {
2115 MI->flat_insncxx . . $ MCInst#flat_insn.->detailcxx . . $ cs_insn#detail.->x86cxx . . $ cs_detail#$anonymous_type_0#x86..operandscxx . . $ cs_x86#operands.[MI->flat_insncxx . . $ MCInst#flat_insn.->detailcxx . . $ cs_insn#detail.->x86cxx . . $ cs_detail#$anonymous_type_0#x86..op_countcxx . . $ cs_x86#op_count.].typecxx . . $ cs_x86_op#type. = X86_OP_REGcxx . . $ X86_OP_REG.;
2116 MI->flat_insncxx . . $ MCInst#flat_insn.->detailcxx . . $ cs_insn#detail.->x86cxx . . $ cs_detail#$anonymous_type_0#x86..operandscxx . . $ cs_x86#operands.[MI->flat_insncxx . . $ MCInst#flat_insn.->detailcxx . . $ cs_insn#detail.->x86cxx . . $ cs_detail#$anonymous_type_0#x86..op_countcxx . . $ cs_x86#op_count.].regcxx . . $ cs_x86_op#$anonymous_type_0#reg. = reg;
2117 MI->flat_insncxx . . $ MCInst#flat_insn.->detailcxx . . $ cs_insn#detail.->x86cxx . . $ cs_detail#$anonymous_type_0#x86..operandscxx . . $ cs_x86#operands.[MI->flat_insncxx . . $ MCInst#flat_insn.->detailcxx . . $ cs_insn#detail.->x86cxx . . $ cs_detail#$anonymous_type_0#x86..op_countcxx . . $ cs_x86#op_count.].sizecxx . . $ cs_x86_op#size. = MI->cshcxx . . $ MCInst#csh.->regsize_mapcxx . . $ cs_struct#regsize_map.[reg];
2118 MI->flat_insncxx . . $ MCInst#flat_insn.->detailcxx . . $ cs_insn#detail.->x86cxx . . $ cs_detail#$anonymous_type_0#x86..op_countcxx . . $ cs_x86#op_count.++;
2119 }
2120
2121 if (MI->op1_sizecxx . . $ MCInst#op1_size. == 0)
2122 MI->op1_sizecxx . . $ MCInst#op1_size. = MI->cshcxx . . $ MCInst#csh.->regsize_mapcxx . . $ cs_struct#regsize_map.[reg];
2123 }
2124
2125 void op_addImmcxx . . $ op_addImm(cff03ea8bb8460e7).(MCInstcxx . . $ MCInst# *MI, int v)
2126 {
2127 if (MI->cshcxx . . $ MCInst#csh.->detailcxx . . $ cs_struct#detail.) {
2128 MI->flat_insncxx . . $ MCInst#flat_insn.->detailcxx . . $ cs_insn#detail.->x86cxx . . $ cs_detail#$anonymous_type_0#x86..operandscxx . . $ cs_x86#operands.[MI->flat_insncxx . . $ MCInst#flat_insn.->detailcxx . . $ cs_insn#detail.->x86cxx . . $ cs_detail#$anonymous_type_0#x86..op_countcxx . . $ cs_x86#op_count.].typecxx . . $ cs_x86_op#type. = X86_OP_IMMcxx . . $ X86_OP_IMM.;
2129 MI->flat_insncxx . . $ MCInst#flat_insn.->detailcxx . . $ cs_insn#detail.->x86cxx . . $ cs_detail#$anonymous_type_0#x86..operandscxx . . $ cs_x86#operands.[MI->flat_insncxx . . $ MCInst#flat_insn.->detailcxx . . $ cs_insn#detail.->x86cxx . . $ cs_detail#$anonymous_type_0#x86..op_countcxx . . $ cs_x86#op_count.].immcxx . . $ cs_x86_op#$anonymous_type_0#imm. = v;
2130 // if op_count > 0, then this operand's size is taken from the destination op
2131 if (MI->cshcxx . . $ MCInst#csh.->syntaxcxx . . $ cs_struct#syntax. != CS_OPT_SYNTAX_ATTcxx . . $ CS_OPT_SYNTAX_ATT.) {
2132 if (MI->flat_insncxx . . $ MCInst#flat_insn.->detailcxx . . $ cs_insn#detail.->x86cxx . . $ cs_detail#$anonymous_type_0#x86..op_countcxx . . $ cs_x86#op_count. > 0)
2133 MI->flat_insncxx . . $ MCInst#flat_insn.->detailcxx . . $ cs_insn#detail.->x86cxx . . $ cs_detail#$anonymous_type_0#x86..operandscxx . . $ cs_x86#operands.[MI->flat_insncxx . . $ MCInst#flat_insn.->detailcxx . . $ cs_insn#detail.->x86cxx . . $ cs_detail#$anonymous_type_0#x86..op_countcxx . . $ cs_x86#op_count.].sizecxx . . $ cs_x86_op#size. = MI->flat_insncxx . . $ MCInst#flat_insn.->detailcxx . . $ cs_insn#detail.->x86cxx . . $ cs_detail#$anonymous_type_0#x86..operandscxx . . $ cs_x86#operands.[0].sizecxx . . $ cs_x86_op#size.;
2134 else
2135 MI->flat_insncxx . . $ MCInst#flat_insn.->detailcxx . . $ cs_insn#detail.->x86cxx . . $ cs_detail#$anonymous_type_0#x86..operandscxx . . $ cs_x86#operands.[MI->flat_insncxx . . $ MCInst#flat_insn.->detailcxx . . $ cs_insn#detail.->x86cxx . . $ cs_detail#$anonymous_type_0#x86..op_countcxx . . $ cs_x86#op_count.].sizecxx . . $ cs_x86_op#size. = MI->imm_sizecxx . . $ MCInst#imm_size.;
2136 } else
2137 MI->has_immcxx . . $ MCInst#has_imm. = truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!;
2138 MI->flat_insncxx . . $ MCInst#flat_insn.->detailcxx . . $ cs_insn#detail.->x86cxx . . $ cs_detail#$anonymous_type_0#x86..op_countcxx . . $ cs_x86#op_count.++;
2139 }
2140
2141 if (MI->op1_sizecxx . . $ MCInst#op1_size. == 0)
2142 MI->op1_sizecxx . . $ MCInst#op1_size. = MI->imm_sizecxx . . $ MCInst#imm_size.;
2143 }
2144
2145 void op_addXopCCcxx . . $ op_addXopCC(cff03ea8bb8460e7).(MCInstcxx . . $ MCInst# *MI, int v)
2146 {
2147 if (MI->cshcxx . . $ MCInst#csh.->detailcxx . . $ cs_struct#detail.) {
2148 MI->flat_insncxx . . $ MCInst#flat_insn.->detailcxx . . $ cs_insn#detail.->x86cxx . . $ cs_detail#$anonymous_type_0#x86..xop_cccxx . . $ cs_x86#xop_cc. = v;
2149 }
2150 }
2151
2152 void op_addSseCCcxx . . $ op_addSseCC(cff03ea8bb8460e7).(MCInstcxx . . $ MCInst# *MI, int v)
2153 {
2154 if (MI->cshcxx . . $ MCInst#csh.->detailcxx . . $ cs_struct#detail.) {
2155 MI->flat_insncxx . . $ MCInst#flat_insn.->detailcxx . . $ cs_insn#detail.->x86cxx . . $ cs_detail#$anonymous_type_0#x86..sse_cccxx . . $ cs_x86#sse_cc. = v;
2156 }
2157 }
2158
2159 void op_addAvxCCcxx . . $ op_addAvxCC(cff03ea8bb8460e7).(MCInstcxx . . $ MCInst# *MI, int v)
2160 {
2161 if (MI->cshcxx . . $ MCInst#csh.->detailcxx . . $ cs_struct#detail.) {
2162 MI->flat_insncxx . . $ MCInst#flat_insn.->detailcxx . . $ cs_insn#detail.->x86cxx . . $ cs_detail#$anonymous_type_0#x86..avx_cccxx . . $ cs_x86#avx_cc. = v;
2163 }
2164 }
2165
2166 void op_addAvxRoundingModecxx . . $ op_addAvxRoundingMode(cff03ea8bb8460e7).(MCInstcxx . . $ MCInst# *MI, int v)
2167 {
2168 if (MI->cshcxx . . $ MCInst#csh.->detailcxx . . $ cs_struct#detail.) {
2169 MI->flat_insncxx . . $ MCInst#flat_insn.->detailcxx . . $ cs_insn#detail.->x86cxx . . $ cs_detail#$anonymous_type_0#x86..avx_rmcxx . . $ cs_x86#avx_rm. = v;
2170 }
2171 }
2172
2173 // below functions supply details to X86GenAsmWriter*.inc
2174 void op_addAvxZeroOpmaskcxx . . $ op_addAvxZeroOpmask(94c8a3269074abe9).(MCInstcxx . . $ MCInst# *MI)
2175 {
2176 if (MI->cshcxx . . $ MCInst#csh.->detailcxx . . $ cs_struct#detail.) {
2177 // link with the previous operand
2178 MI->flat_insncxx . . $ MCInst#flat_insn.->detailcxx . . $ cs_insn#detail.->x86cxx . . $ cs_detail#$anonymous_type_0#x86..operandscxx . . $ cs_x86#operands.[MI->flat_insncxx . . $ MCInst#flat_insn.->detailcxx . . $ cs_insn#detail.->x86cxx . . $ cs_detail#$anonymous_type_0#x86..op_countcxx . . $ cs_x86#op_count. - 1].avx_zero_opmaskcxx . . $ cs_x86_op#avx_zero_opmask. = truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!;
2179 }
2180 }
2181
2182 void op_addAvxSaecxx . . $ op_addAvxSae(94c8a3269074abe9).(MCInstcxx . . $ MCInst# *MI)
2183 {
2184 if (MI->cshcxx . . $ MCInst#csh.->detailcxx . . $ cs_struct#detail.) {
2185 MI->flat_insncxx . . $ MCInst#flat_insn.->detailcxx . . $ cs_insn#detail.->x86cxx . . $ cs_detail#$anonymous_type_0#x86..avx_saecxx . . $ cs_x86#avx_sae. = truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!;
2186 }
2187 }
2188
2189 void op_addAvxBroadcastcxx . . $ op_addAvxBroadcast(3ffada843a4d19dc).(MCInstcxx . . $ MCInst# *MI, x86_avx_bcastcxx . . $ x86_avx_bcast# v)
2190 {
2191 if (MI->cshcxx . . $ MCInst#csh.->detailcxx . . $ cs_struct#detail.) {
2192 // link with the previous operand
2193 MI->flat_insncxx . . $ MCInst#flat_insn.->detailcxx . . $ cs_insn#detail.->x86cxx . . $ cs_detail#$anonymous_type_0#x86..operandscxx . . $ cs_x86#operands.[MI->flat_insncxx . . $ MCInst#flat_insn.->detailcxx . . $ cs_insn#detail.->x86cxx . . $ cs_detail#$anonymous_type_0#x86..op_countcxx . . $ cs_x86#op_count. - 1].avx_bcastcxx . . $ cs_x86_op#avx_bcast. = v;
2194 }
2195 }
2196
2197 #ifndef CAPSTONE_DIET
2198 // map instruction to its characteristics
2199 typedef struct insn_opcxx . . $ insn_op# {
2200 uint64_tcxx . . $ uint64_t# flagscxx . . $ insn_op#flags.; // how this instruction update EFLAGS(arithmetic instrcutions) of FPU FLAGS(for FPU instructions)
2201 uint8_tcxx . . $ uint8_t# accesscxx . . $ insn_op#access.[6];
2202 } insn_opcxx . . $ insn_op#;
2203
2204 static const insn_opcxx . . $ insn_op# insn_opscxx . . $ insn_ops.[] = {
2205 #ifdef CAPSTONE_X86_REDUCE
2206 #include "X86MappingInsnOp_reduce.inc"
2207 #else
2208 #include "X86MappingInsnOp.inc"cxx . . $ `<file>/arch/X86/X86MappingInsnOp.inc`/
2209 #endif
2210 };
2211
2212 // given internal insn id, return operand access info
2213 const uint8_tcxx . . $ uint8_t# *X86_get_op_accesscxx . . $ X86_get_op_access(5cb490f2be29a92d).(cs_structcxx . . $ cs_struct# *h, unsigned int id, uint64_tcxx . . $ uint64_t# *eflags)
2214 {
2215 unsigned int i = find_insn_hcxx . . $ find_insn_h(a4c73a42272bdcc6).(h, id);
2216 if (i != -1) {
2217 *eflags = insn_opscxx . . $ insn_ops.[i].flagscxx . . $ insn_op#flags.;
2218 return insn_opscxx . . $ insn_ops.[i].accesscxx . . $ insn_op#access.;
2219 }
2220
2221 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!;
2222 }
2223
2224 void X86_reg_accesscxx . . $ X86_reg_access(a4e53139cd2f126c).(const cs_insncxx . . $ cs_insn# *insn,
2225 cs_regscxx . . $ cs_regs# regs_read, uint8_tcxx . . $ uint8_t# *regs_read_count,
2226 cs_regscxx . . $ cs_regs# regs_write, uint8_tcxx . . $ uint8_t# *regs_write_count)
2227 {
2228 uint8_tcxx . . $ uint8_t# i;
2229 uint8_tcxx . . $ uint8_t# read_count, write_count;
2230 cs_x86cxx . . $ cs_x86# *x86 = &(insn->detailcxx . . $ cs_insn#detail.->x86cxx . . $ cs_detail#$anonymous_type_0#x86.);
2231
2232 read_count = insn->detailcxx . . $ cs_insn#detail.->regs_read_countcxx . . $ cs_detail#regs_read_count.;
2233 write_count = insn->detailcxx . . $ cs_insn#detail.->regs_write_countcxx . . $ cs_detail#regs_write_count.;
2234
2235 // implicit registers
2236 memcpycxx . . $ memcpy(cc817cb175f282d).(regs_read, insn->detailcxx . . $ cs_insn#detail.->regs_readcxx . . $ cs_detail#regs_read., read_count * sizeof(insn->detailcxx . . $ cs_insn#detail.->regs_readcxx . . $ cs_detail#regs_read.[0]));
2237 memcpycxx . . $ memcpy(cc817cb175f282d).(regs_write, insn->detailcxx . . $ cs_insn#detail.->regs_writecxx . . $ cs_detail#regs_write., write_count * sizeof(insn->detailcxx . . $ cs_insn#detail.->regs_writecxx . . $ cs_detail#regs_write.[0]));
2238
2239 // explicit registers
2240 for (i = 0; i < x86->op_countcxx . . $ cs_x86#op_count.; i++) {
2241 cs_x86_opcxx . . $ cs_x86_op# *op = &(x86->operandscxx . . $ cs_x86#operands.[i]);
2242 switch((int)op->typecxx . . $ cs_x86_op#type.) {
2243 case X86_OP_REGcxx . . $ X86_OP_REG.:
2244 if ((op->accesscxx . . $ cs_x86_op#access. & CS_AC_READcxx . . $ CS_AC_READ.) && !arr_existcxx . . $ arr_exist(c35293ec828d81e3).(regs_read, read_count, op->regcxx . . $ cs_x86_op#$anonymous_type_0#reg.)) {
2245 regs_read[read_count] = op->regcxx . . $ cs_x86_op#$anonymous_type_0#reg.;
2246 read_count++;
2247 }
2248 if ((op->accesscxx . . $ cs_x86_op#access. & CS_AC_WRITEcxx . . $ CS_AC_WRITE.) && !arr_existcxx . . $ arr_exist(c35293ec828d81e3).(regs_write, write_count, op->regcxx . . $ cs_x86_op#$anonymous_type_0#reg.)) {
2249 regs_write[write_count] = op->regcxx . . $ cs_x86_op#$anonymous_type_0#reg.;
2250 write_count++;
2251 }
2252 break;
2253 case X86_OP_MEMcxx . . $ X86_OP_MEM.:
2254 // registers appeared in memory references always being read
2255 if ((op->memcxx . . $ cs_x86_op#$anonymous_type_0#mem..segmentcxx . . $ x86_op_mem#segment. != X86_REG_INVALIDcxx . . $ X86_REG_INVALID.)) {
2256 regs_read[read_count] = op->memcxx . . $ cs_x86_op#$anonymous_type_0#mem..segmentcxx . . $ x86_op_mem#segment.;
2257 read_count++;
2258 }
2259 if ((op->memcxx . . $ cs_x86_op#$anonymous_type_0#mem..basecxx . . $ x86_op_mem#base. != X86_REG_INVALIDcxx . . $ X86_REG_INVALID.) && !arr_existcxx . . $ arr_exist(c35293ec828d81e3).(regs_read, read_count, op->memcxx . . $ cs_x86_op#$anonymous_type_0#mem..basecxx . . $ x86_op_mem#base.)) {
2260 regs_read[read_count] = op->memcxx . . $ cs_x86_op#$anonymous_type_0#mem..basecxx . . $ x86_op_mem#base.;
2261 read_count++;
2262 }
2263 if ((op->memcxx . . $ cs_x86_op#$anonymous_type_0#mem..indexcxx . . $ x86_op_mem#index. != X86_REG_INVALIDcxx . . $ X86_REG_INVALID.) && !arr_existcxx . . $ arr_exist(c35293ec828d81e3).(regs_read, read_count, op->memcxx . . $ cs_x86_op#$anonymous_type_0#mem..indexcxx . . $ x86_op_mem#index.)) {
2264 regs_read[read_count] = op->memcxx . . $ cs_x86_op#$anonymous_type_0#mem..indexcxx . . $ x86_op_mem#index.;
2265 read_count++;
2266 }
2267 default:
2268 break;
2269 }
2270 }
2271
2272 *regs_read_count = read_count;
2273 *regs_write_count = write_count;
2274 }
2275 #endif
2276
2277 // map immediate size to instruction id
2278 // this array is sorted for binary searching
2279 static const struct size_idcxx . . $ size_id# {
2280 uint8_tcxx . . $ uint8_t# enc_sizecxx . . $ size_id#enc_size.;
2281 uint8_tcxx . . $ uint8_t# sizecxx . . $ size_id#size.;
2282 uint16_tcxx . . $ uint16_t# idcxx . . $ size_id#id.;
2283 } x86_imm_sizecxx . . $ x86_imm_size.[] = {
2284 #include "X86ImmSize.inc"cxx . . $ `<file>/arch/X86/X86ImmSize.inc`/
2285 };
2286
2287 // given the instruction name, return the size of its immediate operand (or 0)
2288 uint8_tcxx . . $ uint8_t# X86_immediate_sizecxx . . $ X86_immediate_size(395827a3978c0abb).(unsigned int id, uint8_tcxx . . $ uint8_t# *enc_size)
2289 {
2290 // binary searching since the IDs are sorted in order
2291 unsigned int left, right, m;
2292
2293 right = ARR_SIZEcxx . . $ `utils.h:24:9`!(x86_imm_size) - 1;
2294
2295 if (id < x86_imm_sizecxx . . $ x86_imm_size.[0].idcxx . . $ size_id#id. || id > x86_imm_sizecxx . . $ x86_imm_size.[right].idcxx . . $ size_id#id.)
2296 // not found
2297 return 0;
2298
2299 left = 0;
2300
2301 while (left <= right) {
2302 m = (left + right) / 2;
2303 if (id == x86_imm_sizecxx . . $ x86_imm_size.[m].idcxx . . $ size_id#id.) {
2304 if (enc_size != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!)
2305 *enc_size = x86_imm_sizecxx . . $ x86_imm_size.[m].enc_sizecxx . . $ size_id#enc_size.;
2306
2307 return x86_imm_sizecxx . . $ x86_imm_size.[m].sizecxx . . $ size_id#size.;
2308 }
2309
2310 if (id > x86_imm_sizecxx . . $ x86_imm_size.[m].idcxx . . $ size_id#id.)
2311 left = m + 1;
2312 else {
2313 if (m == 0)
2314 break;
2315 right = m - 1;
2316 }
2317 }
2318
2319 // not found
2320 return 0;
2321 }
2322
2323 #define GET_REGINFO_ENUMcxx . . $ `arch/X86/X86Mapping.c:2323:9`!
2324 #include "X86GenRegisterInfo.inc"cxx . . $ `<file>/arch/X86/X86GenRegisterInfo.inc`/
2325
2326 // map internal register id to public register id
2327 static const struct register_mapcxx . . $ register_map# {
2328 unsigned short idcxx . . $ register_map#id.;
2329 unsigned short pub_idcxx . . $ register_map#pub_id.;
2330 } reg_mapcxx . . $ reg_map. [] = {
2331 // first dummy map
2332 { 0, 0 },
2333 #include "X86MappingReg.inc"cxx . . $ `<file>/arch/X86/X86MappingReg.inc`/
2334 };
2335
2336 // return 0 on invalid input, or public register ID otherwise
2337 // NOTE: reg_map is sorted in order of internal register
2338 unsigned short X86_register_mapcxx . . $ X86_register_map(a18c05e4017afb3d).(unsigned short id)
2339 {
2340 if (id < ARR_SIZEcxx . . $ `utils.h:24:9`!(reg_map))
2341 return reg_mapcxx . . $ reg_map.[id].pub_idcxx . . $ register_map#pub_id.;
2342
2343 return 0;
2344 }
2345
2346 /// The post-printer function. Used to fixup flaws in the disassembly information
2347 /// of certain instructions.
2348 void X86_postprintercxx . . $ X86_postprinter(1e4eab0813f35322).(cshcxx . . $ csh# handle, cs_insncxx . . $ cs_insn# *insn, char *mnem, MCInstcxx . . $ MCInst# *mci) {
2349 if (!insn || !insn->detailcxx . . $ cs_insn#detail.) {
2350 return;
2351 }
2352 switch (insn->idcxx . . $ cs_insn#id.) {
2353 default:
2354 break;
2355 case X86_INS_RCLcxx . . $ X86_INS_RCL.:
2356 // Addmissing 1 immediate
2357 if (insn->detailcxx . . $ cs_insn#detail.->x86cxx . . $ cs_detail#$anonymous_type_0#x86..op_countcxx . . $ cs_x86#op_count. > 1) {
2358 return;
2359 }
2360 insn->detailcxx . . $ cs_insn#detail.->x86cxx . . $ cs_detail#$anonymous_type_0#x86..operandscxx . . $ cs_x86#operands.[1].immcxx . . $ cs_x86_op#$anonymous_type_0#imm. = 1;
2361 insn->detailcxx . . $ cs_insn#detail.->x86cxx . . $ cs_detail#$anonymous_type_0#x86..operandscxx . . $ cs_x86#operands.[1].typecxx . . $ cs_x86_op#type. = X86_OP_IMMcxx . . $ X86_OP_IMM.;
2362 insn->detailcxx . . $ cs_insn#detail.->x86cxx . . $ cs_detail#$anonymous_type_0#x86..operandscxx . . $ cs_x86#operands.[1].accesscxx . . $ cs_x86_op#access. = CS_AC_READcxx . . $ CS_AC_READ.;
2363 insn->detailcxx . . $ cs_insn#detail.->x86cxx . . $ cs_detail#$anonymous_type_0#x86..op_countcxx . . $ cs_x86#op_count.++;
2364 break;
2365 }
2366 }
2367
2368
2369 #endif