xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned int UINT_MAX;
int /*<<< orphan*/ foo(unsigned int);
int /*<<< orphan*/ printf(char *, long);
int main(void) {
  unsigned x = 0;
  long checked = 0;
  while (1) {
    foo(x);
    checked++;
    if (x == UINT_MAX)
      break;
    x++;
  }
  printf("checked %ld values\n", checked);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <foo@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2e8c(%rip),%rcx
cmp    (%rcx),%eax
jne    1169 <main+0x49>
jmp    1177 <main+0x57>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113e <main+0x1e>
mov    -0x10(%rbp),%rsi
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
mov    0x2ebb(%rip),%r14
nopl   (%rax)
mov    %ebx,%edi
call   1040 <foo@plt>
add    $0x1,%rbx
lea    -0x1(%rbx),%eax
cmp    (%r14),%eax
jne    1130 <main+0x10>
lea    0xeb6(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@UINT_MAX = global i32 0
@.str = [20 x i8] c"checked %ld values\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
store i32 0, i32* %1
store i32 0, i32* %2
store i64 0, i64* %3
br label %4
4: ; preds = %0, %13
%5 = load i32, i32* %2
%6 = call i32 @foo(i32 %5)
%7 = load i64, i64* %3
%8 = add nsw i64 %7, 1
store i64 %8, i64* %3
%9 = load i32, i32* %2
%10 = load i32, i32* @UINT_MAX
%11 = icmp eq i32 %9, %10
br i1 %11, label %12, label %13
12: ; preds = %4
br label %16
13: ; preds = %4
%14 = load i32, i32* %2
%15 = add i32 %14, 1
store i32 %15, i32* %2
br label %4
16: ; preds = %12
%17 = load i64, i64* %3
%18 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i64 %17)
ret i32 0
}

