#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 GenWriteIdent(int regSrc, int opSz, int label) {
  int instr = 0x10;
  GenPreIdentAccess(label);
  if (opSz == -1 || opSz == 1) {
    instr = 0x0E;
  } else if (opSz == -2 || opSz == 2) {
    instr = 0x0F;
  }
  GenPrintInstr2Operands(instr, 0, regSrc, 0, 0x83, label);
  GenPostIdentAccess();
}


x86 assembly (clang, -O0):
<GenWriteIdent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x10,-0x10(%rbp)
mov    -0xc(%rbp),%edi
call   1050 <GenPreIdentAccess@plt>
cmpl   $0xffffffff,-0x8(%rbp)
je     1164 <GenWriteIdent+0x34>
cmpl   $0x1,-0x8(%rbp)
jne    1170 <GenWriteIdent+0x40>
movl   $0xe,-0x10(%rbp)
jmp    1190 <GenWriteIdent+0x60>
cmpl   $0xfffffffe,-0x8(%rbp)
je     1184 <GenWriteIdent+0x54>
cmpl   $0x2,-0x8(%rbp)
jne    118b <GenWriteIdent+0x5b>
movl   $0xf,-0x10(%rbp)
jmp    1190 <GenWriteIdent+0x60>
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):
<GenWriteIdent>:
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    $0x10,%edi
cmp    $0x4,%ebp
ja     115c <GenWriteIdent+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 @GenWriteIdent(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 16, 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 %15, label %12
12: ; preds = %3
%13 = load i32, i32* %5
%14 = icmp eq i32 %13, 1
br i1 %14, label %15, label %16
15: ; preds = %12, %3
store i32 14, i32* %7
br label %24
16: ; preds = %12
%17 = load i32, i32* %5
%18 = icmp eq i32 %17, -2
br i1 %18, label %22, label %19
19: ; preds = %16
%20 = load i32, i32* %5
%21 = icmp eq i32 %20, 2
br i1 %21, label %22, label %23
22: ; preds = %19, %16
store i32 15, i32* %7
br label %23
23: ; preds = %22, %19
br label %24
24: ; preds = %23, %15
%25 = load i32, i32* %7
%26 = load i32, i32* %4
%27 = load i32, i32* %6
%28 = call i32 @GenPrintInstr2Operands(i32 %25, i32 0, i32 %26, i32 0, i32 131, i32 %27)
%29 = call i32 (...) @GenPostIdentAccess()
ret void
}

LLVM IR (-O2):
@switch.table.GenWriteIdent = [5 x i32] [i32 15, i32 14, i32 16, i32 14, i32 15]
define void @GenWriteIdent(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.GenWriteIdent, i64 0, i64 %8
%10 = load i32, i32* %9
br label %11
11: ; preds = %3, %7
%12 = phi i32 [ %10, %7 ], [ 16, %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
}