xunge/DecIR huggingface dataset:
int GCD(int x, int y) {
  if (x % y == 0)
    return y;
  else
    return GCD(y % y, x % y);
}


x86 assembly (clang, -O0):
<GCD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1139 <GCD+0x29>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <GCD+0x43>
mov    -0xc(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%edi
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%esi
call   1030 <GCD@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @GCD(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 %1, i32 %3
ret i32 %5
}
int test5(int x) { return x / -10 == 0; }


x86 assembly (clang, -O0):
<test5>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xfffffff6,%ecx
cltd
idiv   %ecx
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test5>:
add    $0x9,%edi
xor    %eax,%eax
cmp    $0x13,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @test5(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, -10
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @test5(i32 %0) {
%2 = add i32 %0, 9
%3 = icmp ult i32 %2, 19
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void _cmsFree(void *Ptr) {
  if (Ptr)
    free(Ptr);
}


x86 assembly (clang, -O0):
<_cmsFree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <_cmsFree+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_cmsFree>:
test   %rdi,%rdi
je     111a <_cmsFree+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @_cmsFree(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 %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @_cmsFree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
unsigned bitScan_fun_uint(unsigned x) {
  unsigned r = 32;
  while (x) {
    --r;
    x >>= 1;
  }
  return r;
}


x86 assembly (clang, -O0):
<bitScan_fun_uint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x20,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112f <bitScan_fun_uint+0x2f>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <bitScan_fun_uint+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitScan_fun_uint>:
mov    $0x20,%eax
test   %edi,%edi
je     111c <bitScan_fun_uint+0x1c>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
add    $0xffffffff,%eax
shr    %ecx
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <bitScan_fun_uint+0x10>
ret

LLVM IR (-O0):
define i32 @bitScan_fun_uint(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 32, i32* %3
br label %4
4: ; preds = %7, %1
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = load i32, i32* %3
%9 = add i32 %8, -1
store i32 %9, i32* %3
%10 = load i32, i32* %2
%11 = lshr i32 %10, 1
store i32 %11, i32* %2
br label %4
12: ; preds = %4
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @bitScan_fun_uint(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 32, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add nsw i32 %4, -1
%7 = lshr i32 %5, 1
%8 = icmp ult i32 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 32, %1 ], [ %6, %3 ]
ret i32 %10
}
/* Variables and functions */
unsigned int exynos_5410_gpio_read(unsigned int);
unsigned int odroid_xu_gpio_read_16() {
  unsigned int bank_offset = 0x0C20;
  unsigned int bit_index = 0;
  return (exynos_5410_gpio_read(bank_offset) >> bit_index) & 0x1;
}


x86 assembly (clang, -O0):
<odroid_xu_gpio_read_16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xc20,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <exynos_5410_gpio_read@plt>
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
and    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<odroid_xu_gpio_read_16>:
push   %rax
mov    $0xc20,%edi
call   1030 <exynos_5410_gpio_read@plt>
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @odroid_xu_gpio_read_16() {
%1 = alloca i32
%2 = alloca i32
store i32 3104, i32* %1
store i32 0, i32* %2
%3 = load i32, i32* %1
%4 = call i32 @exynos_5410_gpio_read(i32 %3)
%5 = load i32, i32* %2
%6 = lshr i32 %4, %5
%7 = and i32 %6, 1
ret i32 %7
}

LLVM IR (-O2):
define i32 @odroid_xu_gpio_read_16() {
%1 = tail call i32 @exynos_5410_gpio_read(i32 3104)
%2 = and i32 %1, 1
ret i32 %2
}
/* Type definitions */
typedef char wchar_t;

/* Variables and functions */
int mbtowc(wchar_t *pwc, const char *s, size_t n) {
  int x = 0;
  if (s == 0)
    return 0;
  if (*s)
    x = 1;
  if (pwc)
    *pwc = *s;
  return x;
}


x86 assembly (clang, -O0):
<mbtowc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    112e <mbtowc+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    115f <mbtowc+0x5f>
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1142 <mbtowc+0x42>
movl   $0x1,-0x24(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1159 <mbtowc+0x59>
mov    -0x18(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mbtowc>:
test   %rsi,%rsi
je     1117 <mbtowc+0x17>
mov    (%rsi),%cl
test   %cl,%cl
setne  %al
test   %rdi,%rdi
je     1113 <mbtowc+0x13>
mov    %cl,(%rdi)
movzbl %al,%eax
ret
xor    %eax,%eax
movzbl %al,%eax
ret

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

LLVM IR (-O2):
define i32 @mbtowc(i8* writeonly %0, i8* %1, i64 %2) {
%4 = icmp eq i8* %1, null
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = load i8, i8* %1
%7 = icmp ne i8 %6, 0
%8 = icmp eq i8* %0, null
br i1 %8, label %10, label %9
9: ; preds = %5
store i8 %6, i8* %0
br label %10
10: ; preds = %5, %9, %3
%11 = phi i1 [ false, %3 ], [ %7, %9 ], [ %7, %5 ]
%12 = zext i1 %11 to i32
ret i32 %12
}
int power(int n1, int n2) {
  int out = 1;
  for (;;) {
    if (n2 & 1)
      out *= n1;
    n2 >>= (int)1;
    if (!n2)
      break;
    n1 *= n1;
  }
  return (out);
}


x86 assembly (clang, -O0):
<power>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     112a <power+0x2a>
mov    -0x4(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1142 <power+0x42>
jmp    1151 <power+0x51>
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1111 <power+0x11>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<power>:
test   $0x1,%sil
mov    $0x1,%r8d
mov    %edi,%eax
cmove  %r8d,%eax
cmp    $0x2,%esi
jb     1139 <power+0x39>
mov    %esi,%edx
nopw   0x0(%rax,%rax,1)
sar    %edx
imul   %edi,%edi
test   $0x2,%sil
mov    %edi,%ecx
cmove  %r8d,%ecx
imul   %ecx,%eax
cmp    $0x3,%esi
mov    %edx,%esi
ja     1120 <power+0x20>
ret

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

LLVM IR (-O2):
define i32 @power(i32 %0, i32 %1) {
%3 = and i32 %1, 1
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 1, i32 %0
%6 = icmp ult i32 %1, 2
br i1 %6, label %18, label %7
7: ; preds = %2, %7
%8 = phi i32 [ %16, %7 ], [ %5, %2 ]
%9 = phi i32 [ %11, %7 ], [ %1, %2 ]
%10 = phi i32 [ %12, %7 ], [ %0, %2 ]
%11 = ashr i32 %9, 1
%12 = mul nsw i32 %10, %10
%13 = and i32 %9, 2
%14 = icmp eq i32 %13, 0
%15 = select i1 %14, i32 1, i32 %12
%16 = mul nsw i32 %15, %8
%17 = icmp ult i32 %9, 4
br i1 %17, label %18, label %7
18: ; preds = %7, %2
%19 = phi i32 [ %5, %2 ], [ %16, %7 ]
ret i32 %19
}
/* Variables and functions */
int EOF;
int /*<<< orphan*/ printf(char *, int, int, int);
int main(void) {
  printf("%c, %d, %x\n", EOF, EOF, EOF);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%esi
mov    0x2eb9(%rip),%rax
mov    (%rax),%edx
mov    0x2eb0(%rip),%rax
mov    (%rax),%ecx
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%ecx
lea    0xedf(%rip),%rdi
mov    %ecx,%esi
mov    %ecx,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"%c, %d, %x\0A\00"
@EOF = global i32 0
define i32 @main() {
%1 = load i32, i32* @EOF
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %1, i32 %1)
ret i32 0
}
int lookup1(int i) {
  int a[] = {0, 1, 2, 3, 4, 5, 6, 7};
  return a[i];
}


x86 assembly (clang, -O0):
<lookup1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0xef2(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xeef(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xeec(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xee9(%rip),%rax
mov    %rax,-0x18(%rbp)
movslq -0x4(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lookup1>:
movslq %edi,%rax
lea    0xef6(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
@__const.lookup1.a = [8 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7]
define i32 @lookup1(i32 %0) {
%2 = alloca i32
%3 = alloca [8 x i32]
store i32 %0, i32* %2
%4 = bitcast [8 x i32]* %3 to i8*
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 %6
%8 = load i32, i32* %7
ret i32 %8
}

LLVM IR (-O2):
@__const.lookup1.a = [8 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7]
define i32 @lookup1(i32 %0) {
%2 = sext i32 %0 to i64
%3 = getelementptr inbounds [8 x i32], [8 x i32]* @__const.lookup1.a, i64 0, i64 %2
%4 = load i32, i32* %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ genfree(void *, char *, scalar_t__);
scalar_t__ strlen(char *);
void DeleteString(void *theEnv, char *theString) {
  if (theString != NULL) {
    genfree(theEnv, theString, strlen(theString) + 1);
  }
}


x86 assembly (clang, -O0):
<DeleteString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1168 <DeleteString+0x48>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
call   1040 <genfree@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DeleteString>:
test   %rsi,%rsi
je     114d <DeleteString+0x2d>
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%rdx
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <genfree@plt>
ret

LLVM IR (-O0):
define void @DeleteString(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %14
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = load i8*, i8** %4
%11 = call i64 @strlen(i8* %10)
%12 = add nsw i64 %11, 1
%13 = call i32 @genfree(i8* %8, i8* %9, i64 %12)
br label %14
14: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
define void @DeleteString(i8* %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = tail call i64 @strlen(i8* %1)
%6 = add nsw i64 %5, 1
%7 = tail call i32 @genfree(i8* %0, i8* %1, i64 %6)
br label %8
8: ; preds = %4, %2
ret void
}
long long suuu() { return 0xffff7fff7fff7fffLL; }


x86 assembly (clang, -O0):
<suuu>:
push   %rbp
mov    %rsp,%rbp
movabs $0xffff7fff7fff7fff,%rax
7f ff ff
pop    %rbp
ret

x86 assembly (clang, -O2):
<suuu>:
movabs $0xffff7fff7fff7fff,%rax
7f ff ff
ret

LLVM IR (-O0):
define i64 @suuu() {
ret i64 -140739635871745
}

LLVM IR (-O2):
define i64 @suuu() {
ret i64 -140739635871745
}
/* Variables and functions */
int /*<<< orphan*/ init_ivt();
void bios_init(void) { init_ivt(); }


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

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

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

LLVM IR (-O2):
define void @bios_init() {
%1 = tail call i32 (...) @init_ivt()
ret void
}
long int foo(long int x) { return x * x + (8 * x) << 4 - x; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    $0x4,%ecx
sub    -0x8(%rbp),%rcx
shl    %cl,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
lea    0x8(%rdi),%rax
imul   %rdi,%rax
mov    $0x4,%cl
sub    %dil,%cl
shl    %cl,%rax
ret

LLVM IR (-O0):
define i64 @foo(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load i64, i64* %2
%5 = mul nsw i64 %3, %4
%6 = load i64, i64* %2
%7 = mul nsw i64 8, %6
%8 = add nsw i64 %5, %7
%9 = load i64, i64* %2
%10 = sub nsw i64 4, %9
%11 = shl i64 %8, %10
ret i64 %11
}

LLVM IR (-O2):
define i64 @foo(i64 %0) {
%2 = add i64 %0, 8
%3 = mul i64 %2, %0
%4 = sub nsw i64 4, %0
%5 = shl i64 %3, %4
ret i64 %5
}
void X509_NAME_digest(void) {}


x86 assembly (clang, -O0):
<X509_NAME_digest>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<X509_NAME_digest>:
ret

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

LLVM IR (-O2):
define void @X509_NAME_digest() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void grpcsharp_completion_queue_next() {
  fprintf(stderr, "Should never reach here");
  abort();
}


x86 assembly (clang, -O0):
<grpcsharp_completion_queue_next>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<grpcsharp_completion_queue_next>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_completion_queue_next() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_completion_queue_next() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
int test_imm_2Euint32_reg(unsigned int val) {
  return ((val) & (0x2E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_2Euint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x2e,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_2Euint32_reg>:
test   $0x2e,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_2Euint32_reg(i32 %0) {
%2 = and i32 %0, 46
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int /*<<< orphan*/ *display;
};
typedef TYPE_1__ XCirculateEvent;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
void set_XCirculateEvent_display(void *_p, void *_v) {
  ((XCirculateEvent *)_p)->display = (Display *)_v;
}


x86 assembly (clang, -O0):
<set_XCirculateEvent_display>:
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_XCirculateEvent_display>:
mov    %rsi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XCirculateEvent_display(i8* nocapture writeonly %0, i8* %1) {
%3 = bitcast i8* %0 to i8**
store i8* %1, i8** %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cleanup_game();
int /*<<< orphan*/ draw_game();
int play_turn();
int /*<<< orphan*/ setup_game();
int /*<<< orphan*/ timer_pause(int);
int main() {
  setup_game();
  int turn_result = 0;
  while (turn_result != -1) {
    turn_result = play_turn();
    if (turn_result == 1) {
      draw_game();
    }
    timer_pause(5);
  }
  cleanup_game();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <setup_game@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
je     11a1 <main+0x51>
mov    $0x0,%al
call   1070 <play_turn@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1192 <main+0x42>
mov    $0x0,%al
call   1040 <draw_game@plt>
mov    $0x5,%edi
call   1060 <timer_pause@plt>
jmp    116d <main+0x1d>
mov    $0x0,%al
call   1050 <cleanup_game@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <setup_game@plt>
jmp    116f <main+0x1f>
nopw   0x0(%rax,%rax,1)
mov    $0x5,%edi
call   1060 <timer_pause@plt>
cmp    $0xffffffff,%ebx
je     1186 <main+0x36>
xor    %eax,%eax
call   1070 <play_turn@plt>
mov    %eax,%ebx
cmp    $0x1,%eax
jne    1160 <main+0x10>
xor    %eax,%eax
call   1040 <draw_game@plt>
jmp    1160 <main+0x10>
xor    %eax,%eax
call   1050 <cleanup_game@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @setup_game()
store i32 0, i32* %2
br label %4
4: ; preds = %13, %0
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, -1
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = call i32 (...) @play_turn()
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = call i32 (...) @draw_game()
br label %13
13: ; preds = %11, %7
%14 = call i32 @timer_pause(i32 5)
br label %4
15: ; preds = %4
%16 = call i32 (...) @cleanup_game()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @setup_game()
br label %2
2: ; preds = %0, %7
%3 = tail call i32 (...) @play_turn()
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @draw_game()
br label %7
7: ; preds = %5, %2
%8 = tail call i32 @timer_pause(i32 5)
%9 = icmp eq i32 %3, -1
br i1 %9, label %10, label %2
10: ; preds = %7
%11 = tail call i32 (...) @cleanup_game()
ret i32 0
}
/* Variables and functions */
int posix_madvise(void *addr, size_t len, int flags) { return 0; }


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

x86 assembly (clang, -O2):
<posix_madvise>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @posix_madvise(i8* %0, i64 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @posix_madvise(i8* nocapture readnone %0, i64 %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ increment(int *);
int /*<<< orphan*/ printf(char *, int);
void main() {
  int n = 1;
  increment(&n);
  printf("%d", n);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <increment@plt>
mov    -0x4(%rbp),%esi
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x1,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <increment@plt>
mov    0x4(%rsp),%esi
lea    0xec2(%rip),%rdi
call   1040 <printf@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 1, i32* %1
%3 = call i32 @increment(i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
void *mcpelauncher_hook(void *sym, void *hook, void *org) {}


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

x86 assembly (clang, -O2):
<mcpelauncher_hook>:
ret

LLVM IR (-O0):
define i8* @mcpelauncher_hook(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
%8 = load i8*, i8** %4
ret i8* %8
}

LLVM IR (-O2):
define noalias i8* @mcpelauncher_hook(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
ret i8* undef
}
/* Variables and functions */
const char *endis(bool enabled) { return enabled ? "enabled" : "disabled"; }


x86 assembly (clang, -O0):
<endis>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xef7(%rip),%rax
lea    0xee8(%rip),%rcx
cmp    $0x0,%edx
cmovne %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<endis>:
test   %edi,%edi
lea    0xeff(%rip),%rcx
lea    0xef0(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [8 x i8] c"enabled\00"
@.str.1 = [9 x i8] c"disabled\00"
define i8* @endis(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0)
ret i8* %6
}

LLVM IR (-O2):
@.str = [8 x i8] c"enabled\00"
@.str.1 = [9 x i8] c"disabled\00"
define i8* @endis(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *wrap_malloc(char *, int, scalar_t__);
char *Strdup(const char *str) {
  char *cpy;
  cpy = wrap_malloc("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                    "outputs/2022-01-22/02-19-57/repos/ystk/debian-freeipmi/"
                    "refs/heads/master/ipmipower/src/wrappers.c",
                    363, strlen(str) + 1);
  strcpy(cpy, str);
  return cpy;
}


x86 assembly (clang, -O0):
<Strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdx
add    $0x1,%rdx
lea    0xead(%rip),%rdi
mov    $0x16b,%esi
call   1050 <wrap_malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdx
lea    0xeb9(%rip),%rdi
mov    $0x16b,%esi
call   1050 <wrap_malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [154 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ystk/debian-freeipmi/refs/heads/master/ipmipower/src/wrappers.c\00"
define i8* @Strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @wrap_malloc(i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str, i64 0, i64 0), i32 363, i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [154 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ystk/debian-freeipmi/refs/heads/master/ipmipower/src/wrappers.c\00"
define i8* @Strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @wrap_malloc(i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str, i64 0, i64 0), i32 363, i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
void Default_IRQHandler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<Default_IRQHandler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <Default_IRQHandler+0x9>
jmp    1109 <Default_IRQHandler+0x9>

x86 assembly (clang, -O2):
<Default_IRQHandler>:
jmp    1100 <Default_IRQHandler>

LLVM IR (-O0):
define void @Default_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @Default_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
double log(double);
double logit(double p) { return log(p / (1.0 - p)); }


x86 assembly (clang, -O0):
<logit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
subsd  -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1030 <log@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logit>:
movsd  0xee8(%rip),%xmm1
subsd  %xmm0,%xmm1
divsd  %xmm1,%xmm0
jmp    1030 <log@plt>

LLVM IR (-O0):
define double @logit(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fsub double 1.000000e+00, %4
%6 = fdiv double %3, %5
%7 = call double @log(double %6)
ret double %7
}

LLVM IR (-O2):
define double @logit(double %0) {
%2 = fsub double 1.000000e+00, %0
%3 = fdiv double %0, %2
%4 = tail call double @log(double %3)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ execl(char *, char *, char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *);
void main() {
  execl("/bin/ls", "ls", "/arm/", NULL);
  printf("Hello\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed3(%rip),%rsi
lea    0xecf(%rip),%rdx
xor    %eax,%eax
mov    %eax,%ecx
call   1040 <execl@plt>
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed6(%rip),%rsi
lea    0xed2(%rip),%rdx
xor    %ecx,%ecx
call   1040 <execl@plt>
lea    0xeca(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"/bin/ls\00"
@.str.1 = [3 x i8] c"ls\00"
@.str.2 = [6 x i8] c"/arm/\00"
@.str.3 = [7 x i8] c"Hello\0A\00"
define void @main() {
%1 = call i32 @execl(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32* null)
%2 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"/bin/ls\00"
@.str.1 = [3 x i8] c"ls\00"
@.str.2 = [6 x i8] c"/arm/\00"
@str = [6 x i8] c"Hello\00"
define void @main() {
%1 = tail call i32 @execl(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32* null)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct hle_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ set_address(struct hle_t *, int /*<<< orphan*/);
void SEGMENT(struct hle_t *hle, uint32_t UNUSED_w1 __attribute__((__unused__)),
             uint32_t w2) {
  set_address(hle, w2);
}


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

x86 assembly (clang, -O2):
<SEGMENT>:
mov    %edx,%esi
jmp    1030 <set_address@plt>

LLVM IR (-O0):
%struct.hle_t = type { i32 }
define void @SEGMENT(%struct.hle_t* %0, i32 %1, i32 %2) {
%4 = alloca %struct.hle_t*
%5 = alloca i32
%6 = alloca i32
store %struct.hle_t* %0, %struct.hle_t** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.hle_t*, %struct.hle_t** %4
%8 = load i32, i32* %6
%9 = call i32 @set_address(%struct.hle_t* %7, i32 %8)
ret void
}

LLVM IR (-O2):
%struct.hle_t = type { i32 }
define void @SEGMENT(%struct.hle_t* %0, i32 %1, i32 %2) {
%4 = tail call i32 @set_address(%struct.hle_t* %0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CCP4_fatal(char *);
scalar_t__ malloc(scalar_t__);
int putenv(char *);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
int ccp4_ustenv(char *str) {
  char *param;
  if ((param = (char *)malloc(strlen(str) + 1)) == NULL)
    CCP4_fatal("CCP4_USTENV: Memory allocation failed");
  strcpy(param, str);
  return (putenv(param));
}


x86 assembly (clang, -O0):
<ccp4_ustenv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1070 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    118b <ccp4_ustenv+0x3b>
lea    0xe7a(%rip),%rdi
call   1060 <CCP4_fatal@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
call   1050 <putenv@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ccp4_ustenv>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1070 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1179 <ccp4_ustenv+0x29>
lea    0xe8c(%rip),%rdi
call   1060 <CCP4_fatal@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <putenv@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"CCP4_USTENV: Memory allocation failed\00"
define i32 @ccp4_ustenv(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i64 @malloc(i64 %6)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %3
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = call i32 @CCP4_fatal(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %1
%13 = load i8*, i8** %3
%14 = load i8*, i8** %2
%15 = call i32 @strcpy(i8* %13, i8* %14)
%16 = load i8*, i8** %3
%17 = call i32 @putenv(i8* %16)
ret i32 %17
}

LLVM IR (-O2):
@.str = [38 x i8] c"CCP4_USTENV: Memory allocation failed\00"
define i32 @ccp4_ustenv(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = tail call i32 @CCP4_fatal(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
%10 = tail call i32 @strcpy(i8* %5, i8* %0)
%11 = tail call i32 @putenv(i8* %5)
ret i32 %11
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int stat(char const *, struct stat *);
char isFileExists(const char *filename) {
  struct stat buffer;
  int exist = stat(filename, &buffer);
  return (exist == 0) ? 1 : 0;
}


x86 assembly (clang, -O0):
<isFileExists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
movsbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isFileExists>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
test   %eax,%eax
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define signext i8 @isFileExists(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @stat(i8* %5, %struct.stat* %3)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 1, i32 0
%11 = trunc i32 %10 to i8
ret i8 %11
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define signext i8 @isFileExists(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i8
ret i8 %6
}
void gensdl() {}


x86 assembly (clang, -O0):
<gensdl>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gensdl>:
ret

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

LLVM IR (-O2):
define void @gensdl() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ abort();
int pthread_mutex_lock(int /*<<< orphan*/ *);
void __safe_p_mutex_lock(pthread_mutex_t *mtx) {
  int en = pthread_mutex_lock(mtx);
  if (en) {
    abort();
  }
}


x86 assembly (clang, -O0):
<__safe_p_mutex_lock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <pthread_mutex_lock@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1149 <__safe_p_mutex_lock+0x29>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__safe_p_mutex_lock>:
push   %rax
call   1040 <pthread_mutex_lock@plt>
test   %eax,%eax
jne    112c <__safe_p_mutex_lock+0xc>
pop    %rax
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define void @__safe_p_mutex_lock(i32* %0) {
%2 = tail call i32 @pthread_mutex_lock(i32* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ActuatorCommandHandle();
int /*<<< orphan*/ UAVObjLogging(int /*<<< orphan*/);
void ActuatorCommandLogging() { UAVObjLogging(ActuatorCommandHandle()); }


x86 assembly (clang, -O0):
<ActuatorCommandLogging>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <ActuatorCommandHandle@plt>
mov    %eax,%edi
call   1030 <UAVObjLogging@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ActuatorCommandLogging>:
push   %rax
xor    %eax,%eax
call   1040 <ActuatorCommandHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <UAVObjLogging@plt>

LLVM IR (-O0):
define void @ActuatorCommandLogging() {
%1 = call i32 (...) @ActuatorCommandHandle()
%2 = call i32 @UAVObjLogging(i32 %1)
ret void
}

LLVM IR (-O2):
define void @ActuatorCommandLogging() {
%1 = tail call i32 (...) @ActuatorCommandHandle()
%2 = tail call i32 @UAVObjLogging(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
__attribute__((weak, noreturn)) void __cxa_pure_virtual() { abort(); }


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

x86 assembly (clang, -O2):
<__cxa_pure_virtual>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define weak void @__cxa_pure_virtual() {
%1 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define weak void @__cxa_pure_virtual() {
%1 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int str_comparen(char const *, char const *, scalar_t__);
scalar_t__ str_length(char const *);
int str_compare(const char *a, const char *b) {
  return str_comparen(a, b, str_length(b) + 1);
}


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

x86 assembly (clang, -O2):
<str_compare>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <str_length@plt>
lea    0x1(%rax),%rdx
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <str_comparen@plt>

LLVM IR (-O0):
define i32 @str_compare(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i64 @str_length(i8* %7)
%9 = add nsw i64 %8, 1
%10 = call i32 @str_comparen(i8* %5, i8* %6, i64 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @str_compare(i8* %0, i8* %1) {
%3 = tail call i64 @str_length(i8* %1)
%4 = add nsw i64 %3, 1
%5 = tail call i32 @str_comparen(i8* %0, i8* %1, i64 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ read_graph();
int /*<<< orphan*/ read_problems_write_answers();
int main() {
  read_graph();
  read_problems_write_answers();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @read_graph()
%2 = tail call i32 (...) @read_problems_write_answers()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_hashmap();
int /*<<< orphan*/ test_performance();
int main(int argc, char *argv[]) {
  printf("Test result\n");
  printf("---------------\n");
  test_hashmap();
  printf("Hurray! All tests passed successfully!\n");
  test_performance();
  printf("---------------\n");
  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    0xeb3(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <test_hashmap@plt>
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <test_performance@plt>
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeef(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <test_hashmap@plt>
lea    0xeb2(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <test_performance@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Test result\0A\00"
@.str.1 = [17 x i8] c"---------------\0A\00"
@.str.2 = [40 x i8] c"Hurray! All tests passed successfully!\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 ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 (...) @test_hashmap()
%9 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 (...) @test_performance()
%11 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"Test result\00"
@str.4 = [39 x i8] c"Hurray! All tests passed successfully!\00"
@str.5 = [16 x i8] c"---------------\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.5, i64 0, i64 0))
%5 = tail call i32 (...) @test_hashmap()
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.4, i64 0, i64 0))
%7 = tail call i32 (...) @test_performance()
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.5, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
double strtod(char const *, char **);
double atof(const char *s) {
  char *tmp;
  return strtod(s, &tmp);
}


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

x86 assembly (clang, -O2):
<atof>:
push   %rax
mov    %rsp,%rsi
call   1030 <strtod@plt>
pop    %rax
ret

LLVM IR (-O0):
define double @atof(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call double @strtod(i8* %4, i8** %3)
ret double %5
}

LLVM IR (-O2):
define double @atof(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call double @strtod(i8* %0, i8** %2)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ getdata(char *);
int main(void) {
  char *filename;
  filename = "files/progress.txt";
  getdata(filename);
  return (0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <getdata@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"files/progress.txt\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @getdata(i8* %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"files/progress.txt\00"
define i32 @main() {
%1 = tail call i32 @getdata(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void XChangeGC() {}


x86 assembly (clang, -O0):
<XChangeGC>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<XChangeGC>:
ret

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

LLVM IR (-O2):
define void @XChangeGC() {
ret void
}
void _Mutex_Destroy(struct _Mutex_Control *_mutex) { (void)_mutex; }


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

x86 assembly (clang, -O2):
<_Mutex_Destroy>:
ret

LLVM IR (-O0):
%struct._Mutex_Control = type opaque
define void @_Mutex_Destroy(%struct._Mutex_Control* %0) {
%2 = alloca %struct._Mutex_Control*
store %struct._Mutex_Control* %0, %struct._Mutex_Control** %2
%3 = load %struct._Mutex_Control*, %struct._Mutex_Control** %2
ret void
}

LLVM IR (-O2):
%struct._Mutex_Control = type opaque
define void @_Mutex_Destroy(%struct._Mutex_Control* nocapture %0) {
ret void
}