xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
main() {
  if ((double)18446744073709551615ULL < 1.84467440737095e+19 ||
      (double)18446744073709551615ULL > 1.84467440737096e+19)
    abort();
  if (16777217L != (float)16777217e0)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct gdev_time {
  int dummy;
};

/* Variables and functions */
scalar_t__ gdev_time_eq(struct gdev_time *, struct gdev_time *);
int gdev_time_gt(struct gdev_time *, struct gdev_time *);
int gdev_time_ge(struct gdev_time *x, struct gdev_time *y) {
  if (gdev_time_eq(x, y))
    return 1;
  else
    return gdev_time_gt(x, y);
}


x86 assembly (clang, -O0):
<gdev_time_ge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <gdev_time_eq@plt>
cmp    $0x0,%rax
je     1153 <gdev_time_ge+0x33>
movl   $0x1,-0x4(%rbp)
jmp    1163 <gdev_time_ge+0x43>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <gdev_time_gt@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdev_time_ge>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <gdev_time_eq@plt>
test   %rax,%rax
je     1141 <gdev_time_ge+0x21>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <gdev_time_gt@plt>

LLVM IR (-O0):
%struct.gdev_time = type { i32 }
define i32 @gdev_time_ge(%struct.gdev_time* %0, %struct.gdev_time* %1) {
%3 = alloca i32
%4 = alloca %struct.gdev_time*
%5 = alloca %struct.gdev_time*
store %struct.gdev_time* %0, %struct.gdev_time** %4
store %struct.gdev_time* %1, %struct.gdev_time** %5
%6 = load %struct.gdev_time*, %struct.gdev_time** %4
%7 = load %struct.gdev_time*, %struct.gdev_time** %5
%8 = call i64 @gdev_time_eq(%struct.gdev_time* %6, %struct.gdev_time* %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 1, i32* %3
br label %15
11: ; preds = %2
%12 = load %struct.gdev_time*, %struct.gdev_time** %4
%13 = load %struct.gdev_time*, %struct.gdev_time** %5
%14 = call i32 @gdev_time_gt(%struct.gdev_time* %12, %struct.gdev_time* %13)
store i32 %14, i32* %3
br label %15
15: ; preds = %11, %10
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
%struct.gdev_time = type { i32 }
define i32 @gdev_time_ge(%struct.gdev_time* %0, %struct.gdev_time* %1) {
%3 = tail call i64 @gdev_time_eq(%struct.gdev_time* %0, %struct.gdev_time* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @gdev_time_gt(%struct.gdev_time* %0, %struct.gdev_time* %1)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ 1, %2 ]
ret i32 %8
}
/* Variables and functions */
void *dlmalloc(size_t);
int /*<<< orphan*/ mem_error();
void *mem_alloc(size_t s) {
  void *x = dlmalloc(s);
  if (!x)
    mem_error();
  return x;
}


x86 assembly (clang, -O0):
<mem_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <dlmalloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114b <mem_alloc+0x2b>
mov    $0x0,%al
call   1030 <mem_error@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_alloc>:
push   %rbx
call   1040 <dlmalloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <mem_alloc+0x15>
xor    %eax,%eax
call   1030 <mem_error@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @mem_alloc(i64 %0) {
%2 = tail call i8* @dlmalloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @mem_error()
br label %6
6: ; preds = %4, %1
ret i8* %2
}
int main() {
  int x1, x2, x2pred;
  int y1, y2, y3;
  y1 = 0;
  y2 = 0;
  y3 = x1;
  while (1) {
    if (y2 + 1 == x2) {
      y1++;
      y2 = 0;
      y3--;
    } else {
      y2++;
      y3--;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
cmp    -0xc(%rbp),%eax
jne    114c <main+0x4c>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    115e <main+0x5e>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    111f <main+0x1f>

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

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

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile uint32_t;

/* Variables and functions */
uint32_t readl(const void *address) {
  return *((volatile uint32_t *)(address));
}


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

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

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

LLVM IR (-O2):
define i32 @readl(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = load volatile i32, i32* %2
ret i32 %3
}
/* Variables and functions */
void *ta_memdup(void *, void *, size_t);
int /*<<< orphan*/ ta_oom_b(int /*<<< orphan*/);
void *ta_xmemdup(void *ta_parent, void *ptr, size_t size) {
  void *new = ta_memdup(ta_parent, ptr, size);
  ta_oom_b(new || !ptr);
  return new;
}


x86 assembly (clang, -O0):
<ta_xmemdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <ta_memdup@plt>
mov    %rax,-0x20(%rbp)
mov    $0x1,%al
cmpq   $0x0,-0x20(%rbp)
mov    %al,-0x21(%rbp)
jne    1166 <ta_xmemdup+0x46>
cmpq   $0x0,-0x10(%rbp)
setne  %al
xor    $0xff,%al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ta_oom_b@plt>
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ta_xmemdup>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1040 <ta_memdup@plt>
mov    %rax,%r14
test   %rax,%rax
setne  %al
test   %rbx,%rbx
sete   %cl
or     %al,%cl
movzbl %cl,%edi
call   1030 <ta_oom_b@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @ta_xmemdup(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i8* @ta_memdup(i8* %8, i8* %9, i64 %10)
store i8* %11, i8** %7
%12 = load i8*, i8** %7
%13 = icmp ne i8* %12, null
br i1 %13, label %18, label %14
14: ; preds = %3
%15 = load i8*, i8** %5
%16 = icmp ne i8* %15, null
%17 = xor i1 %16, true
br label %18
18: ; preds = %14, %3
%19 = phi i1 [ true, %3 ], [ %17, %14 ]
%20 = zext i1 %19 to i32
%21 = call i32 @ta_oom_b(i32 %20)
%22 = load i8*, i8** %7
ret i8* %22
}

LLVM IR (-O2):
define i8* @ta_xmemdup(i8* %0, i8* %1, i64 %2) {
%4 = tail call i8* @ta_memdup(i8* %0, i8* %1, i64 %2)
%5 = icmp ne i8* %4, null
%6 = icmp eq i8* %1, null
%7 = or i1 %6, %5
%8 = zext i1 %7 to i32
%9 = tail call i32 @ta_oom_b(i32 %8)
ret i8* %4
}
/* Variables and functions */
int crypto_sign_ed25519_open(unsigned char *, unsigned long long *,
                             unsigned char const *, unsigned long long,
                             unsigned char const *);
int crypto_sign_open(unsigned char *m, unsigned long long *mlen_p,
                     const unsigned char *sm, unsigned long long smlen,
                     const unsigned char *pk) {
  return crypto_sign_ed25519_open(m, mlen_p, sm, smlen, pk);
}


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

x86 assembly (clang, -O2):
<crypto_sign_open>:
jmp    1030 <crypto_sign_ed25519_open@plt>

LLVM IR (-O0):
define i32 @crypto_sign_open(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i64*
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i8*
store i8* %0, i8** %6
store i64* %1, i64** %7
store i8* %2, i8** %8
store i64 %3, i64* %9
store i8* %4, i8** %10
%11 = load i8*, i8** %6
%12 = load i64*, i64** %7
%13 = load i8*, i8** %8
%14 = load i64, i64* %9
%15 = load i8*, i8** %10
%16 = call i32 @crypto_sign_ed25519_open(i8* %11, i64* %12, i8* %13, i64 %14, i8* %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @crypto_sign_open(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4) {
%6 = tail call i32 @crypto_sign_ed25519_open(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x96() {
  Assert_real((isodigit(150) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isodigit.c",
              755, ("isodigit should be 0 for 0x96"));
}


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

x86 assembly (clang, -O2):
<t_isodigit_0x96>:
push   %rax
mov    $0x96,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x2f3,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

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

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0x96\00"
define void @t_isodigit_0x96() {
%1 = tail call i64 @isodigit(i32 150)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 755, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
long __scanbit(unsigned long val, unsigned long max) {
  asm("bsfq %1,%0 ; cmovz %2,%0" : "=&r"(val) : "r"(val), "r"(max));
  return val;
}


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

x86 assembly (clang, -O2):
<__scanbit>:
bsf    %rdi,%rax
cmove  %rsi,%rax
ret

LLVM IR (-O0):
define i64 @__scanbit(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = call i64 asm "bsfq $1,$0 ; cmovz $2,$0", "=&r,r,r,~{dirflag},~{fpsr},~{flags}"(i64 %5, i64 %6)
store i64 %7, i64* %3
%8 = load i64, i64* %3
ret i64 %8
}

LLVM IR (-O2):
define i64 @__scanbit(i64 %0, i64 %1) {
%3 = tail call i64 asm "bsfq $1,$0 ; cmovz $2,$0", "=&r,r,r,~{dirflag},~{fpsr},~{flags}"(i64 %0, i64 %1)
ret i64 %3
}
double compute_combinations(int choices, int chosen) {
  if (chosen == 0) {
    return 1;
  } else {
    return choices * compute_combinations(choices - 1, chosen - 1) / chosen;
  }
}


x86 assembly (clang, -O0):
<compute_combinations>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    113a <compute_combinations+0x2a>
movsd  0xed0(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    116f <compute_combinations+0x5f>
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0xc(%rbp),%edi
sub    $0x1,%edi
mov    -0x10(%rbp),%esi
sub    $0x1,%esi
call   1030 <compute_combinations@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_combinations>:
push   %rbx
sub    $0x10,%rsp
test   %esi,%esi
je     1140 <compute_combinations+0x30>
mov    %esi,%ebx
cvtsi2sd %edi,%xmm0
movsd  %xmm0,0x8(%rsp)
add    $0xffffffff,%edi
lea    -0x1(%rbx),%esi
call   1030 <compute_combinations@plt>
mulsd  0x8(%rsp),%xmm0
cvtsi2sd %ebx,%xmm1
divsd  %xmm1,%xmm0
jmp    1148 <compute_combinations+0x38>
movsd  0xeb8(%rip),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @compute_combinations(i32 %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store double 1.000000e+00, double* %3
br label %21
9: ; preds = %2
%10 = load i32, i32* %4
%11 = sitofp i32 %10 to double
%12 = load i32, i32* %4
%13 = sub nsw i32 %12, 1
%14 = load i32, i32* %5
%15 = sub nsw i32 %14, 1
%16 = call double @compute_combinations(i32 %13, i32 %15)
%17 = fmul double %11, %16
%18 = load i32, i32* %5
%19 = sitofp i32 %18 to double
%20 = fdiv double %17, %19
store double %20, double* %3
br label %21
21: ; preds = %9, %8
%22 = load double, double* %3
ret double %22
}

LLVM IR (-O2):
define double @compute_combinations(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2, %6
%5 = phi double [ %13, %6 ], [ 1.000000e+00, %2 ]
ret double %5
6: ; preds = %2
%7 = sitofp i32 %0 to double
%8 = add nsw i32 %0, -1
%9 = add nsw i32 %1, -1
%10 = tail call double @compute_combinations(i32 %8, i32 %9)
%11 = fmul double %10, %7
%12 = sitofp i32 %1 to double
%13 = fdiv double %11, %12
br label %4
}
void g_tree_steal() {}


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

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

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

LLVM IR (-O2):
define void @g_tree_steal() {
ret void
}
int _comb(int n, int d) {
  int x = 1;
  for (int i = 0; i < d; ++i)
    x = x * (n - i) / (i + 1);
  return x;
}


x86 assembly (clang, -O0):
<_comb>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    114a <_comb+0x4a>
mov    -0xc(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    -0x10(%rbp),%ecx
imul   %ecx,%eax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1118 <_comb+0x18>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_comb>:
test   %esi,%esi
jle    1113 <_comb+0x13>
cmp    $0x1,%esi
jne    1119 <_comb+0x19>
mov    $0x1,%eax
xor    %r9d,%r9d
jmp    1151 <_comb+0x51>
mov    $0x1,%eax
ret
mov    %esi,%r8d
and    $0xfffffffe,%r8d
mov    $0x1,%eax
xor    %r9d,%r9d
mov    %edi,%ecx
nopw   0x0(%rax,%rax,1)
imul   %ecx,%eax
lea    0x1(%r9),%r10d
cltd
idiv   %r10d
lea    -0x1(%rcx),%edx
imul   %edx,%eax
add    $0x2,%r9d
cltd
idiv   %r9d
add    $0xfffffffe,%ecx
cmp    %r9d,%r8d
jne    1130 <_comb+0x30>
test   $0x1,%sil
je     1167 <_comb+0x67>
sub    %r9d,%edi
imul   %eax,%edi
add    $0x1,%r9d
mov    %edi,%eax
cltd
idiv   %r9d
ret

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

LLVM IR (-O2):
define i32 @_comb(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %19
4: ; preds = %2
%5 = and i32 %1, 1
%6 = icmp eq i32 %1, 1
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = and i32 %1, -2
br label %21
9: ; preds = %21, %4
%10 = phi i32 [ undef, %4 ], [ %32, %21 ]
%11 = phi i32 [ 0, %4 ], [ %31, %21 ]
%12 = phi i32 [ 1, %4 ], [ %32, %21 ]
%13 = icmp eq i32 %5, 0
br i1 %13, label %19, label %14
14: ; preds = %9
%15 = sub nsw i32 %0, %11
%16 = mul nsw i32 %15, %12
%17 = add nuw nsw i32 %11, 1
%18 = sdiv i32 %16, %17
br label %19
19: ; preds = %14, %9, %2
%20 = phi i32 [ 1, %2 ], [ %10, %9 ], [ %18, %14 ]
ret i32 %20
21: ; preds = %21, %7
%22 = phi i32 [ 0, %7 ], [ %31, %21 ]
%23 = phi i32 [ 1, %7 ], [ %32, %21 ]
%24 = phi i32 [ 0, %7 ], [ %33, %21 ]
%25 = sub nsw i32 %0, %22
%26 = mul nsw i32 %25, %23
%27 = or i32 %22, 1
%28 = sdiv i32 %26, %27
%29 = sub nsw i32 %0, %27
%30 = mul nsw i32 %29, %28
%31 = add nuw nsw i32 %22, 2
%32 = sdiv i32 %30, %31
%33 = add nuw i32 %24, 2
%34 = icmp eq i32 %33, %8
br i1 %34, label %9, label %21
}
double ts2epb(tsec)
double tsec;
{
  double dj;
  dj = ts2jd(tsec);
  return (jd2epb(dj));
}


x86 assembly (clang, -O0):
<ts2epb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x1,%al
call   1040 <ts2jd@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0x1,%al
call   1030 <jd2epb@plt>
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ts2epb>:
push   %rax
mov    $0x1,%al
call   1040 <ts2jd@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mov    $0x1,%al
call   1030 <jd2epb@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @ts2epb(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call i32 (double, ...) bitcast (i32 (...)* @ts2jd to i32 (double, ...)*)(double %4)
%6 = sitofp i32 %5 to double
store double %6, double* %3
%7 = load double, double* %3
%8 = call i32 (double, ...) bitcast (i32 (...)* @jd2epb to i32 (double, ...)*)(double %7)
%9 = sitofp i32 %8 to double
ret double %9
}

LLVM IR (-O2):
define double @ts2epb(double %0) {
%2 = tail call i32 (double, ...) bitcast (i32 (...)* @ts2jd to i32 (double, ...)*)(double %0)
%3 = sitofp i32 %2 to double
%4 = tail call i32 (double, ...) bitcast (i32 (...)* @jd2epb to i32 (double, ...)*)(double %3)
%5 = sitofp i32 %4 to double
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int free_char_star(void *item) {
  char *s = (char *)item;
  free(s);
  s = NULL;
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @free_char_star(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @free(i8* %5)
store i8* null, i8** %3
ret i32 0
}

LLVM IR (-O2):
define i32 @free_char_star(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int *, int *, int *);
void fn1(int a) {
  int b = 10, c;
  c = a + b;
  printf("fn1(): a=%p, b=%p, c=%p\n", &a, &b, &c);
}


x86 assembly (clang, -O0):
<fn1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
lea    0xece(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
lea    -0xc(%rbp),%rcx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn1>:
sub    $0x18,%rsp
mov    %edi,0x14(%rsp)
movl   $0xa,0x10(%rsp)
add    $0xa,%edi
mov    %edi,0xc(%rsp)
lea    0xed2(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1030 <printf@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [25 x i8] c"fn1(): a=%p, b=%p, c=%p\0A\00"
define void @fn1(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 10, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = add nsw i32 %5, %6
store i32 %7, i32* %4
%8 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"fn1(): a=%p, b=%p, c=%p\0A\00"
define void @fn1(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = bitcast i32* %3 to i8*
store i32 10, i32* %3
%6 = bitcast i32* %4 to i8*
%7 = add nsw i32 %0, 10
store i32 %7, i32* %4
%8 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ handle_TTIN(int /*<<< orphan*/);
int gen_TTIN() {
  handle_TTIN(0);
  return 0;
}


x86 assembly (clang, -O0):
<gen_TTIN>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <handle_TTIN@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @gen_TTIN() {
%1 = call i32 @handle_TTIN(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @gen_TTIN() {
%1 = tail call i32 @handle_TTIN(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void nrerror(char error_text[]) {
  fprintf(stderr, "nr error: %s\n", error_text);
  _exit(1);
}


x86 assembly (clang, -O0):
<nrerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<nrerror>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [14 x i8] c"nr error: %s\0A\00"
define void @nrerror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @_exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [14 x i8] c"nr error: %s\0A\00"
define void @nrerror(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @_exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ babl_base_model_gray();
int /*<<< orphan*/ babl_base_model_rgb();
int /*<<< orphan*/ babl_base_model_ycbcr();
void models(void) {
  babl_base_model_rgb();
  babl_base_model_gray();
  babl_base_model_ycbcr();
}


x86 assembly (clang, -O0):
<models>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <babl_base_model_rgb@plt>
mov    $0x0,%al
call   1030 <babl_base_model_gray@plt>
mov    $0x0,%al
call   1050 <babl_base_model_ycbcr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<models>:
push   %rax
xor    %eax,%eax
call   1040 <babl_base_model_rgb@plt>
xor    %eax,%eax
call   1030 <babl_base_model_gray@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <babl_base_model_ycbcr@plt>

LLVM IR (-O0):
define void @models() {
%1 = call i32 (...) @babl_base_model_rgb()
%2 = call i32 (...) @babl_base_model_gray()
%3 = call i32 (...) @babl_base_model_ycbcr()
ret void
}

LLVM IR (-O2):
define void @models() {
%1 = tail call i32 (...) @babl_base_model_rgb()
%2 = tail call i32 (...) @babl_base_model_gray()
%3 = tail call i32 (...) @babl_base_model_ycbcr()
ret void
}
int main(int argc, char *argv[]) {
#pragma starpu initialize
  int x[123] __attribute__((unused));
  static char z[345] __attribute__((unused));
#pragma starpu register x
#pragma starpu acquire
#pragma starpu acquire 123
#pragma starpu acquire does_not_exit
#pragma starpu acquire argc
#pragma starpu acquire y
#pragma starpu acquire x
#pragma starpu acquire x z
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x180,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%eax
add    $0x180,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@main.z = internal global [345 x i8] zeroinitializer
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [123 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
ret i32 1
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void fastq_print_version() { fprintf(stderr, "fastq_utils %s\n", "0.25.1"); }


x86 assembly (clang, -O0):
<fastq_print_version>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
lea    0xee5(%rip),%rdx
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fastq_print_version>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
lea    0xee9(%rip),%rdx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [16 x i8] c"fastq_utils %s\0A\00"
@.str.1 = [7 x i8] c"0.25.1\00"
define void @fastq_print_version() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"fastq_utils %s\0A\00"
@.str.1 = [7 x i8] c"0.25.1\00"
define void @fastq_print_version() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int strcmp(char const *, char const *);
int cmp_string(const void *pstr1, const void *pstr2) {
  const char *str1 = *(const char **)pstr1;
  const char *str2 = *(const char **)pstr2;
  return strcmp(str1, str2);
}


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

x86 assembly (clang, -O2):
<cmp_string>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @cmp_string(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i8**
%9 = load i8*, i8** %8
store i8* %9, i8** %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i8**
%12 = load i8*, i8** %11
store i8* %12, i8** %6
%13 = load i8*, i8** %5
%14 = load i8*, i8** %6
%15 = call i32 @strcmp(i8* %13, i8* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @cmp_string(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Type definitions */
struct linux_binprm {
  int dummy;
};

/* Variables and functions */
int cap_bprm_secureexec(struct linux_binprm *);
int security_bprm_secureexec(struct linux_binprm *bprm) {
  return cap_bprm_secureexec(bprm);
}


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

x86 assembly (clang, -O2):
<security_bprm_secureexec>:
jmp    1030 <cap_bprm_secureexec@plt>

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

LLVM IR (-O2):
%struct.linux_binprm = type { i32 }
define i32 @security_bprm_secureexec(%struct.linux_binprm* %0) {
%2 = tail call i32 @cap_bprm_secureexec(%struct.linux_binprm* %0)
ret i32 %2
}
int f(char c) {
  switch (c) {
  case 0:
    return 3;
  case 1:
    return 2;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     112f <f+0x2f>
jmp    111e <f+0x1e>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
je     113b <f+0x3b>
jmp    1147 <f+0x47>
movl   $0x3,-0x4(%rbp)
jmp    114e <f+0x4e>
movl   $0x2,-0x4(%rbp)
jmp    114e <f+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
xor    %ecx,%ecx
cmp    $0x1,%dil
sete   %cl
add    %ecx,%ecx
test   %dil,%dil
mov    $0x3,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @f(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %8 [
i32 0, label %6
i32 1, label %7
]
6: ; preds = %1
store i32 3, i32* %2
br label %9
7: ; preds = %1
store i32 2, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7, %6
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @f(i8 signext %0) {
%2 = icmp eq i8 %0, 1
%3 = select i1 %2, i32 2, i32 0
%4 = icmp eq i8 %0, 0
%5 = select i1 %4, i32 3, i32 %3
ret i32 %5
}
void checkpoint1() {}


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

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

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

LLVM IR (-O2):
define void @checkpoint1() {
ret void
}
int test_00(unsigned char *x) { return x[0]; }


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

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

LLVM IR (-O0):
define i32 @test_00(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @test_00(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
ret i32 %3
}
void main(void) {
  do {
  } while (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <main+0x9>
jmp    110e <main+0xe>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @main() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DoList(char *, char *);
void List(char *param) { DoList(param, "-l"); }


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

x86 assembly (clang, -O2):
<List>:
lea    0xee9(%rip),%rsi
jmp    1030 <DoList@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"-l\00"
define void @List(i8* %0) {
%2 = tail call i32 @DoList(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_lcol(char *, char *, int);
int main(void) {
  test_lcol("abc\n"
            "this is a test\n",
            "this is another test\n"
            "still testing\n",
            2);
  test_lcol("abc\n"
            "this is a test\n",
            "this is another test\n"
            "still testing\n",
            2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xef2(%rip),%rsi
mov    $0x2,%edx
call   1030 <test_lcol@plt>
lea    0xecd(%rip),%rdi
lea    0xeda(%rip),%rsi
mov    $0x2,%edx
call   1030 <test_lcol@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xee5(%rip),%rbx
lea    0xef2(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x2,%edx
call   1030 <test_lcol@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x2,%edx
call   1030 <test_lcol@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [20 x i8] c"abc\0Athis is a test\0A\00"
@.str.1 = [36 x i8] c"this is another test\0Astill testing\0A\00"
define i32 @main() {
%1 = call i32 @test_lcol(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 2)
%2 = call i32 @test_lcol(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 2)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"abc\0Athis is a test\0A\00"
@.str.1 = [36 x i8] c"this is another test\0Astill testing\0A\00"
define i32 @main() {
%1 = tail call i32 @test_lcol(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 2)
%2 = tail call i32 @test_lcol(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 2)
ret i32 0
}
/* Variables and functions */
double log10(double);
double intr_wrap_056(double p1) { return log10(p1); }


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

x86 assembly (clang, -O2):
<intr_wrap_056>:
jmp    1030 <log10@plt>

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

LLVM IR (-O2):
define double @intr_wrap_056(double %0) {
%2 = tail call double @log10(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage() { printf("USAGE: netmanager [iface]\n"); }


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"USAGE: netmanager [iface]\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [26 x i8] c"USAGE: netmanager [iface]\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
ret void
}
int proc_comm_batt_is_valid(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @proc_comm_batt_is_valid() {
ret i32 0
}
void doublefault_init_cpu_tss(void) {}


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

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

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

LLVM IR (-O2):
define void @doublefault_init_cpu_tss() {
ret void
}
/* Variables and functions */
int pnmwriter_pixel(void *, unsigned int, unsigned int, unsigned int);
bool got_pixel(unsigned int col, unsigned int row, unsigned int r,
               unsigned int g, unsigned int b, void *userdata) {
  return pnmwriter_pixel(userdata, r, g, b);
}


x86 assembly (clang, -O0):
<got_pixel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1030 <pnmwriter_pixel@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<got_pixel>:
mov    %r9,%rdi
mov    %edx,%esi
mov    %ecx,%edx
mov    %r8d,%ecx
jmp    1030 <pnmwriter_pixel@plt>

LLVM IR (-O0):
define i32 @got_pixel(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i8* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i8* %5, i8** %12
%13 = load i8*, i8** %12
%14 = load i32, i32* %9
%15 = load i32, i32* %10
%16 = load i32, i32* %11
%17 = call i32 @pnmwriter_pixel(i8* %13, i32 %14, i32 %15, i32 %16)
ret i32 %17
}

LLVM IR (-O2):
define i32 @got_pixel(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i8* %5) {
%7 = tail call i32 @pnmwriter_pixel(i8* %5, i32 %2, i32 %3, i32 %4)
ret i32 %7
}
/* Type definitions */
struct ext4_sblock {
  int dummy;
};
struct ext4_blockdev {
  int dummy;
};

/* Variables and functions */
int ext4_block_readbytes(struct ext4_blockdev *, int, struct ext4_sblock *,
                         int);
int ext4_sb_read(struct ext4_blockdev *bdev, struct ext4_sblock *s) {
  return ext4_block_readbytes(bdev, 1024, s, 1024);
}


x86 assembly (clang, -O0):
<ext4_sb_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x400,%ecx
mov    %ecx,%esi
call   1030 <ext4_block_readbytes@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ext4_sb_read>:
mov    %rsi,%rdx
mov    $0x400,%esi
mov    $0x400,%ecx
jmp    1030 <ext4_block_readbytes@plt>

LLVM IR (-O0):
%struct.ext4_blockdev = type { i32 }
%struct.ext4_sblock = type { i32 }
define i32 @ext4_sb_read(%struct.ext4_blockdev* %0, %struct.ext4_sblock* %1) {
%3 = alloca %struct.ext4_blockdev*
%4 = alloca %struct.ext4_sblock*
store %struct.ext4_blockdev* %0, %struct.ext4_blockdev** %3
store %struct.ext4_sblock* %1, %struct.ext4_sblock** %4
%5 = load %struct.ext4_blockdev*, %struct.ext4_blockdev** %3
%6 = load %struct.ext4_sblock*, %struct.ext4_sblock** %4
%7 = call i32 @ext4_block_readbytes(%struct.ext4_blockdev* %5, i32 1024, %struct.ext4_sblock* %6, i32 1024)
ret i32 %7
}

LLVM IR (-O2):
%struct.ext4_blockdev = type { i32 }
%struct.ext4_sblock = type { i32 }
define i32 @ext4_sb_read(%struct.ext4_blockdev* %0, %struct.ext4_sblock* %1) {
%3 = tail call i32 @ext4_block_readbytes(%struct.ext4_blockdev* %0, i32 1024, %struct.ext4_sblock* %1, i32 1024)
ret i32 %3
}
/* Variables and functions */
int sum(int);
int main(int argc, char **argv) {
  if (argc == 0) {
    return 0;
  }
  return sum(argc);
}


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)
cmpl   $0x0,-0x8(%rbp)
jne    113c <main+0x2c>
movl   $0x0,-0x4(%rbp)
jmp    1147 <main+0x37>
mov    -0x8(%rbp),%edi
call   1030 <sum@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
test   %edi,%edi
je     1119 <main+0x9>
jmp    1030 <sum@plt>
xor    %eax,%eax
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 = load i32, i32* %4
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 0, i32* %3
br label %12
9: ; preds = %2
%10 = load i32, i32* %4
%11 = call i32 @sum(i32 %10)
store i32 %11, i32* %3
br label %12
12: ; preds = %9, %8
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @sum(i32 %0)
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ %5, %4 ], [ 0, %2 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printid(int);
void func3(int i) { printid(i); }


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

x86 assembly (clang, -O2):
<func3>:
jmp    1030 <printid@plt>

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

LLVM IR (-O2):
define void @func3(i32 %0) {
%2 = tail call i32 @printid(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ makethread(void *(*)(void *), void *);
void multhread(int num, void *(*fn)(void *), void *arg) {
  int i = 0;
  for (i = 0; i < num; i++)
    makethread(fn, arg);
}


x86 assembly (clang, -O0):
<multhread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1158 <multhread+0x48>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <makethread@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1131 <multhread+0x21>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<multhread>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
jle    1130 <multhread+0x20>
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <makethread@plt>
add    $0xffffffff,%ebp
jne    1120 <multhread+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @multhread(i32 %0, i8* (i8*)* %1, i8* %2) {
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %10
5: ; preds = %3, %5
%6 = phi i32 [ %8, %5 ], [ 0, %3 ]
%7 = tail call i32 @makethread(i8* (i8*)* %1, i8* %2)
%8 = add nuw nsw i32 %6, 1
%9 = icmp eq i32 %8, %0
br i1 %9, label %10, label %5
10: ; preds = %5, %3
ret void
}
int icomp(const void *v1, const void *v2) {
  const int *p1 = v1;
  const int *p2 = v2;
  return (*p1 - *p2);
}


x86 assembly (clang, -O0):
<icomp>:
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),%eax
mov    -0x20(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @icomp(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 = sub nsw i32 %12, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @icomp(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 = sub nsw i32 %5, %6
ret i32 %7
}
int foo19() { return 19; }


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

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

LLVM IR (-O0):
define i32 @foo19() {
ret i32 19
}

LLVM IR (-O2):
define i32 @foo19() {
ret i32 19
}