#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ GenPostIdentAccess();
int /*<<< orphan*/ GenPreIdentAccess(int);
int /*<<< orphan*/ GenPrintInstr2Operands(int, int /*<<< orphan*/, int,
                                          int /*<<< orphan*/, int, int);
void GenReadIdent(int regDst, int opSz, int label) {
  int instr = 0x0D;
  GenPreIdentAccess(label);
  if (opSz == -1) {
    instr = 0x09;
  } else if (opSz == 1) {
    instr = 0x0A;
  } else if (opSz == -2) {
    instr = 0x0B;
  } else if (opSz == 2) {
    instr = 0x0C;
  }
  GenPrintInstr2Operands(instr, 0, regDst, 0, 0x83, label);
  GenPostIdentAccess();
}


x86 assembly (clang, -O0):
<GenReadIdent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0xd,-0x10(%rbp)
mov    -0xc(%rbp),%edi
call   1050 <GenPreIdentAccess@plt>
cmpl   $0xffffffff,-0x8(%rbp)
jne    1166 <GenReadIdent+0x36>
movl   $0x9,-0x10(%rbp)
jmp    11b2 <GenReadIdent+0x82>
cmpl   $0x1,-0x8(%rbp)
jne    117c <GenReadIdent+0x4c>
movl   $0xa,-0x10(%rbp)
jmp    11ad <GenReadIdent+0x7d>
cmpl   $0xfffffffe,-0x8(%rbp)
jne    1192 <GenReadIdent+0x62>
movl   $0xb,-0x10(%rbp)
jmp    11a8 <GenReadIdent+0x78>
cmpl   $0x2,-0x8(%rbp)
jne    11a3 <GenReadIdent+0x73>
movl   $0xc,-0x10(%rbp)
jmp    11a8 <GenReadIdent+0x78>
jmp    11ad <GenReadIdent+0x7d>
jmp    11b2 <GenReadIdent+0x82>
mov    -0x10(%rbp),%edi
mov    -0x4(%rbp),%edx
mov    -0xc(%rbp),%r9d
xor    %ecx,%ecx
mov    $0x83,%r8d
mov    %ecx,%esi
call   1030 <GenPrintInstr2Operands@plt>
mov    $0x0,%al
call   1040 <GenPostIdentAccess@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GenReadIdent>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%ebp
mov    %edi,%r14d
mov    %edx,%edi
call   1050 <GenPreIdentAccess@plt>
add    $0x2,%ebp
mov    $0xd,%edi
cmp    $0x4,%ebp
ja     115c <GenReadIdent+0x2c>
movslq %ebp,%rax
lea    0xea7(%rip),%rcx
mov    (%rcx,%rax,4),%edi
xor    %esi,%esi
mov    %r14d,%edx
xor    %ecx,%ecx
mov    $0x83,%r8d
mov    %ebx,%r9d
call   1030 <GenPrintInstr2Operands@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <GenPostIdentAccess@plt>

LLVM IR (-O0):
define void @GenReadIdent(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 13, i32* %7
%8 = load i32, i32* %6
%9 = call i32 @GenPreIdentAccess(i32 %8)
%10 = load i32, i32* %5
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %13
12: ; preds = %3
store i32 9, i32* %7
br label %28
13: ; preds = %3
%14 = load i32, i32* %5
%15 = icmp eq i32 %14, 1
br i1 %15, label %16, label %17
16: ; preds = %13
store i32 10, i32* %7
br label %27
17: ; preds = %13
%18 = load i32, i32* %5
%19 = icmp eq i32 %18, -2
br i1 %19, label %20, label %21
20: ; preds = %17
store i32 11, i32* %7
br label %26
21: ; preds = %17
%22 = load i32, i32* %5
%23 = icmp eq i32 %22, 2
br i1 %23, label %24, label %25
24: ; preds = %21
store i32 12, i32* %7
br label %25
25: ; preds = %24, %21
br label %26
26: ; preds = %25, %20
br label %27
27: ; preds = %26, %16
br label %28
28: ; preds = %27, %12
%29 = load i32, i32* %7
%30 = load i32, i32* %4
%31 = load i32, i32* %6
%32 = call i32 @GenPrintInstr2Operands(i32 %29, i32 0, i32 %30, i32 0, i32 131, i32 %31)
%33 = call i32 (...) @GenPostIdentAccess()
ret void
}

LLVM IR (-O2):
@switch.table.GenReadIdent = [5 x i32] [i32 11, i32 9, i32 13, i32 10, i32 12]
define void @GenReadIdent(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @GenPreIdentAccess(i32 %2)
%5 = add i32 %1, 2
%6 = icmp ult i32 %5, 5
br i1 %6, label %7, label %11
7: ; preds = %3
%8 = sext i32 %5 to i64
%9 = getelementptr inbounds [5 x i32], [5 x i32]* @switch.table.GenReadIdent, i64 0, i64 %8
%10 = load i32, i32* %9
br label %11
11: ; preds = %3, %7
%12 = phi i32 [ %10, %7 ], [ 13, %3 ]
%13 = tail call i32 @GenPrintInstr2Operands(i32 %12, i32 0, i32 %0, i32 0, i32 131, i32 %2)
%14 = tail call i32 (...) @GenPostIdentAccess()
ret void
}