LLVM IR (-O2):
@UINT_MAX = global i32 0
@.str = [20 x i8] c"checked %ld values\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i64 [ 0, %0 ], [ %5, %1 ]
%3 = trunc i64 %2 to i32
%4 = tail call i32 @foo(i32 %3)
%5 = add nuw nsw i64 %2, 1
%6 = load i32, i32* @UINT_MAX
%7 = icmp eq i32 %6, %3
br i1 %7, label %8, label %1
8: ; preds = %1
%9 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i64 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int foo(int);
int /*<<< orphan*/ printf(char *);
void bar(void) {
  if (foo(5) != 5)
    abort();
  printf("PASS\n");
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
call   1050 <foo@plt>
cmp    $0x5,%eax
je     114e <bar+0x1e>
mov    $0x0,%al
call   1030 <abort@plt>
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rax
mov    $0x5,%edi
call   1050 <foo@plt>
cmp    $0x5,%eax
jne    114d <bar+0x1d>
lea    0xeb9(%rip),%rdi
pop    %rax
jmp    1040 <puts@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"PASS\0A\00"
define void @bar() {
%1 = call i32 @foo(i32 5)
%2 = icmp ne i32 %1, 5
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [5 x i8] c"PASS\00"
define void @bar() {
%1 = tail call i32 @foo(i32 5)
%2 = icmp eq i32 %1, 5
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ GENERAL_NAMES;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int /*<<< orphan*/ ASN1_item_free(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ GENERAL_NAMES_it;
void GENERAL_NAMES_free(GENERAL_NAMES *a) {
  ASN1_item_free((ASN1_VALUE *)a, &GENERAL_NAMES_it);
}


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

x86 assembly (clang, -O2):
<GENERAL_NAMES_free>:
mov    0x2ec9(%rip),%rsi
jmp    1030 <ASN1_item_free@plt>

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

LLVM IR (-O2):
@GENERAL_NAMES_it = global i32 0
define void @GENERAL_NAMES_free(i32* %0) {
%2 = tail call i32 @ASN1_item_free(i32* %0, i32* @GENERAL_NAMES_it)
ret void
}
int hybris_check_android_shared_cond(unsigned int cond_addr) {
  if ((cond_addr <= 0xFFFF) && (cond_addr & 0x0001))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<hybris_check_android_shared_cond>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xffff,-0x8(%rbp)
ja     112f <hybris_check_android_shared_cond+0x2f>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     112f <hybris_check_android_shared_cond+0x2f>
movl   $0x1,-0x4(%rbp)
jmp    1136 <hybris_check_android_shared_cond+0x36>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hybris_check_android_shared_cond>:
and    $0xffff0001,%edi
xor    %eax,%eax
cmp    $0x1,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @hybris_check_android_shared_cond(i32 %0) {
%2 = and i32 %0, -65535
%3 = icmp eq i32 %2, 1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ apbuart_test(int);
int /*<<< orphan*/ get_pid();
int /*<<< orphan*/ gptimer_test(int, int);
int /*<<< orphan*/ irqtest(int);
int /*<<< orphan*/ leon3_test(int, int, int /*<<< orphan*/);
int /*<<< orphan*/ mem_test();
base_test_tirq(int irq) {
  if (!get_pid())
    mem_test();
  leon3_test(1, 0x80000200, 0);
  irqtest(0x80000200);
  gptimer_test(0x80000300, irq);
  apbuart_test(0x80000100);
}


x86 assembly (clang, -O0):
<base_test_tirq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1080 <get_pid@plt>
cmp    $0x0,%eax
jne    1182 <base_test_tirq+0x22>
mov    $0x0,%al
call   1030 <mem_test@plt>
mov    $0x1,%edi
mov    $0x80000200,%esi
xor    %edx,%edx
call   1050 <leon3_test@plt>
mov    $0x80000200,%edi
call   1060 <irqtest@plt>
mov    -0x8(%rbp),%esi
mov    $0x80000300,%edi
call   1040 <gptimer_test@plt>
mov    $0x80000100,%edi
call   1070 <apbuart_test@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<base_test_tirq>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1080 <get_pid@plt>
test   %eax,%eax
jne    1175 <base_test_tirq+0x15>
xor    %eax,%eax
call   1030 <mem_test@plt>
mov    $0x1,%edi
mov    $0x80000200,%esi
xor    %edx,%edx
call   1050 <leon3_test@plt>
mov    $0x80000200,%edi
call   1060 <irqtest@plt>
mov    $0x80000300,%edi
mov    %ebx,%esi
call   1040 <gptimer_test@plt>
mov    $0x80000100,%edi
pop    %rbx
jmp    1070 <apbuart_test@plt>

LLVM IR (-O0):
define i32 @base_test_tirq(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (...) @get_pid()
%5 = icmp ne i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 (...) @mem_test()
br label %8
8: ; preds = %6, %1
%9 = call i32 @leon3_test(i32 1, i32 -2147483136, i32 0)
%10 = call i32 @irqtest(i32 -2147483136)
%11 = load i32, i32* %3
%12 = call i32 @gptimer_test(i32 -2147482880, i32 %11)
%13 = call i32 @apbuart_test(i32 -2147483392)
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @base_test_tirq(i32 %0) {
%2 = tail call i32 (...) @get_pid()
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @mem_test()
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @leon3_test(i32 1, i32 -2147483136, i32 0)
%8 = tail call i32 @irqtest(i32 -2147483136)
%9 = tail call i32 @gptimer_test(i32 -2147482880, i32 %0)
%10 = tail call i32 @apbuart_test(i32 -2147483392)
ret i32 undef
}
double cal_fmeasure(double r, double p) {
  if (r < 1.0e-8 || p < 1.0e-8)
    return 0;
  return 2 * r * p / (r + p);
}


x86 assembly (clang, -O0):
<cal_fmeasure>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  0xeea(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
ja     1134 <cal_fmeasure+0x34>
movsd  0xed7(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1141 <cal_fmeasure+0x41>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1166 <cal_fmeasure+0x66>
movsd  0xebf(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
addsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cal_fmeasure>:
movapd %xmm0,%xmm2
movsd  0xef4(%rip),%xmm3
ucomisd %xmm0,%xmm3
xorpd  %xmm0,%xmm0
ja     1130 <cal_fmeasure+0x30>
ucomisd %xmm1,%xmm3
ja     1130 <cal_fmeasure+0x30>
movapd %xmm2,%xmm0
addsd  %xmm2,%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm1,%xmm2
divsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @cal_fmeasure(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = fcmp olt double %6, 1.000000e-08
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load double, double* %5
%10 = fcmp olt double %9, 1.000000e-08
br i1 %10, label %11, label %12
11: ; preds = %8, %2
store double 0.000000e+00, double* %3
br label %21
12: ; preds = %8
%13 = load double, double* %4
%14 = fmul double 2.000000e+00, %13
%15 = load double, double* %5
%16 = fmul double %14, %15
%17 = load double, double* %4
%18 = load double, double* %5
%19 = fadd double %17, %18
%20 = fdiv double %16, %19
store double %20, double* %3
br label %21
21: ; preds = %12, %11
%22 = load double, double* %3
ret double %22
}

LLVM IR (-O2):
define double @cal_fmeasure(double %0, double %1) {
%3 = fcmp olt double %0, 1.000000e-08
%4 = fcmp olt double %1, 1.000000e-08
%5 = or i1 %3, %4
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = fmul double %0, 2.000000e+00
%8 = fmul double %7, %1
%9 = fadd double %0, %1
%10 = fdiv double %8, %9
br label %11
11: ; preds = %2, %6
%12 = phi double [ %10, %6 ], [ 0.000000e+00, %2 ]
ret double %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *remove_dup(char *);
void main() {
  char a[] = "geeksforgeeks";
  printf("string after dumplicate removals is %s", remove_dup(a));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0xe(%rbp)
mov    0xecf(%rip),%eax
mov    %eax,-0x6(%rbp)
mov    0xec9(%rip),%ax
mov    %ax,-0x2(%rbp)
lea    -0xe(%rbp),%rdi
call   1030 <remove_dup@plt>
mov    %rax,%rsi
lea    0xeb4(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x736b656567726f,%rax
mov    %rax,0xe(%rsp)
movabs $0x726f66736b656567,%rax
66 6f 72
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
call   1030 <remove_dup@plt>
lea    0xebb(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [14 x i8] c"geeksforgeeks\00"
@.str = [39 x i8] c"string after dumplicate removals is %s\00"
define void @main() {
%1 = alloca [14 x i8]
%2 = bitcast [14 x i8]* %1 to i8*
%3 = getelementptr inbounds [14 x i8], [14 x i8]* %1, i64 0, i64 0
%4 = call i8* @remove_dup(i8* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@__const.main.a = [14 x i8] c"geeksforgeeks\00"
@.str = [39 x i8] c"string after dumplicate removals is %s\00"
define void @main() {
%1 = alloca [14 x i8]
%2 = getelementptr inbounds [14 x i8], [14 x i8]* %1, i64 0, i64 0
%3 = call i8* @remove_dup(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
/* Variables and functions */
int procfs_check_ac_state();
int sysfs_check_ac_state();
int check_ac_state(void) {
  int ret;
  ret = sysfs_check_ac_state();
  if (ret == -1)
    return procfs_check_ac_state();
  return ret;
}


x86 assembly (clang, -O0):
<check_ac_state>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <sysfs_check_ac_state@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    114b <check_ac_state+0x2b>
mov    $0x0,%al
call   1040 <procfs_check_ac_state@plt>
mov    %eax,-0x4(%rbp)
jmp    1151 <check_ac_state+0x31>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_ac_state>:
push   %rax
xor    %eax,%eax
call   1030 <sysfs_check_ac_state@plt>
cmp    $0xffffffff,%eax
je     112f <check_ac_state+0xf>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
jmp    1040 <procfs_check_ac_state@plt>

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

LLVM IR (-O2):
define i32 @check_ac_state() {
%1 = tail call i32 (...) @sysfs_check_ac_state()
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @procfs_check_ac_state()
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ %4, %3 ], [ %1, %0 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i = 1;
  for (i = 1; i <= 5; i++) {
    printf("%d\n", i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jg     1154 <main+0x44>
mov    -0x8(%rbp),%esi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 2)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void *detect_oom(void *ptr) {
  if (NULL == ptr) {
    fprintf(stderr, "out of memory\n");
    exit(1);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<detect_oom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
jne    1157 <detect_oom+0x37>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
lea    0xeb8(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<detect_oom>:
test   %rdi,%rdi
je     1129 <detect_oom+0x9>
mov    %rdi,%rax
ret
push   %rax
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
lea    0xec6(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"out of memory\0A\00"
define i8* @detect_oom(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* null, %3
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 1)
unreachable
9: ; preds = %1
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"out of memory\0A\00"
define i8* @detect_oom(i8* readnone returned %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ SIGUSR1;
int /*<<< orphan*/ signal(int /*<<< orphan*/, void (*)(int));
void mezz_sigusr1(int signum) {
  signal(SIGUSR1, mezz_sigusr1);
  return;
}


x86 assembly (clang, -O0):
<mezz_sigusr1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
mov    0x2eb5(%rip),%rsi
call   1030 <signal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mezz_sigusr1>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
mov    0x2ec0(%rip),%rsi
jmp    1030 <signal@plt>

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

LLVM IR (-O2):
@SIGUSR1 = global i32 0
define void @mezz_sigusr1(i32 %0) {
%2 = load i32, i32* @SIGUSR1
%3 = tail call i32 @signal(i32 %2, void (i32)* @mezz_sigusr1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pipc(char *, char *, int);
int /*<<< orphan*/ printf(char *, char *);
char *strchr(char *, char);
void pip(char *cmdline, int bin) {
  char *i;
  if ((i = strchr(cmdline, ' ')) == NULL) {
    printf("too few arguments: %s\n", cmdline);
    return;
  }
  *i = '\0';
  pipc(cmdline, i + 1, bin);
}


x86 assembly (clang, -O0):
<pip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x20,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1170 <pip+0x40>
mov    -0x8(%rbp),%rsi
lea    0xe9a(%rip),%rdi
call   1040 <printf@plt>
jmp    118b <pip+0x5b>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
add    $0x1,%rsi
mov    -0xc(%rbp),%edx
call   1050 <pipc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pip>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0x20,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1161 <pip+0x31>
movb   $0x0,(%rax)
add    $0x1,%rax
mov    %rbx,%rdi
mov    %rax,%rsi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <pipc@plt>
lea    0xe98(%rip),%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"too few arguments: %s\0A\00"
define void @pip(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = call i8* @strchr(i8* %6, i8 signext 32)
store i8* %7, i8** %5
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %19
12: ; preds = %2
%13 = load i8*, i8** %5
store i8 0, i8* %13
%14 = load i8*, i8** %3
%15 = load i8*, i8** %5
%16 = getelementptr inbounds i8, i8* %15, i64 1
%17 = load i32, i32* %4
%18 = call i32 @pipc(i8* %14, i8* %16, i32 %17)
br label %19
19: ; preds = %12, %9
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"too few arguments: %s\0A\00"
define void @pip(i8* %0, i32 %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 32)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %10
7: ; preds = %2
store i8 0, i8* %3
%8 = getelementptr inbounds i8, i8* %3, i64 1
%9 = tail call i32 @pipc(i8* %0, i8* %8, i32 %1)
br label %10
10: ; preds = %7, %5
ret void
}
unsigned int qsd_lsensor_read(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @qsd_lsensor_read() {
ret i32 0
}

LLVM IR (-O2):
define i32 @qsd_lsensor_read() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void TIM8_UP_TIM13_IRQHandler() { default_handler(); }


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

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

LLVM IR (-O0):
define weak void @TIM8_UP_TIM13_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @TIM8_UP_TIM13_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outw(int, int);
void vbe_outw(int index, int val) {
  outw(0x1ce, index);
  outw(0x1d0, val);
}


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

x86 assembly (clang, -O2):
<vbe_outw>:
push   %rbx
mov    %esi,%ebx
mov    %edi,%esi
mov    $0x1ce,%edi
call   1030 <outw@plt>
mov    $0x1d0,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <outw@plt>

LLVM IR (-O0):
define void @vbe_outw(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 @outw(i32 462, i32 %5)
%7 = load i32, i32* %4
%8 = call i32 @outw(i32 464, i32 %7)
ret void
}

LLVM IR (-O2):
define void @vbe_outw(i32 %0, i32 %1) {
%3 = tail call i32 @outw(i32 462, i32 %0)
%4 = tail call i32 @outw(i32 464, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ system(char *);
int x41_setup() {
  char cmd[256];
  sprintf(cmd,
          "iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags "
          "SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d",
          1);
  system(cmd);
  return 0;
}


x86 assembly (clang, -O0):
<x41_setup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x1,%edx
call   1040 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x41_setup>:
push   %rbx
sub    $0x100,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [106 x i8] c"iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x41_setup() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = call i32 @system(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [106 x i8] c"iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x41_setup() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = call i32 @system(i8* %2)
ret i32 0
}
int test_imm_B8int64_lowword_reg(long long val) {
  return ((val) & (0xB8 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B8int64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0xb8,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_B8int64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 184
%5 = icmp ne i64 %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_B8int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 184
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_invasions_header() { printf("W, M, T, s1, s2, d1, d2, K, k \n"); }


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"W, M, T, s1, s2, d1, d2, K, k \0A\00"
define void @print_invasions_header() {
%1 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [31 x i8] c"W, M, T, s1, s2, d1, d2, K, k \00"
define void @print_invasions_header() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, size_t);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *xmalloc(size_t size) {
  void *ptr = malloc(size);
  if (ptr)
    return ptr;
  fprintf(stderr, "xmalloc(): Could not allocate %zd bytes.\n", size);
  abort();
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115e <xmalloc+0x2e>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe8e(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
mov    %rdi,%rbx
call   1050 <malloc@plt>
test   %rax,%rax
je     1140 <xmalloc+0x10>
pop    %rbx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [42 x i8] c"xmalloc(): Could not allocate %zd bytes.\0A\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i8*, i8** %3
ret i8* %9
10: ; preds = %1
%11 = load i32, i32* @stderr
%12 = load i64, i64* %2
%13 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i64 %12)
%14 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [42 x i8] c"xmalloc(): Could not allocate %zd bytes.\0A\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
ret i8* %2
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i64 %0)
%8 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
float powf(float, float);
float sinf(float);
float vorbis(int k, int N) {
  float p = ((float)(k)) / ((float)(N));
  return sinf(3.14159265358979323846f / 2.f *
              powf(sinf(3.14159265358979323846f * p), 2.f));
}


x86 assembly (clang, -O0):
<vorbis>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xebf(%rip),%xmm0
mulss  -0xc(%rbp),%xmm0
call   1030 <sinf@plt>
movss  0xea9(%rip),%xmm1
call   1040 <powf@plt>
movaps %xmm0,%xmm1
movss  0xe95(%rip),%xmm0
mulss  %xmm1,%xmm0
call   1030 <sinf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vorbis>:
push   %rax
cvtsi2ss %edi,%xmm0
cvtsi2ss %esi,%xmm1
divss  %xmm1,%xmm0
mulss  0xedb(%rip),%xmm0
call   1030 <sinf@plt>
mulss  %xmm0,%xmm0
mulss  0xece(%rip),%xmm0
pop    %rax
jmp    1030 <sinf@plt>

LLVM IR (-O0):
define float @vorbis(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca float
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = sitofp i32 %6 to float
%8 = load i32, i32* %4
%9 = sitofp i32 %8 to float
%10 = fdiv float %7, %9
store float %10, float* %5
%11 = load float, float* %5
%12 = fmul float 0x400921FB60000000, %11
%13 = call float @sinf(float %12)
%14 = call float @powf(float %13, float 2.000000e+00)
%15 = fmul float 0x3FF921FB60000000, %14
%16 = call float @sinf(float %15)
ret float %16
}

LLVM IR (-O2):
define float @vorbis(i32 %0, i32 %1) {
%3 = sitofp i32 %0 to float
%4 = sitofp i32 %1 to float
%5 = fdiv float %3, %4
%6 = fmul float %5, 0x400921FB60000000
%7 = tail call float @sinf(float %6)
%8 = fmul float %7, %7
%9 = fmul float %8, 0x3FF921FB60000000
%10 = tail call float @sinf(float %9)
ret float %10
}
/* Variables and functions */
int yas_l3g4200d_write_reg(unsigned char, unsigned char *, int);
int yas_l3g4200d_write_reg_byte(unsigned char adr, unsigned char val) {
  return yas_l3g4200d_write_reg(adr, &val, 1);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
lea    -0x2(%rbp),%rsi
mov    $0x1,%edx
movzbl -0x1(%rbp),%edi
call   1030 <yas_l3g4200d_write_reg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rax
mov    %sil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <yas_l3g4200d_write_reg@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @yas_l3g4200d_write_reg_byte(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = call i32 @yas_l3g4200d_write_reg(i8 zeroext %5, i8* %4, i32 1)
ret i32 %6
}

LLVM IR (-O2):
define i32 @yas_l3g4200d_write_reg_byte(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
store i8 %1, i8* %3
%4 = call i32 @yas_l3g4200d_write_reg(i8 zeroext %0, i8* %3, i32 1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ test_gc1();
int /*<<< orphan*/ test_gc2();
int /*<<< orphan*/ test_gc3();
int /*<<< orphan*/ test_gc4();
int main(int argc, const char *argv[]) {
  test_gc1();
  test_gc2();
  test_gc3();
  test_gc4();
  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)
mov    $0x0,%al
call   1050 <test_gc1@plt>
mov    $0x0,%al
call   1030 <test_gc2@plt>
mov    $0x0,%al
call   1060 <test_gc3@plt>
mov    $0x0,%al
call   1040 <test_gc4@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <test_gc1@plt>
xor    %eax,%eax
call   1030 <test_gc2@plt>
xor    %eax,%eax
call   1060 <test_gc3@plt>
xor    %eax,%eax
call   1040 <test_gc4@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
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 (...) @test_gc1()
%7 = call i32 (...) @test_gc2()
%8 = call i32 (...) @test_gc3()
%9 = call i32 (...) @test_gc4()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_gc1()
%4 = tail call i32 (...) @test_gc2()
%5 = tail call i32 (...) @test_gc3()
%6 = tail call i32 (...) @test_gc4()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ kirstu_dbus_free();
int /*<<< orphan*/ kirstu_notification_list_free();
int /*<<< orphan*/ kirstu_xcb_free();
void bye(void) {
  kirstu_notification_list_free();
  kirstu_dbus_free();
  kirstu_xcb_free();
}


x86 assembly (clang, -O0):
<bye>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <kirstu_notification_list_free@plt>
mov    $0x0,%al
call   1030 <kirstu_dbus_free@plt>
mov    $0x0,%al
call   1050 <kirstu_xcb_free@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bye>:
push   %rax
xor    %eax,%eax
call   1040 <kirstu_notification_list_free@plt>
xor    %eax,%eax
call   1030 <kirstu_dbus_free@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <kirstu_xcb_free@plt>

LLVM IR (-O0):
define void @bye() {
%1 = call i32 (...) @kirstu_notification_list_free()
%2 = call i32 (...) @kirstu_dbus_free()
%3 = call i32 (...) @kirstu_xcb_free()
ret void
}

LLVM IR (-O2):
define void @bye() {
%1 = tail call i32 (...) @kirstu_notification_list_free()
%2 = tail call i32 (...) @kirstu_dbus_free()
%3 = tail call i32 (...) @kirstu_xcb_free()
ret void
}
/* Variables and functions */
scalar_t__ strcasecmp(char const *, char const *);
int acase_eq(const char *pat, const char *text) {
  return (strcasecmp(text, pat) == 0);
}


x86 assembly (clang, -O0):
<acase_eq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acase_eq>:
push   %rax
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
call   1030 <strcasecmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @acase_eq(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 = load i8*, i8** %3
%7 = call i64 @strcasecmp(i8* %5, i8* %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @acase_eq(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i64 @strcasecmp(i8* %1, i8* %0)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ heap_init();
void setup() { heap_init(); }


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

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

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

LLVM IR (-O2):
define void @setup() {
%1 = tail call i32 (...) @heap_init()
ret void
}
void init_space(int dim, int *perm) {
  for (int i = 0; i < dim; i++) {
  }
}


x86 assembly (clang, -O0):
<init_space>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1131 <init_space+0x31>
jmp    1123 <init_space+0x23>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1112 <init_space+0x12>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @init_space(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 0, i32* %5
br label %6
6: ; preds = %11, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %3
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %14
10: ; preds = %6
br label %11
11: ; preds = %10
%12 = load i32, i32* %5
%13 = add nsw i32 %12, 1
store i32 %13, i32* %5
br label %6
14: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @init_space(i32 %0, i32* nocapture %1) {
ret void
}
/* Type definitions */
struct obj {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ err(char *, struct obj *);
void err_stack(char *ptr) {
  err("the currently assigned stack limit has been exceded", ((struct obj *)0));
}


x86 assembly (clang, -O0):
<err_stack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <err@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<err_stack>:
lea    0xee9(%rip),%rdi
xor    %esi,%esi
jmp    1030 <err@plt>

LLVM IR (-O0):
%struct.obj = type { i32 }
@.str = [52 x i8] c"the currently assigned stack limit has been exceded\00"
define void @err_stack(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @err(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), %struct.obj* null)
ret void
}

LLVM IR (-O2):
%struct.obj = type { i32 }
@.str = [52 x i8] c"the currently assigned stack limit has been exceded\00"
define void @err_stack(i8* nocapture readnone %0) {
%2 = tail call i32 @err(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), %struct.obj* null)
ret void
}
/* Type definitions */
struct utsname {
  int /*<<< orphan*/ release;
};

/* Variables and functions */
char *strdup(int /*<<< orphan*/);
int /*<<< orphan*/ uname(struct utsname *);
char *OSRelease() {
  struct utsname buf;
  uname(&buf);
  return strdup(buf.release);
}


x86 assembly (clang, -O0):
<OSRelease>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
call   1030 <uname@plt>
mov    -0x8(%rbp),%edi
call   1040 <strdup@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OSRelease>:
push   %rax
mov    %rsp,%rdi
call   1030 <uname@plt>
mov    (%rsp),%edi
pop    %rax
jmp    1040 <strdup@plt>

LLVM IR (-O0):
%struct.utsname = type { i32 }
define i8* @OSRelease() {
%1 = alloca %struct.utsname
%2 = call i32 @uname(%struct.utsname* %1)
%3 = getelementptr inbounds %struct.utsname, %struct.utsname* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = call i8* @strdup(i32 %4)
ret i8* %5
}

LLVM IR (-O2):
%struct.utsname = type { i32 }
define i8* @OSRelease() {
%1 = alloca %struct.utsname
%2 = bitcast %struct.utsname* %1 to i8*
%3 = call i32 @uname(%struct.utsname* %1)
%4 = getelementptr inbounds %struct.utsname, %struct.utsname* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = tail call i8* @strdup(i32 %5)
ret i8* %6
}
/* Type definitions */
struct pt_regs {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __do_IRQ(int);
int /*<<< orphan*/ irq_enter();
int /*<<< orphan*/ irq_exit();
struct pt_regs *set_irq_regs(struct pt_regs *);
void xen_do_IRQ(int irq, struct pt_regs *regs) {
  struct pt_regs *old_regs;
  old_regs = set_irq_regs(regs);
  irq_enter();
  __do_IRQ(irq);
  irq_exit();
  set_irq_regs(old_regs);
}


x86 assembly (clang, -O0):
<xen_do_IRQ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <set_irq_regs@plt>
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <irq_enter@plt>
mov    -0x4(%rbp),%edi
call   1040 <__do_IRQ@plt>
mov    $0x0,%al
call   1060 <irq_exit@plt>
mov    -0x18(%rbp),%rdi
call   1050 <set_irq_regs@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xen_do_IRQ>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    %rsi,%rdi
call   1050 <set_irq_regs@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1030 <irq_enter@plt>
mov    %ebx,%edi
call   1040 <__do_IRQ@plt>
xor    %eax,%eax
call   1060 <irq_exit@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <set_irq_regs@plt>

LLVM IR (-O0):
%struct.pt_regs = type { i32 }
define void @xen_do_IRQ(i32 %0, %struct.pt_regs* %1) {
%3 = alloca i32
%4 = alloca %struct.pt_regs*
%5 = alloca %struct.pt_regs*
store i32 %0, i32* %3
store %struct.pt_regs* %1, %struct.pt_regs** %4
%6 = load %struct.pt_regs*, %struct.pt_regs** %4
%7 = call %struct.pt_regs* @set_irq_regs(%struct.pt_regs* %6)
store %struct.pt_regs* %7, %struct.pt_regs** %5
%8 = call i32 (...) @irq_enter()
%9 = load i32, i32* %3
%10 = call i32 @__do_IRQ(i32 %9)
%11 = call i32 (...) @irq_exit()
%12 = load %struct.pt_regs*, %struct.pt_regs** %5
%13 = call %struct.pt_regs* @set_irq_regs(%struct.pt_regs* %12)
ret void
}

LLVM IR (-O2):
%struct.pt_regs = type { i32 }
define void @xen_do_IRQ(i32 %0, %struct.pt_regs* %1) {
%3 = tail call %struct.pt_regs* @set_irq_regs(%struct.pt_regs* %1)
%4 = tail call i32 (...) @irq_enter()
%5 = tail call i32 @__do_IRQ(i32 %0)
%6 = tail call i32 (...) @irq_exit()
%7 = tail call %struct.pt_regs* @set_irq_regs(%struct.pt_regs* %3)
ret void
}
/* Variables and functions */
unsigned char dxl_read_byte(unsigned char, int);
unsigned char getCCWComplianceMargin(unsigned char id) {
  return dxl_read_byte(id, (27));
}


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

x86 assembly (clang, -O2):
<getCCWComplianceMargin>:
mov    $0x1b,%esi
jmp    1030 <dxl_read_byte@plt>

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

LLVM IR (-O2):
define zeroext i8 @getCCWComplianceMargin(i8 zeroext %0) {
%2 = tail call zeroext i8 @dxl_read_byte(i8 zeroext %0, i32 27)
ret i8 %2
}
int compare_pivot(void *key1, void *key2) {
  int *a = (int *)key1;
  int *b = (int *)key2;
  return *a > *b ? 1 : 0;
}


x86 assembly (clang, -O0):
<compare_pivot>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmovg  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_pivot>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
setg   %al
ret

LLVM IR (-O0):
define i32 @compare_pivot(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %6
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = icmp sgt i32 %12, %14
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 1, i32 0
ret i32 %17
}

LLVM IR (-O2):
define i32 @compare_pivot(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp sgt i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
char *middleLib_GetMessage();
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char *message = middleLib_GetMessage();
  printf("Message was: %s\n", message);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <middleLib_GetMessage@plt>
lea    0xed1(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [17 x i8] c"Message was: %s\0A\00"
define i32 @main() {
%1 = tail call i8* (...) @middleLib_GetMessage()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 0
}
/* Type definitions */
struct pbst_table {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void *pbst_delete(struct pbst_table *, void *);
void *(pbst_assert_delete)(struct pbst_table *table, void *item) {
  void *p = pbst_delete(table, item);
  assert(p != NULL);
  return p;
}


x86 assembly (clang, -O0):
<pbst_assert_delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <pbst_delete@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pbst_assert_delete>:
push   %rbx
call   1030 <pbst_delete@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1040 <assert@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.pbst_table = type { i32 }
define i8* @pbst_assert_delete(%struct.pbst_table* %0, i8* %1) {
%3 = alloca %struct.pbst_table*
%4 = alloca i8*
%5 = alloca i8*
store %struct.pbst_table* %0, %struct.pbst_table** %3
store i8* %1, i8** %4
%6 = load %struct.pbst_table*, %struct.pbst_table** %3
%7 = load i8*, i8** %4
%8 = call i8* @pbst_delete(%struct.pbst_table* %6, i8* %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i8*, i8** %5
ret i8* %13
}

LLVM IR (-O2):
%struct.pbst_table = type { i32 }
define i8* @pbst_assert_delete(%struct.pbst_table* %0, i8* %1) {
%3 = tail call i8* @pbst_delete(%struct.pbst_table* %0, i8* %1)
%4 = icmp ne i8* %3, null
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
ret i8* %3
}
void RTTimeNanoTSLegacyAsync(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTimeNanoTSLegacyAsync() {
ret void
}