xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ chr8setBank0(int);
int /*<<< orphan*/ ppuSetNameTblSingleLower();
int /*<<< orphan*/ ppuSetNameTblSingleUpper();
int /*<<< orphan*/ prg16setBank0(int);
void m152_setParams(uint16_t addr, uint8_t val) {
  (void)addr;
  prg16setBank0(((val >> 4) & 7) << 14);
  chr8setBank0((val & 0xF) << 13);
  if ((val & 0x80) == 0)
    ppuSetNameTblSingleLower();
  else
    ppuSetNameTblSingleUpper();
}


x86 assembly (clang, -O0):
<m152_setParams>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
sar    $0x4,%edi
and    $0x7,%edi
shl    $0xe,%edi
call   1040 <prg16setBank0@plt>
mov    -0x8(%rbp),%edi
and    $0xf,%edi
shl    $0xd,%edi
call   1060 <chr8setBank0@plt>
mov    -0x8(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
jne    118a <m152_setParams+0x4a>
mov    $0x0,%al
call   1050 <ppuSetNameTblSingleLower@plt>
jmp    1191 <m152_setParams+0x51>
mov    $0x0,%al
call   1030 <ppuSetNameTblSingleUpper@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m152_setParams>:
push   %rbx
mov    %esi,%ebx
mov    %esi,%edi
and    $0x70,%edi
shl    $0xa,%edi
call   1040 <prg16setBank0@plt>
mov    %ebx,%edi
and    $0xf,%edi
shl    $0xd,%edi
call   1060 <chr8setBank0@plt>
xor    %eax,%eax
test   $0x80,%bl
jne    116a <m152_setParams+0x2a>
pop    %rbx
jmp    1050 <ppuSetNameTblSingleLower@plt>
pop    %rbx
jmp    1030 <ppuSetNameTblSingleUpper@plt>

LLVM IR (-O0):
define void @m152_setParams(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = ashr i32 %6, 4
%8 = and i32 %7, 7
%9 = shl i32 %8, 14
%10 = call i32 @prg16setBank0(i32 %9)
%11 = load i32, i32* %4
%12 = and i32 %11, 15
%13 = shl i32 %12, 13
%14 = call i32 @chr8setBank0(i32 %13)
%15 = load i32, i32* %4
%16 = and i32 %15, 128
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %2
%19 = call i32 (...) @ppuSetNameTblSingleLower()
br label %22
20: ; preds = %2
%21 = call i32 (...) @ppuSetNameTblSingleUpper()
br label %22
22: ; preds = %20, %18
ret void
}

LLVM IR (-O2):
define void @m152_setParams(i32 %0, i32 %1) {
%3 = shl i32 %1, 10
%4 = and i32 %3, 114688
%5 = tail call i32 @prg16setBank0(i32 %4)
%6 = shl i32 %1, 13
%7 = and i32 %6, 122880
%8 = tail call i32 @chr8setBank0(i32 %7)
%9 = and i32 %1, 128
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = tail call i32 (...) @ppuSetNameTblSingleLower()
br label %15
13: ; preds = %2
%14 = tail call i32 (...) @ppuSetNameTblSingleUpper()
br label %15
15: ; preds = %13, %11
ret void
}
/* Variables and functions */
char *malloc(int);
int rand();
char *realloc(char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
char *fn43() {
  char *result;
  result = malloc(20 + rand() % 20);
  result = realloc(result, 30 + rand() % 20);
  strcpy((char *)result, "fn43");
  return result;
}


x86 assembly (clang, -O0):
<fn43>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
mov    -0x10(%rbp),%rdi
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
add    $0x1e,%esi
call   1050 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe67(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn43>:
push   %rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0x1e,%esi
mov    %rbx,%rdi
call   1050 <realloc@plt>
mov    %rax,%rbx
lea    0xe4f(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"fn43\00"
define i8* @fn43() {
%1 = alloca i8*
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 20
%4 = add nsw i32 20, %3
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %1
%6 = load i8*, i8** %1
%7 = call i32 (...) @rand()
%8 = srem i32 %7, 20
%9 = add nsw i32 30, %8
%10 = call i8* @realloc(i8* %6, i32 %9)
store i8* %10, i8** %1
%11 = load i8*, i8** %1
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%13 = load i8*, i8** %1
ret i8* %13
}

LLVM IR (-O2):
@.str = [5 x i8] c"fn43\00"
define i8* @fn43() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 20
%3 = add nsw i32 %2, 20
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, 20
%7 = add nsw i32 %6, 30
%8 = tail call i8* @realloc(i8* %4, i32 %7)
%9 = tail call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %8
}
INSTR(CLRMAC) {
  STORE_MACH_IMM_I32(0);
  STORE_MACL_IMM_I32(0);
  NEXT_INSTR();
}


x86 assembly (clang, -O0):
<INSTR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
xor    %edi,%edi
mov    $0x0,%al
call   1030 <STORE_MACH_IMM_I32@plt>
xor    %edi,%edi
mov    $0x0,%al
call   1040 <STORE_MACL_IMM_I32@plt>
mov    $0x0,%al
call   1050 <NEXT_INSTR@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<INSTR>:
push   %rax
xor    %edi,%edi
xor    %eax,%eax
call   1030 <STORE_MACH_IMM_I32@plt>
xor    %edi,%edi
xor    %eax,%eax
call   1040 <STORE_MACL_IMM_I32@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <NEXT_INSTR@plt>

LLVM IR (-O0):
define i32 @INSTR(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (i32, ...) bitcast (i32 (...)* @STORE_MACH_IMM_I32 to i32 (i32, ...)*)(i32 0)
%5 = call i32 (i32, ...) bitcast (i32 (...)* @STORE_MACL_IMM_I32 to i32 (i32, ...)*)(i32 0)
%6 = call i32 (...) @NEXT_INSTR()
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
define i32 @INSTR(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @STORE_MACH_IMM_I32 to i32 (i32, ...)*)(i32 0)
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @STORE_MACL_IMM_I32 to i32 (i32, ...)*)(i32 0)
%4 = tail call i32 (...) @NEXT_INSTR()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ Rf_error(char *);
void R_assert(int expr) {
  if (expr == 0)
    Rf_error("internal allocation error in TRE");
}


x86 assembly (clang, -O0):
<R_assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1131 <R_assert+0x21>
lea    0xed4(%rip),%rdi
call   1030 <Rf_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<R_assert>:
test   %edi,%edi
je     1115 <R_assert+0x5>
ret
lea    0xee4(%rip),%rdi
jmp    1030 <Rf_error@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"internal allocation error in TRE\00"
define void @R_assert(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @Rf_error(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"internal allocation error in TRE\00"
define void @R_assert(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @Rf_error(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int floorf(float);
int __attribute__((always_)) fast_floorf(float x) { return floorf(x); }


x86 assembly (clang, -O0):
<fast_floorf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <floorf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fast_floorf>:
jmp    1030 <floorf@plt>

LLVM IR (-O0):
define i32 @fast_floorf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i32 @floorf(float %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @fast_floorf(float %0) {
%2 = tail call i32 @floorf(float %0)
ret i32 %2
}
int my_lower(int c) {
  if (c >= 'A' && c <= 'Z')
    return c + 'a' - 'A';
  else
    return c;
}


x86 assembly (clang, -O0):
<my_lower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x41,-0x8(%rbp)
jl     112c <my_lower+0x2c>
cmpl   $0x5a,-0x8(%rbp)
jg     112c <my_lower+0x2c>
mov    -0x8(%rbp),%eax
add    $0x61,%eax
sub    $0x41,%eax
mov    %eax,-0x4(%rbp)
jmp    1132 <my_lower+0x32>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_lower>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @my_lower(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 90
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 97
%12 = sub nsw i32 %11, 65
store i32 %12, i32* %2
br label %15
13: ; preds = %6, %1
%14 = load i32, i32* %3
store i32 %14, i32* %2
br label %15
15: ; preds = %13, %9
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @my_lower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
long blargg_min(long x, long y) {
  if (y < x)
    x = y;
  return x;
}


x86 assembly (clang, -O0):
<blargg_min>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jge    1122 <blargg_min+0x22>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<blargg_min>:
mov    %rdi,%rax
cmp    %rdi,%rsi
cmovl  %rsi,%rax
ret

LLVM IR (-O0):
define i64 @blargg_min(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = icmp slt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %4
store i64 %9, i64* %3
br label %10
10: ; preds = %8, %2
%11 = load i64, i64* %3
ret i64 %11
}

LLVM IR (-O2):
define i64 @blargg_min(i64 %0, i64 %1) {
%3 = icmp slt i64 %1, %0
%4 = select i1 %3, i64 %1, i64 %0
ret i64 %4
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned long drawable;
};
struct TYPE_4__ {
  TYPE_1__ xgraphicsexpose;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xgraphicsexpose_drawable(void *_p, unsigned long _v) {
  ((XEvent *)_p)->xgraphicsexpose.drawable = (unsigned long)_v;
}


x86 assembly (clang, -O0):
<set_XEvent_xgraphicsexpose_drawable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XEvent_xgraphicsexpose_drawable>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define void @set_XEvent_xgraphicsexpose_drawable(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i64 %5, i64* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xgraphicsexpose_drawable(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Type definitions */
struct oplist {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct oplist *);
void opl_free(struct oplist *o) { free(o); }


x86 assembly (clang, -O0):
<opl_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opl_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.oplist = type { i32 }
define void @opl_free(%struct.oplist* %0) {
%2 = alloca %struct.oplist*
store %struct.oplist* %0, %struct.oplist** %2
%3 = load %struct.oplist*, %struct.oplist** %2
%4 = call i32 @free(%struct.oplist* %3)
ret void
}

LLVM IR (-O2):
%struct.oplist = type { i32 }
define void @opl_free(%struct.oplist* nocapture %0) {
%2 = tail call i32 @free(%struct.oplist* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fread(unsigned char *, size_t, int, int /*<<< orphan*/ *);
int snapshot_read_byte_array(FILE *f, unsigned char *b_return,
                             unsigned int num) {
  if (num > 0 && fread(b_return, (size_t)num, 1, f) < 1)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<snapshot_read_byte_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jbe    1159 <snapshot_read_byte_array+0x49>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%eax
mov    %eax,%esi
mov    -0x10(%rbp),%rcx
mov    $0x1,%edx
call   1030 <fread@plt>
cmp    $0x1,%eax
jge    1159 <snapshot_read_byte_array+0x49>
movl   $0xffffffff,-0x4(%rbp)
jmp    1160 <snapshot_read_byte_array+0x50>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<snapshot_read_byte_array>:
test   %edx,%edx
je     1133 <snapshot_read_byte_array+0x23>
push   %rax
mov    %rdi,%rcx
mov    %edx,%eax
mov    %rsi,%rdi
mov    %rax,%rsi
mov    $0x1,%edx
call   1030 <fread@plt>
test   %eax,%eax
lea    0x8(%rsp),%rsp
jle    1136 <snapshot_read_byte_array+0x26>
xor    %eax,%eax
ret
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @snapshot_read_byte_array(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i32
store i32* %0, i32** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%8 = load i32, i32* %7
%9 = icmp ugt i32 %8, 0
br i1 %9, label %10, label %18
10: ; preds = %3
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = zext i32 %12 to i64
%14 = load i32*, i32** %5
%15 = call i32 @fread(i8* %11, i64 %13, i32 1, i32* %14)
%16 = icmp slt i32 %15, 1
br i1 %16, label %17, label %18
17: ; preds = %10
store i32 -1, i32* %4
br label %19
18: ; preds = %10, %3
store i32 0, i32* %4
br label %19
19: ; preds = %18, %17
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
define i32 @snapshot_read_byte_array(i32* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %9, label %5
5: ; preds = %3
%6 = zext i32 %2 to i64
%7 = tail call i32 @fread(i8* %1, i64 %6, i32 1, i32* %0)
%8 = icmp slt i32 %7, 1
br i1 %8, label %10, label %9
9: ; preds = %5, %3
br label %10
10: ; preds = %5, %9
%11 = phi i32 [ 0, %9 ], [ -1, %5 ]
ret i32 %11
}
/* Type definitions */
struct tipc_msg {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ msg_set_bits(struct tipc_msg *, int, int, int,
                                int /*<<< orphan*/);
void msg_reset_reroute_cnt(struct tipc_msg *m) {
  msg_set_bits(m, 1, 21, 0xf, 0);
}


x86 assembly (clang, -O0):
<msg_reset_reroute_cnt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
mov    $0x15,%edx
mov    $0xf,%ecx
xor    %r8d,%r8d
call   1030 <msg_set_bits@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msg_reset_reroute_cnt>:
mov    $0x1,%esi
mov    $0x15,%edx
mov    $0xf,%ecx
xor    %r8d,%r8d
jmp    1030 <msg_set_bits@plt>

LLVM IR (-O0):
%struct.tipc_msg = type { i32 }
define void @msg_reset_reroute_cnt(%struct.tipc_msg* %0) {
%2 = alloca %struct.tipc_msg*
store %struct.tipc_msg* %0, %struct.tipc_msg** %2
%3 = load %struct.tipc_msg*, %struct.tipc_msg** %2
%4 = call i32 @msg_set_bits(%struct.tipc_msg* %3, i32 1, i32 21, i32 15, i32 0)
ret void
}

LLVM IR (-O2):
%struct.tipc_msg = type { i32 }
define void @msg_reset_reroute_cnt(%struct.tipc_msg* %0) {
%2 = tail call i32 @msg_set_bits(%struct.tipc_msg* %0, i32 1, i32 21, i32 15, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ plcvm_get_s8(scalar_t__);
scalar_t__ plcvm_lpm_u16();
int plcvm_pop();
int /*<<< orphan*/ plcvm_push(int /*<<< orphan*/);
void cb_ldm_s1_cs16(void) {
  plcvm_push(plcvm_get_s8(plcvm_pop() * 4 + plcvm_lpm_u16()));
}


x86 assembly (clang, -O0):
<cb_ldm_s1_cs16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <plcvm_pop@plt>
shl    $0x2,%eax
cltq
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <plcvm_lpm_u16@plt>
mov    -0x8(%rbp),%rdi
add    %rax,%rdi
call   1060 <plcvm_get_s8@plt>
mov    %eax,%edi
call   1050 <plcvm_push@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cb_ldm_s1_cs16>:
push   %rbx
xor    %eax,%eax
call   1030 <plcvm_pop@plt>
shl    $0x2,%eax
movslq %eax,%rbx
xor    %eax,%eax
call   1040 <plcvm_lpm_u16@plt>
add    %rax,%rbx
mov    %rbx,%rdi
call   1060 <plcvm_get_s8@plt>
mov    %eax,%edi
pop    %rbx
jmp    1050 <plcvm_push@plt>

LLVM IR (-O0):
define void @cb_ldm_s1_cs16() {
%1 = call i32 (...) @plcvm_pop()
%2 = mul nsw i32 %1, 4
%3 = sext i32 %2 to i64
%4 = call i64 (...) @plcvm_lpm_u16()
%5 = add nsw i64 %3, %4
%6 = call i32 @plcvm_get_s8(i64 %5)
%7 = call i32 @plcvm_push(i32 %6)
ret void
}

LLVM IR (-O2):
define void @cb_ldm_s1_cs16() {
%1 = tail call i32 (...) @plcvm_pop()
%2 = shl nsw i32 %1, 2
%3 = sext i32 %2 to i64
%4 = tail call i64 (...) @plcvm_lpm_u16()
%5 = add nsw i64 %4, %3
%6 = tail call i32 @plcvm_get_s8(i64 %5)
%7 = tail call i32 @plcvm_push(i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void showVec(int *x) {
  for (int i = 0; i < 10000000; i++)
    printf("%d ", x[i]);
}


x86 assembly (clang, -O0):
<showVec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x989680,-0xc(%rbp)
jge    1155 <showVec+0x45>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <showVec+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<showVec>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
xor    %ebx,%ebx
lea    0xedf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    $0x989680,%rbx
jne    1130 <showVec+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
define void @showVec(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
br label %4
4: ; preds = %14, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 10000000
br i1 %6, label %7, label %17
7: ; preds = %4
%8 = load i32*, i32** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
br label %14
14: ; preds = %7
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %4
17: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @showVec(i32* nocapture %0) {
br label %3
2: ; preds = %3
ret void
3: ; preds = %1, %3
%4 = phi i64 [ 0, %1 ], [ %8, %3 ]
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = add nuw nsw i64 %4, 1
%9 = icmp eq i64 %8, 10000000
br i1 %9, label %2, label %3
}
int fun202() { return 202; }


x86 assembly (clang, -O0):
<fun202>:
push   %rbp
mov    %rsp,%rbp
mov    $0xca,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun202>:
mov    $0xca,%eax
ret

LLVM IR (-O0):
define i32 @fun202() {
ret i32 202
}

LLVM IR (-O2):
define i32 @fun202() {
ret i32 202
}
const void *HT_GetKey(const void *Entry) { return Entry; }


x86 assembly (clang, -O0):
<HT_GetKey>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<HT_GetKey>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i8* @HT_GetKey(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
ret i8* %3
}

LLVM IR (-O2):
define i8* @HT_GetKey(i8* readnone returned %0) {
ret i8* %0
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
int cmp_int2(const void *p1, const void *p2) {
  int64_t v1 = *(int64_t *)p1;
  int64_t v2 = *(int64_t *)p2;
  if (v1 < v2)
    return -1;
  else if (v1 == v2)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<cmp_int2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jge    113c <cmp_int2+0x3c>
movl   $0xffffffff,-0x4(%rbp)
jmp    115d <cmp_int2+0x5d>
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jne    1156 <cmp_int2+0x56>
movl   $0x0,-0x4(%rbp)
jmp    115d <cmp_int2+0x5d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_int2>:
mov    (%rdi),%rax
xor    %ecx,%ecx
cmp    (%rsi),%rax
setne  %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cmp_int2(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i64*
%10 = load i64, i64* %9
store i64 %10, i64* %6
%11 = load i8*, i8** %5
%12 = bitcast i8* %11 to i64*
%13 = load i64, i64* %12
store i64 %13, i64* %7
%14 = load i64, i64* %6
%15 = load i64, i64* %7
%16 = icmp slt i64 %14, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 -1, i32* %3
br label %24
18: ; preds = %2
%19 = load i64, i64* %6
%20 = load i64, i64* %7
%21 = icmp eq i64 %19, %20
br i1 %21, label %22, label %23
22: ; preds = %18
store i32 0, i32* %3
br label %24
23: ; preds = %18
store i32 1, i32* %3
br label %24
24: ; preds = %23, %22, %17
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @cmp_int2(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp slt i64 %4, %6
%8 = icmp ne i64 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;

/* Variables and functions */
__attribute__((always_)) void BME_XOR_B(volatile uint8_t *addr,
                                        register uint8_t wdata) {
  *(volatile uint8_t *)((uint32_t)addr | (3 << 26)) = wdata;
}


x86 assembly (clang, -O0):
<BME_XOR_B>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
or     $0xc000000,%eax
cltq
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<BME_XOR_B>:
movslq %edi,%rax
or     $0xc000000,%rax
mov    %esi,(%rax)
ret

LLVM IR (-O0):
define void @BME_XOR_B(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32*, i32** %3
%7 = ptrtoint i32* %6 to i32
%8 = or i32 %7, 201326592
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
store volatile i32 %5, i32* %10
ret void
}

LLVM IR (-O2):
define void @BME_XOR_B(i32* %0, i32 %1) {
%3 = ptrtoint i32* %0 to i64
%4 = shl i64 %3, 32
%5 = ashr exact i64 %4, 32
%6 = or i64 %5, 201326592
%7 = inttoptr i64 %6 to i32*
store volatile i32 %1, i32* %7
ret void
}
int DL_fix_equivalences(const int nrval) { return 1; }


x86 assembly (clang, -O0):
<DL_fix_equivalences>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<DL_fix_equivalences>:
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @DL_fix_equivalences(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i32 1
}

LLVM IR (-O2):
define i32 @DL_fix_equivalences(i32 %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ *getenv(char *);
int have_decent_term(void) { return getenv("TERM") != NULL; }


x86 assembly (clang, -O0):
<have_decent_term>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <getenv@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<have_decent_term>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <getenv@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"TERM\00"
define i32 @have_decent_term() {
%1 = call i32* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = icmp ne i32* %1, null
%3 = zext i1 %2 to i32
ret i32 %3
}

LLVM IR (-O2):
@.str = [5 x i8] c"TERM\00"
define i32 @have_decent_term() {
%1 = tail call i32* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = icmp ne i32* %1, null
%3 = zext i1 %2 to i32
ret i32 %3
}
int BlowFish_keyLen(void) { return 448; }


x86 assembly (clang, -O0):
<BlowFish_keyLen>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1c0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BlowFish_keyLen>:
mov    $0x1c0,%eax
ret

LLVM IR (-O0):
define i32 @BlowFish_keyLen() {
ret i32 448
}

LLVM IR (-O2):
define i32 @BlowFish_keyLen() {
ret i32 448
}
/* Variables and functions */
int strlen(char *);
int sMul(char *opt) {
  int l = strlen(opt) * 12;
  return l;
}


x86 assembly (clang, -O0):
<sMul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
imul   $0xc,%eax,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sMul>:
push   %rax
call   1030 <strlen@plt>
shl    $0x2,%eax
lea    (%rax,%rax,2),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @sMul(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = mul nsw i32 %5, 12
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @sMul(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = mul nsw i32 %2, 12
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ klogctl(int, int /*<<< orphan*/ *, int /*<<< orphan*/);
void close_klog(void *arg) {
  (void)klogctl(7, NULL, 0);
  (void)klogctl(0, NULL, 0);
}


x86 assembly (clang, -O0):
<close_klog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x7,%edi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1030 <klogctl@plt>
xor    %edx,%edx
xor    %eax,%eax
mov    %eax,%esi
mov    %edx,%edi
call   1030 <klogctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_klog>:
push   %rax
mov    $0x7,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <klogctl@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
pop    %rax
jmp    1030 <klogctl@plt>

LLVM IR (-O0):
define void @close_klog(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @klogctl(i32 7, i32* null, i32 0)
%4 = call i32 @klogctl(i32 0, i32* null, i32 0)
ret void
}

LLVM IR (-O2):
define void @close_klog(i8* nocapture readnone %0) {
%2 = tail call i32 @klogctl(i32 7, i32* null, i32 0)
%3 = tail call i32 @klogctl(i32 0, i32* null, i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t s500_readl(volatile uint32_t *addr) {
  uint32_t val = 0;
  val = *addr;
  return val;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @s500_readl(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
%4 = load i32*, i32** %2
%5 = load volatile i32, i32* %4
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @s500_readl(i32* %0) {
%2 = load volatile i32, i32* %0
ret i32 %2
}
/* Variables and functions */
char const *iamalsoareffunc(char);
__attribute__((no, cold)) const char *ialsohaveareffunc(char opt) {
  return iamalsoareffunc(opt + 1);
}


x86 assembly (clang, -O0):
<ialsohaveareffunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x1,%eax
movsbl %al,%edi
call   1030 <iamalsoareffunc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ialsohaveareffunc>:
inc    %dil
movsbl %dil,%edi
jmp    1030 <iamalsoareffunc@plt>
nopl   0x0(%rax)

LLVM IR (-O0):
define i8* @ialsohaveareffunc(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = add nsw i32 %4, 1
%6 = trunc i32 %5 to i8
%7 = call i8* @iamalsoareffunc(i8 signext %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @ialsohaveareffunc(i8 signext %0) {
%2 = add i8 %0, 1
%3 = tail call i8* @iamalsoareffunc(i8 signext %2)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/, char *, int);
void memcpy10() {
  char a[4] = {0};
  memcpy(0, a, 4);
}


x86 assembly (clang, -O0):
<memcpy10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
lea    -0x4(%rbp),%rsi
xor    %edi,%edi
mov    $0x4,%edx
call   1040 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memcpy10>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rsi
xor    %edi,%edi
mov    $0x4,%edx
call   1030 <memcpy@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @memcpy10() {
%1 = alloca [4 x i8]
%2 = bitcast [4 x i8]* %1 to i8*
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%4 = call i32 @memcpy(i32 0, i8* %3, i32 4)
ret void
}

LLVM IR (-O2):
define void @memcpy10() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @memcpy(i32 0, i8* %2, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TIOCSPTLCK;
int errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
scalar_t__ ioctl(int, int /*<<< orphan*/, int *);
int /*<<< orphan*/ stderr;
int my_unlockpt(int ptm) {
  int unlock;
  unlock = 0;
  if (ioctl(ptm, TIOCSPTLCK, &unlock)) {
    fprintf(stderr, "Error %d: ioctl() failure\n", errno);
    return (-1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<my_unlockpt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2e9c(%rip),%rax
mov    (%rax),%esi
lea    -0xc(%rbp),%rdx
call   1030 <ioctl@plt>
cmp    $0x0,%rax
je     117b <my_unlockpt+0x5b>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
mov    0x2e6f(%rip),%rax
mov    (%rax),%edx
lea    0xe96(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1182 <my_unlockpt+0x62>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_unlockpt>:
push   %rax
movl   $0x0,0x4(%rsp)
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdx
call   1030 <ioctl@plt>
test   %rax,%rax
je     1166 <my_unlockpt+0x46>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
mov    0x2e7f(%rip),%rax
mov    (%rax),%edx
lea    0xea6(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@TIOCSPTLCK = global i32 0
@stderr = global i32 0
@.str = [27 x i8] c"Error %d: ioctl() failure\0A\00"
@errno = global i32 0
define i32 @my_unlockpt(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 0, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* @TIOCSPTLCK
%7 = call i64 @ioctl(i32 %5, i32 %6, i32* %4)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i32, i32* @stderr
%11 = load i32, i32* @errno
%12 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %11)
store i32 -1, i32* %2
br label %14
13: ; preds = %1
store i32 0, i32* %2
br label %14
14: ; preds = %13, %9
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@TIOCSPTLCK = global i32 0
@stderr = global i32 0
@.str = [27 x i8] c"Error %d: ioctl() failure\0A\00"
@errno = global i32 0
define i32 @my_unlockpt(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = load i32, i32* @TIOCSPTLCK
%5 = call i64 @ioctl(i32 %0, i32 %4, i32* %2)
%6 = icmp eq i64 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = load i32, i32* @errno
%10 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %1, %7
%12 = phi i32 [ -1, %7 ], [ 0, %1 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", 203);
  printf("%d\n", 204);
  printf("%d\n", 205);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0xcb,%esi
call   1030 <printf@plt>
lea    0xec9(%rip),%rdi
mov    $0xcc,%esi
call   1030 <printf@plt>
lea    0xeb8(%rip),%rdi
mov    $0xcd,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0xcb,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xcc,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xcd,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 203)
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 204)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 205)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 203)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 204)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 205)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void show_welcome() {
  printf("\nTeenage Mutant Ninja Shell v 1.0.0\nTo escape type 'quit' and hit "
         "return.\n\n");
}


x86 assembly (clang, -O0):
<show_welcome>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_welcome>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [76 x i8] c"\0ATeenage Mutant Ninja Shell v 1.0.0\0ATo escape type 'quit' and hit return.\0A\0A\00"
define void @show_welcome() {
%1 = call i32 @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [75 x i8] c"\0ATeenage Mutant Ninja Shell v 1.0.0\0ATo escape type 'quit' and hit return.\0A\00"
define void @show_welcome() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([75 x i8], [75 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void html_before() { printf("<ul>\n"); }


x86 assembly (clang, -O0):
<html_before>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<html_before>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"<ul>\0A\00"
define void @html_before() {
%1 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [5 x i8] c"<ul>\00"
define void @html_before() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret void
}
int strlen_zero(const char *s) { return (!s || (*s == '\0')); }


x86 assembly (clang, -O0):
<strlen_zero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%al
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1128 <strlen_zero+0x28>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen_zero>:
test   %rdi,%rdi
je     110e <strlen_zero+0xe>
xor    %eax,%eax
cmpb   $0x0,(%rdi)
sete   %al
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @strlen_zero(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 0
br label %10
10: ; preds = %5, %1
%11 = phi i1 [ true, %1 ], [ %9, %5 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @strlen_zero(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 1, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printnum(int);
int e(int x, int y) {
  printnum(x);
  return x;
}


x86 assembly (clang, -O0):
<e>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <printnum@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<e>:
push   %rbx
mov    %edi,%ebx
call   1030 <printnum@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @e(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call i32 @printnum(i32 %5)
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @e(i32 returned %0, i32 %1) {
%3 = tail call i32 @printnum(i32 %0)
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_post_solib();
int /*<<< orphan*/ test_pre_solib();
int /*<<< orphan*/ test_solib();
int main(int argc, char *argv[]) {
  printf("This is a \"bin\" target.\n");
  test_pre_solib();
  test_solib();
  test_post_solib();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <test_pre_solib@plt>
mov    $0x0,%al
call   1050 <test_solib@plt>
mov    $0x0,%al
call   1060 <test_post_solib@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <test_pre_solib@plt>
xor    %eax,%eax
call   1050 <test_solib@plt>
xor    %eax,%eax
call   1060 <test_post_solib@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"This is a \22bin\22 target.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @test_pre_solib()
%8 = call i32 (...) @test_solib()
%9 = call i32 (...) @test_post_solib()
ret i32 0
}

LLVM IR (-O2):
@str = [24 x i8] c"This is a \22bin\22 target.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @test_pre_solib()
%5 = tail call i32 (...) @test_solib()
%6 = tail call i32 (...) @test_post_solib()
ret i32 0
}
int f_gt_cr1(float a1) { return (((100) > (a1))); }


x86 assembly (clang, -O0):
<f_gt_cr1>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
ucomiss -0x4(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_gt_cr1>:
movss  0xef8(%rip),%xmm1
xor    %eax,%eax
ucomiss %xmm0,%xmm1
seta   %al
ret

LLVM IR (-O0):
define i32 @f_gt_cr1(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp ogt float 1.000000e+02, %3
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @f_gt_cr1(float %0) {
%2 = fcmp olt float %0, 1.000000e+02
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, char *, int, int);
void file_err(void *context, const char *error, int line_num, int char_pos) {
  printf("error %s at file %s %d:%d", error, (char *)context, line_num,
         char_pos);
}


x86 assembly (clang, -O0):
<file_err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_err>:
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %rdi,%rdx
lea    0xee1(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"error %s at file %s %d:%d\00"
define void @file_err(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i8*, i8** %6
%10 = load i8*, i8** %5
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10, i32 %11, i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"error %s at file %s %d:%d\00"
define void @file_err(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %0, i32 %2, i32 %3)
ret void
}
int add(int n1, int n2) { return n1 + n2; }


x86 assembly (clang, -O0):
<add>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<add>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @add(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @add(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
int share__getopt_long(argc, argv, options, long_options, opt_index)
int argc;
char *const *argv;
const char *options;
const struct share__option *long_options;
int *opt_index;
{
  return share___getopt_internal(argc, argv, options, long_options, opt_index,
                                 0);
}


x86 assembly (clang, -O0):
<share__getopt_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
xor    %r9d,%r9d
mov    $0x0,%al
call   1030 <share___getopt_internal@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<share__getopt_long>:
xor    %r9d,%r9d
xor    %eax,%eax
jmp    1030 <share___getopt_internal@plt>

LLVM IR (-O0):
%struct.share__option = type opaque
define i32 @share__getopt_long(i32 %0, i8** %1, i8* %2, %struct.share__option* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i8*
%9 = alloca %struct.share__option*
%10 = alloca i32*
store i32 %0, i32* %6
store i8** %1, i8*** %7
store i8* %2, i8** %8
store %struct.share__option* %3, %struct.share__option** %9
store i32* %4, i32** %10
%11 = load i32, i32* %6
%12 = load i8**, i8*** %7
%13 = load i8*, i8** %8
%14 = load %struct.share__option*, %struct.share__option** %9
%15 = load i32*, i32** %10
%16 = call i32 (i32, i8**, i8*, %struct.share__option*, i32*, i32, ...) bitcast (i32 (...)* @share___getopt_internal to i32 (i32, i8**, i8*, %struct.share__option*, i32*, i32, ...)*)(i32 %11, i8** %12, i8* %13, %struct.share__option* %14, i32* %15, i32 0)
ret i32 %16
}

LLVM IR (-O2):
%struct.share__option = type opaque
define i32 @share__getopt_long(i32 %0, i8** %1, i8* %2, %struct.share__option* %3, i32* %4) {
%6 = tail call i32 (i32, i8**, i8*, %struct.share__option*, i32*, i32, ...) bitcast (i32 (...)* @share___getopt_internal to i32 (i32, i8**, i8*, %struct.share__option*, i32*, i32, ...)*)(i32 %0, i8** %1, i8* %2, %struct.share__option* %3, i32* %4, i32 0)
ret i32 %6
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, char const *);
int startAgent(const char *configFile) {
  printf("starting agent process %s\n", configFile);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<startAgent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ead(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<startAgent>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eb9(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"starting agent process %s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @startAgent(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}

LLVM IR (-O2):
@.str = [27 x i8] c"starting agent process %s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @startAgent(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}