#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*/ GenPrintInstr2Operands(int, int /*<<< orphan*/, int,
                                          int /*<<< orphan*/, int, int);
void GenReadLocal(int regDst, int opSz, int ofs) {
  int instr = 0x0D;
  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, 0x3E, ofs);
}


x86 assembly (clang, -O0):
<GenReadLocal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0xd,-0x10(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    113e <GenReadLocal+0x2e>
movl   $0x9,-0x10(%rbp)
jmp    118a <GenReadLocal+0x7a>
cmpl   $0x1,-0x8(%rbp)
jne    1154 <GenReadLocal+0x44>
movl   $0xa,-0x10(%rbp)
jmp    1185 <GenReadLocal+0x75>
cmpl   $0xfffffffe,-0x8(%rbp)
jne    116a <GenReadLocal+0x5a>
movl   $0xb,-0x10(%rbp)
jmp    1180 <GenReadLocal+0x70>
cmpl   $0x2,-0x8(%rbp)
jne    117b <GenReadLocal+0x6b>
movl   $0xc,-0x10(%rbp)
jmp    1180 <GenReadLocal+0x70>
jmp    1185 <GenReadLocal+0x75>
jmp    118a <GenReadLocal+0x7a>
mov    -0x10(%rbp),%edi
mov    -0x4(%rbp),%edx
mov    -0xc(%rbp),%r9d
xor    %ecx,%ecx
mov    $0x3e,%r8d
mov    %ecx,%esi
call   1030 <GenPrintInstr2Operands@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GenReadLocal>:
mov    %edx,%r9d
mov    %edi,%edx
add    $0x2,%esi
mov    $0xd,%edi
cmp    $0x4,%esi
ja     112f <GenReadLocal+0x1f>
movslq %esi,%rax
lea    0xed4(%rip),%rcx
mov    (%rcx,%rax,4),%edi
xor    %esi,%esi
xor    %ecx,%ecx
mov    $0x3e,%r8d
jmp    1030 <GenPrintInstr2Operands@plt>

LLVM IR (-O0):
define void @GenReadLocal(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* %5
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %11
10: ; preds = %3
store i32 9, i32* %7
br label %26
11: ; preds = %3
%12 = load i32, i32* %5
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %15
14: ; preds = %11
store i32 10, i32* %7
br label %25
15: ; preds = %11
%16 = load i32, i32* %5
%17 = icmp eq i32 %16, -2
br i1 %17, label %18, label %19
18: ; preds = %15
store i32 11, i32* %7
br label %24
19: ; preds = %15
%20 = load i32, i32* %5
%21 = icmp eq i32 %20, 2
br i1 %21, label %22, label %23
22: ; preds = %19
store i32 12, i32* %7
br label %23
23: ; preds = %22, %19
br label %24
24: ; preds = %23, %18
br label %25
25: ; preds = %24, %14
br label %26
26: ; preds = %25, %10
%27 = load i32, i32* %7
%28 = load i32, i32* %4
%29 = load i32, i32* %6
%30 = call i32 @GenPrintInstr2Operands(i32 %27, i32 0, i32 %28, i32 0, i32 62, i32 %29)
ret void
}

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