xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ s2e_kill_state(int /*<<< orphan*/, char const *);
void _s2e_assert(int b, const char *expression) {
  if (!b) {
    s2e_kill_state(0, expression);
  }
}


x86 assembly (clang, -O0):
<_s2e_assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1134 <_s2e_assert+0x24>
mov    -0x10(%rbp),%rsi
xor    %edi,%edi
call   1030 <s2e_kill_state@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_s2e_assert>:
test   %edi,%edi
je     1115 <_s2e_assert+0x5>
ret
xor    %edi,%edi
jmp    1030 <s2e_kill_state@plt>

LLVM IR (-O0):
define void @_s2e_assert(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = call i32 @s2e_kill_state(i32 0, i8* %8)
br label %10
10: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
define void @_s2e_assert(i32 %0, i8* %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @s2e_kill_state(i32 0, i8* %1)
br label %6
6: ; preds = %4, %2
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int same_screen;
};
typedef TYPE_1__ XButtonReleasedEvent;

/* Variables and functions */
void set_XButtonReleasedEvent_same_screen(void *_p, int _v) {
  ((XButtonReleasedEvent *)_p)->same_screen = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XButtonReleasedEvent_same_screen>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XButtonReleasedEvent_same_screen(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
short halfrandom(mv)
int mv;
{
  static short lasthalf = 0;
  unsigned long r;
  if (lasthalf) {
    r = lasthalf;
    lasthalf = 0;
  } else {
    r = random();
    lasthalf = r >> 16;
  }
  return r % mv;
}


x86 assembly (clang, -O0):
<halfrandom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpw   $0x0,0x2f07(%rip)
je     1143 <halfrandom+0x33>
movswq 0x2ef9(%rip),%rax
mov    %rax,-0x10(%rbp)
movw   $0x0,0x2eec(%rip)
jmp    115f <halfrandom+0x4f>
mov    $0x0,%al
call   1030 <random@plt>
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x10,%rax
mov    %ax,0x2ecb(%rip)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
xor    %edx,%edx
div    %rcx
mov    %dx,%ax
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<halfrandom>:
push   %rbx
mov    %edi,%ebx
movswq 0x2f0f(%rip),%rax
test   %rax,%rax
je     1124 <halfrandom+0x14>
xor    %ecx,%ecx
jmp    1132 <halfrandom+0x22>
xor    %eax,%eax
call   1030 <random@plt>
cltq
mov    %eax,%ecx
shr    $0x10,%ecx
mov    %cx,0x2ef1(%rip)
movslq %ebx,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
je     1152 <halfrandom+0x42>
xor    %edx,%edx
div    %rcx
mov    %rdx,%rax
pop    %rbx
ret
xor    %edx,%edx
div    %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@halfrandom.lasthalf = internal global i16 0
define signext i16 @halfrandom(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
%4 = load i16, i16* @halfrandom.lasthalf
%5 = icmp ne i16 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i16, i16* @halfrandom.lasthalf
%8 = sext i16 %7 to i64
store i64 %8, i64* %3
store i16 0, i16* @halfrandom.lasthalf
br label %15
9: ; preds = %1
%10 = call i32 (...) @random()
%11 = sext i32 %10 to i64
store i64 %11, i64* %3
%12 = load i64, i64* %3
%13 = lshr i64 %12, 16
%14 = trunc i64 %13 to i16
store i16 %14, i16* @halfrandom.lasthalf
br label %15
15: ; preds = %9, %6
%16 = load i64, i64* %3
%17 = load i32, i32* %2
%18 = sext i32 %17 to i64
%19 = urem i64 %16, %18
%20 = trunc i64 %19 to i16
ret i16 %20
}

LLVM IR (-O2):
@halfrandom.lasthalf = internal unnamed_addr global i16 0
define signext i16 @halfrandom(i32 %0) {
%2 = load i16, i16* @halfrandom.lasthalf
%3 = icmp eq i16 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = sext i16 %2 to i64
br label %11
6: ; preds = %1
%7 = tail call i32 (...) @random()
%8 = sext i32 %7 to i64
%9 = lshr i32 %7, 16
%10 = trunc i32 %9 to i16
br label %11
11: ; preds = %6, %4
%12 = phi i16 [ %10, %6 ], [ 0, %4 ]
%13 = phi i64 [ %8, %6 ], [ %5, %4 ]
store i16 %12, i16* @halfrandom.lasthalf
%14 = sext i32 %0 to i64
%15 = urem i64 %13, %14
%16 = trunc i64 %15 to i16
ret i16 %16
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0x60() {
  Assert_real((islower(96) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_islower.c",
              485, ("islower should be 0 for `"));
}


x86 assembly (clang, -O0):
<t_islower_0x60>:
push   %rbp
mov    %rsp,%rbp
mov    $0x60,%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x1e5,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_islower_0x60>:
push   %rax
mov    $0x60,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x1e5,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [26 x i8] c"islower should be 0 for `\00"
define void @t_islower_0x60() {
%1 = call i64 @islower(i32 96)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 485, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [26 x i8] c"islower should be 0 for `\00"
define void @t_islower_0x60() {
%1 = tail call i64 @islower(i32 96)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 485, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void menuFunc(int choice) { printf("choice = %d\n", choice); }


x86 assembly (clang, -O0):
<menuFunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<menuFunc>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [13 x i8] c"choice = %d\0A\00"
define void @menuFunc(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
char *GetRandomData(char *, int, char *);
char *GetRandomHexStr(char *RetBuff, int len) {
  return (GetRandomData(RetBuff, len, "0123456789ABCDEF"));
}


x86 assembly (clang, -O0):
<GetRandomHexStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    0xed3(%rip),%rdx
call   1030 <GetRandomData@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetRandomHexStr>:
lea    0xee9(%rip),%rdx
jmp    1030 <GetRandomData@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"0123456789ABCDEF\00"
define i8* @GetRandomHexStr(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i8* @GetRandomData(i8* %5, i32 %6, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i8* %7
}

LLVM IR (-O2):
@.str = [17 x i8] c"0123456789ABCDEF\00"
define i8* @GetRandomHexStr(i8* %0, i32 %1) {
%3 = tail call i8* @GetRandomData(i8* %0, i32 %1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}
/* Variables and functions */
int powl(long double, int);
long double j_invariant(long double a, long double b) {
  long double j =
      (1728 * ((4 * powl(a, 3)) / ((4 * powl(a, 3)) * (27 * powl(b, 2)))));
  return j;
}


x86 assembly (clang, -O0):
<j_invariant>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
mov    $0x3,%edi
mov    %edi,-0x40(%rbp)
call   1030 <powl@plt>
mov    -0x40(%rbp),%edi
shl    $0x2,%eax
mov    %eax,-0x38(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <powl@plt>
mov    %eax,-0x3c(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
mov    $0x2,%edi
call   1030 <powl@plt>
mov    -0x3c(%rbp),%edx
mov    %eax,%ecx
mov    -0x38(%rbp),%eax
imul   %edx,%ecx
imul   $0x6c,%ecx,%ecx
cltd
idiv   %ecx
imul   $0x6c0,%eax,%eax
mov    %eax,-0x34(%rbp)
fildl  -0x34(%rbp)
fstpt  -0x30(%rbp)
fldt   -0x30(%rbp)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<j_invariant>:
push   %rbp
push   %rbx
sub    $0x38,%rsp
fldt   0x60(%rsp)
fstpt  0x2c(%rsp)
fldt   0x50(%rsp)
fld    %st(0)
fstpt  0x20(%rsp)
fstpt  (%rsp)
mov    $0x3,%edi
call   1030 <powl@plt>
mov    %eax,%ebx
shl    $0x2,%ebx
fldt   0x20(%rsp)
fstpt  (%rsp)
mov    $0x3,%edi
call   1030 <powl@plt>
mov    %eax,%ebp
fldt   0x2c(%rsp)
fstpt  (%rsp)
mov    $0x2,%edi
call   1030 <powl@plt>
imul   %ebp,%eax
imul   $0x6c,%eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
imul   $0x6c0,%eax,%eax
mov    %eax,0x1c(%rsp)
fildl  0x1c(%rsp)
add    $0x38,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define x86_fp80 @j_invariant(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
%5 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%6 = load x86_fp80, x86_fp80* %3
%7 = call i32 @powl(x86_fp80 %6, i32 3)
%8 = mul nsw i32 4, %7
%9 = load x86_fp80, x86_fp80* %3
%10 = call i32 @powl(x86_fp80 %9, i32 3)
%11 = mul nsw i32 4, %10
%12 = load x86_fp80, x86_fp80* %4
%13 = call i32 @powl(x86_fp80 %12, i32 2)
%14 = mul nsw i32 27, %13
%15 = mul nsw i32 %11, %14
%16 = sdiv i32 %8, %15
%17 = mul nsw i32 1728, %16
%18 = sitofp i32 %17 to x86_fp80
store x86_fp80 %18, x86_fp80* %5
%19 = load x86_fp80, x86_fp80* %5
ret x86_fp80 %19
}

LLVM IR (-O2):
define x86_fp80 @j_invariant(x86_fp80 %0, x86_fp80 %1) {
%3 = tail call i32 @powl(x86_fp80 %0, i32 3)
%4 = shl nsw i32 %3, 2
%5 = tail call i32 @powl(x86_fp80 %0, i32 3)
%6 = tail call i32 @powl(x86_fp80 %1, i32 2)
%7 = mul i32 %5, 108
%8 = mul i32 %7, %6
%9 = sdiv i32 %4, %8
%10 = mul nsw i32 %9, 1728
%11 = sitofp i32 %10 to x86_fp80
ret x86_fp80 %11
}
/* Variables and functions */
int abs(int);
int isreach_king(int dx, int dy) { return abs(dx) <= 1 && abs(dy) <= 1; }


x86 assembly (clang, -O0):
<isreach_king>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
mov    %al,-0x9(%rbp)
jg     1147 <isreach_king+0x37>
mov    -0x8(%rbp),%edi
call   1030 <abs@plt>
cmp    $0x1,%eax
setle  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isreach_king>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
cmp    $0x2,%eax
setb   %al
mov    %esi,%ecx
neg    %ecx
cmovs  %esi,%ecx
cmp    $0x2,%ecx
setb   %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isreach_king(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 @abs(i32 %5)
%7 = icmp sle i32 %6, 1
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* %4
%10 = call i32 @abs(i32 %9)
%11 = icmp sle i32 %10, 1
br label %12
12: ; preds = %8, %2
%13 = phi i1 [ false, %2 ], [ %11, %8 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @isreach_king(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%4 = icmp ult i32 %3, 2
%5 = tail call i32 @llvm.abs.i32(i32 %1, i1 true)
%6 = icmp ult i32 %5, 2
%7 = select i1 %4, i1 %6, i1 false
%8 = zext i1 %7 to i32
ret i32 %8
}
int test_imm_06uint8_mem(unsigned char *val) {
  return ((*val) & (-0x06 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_06uint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0xfffffffa,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_06uint8_mem>:
testb  $0xfa,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_06uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, -6
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_06uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -6
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
#define SIGINT 128
int /*<<< orphan*/ exit_program(int /*<<< orphan*/);
void sig_handler(int signo) {
  switch (signo) {
  case SIGINT:
    exit_program(0);
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<sig_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x80,%eax
jne    1135 <sig_handler+0x25>
jmp    112e <sig_handler+0x1e>
xor    %edi,%edi
call   1030 <exit_program@plt>
jmp    113a <sig_handler+0x2a>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_handler>:
cmp    $0x80,%edi
jne    111f <sig_handler+0xf>
xor    %edi,%edi
jmp    1030 <exit_program@plt>
ret

LLVM IR (-O0):
define void @sig_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %6 [
i32 128, label %4
]
4: ; preds = %1
%5 = call i32 @exit_program(i32 0)
br label %6
6: ; preds = %1, %4
br label %7
7: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @sig_handler(i32 %0) {
%2 = icmp eq i32 %0, 128
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @exit_program(i32 0)
br label %5
5: ; preds = %3, %1
ret void
}
int yy_strlen(s) const char *s;
{
  int len = 0;
  while (s[len])
    ++len;
  return len;
}


x86 assembly (clang, -O0):
<yy_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     112f <yy_strlen+0x2f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <yy_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<yy_strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <yy_strlen+0x10>
ret

LLVM IR (-O0):
define i32 @yy_strlen(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %11, %1
%5 = load i8*, i8** %2
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = icmp ne i8 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %4
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
br label %4
14: ; preds = %4
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @yy_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ run_lmdb();
int /*<<< orphan*/ run_trlmdb();
int main(void) {
  run_trlmdb();
  run_lmdb();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <run_trlmdb@plt>
mov    $0x0,%al
call   1040 <run_lmdb@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <run_trlmdb@plt>
xor    %eax,%eax
call   1040 <run_lmdb@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @run_trlmdb()
%3 = call i32 (...) @run_lmdb()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @run_trlmdb()
%2 = tail call i32 (...) @run_lmdb()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ dumpme();
int main(void) {
  dumpme();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <dumpme@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <dumpme@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @dumpme()
ret i32 0
}
/* Variables and functions */
int yy_parse_line(char const *);
int interp_line(const char *str) { return yy_parse_line(str); }


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

x86 assembly (clang, -O2):
<interp_line>:
jmp    1030 <yy_parse_line@plt>

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

LLVM IR (-O2):
define i32 @interp_line(i8* %0) {
%2 = tail call i32 @yy_parse_line(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void teredo_close(int fd) { (void)close(fd); }


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

x86 assembly (clang, -O2):
<teredo_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @teredo_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ valid;
};
typedef int /*<<< orphan*/ ASN1_VALUE;
typedef TYPE_1__ ASN1_TLC;
typedef int /*<<< orphan*/ ASN1_TEMPLATE;

/* Variables and functions */
int asn1_template_ex_d2i(int /*<<< orphan*/ **, unsigned char **, long,
                         int /*<<< orphan*/ const *, int /*<<< orphan*/,
                         TYPE_1__ *);
int ASN1_template_d2i(ASN1_VALUE **pval, unsigned char **in, long len,
                      const ASN1_TEMPLATE *tt) {
  ASN1_TLC c;
  if (&c)
    (&c)->valid = 0;
  return asn1_template_ex_d2i(pval, in, len, tt, 0, &c);
}


x86 assembly (clang, -O0):
<ASN1_template_d2i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    -0x28(%rbp),%rax
cmp    $0x0,%rax
je     113e <ASN1_template_d2i+0x2e>
movq   $0x0,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
xor    %r8d,%r8d
lea    -0x28(%rbp),%r9
call   1030 <asn1_template_ex_d2i@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ASN1_template_d2i>:
push   %rax
movq   $0x0,(%rsp)
mov    %rsp,%r9
xor    %r8d,%r8d
call   1030 <asn1_template_ex_d2i@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i64 }
define i32 @ASN1_template_d2i(i32** %0, i8** %1, i64 %2, i32* %3) {
%5 = alloca i32**
%6 = alloca i8**
%7 = alloca i64
%8 = alloca i32*
%9 = alloca %struct.TYPE_3__
store i32** %0, i32*** %5
store i8** %1, i8*** %6
store i64 %2, i64* %7
store i32* %3, i32** %8
%10 = icmp ne %struct.TYPE_3__* %9, null
br i1 %10, label %11, label %13
11: ; preds = %4
%12 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %9, i32 0, i32 0
store i64 0, i64* %12
br label %13
13: ; preds = %11, %4
%14 = load i32**, i32*** %5
%15 = load i8**, i8*** %6
%16 = load i64, i64* %7
%17 = load i32*, i32** %8
%18 = call i32 @asn1_template_ex_d2i(i32** %14, i8** %15, i64 %16, i32* %17, i32 0, %struct.TYPE_3__* %9)
ret i32 %18
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i64 }
define i32 @ASN1_template_d2i(i32** %0, i8** %1, i64 %2, i32* %3) {
%5 = alloca %struct.TYPE_3__
%6 = bitcast %struct.TYPE_3__* %5 to i8*
%7 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i64 0, i32 0
store i64 0, i64* %7
%8 = call i32 @asn1_template_ex_d2i(i32** %0, i8** %1, i64 %2, i32* %3, i32 0, %struct.TYPE_3__* %5)
ret i32 %8
}
int f2(int x, int y) {
  if (x >= -0x7fffffff + 1)
    __builtin_unreachable();
  return x % -y;
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x80000002,-0x4(%rbp)
jl     1117 <f2+0x17>
mov    -0x4(%rbp),%eax
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
mov    %edi,%eax
neg    %esi
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @f2(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 = icmp sge i32 %5, -2147483646
br i1 %6, label %7, label %8
7: ; preds = %2
unreachable
8: ; preds = %2
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = sub nsw i32 0, %10
%12 = srem i32 %9, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @f2(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, -2147483646
tail call void @llvm.assume(i1 %3)
%4 = sub nsw i32 0, %1
%5 = srem i32 %0, %4
ret i32 %5
}
unsigned addval_110(unsigned x) { return x + 3286272456U; }


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

x86 assembly (clang, -O2):
<addval_110>:
lea    -0x3c1f7638(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @addval_110(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, -1008694840
ret i32 %4
}

LLVM IR (-O2):
define i32 @addval_110(i32 %0) {
%2 = add i32 %0, -1008694840
ret i32 %2
}
int get_time(void) {
  return *(volatile int *)(((0x10000000 + 0xA100000) + 0x3000) + 0x00);
}


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

x86 assembly (clang, -O2):
<get_time>:
mov    0x1a103000,%eax
ret

LLVM IR (-O0):
define i32 @get_time() {
%1 = load volatile i32, i32* inttoptr (i64 437268480 to i32*)
ret i32 %1
}

LLVM IR (-O2):
define i32 @get_time() {
%1 = load volatile i32, i32* inttoptr (i64 437268480 to i32*)
ret i32 %1
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void wm8(uint8_t a[1], uint8_t x) { a[0] = x >> 0; }


x86 assembly (clang, -O0):
<wm8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x0,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<wm8>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @wm8(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 = ashr i32 %5, 0
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 0
store i32 %6, i32* %8
ret void
}

LLVM IR (-O2):
define void @wm8(i32* nocapture writeonly %0, i32 %1) {
store i32 %1, i32* %0
ret void
}
long int fltoint(double fl) { return (long int)fl; }


x86 assembly (clang, -O0):
<fltoint>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fltoint>:
cvttsd2si %xmm0,%rax
ret

LLVM IR (-O0):
define i64 @fltoint(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fptosi double %3 to i64
ret i64 %4
}

LLVM IR (-O2):
define i64 @fltoint(double %0) {
%2 = fptosi double %0 to i64
ret i64 %2
}
/* Type definitions */
struct mstr {
  int dummy;
};

/* Variables and functions */
struct mstr *_mstr_init(struct mstr *, char *, size_t);
struct mstr *mstr_init(struct mstr *mstr, char *data, size_t len) {
  return _mstr_init(mstr, data, len);
}


x86 assembly (clang, -O0):
<mstr_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <_mstr_init@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mstr_init>:
jmp    1030 <_mstr_init@plt>

LLVM IR (-O0):
%struct.mstr = type { i32 }
define %struct.mstr* @mstr_init(%struct.mstr* %0, i8* %1, i64 %2) {
%4 = alloca %struct.mstr*
%5 = alloca i8*
%6 = alloca i64
store %struct.mstr* %0, %struct.mstr** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load %struct.mstr*, %struct.mstr** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call %struct.mstr* @_mstr_init(%struct.mstr* %7, i8* %8, i64 %9)
ret %struct.mstr* %10
}

LLVM IR (-O2):
%struct.mstr = type { i32 }
define %struct.mstr* @mstr_init(%struct.mstr* %0, i8* %1, i64 %2) {
%4 = tail call %struct.mstr* @_mstr_init(%struct.mstr* %0, i8* %1, i64 %2)
ret %struct.mstr* %4
}
/* Variables and functions */
int devrandomseed();
int /*<<< orphan*/ sgenrand(int);
int initmyrand(int seed) {
  if (seed < 0) {
    seed = devrandomseed();
  }
  sgenrand(seed);
  return seed;
}


x86 assembly (clang, -O0):
<initmyrand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    113f <initmyrand+0x1f>
mov    $0x0,%al
call   1040 <devrandomseed@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <sgenrand@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initmyrand>:
push   %rbx
mov    %edi,%ebx
test   %edi,%edi
jns    1130 <initmyrand+0x10>
xor    %eax,%eax
call   1040 <devrandomseed@plt>
mov    %eax,%ebx
mov    %ebx,%edi
call   1030 <sgenrand@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @initmyrand(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @devrandomseed()
br label %5
5: ; preds = %3, %1
%6 = phi i32 [ %4, %3 ], [ %0, %1 ]
%7 = tail call i32 @sgenrand(i32 %6)
ret i32 %6
}
int BitSize(int n) {
  register int i;
  for (i = 1; i <= 8; i++)
    if ((1 << i) >= n)
      break;
  return (i);
}


x86 assembly (clang, -O0):
<BitSize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jg     1143 <BitSize+0x43>
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
cmp    -0x4(%rbp),%eax
jl     1130 <BitSize+0x30>
jmp    1143 <BitSize+0x43>
jmp    1135 <BitSize+0x35>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <BitSize+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BitSize>:
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
cmp    $0x8,%ecx
ja     1123 <BitSize+0x23>
cmp    %edi,%eax
jl     1110 <BitSize+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @BitSize(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 1, %1 ], [ %8, %2 ]
%4 = icmp ult i32 %3, 9
%5 = shl nuw nsw i32 1, %3
%6 = icmp slt i32 %5, %0
%7 = select i1 %4, i1 %6, i1 false
%8 = add nuw nsw i32 %3, 1
br i1 %7, label %2, label %9
9: ; preds = %2
ret i32 %3
}
nonblank(s) char *s;
{
  int c;
  while (c = *s++)
    if (c != ' ' && c != '\t' && c != '\n')
      return (1);
  return (0);
}


x86 assembly (clang, -O0):
<nonblank>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     1155 <nonblank+0x55>
cmpl   $0x20,-0x14(%rbp)
je     1150 <nonblank+0x50>
cmpl   $0x9,-0x14(%rbp)
je     1150 <nonblank+0x50>
cmpl   $0xa,-0x14(%rbp)
je     1150 <nonblank+0x50>
movl   $0x1,-0x4(%rbp)
jmp    115c <nonblank+0x5c>
jmp    1108 <nonblank+0x8>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nonblank>:
mov    (%rdi),%dl
test   %dl,%dl
je     1139 <nonblank+0x39>
add    $0x1,%rdi
movabs $0x100000600,%rcx
mov    $0x1,%eax
nopl   0x0(%rax)
cmp    $0x20,%dl
ja     113b <nonblank+0x3b>
movzbl %dl,%edx
bt     %rdx,%rcx
jae    113b <nonblank+0x3b>
movzbl (%rdi),%edx
add    $0x1,%rdi
test   %dl,%dl
jne    1120 <nonblank+0x20>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @nonblank(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %8
%5 = phi i8 [ %9, %8 ], [ %2, %1 ]
%6 = phi i8* [ %7, %8 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
switch i8 %5, label %11 [
i8 32, label %8
i8 10, label %8
i8 9, label %8
]
8: ; preds = %4, %4, %4
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %8, %1
%12 = phi i32 [ 0, %1 ], [ 0, %8 ], [ 1, %4 ]
ret i32 %12
}
int func(x) { printf("called func\n"); }


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
lea    0xede(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"called func\0A\00"
define i32 @func(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
@str = [12 x i8] c"called func\00"
define i32 @func(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int lcal(int);
int dec(int a) { return lcal(a); }


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

x86 assembly (clang, -O2):
<dec>:
jmp    1030 <lcal@plt>

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

LLVM IR (-O2):
define i32 @dec(i32 %0) {
%2 = tail call i32 @lcal(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
int strlen(char *);
void print(char *string) {
  int size = strlen(string);
  int i;
  for (i = 0; i < size; i++) {
    putchar(string[i]);
  }
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    116a <print+0x4a>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <putchar@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113f <print+0x1f>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1040 <strlen@plt>
test   %eax,%eax
jle    1153 <print+0x33>
mov    %eax,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1140 <print+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @print(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
store i32 %6, i32* %3
store i32 0, i32* %4
br label %7
7: ; preds = %18, %1
%8 = load i32, i32* %4
%9 = load i32, i32* %3
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %21
11: ; preds = %7
%12 = load i8*, i8** %2
%13 = load i32, i32* %4
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8, i8* %15
%17 = call i32 @putchar(i8 signext %16)
br label %18
18: ; preds = %11
%19 = load i32, i32* %4
%20 = add nsw i32 %19, 1
store i32 %20, i32* %4
br label %7
21: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @print(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %13
4: ; preds = %1
%5 = zext i32 %2 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call i32 @putchar(i8 signext %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hash(char *);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char input[200];
  scanf("%s", input);
  printf("%ld", hash(input));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xd0(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1050 <scanf@plt>
lea    -0xd0(%rbp),%rdi
call   1030 <hash@plt>
mov    %eax,%esi
lea    0xe99(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xd0,%rsp
lea    0xec1(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1030 <hash@plt>
lea    0xeaa(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%ld\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [200 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%6 = call i32 @hash(i8* %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%ld\00"
define i32 @main() {
%1 = alloca [200 x i8]
%2 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @hash(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}
void foo(void) { asm volatile("movl $0,%%ebx" : : : "ebx"); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    $0x0,%ebx
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
mov    $0x0,%ebx
pop    %rbx
ret

LLVM IR (-O0):
define void @foo() {
ret void
}

LLVM IR (-O2):
define void @foo() {
tail call void asm sideeffect "movl $$0,%ebx", "~{ebx},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ test_rules_parser();
void rules_parser_test_suite(void) {
  test_rules_parser();
  printf("Finished  %s\n", "test_rules_parser");
  ;
}


x86 assembly (clang, -O0):
<rules_parser_test_suite>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <test_rules_parser@plt>
lea    0xece(%rip),%rdi
lea    0xed5(%rip),%rsi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rules_parser_test_suite>:
push   %rax
xor    %eax,%eax
call   1040 <test_rules_parser@plt>
lea    0xed1(%rip),%rdi
lea    0xed8(%rip),%rsi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"Finished %s\0A\00"
@.str.1 = [18 x i8] c"test_rules_parser\00"
define void @rules_parser_test_suite() {
%1 = call i32 (...) @test_rules_parser()
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"Finished %s\0A\00"
@.str.1 = [18 x i8] c"test_rules_parser\00"
define void @rules_parser_test_suite() {
%1 = tail call i32 (...) @test_rules_parser()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void GPMCPrefetchAccessCycleOptConfig(unsigned int baseAddr,
                                      unsigned int configVal) {
  (*((volatile unsigned int *)(baseAddr + (0x1E0 + ((1 - 1) * (0x4)))))) &=
      ~(0x08000000u);
  (*((volatile unsigned int *)(baseAddr + (0x1E0 + ((1 - 1) * (0x4)))))) |=
      ((configVal << (0x0000001Bu)) & (0x08000000u));
}


x86 assembly (clang, -O0):
<GPMCPrefetchAccessCycleOptConfig>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1e0,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xf7ffffff,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%edx
shl    $0x1b,%edx
and    $0x8000000,%edx
mov    -0x4(%rbp),%eax
add    $0x1e0,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPMCPrefetchAccessCycleOptConfig>:
add    $0x1e0,%edi
andl   $0xf7ffffff,(%rdi)
and    $0x1,%esi
shl    $0x1b,%esi
or     %esi,(%rdi)
ret

LLVM IR (-O0):
define void @GPMCPrefetchAccessCycleOptConfig(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 = add i32 %5, 480
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = and i32 %9, -134217729
store volatile i32 %10, i32* %8
%11 = load i32, i32* %4
%12 = shl i32 %11, 27
%13 = and i32 %12, 134217728
%14 = load i32, i32* %3
%15 = add i32 %14, 480
%16 = zext i32 %15 to i64
%17 = inttoptr i64 %16 to i32*
%18 = load volatile i32, i32* %17
%19 = or i32 %18, %13
store volatile i32 %19, i32* %17
ret void
}

LLVM IR (-O2):
define void @GPMCPrefetchAccessCycleOptConfig(i32 %0, i32 %1) {
%3 = add i32 %0, 480
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, -134217729
store volatile i32 %7, i32* %5
%8 = shl i32 %1, 27
%9 = and i32 %8, 134217728
%10 = load volatile i32, i32* %5
%11 = or i32 %10, %9
store volatile i32 %11, i32* %5
ret void
}
void prtCsvField(formfunc, val, leaveempty) void (*formfunc)();
int val, leaveempty;
{
  char buf[64];
  memset(buf, '\0', sizeof buf);
  if (!leaveempty)
    (*formfunc)(buf, val, leaveempty);
  prtCsvStr(buf, ',');
}


x86 assembly (clang, -O0):
<prtCsvField>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1030 <memset@plt>
cmpl   $0x0,-0x10(%rbp)
jne    115e <prtCsvField+0x3e>
mov    -0x8(%rbp),%rcx
lea    -0x50(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    $0x0,%al
call   *%rcx
lea    -0x50(%rbp),%rdi
mov    $0x2c,%esi
mov    $0x0,%al
call   1040 <prtCsvStr@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prtCsvField>:
sub    $0x48,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
test   %edx,%edx
jne    113a <prtCsvField+0x2a>
mov    %rdi,%rcx
mov    %rsp,%rdi
xor    %edx,%edx
xor    %eax,%eax
call   *%rcx
mov    %rsp,%rdi
mov    $0x2c,%esi
xor    %eax,%eax
call   1030 <prtCsvStr@plt>
add    $0x48,%rsp
ret

LLVM IR (-O0):
define void @prtCsvField(void (...)* %0, i32 %1, i32 %2) {
%4 = alloca void (...)*
%5 = alloca i32
%6 = alloca i32
%7 = alloca [64 x i8]
store void (...)* %0, void (...)** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = getelementptr inbounds [64 x i8], [64 x i8]* %7, i64 0, i64 0
%9 = load i32, i32* %6
%10 = icmp ne i32 %9, 0
br i1 %10, label %17, label %11
11: ; preds = %3
%12 = load void (...)*, void (...)** %4
%13 = getelementptr inbounds [64 x i8], [64 x i8]* %7, i64 0, i64 0
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = bitcast void (...)* %12 to void (i8*, i32, i32, ...)*
br label %17
17: ; preds = %11, %3
%18 = getelementptr inbounds [64 x i8], [64 x i8]* %7, i64 0, i64 0
%19 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @prtCsvStr to i32 (i8*, i32, ...)*)(i8* %18, i32 44)
ret void
}

LLVM IR (-O2):
define void @prtCsvField(void (...)* nocapture %0, i32 %1, i32 %2) {
%4 = alloca [64 x i8]
%5 = getelementptr inbounds [64 x i8], [64 x i8]* %4, i64 0, i64 0
%6 = icmp eq i32 %2, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = bitcast void (...)* %0 to void (i8*, i32, i32, ...)*
br label %9
9: ; preds = %7, %3
%10 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @prtCsvStr to i32 (i8*, i32, ...)*)(i8* %5, i32 44)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ depth_2();
__attribute__((always_)) void depth_3(void) { depth_2(); }


x86 assembly (clang, -O0):
<depth_3>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <depth_2@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<depth_3>:
xor    %eax,%eax
jmp    1030 <depth_2@plt>

LLVM IR (-O0):
define void @depth_3() {
%1 = call i32 (...) @depth_2()
ret void
}

LLVM IR (-O2):
define void @depth_3() {
%1 = tail call i32 (...) @depth_2()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGPIPE;
int /*<<< orphan*/ sig_default(int /*<<< orphan*/);
extern void sig_pipe_default(void) { sig_default(SIGPIPE); }


x86 assembly (clang, -O0):
<sig_pipe_default>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <sig_default@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_pipe_default>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <sig_default@plt>

LLVM IR (-O0):
@SIGPIPE = global i32 0
define void @sig_pipe_default() {
%1 = load i32, i32* @SIGPIPE
%2 = call i32 @sig_default(i32 %1)
ret void
}

LLVM IR (-O2):
@SIGPIPE = global i32 0
define void @sig_pipe_default() {
%1 = load i32, i32* @SIGPIPE
%2 = tail call i32 @sig_default(i32 %1)
ret void
}
int nanddrv_status_pass(unsigned char status) {
  return (status & (1 << 0)) == 0;
}


x86 assembly (clang, -O0):
<nanddrv_status_pass>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nanddrv_status_pass>:
not    %dil
and    $0x1,%dil
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @nanddrv_status_pass(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 1
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @nanddrv_status_pass(i8 zeroext %0) {
%2 = and i8 %0, 1
%3 = xor i8 %2, 1
%4 = zext i8 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ runAllTests_scan();
int main(void) {
  runAllTests_scan();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <runAllTests_scan@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <runAllTests_scan@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @runAllTests_scan()
ret i32 0
}
void swap(int *a, int *b) {
  int c = *a;
  *a = *b;
  *b = c;
}


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

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

LLVM IR (-O0):
define void @swap(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}