xunge/DecIR huggingface dataset:
void rotr(int *a, int *b, int *c) {
  int swapp;
  swapp = *c;
  *c = *b;
  *b = *a;
  *a = swapp;
}


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

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

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

LLVM IR (-O2):
define void @rotr(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %2
%5 = load i32, i32* %1
store i32 %5, i32* %2
%6 = load i32, i32* %0
store i32 %6, i32* %1
store i32 %4, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ config_load(char *);
int vpmnd_help();
int vpmnd_start();
int main(int argc, char *argv[]) {
  if (argc != 2)
    return vpmnd_help();
  config_load(argv[1]);
  return vpmnd_start();
}


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   $0x2,-0x8(%rbp)
je     115f <main+0x2f>
mov    $0x0,%al
call   1050 <vpmnd_help@plt>
mov    %eax,-0x4(%rbp)
jmp    1176 <main+0x46>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <config_load@plt>
mov    $0x0,%al
call   1040 <vpmnd_start@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x2,%edi
jne    1147 <main+0x17>
push   %rax
mov    0x8(%rsi),%rdi
call   1030 <config_load@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <vpmnd_start@plt>
xor    %eax,%eax
jmp    1050 <vpmnd_help@plt>

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 ne i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (...) @vpmnd_help()
store i32 %9, i32* %3
br label %16
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @config_load(i8* %13)
%15 = call i32 (...) @vpmnd_start()
store i32 %15, i32* %3
br label %16
16: ; preds = %10, %8
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 (...) @vpmnd_help()
br label %11
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @config_load(i8* %8)
%10 = tail call i32 (...) @vpmnd_start()
br label %11
11: ; preds = %6, %4
%12 = phi i32 [ %5, %4 ], [ %10, %6 ]
ret i32 %12
}
/* Variables and functions */
int foo(int);
int main(int argc, char *argv[]) {
  (void)argv;
  return foo(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)
mov    -0x8(%rbp),%edi
call   1030 <foo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <foo@plt>

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 i8**, i8*** %5
%7 = load i32, i32* %4
%8 = call i32 @foo(i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @foo(i32 %0)
ret i32 %3
}
long long bit09() { return 0x0000000000000200LL; }


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

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

LLVM IR (-O0):
define i64 @bit09() {
ret i64 512
}

LLVM IR (-O2):
define i64 @bit09() {
ret i64 512
}
void RandomFunc(unsigned long input[1], unsigned long output[1]) {
  unsigned long state[1];
  unsigned long local1;
  {
    state[0UL] = input[0UL] + 0xffffffffff660b45UL;
    local1 = 0UL;
    while (local1 < 1UL) {
      state[local1] *= state[local1];
      local1 += 2UL;
    }
    output[0UL] = state[0UL] - 114204063568655258UL;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
add    $0xffffffffff660b45,%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x1,-0x20(%rbp)
jae    1159 <RandomFunc+0x59>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp,%rax,8),%rcx
mov    -0x20(%rbp),%rax
imul   -0x18(%rbp,%rax,8),%rcx
mov    %rcx,-0x18(%rbp,%rax,8)
mov    -0x20(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x20(%rbp)
jmp    1125 <RandomFunc+0x25>
mov    -0x18(%rbp),%rcx
movabs $0x195bbfda0ea739a,%rax
bb 95 01
sub    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    $0xffffffffff660b45,%rax
add    (%rdi),%rax
imul   %rax,%rax
movabs $0xfe6a44025f158c66,%rcx
44 6a fe
add    %rax,%rcx
mov    %rcx,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
%5 = alloca [1 x i64]
%6 = alloca i64
store i64* %0, i64** %3
store i64* %1, i64** %4
%7 = load i64*, i64** %3
%8 = getelementptr inbounds i64, i64* %7, i64 0
%9 = load i64, i64* %8
%10 = add i64 %9, -10089659
%11 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
store i64 %10, i64* %11
store i64 0, i64* %6
br label %12
12: ; preds = %15, %2
%13 = load i64, i64* %6
%14 = icmp ult i64 %13, 1
br i1 %14, label %15, label %25
15: ; preds = %12
%16 = load i64, i64* %6
%17 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 %16
%18 = load i64, i64* %17
%19 = load i64, i64* %6
%20 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 %19
%21 = load i64, i64* %20
%22 = mul i64 %21, %18
store i64 %22, i64* %20
%23 = load i64, i64* %6
%24 = add i64 %23, 2
store i64 %24, i64* %6
br label %12
25: ; preds = %12
%26 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%27 = load i64, i64* %26
%28 = sub i64 %27, 114204063568655258
%29 = load i64*, i64** %4
%30 = getelementptr inbounds i64, i64* %29, i64 0
store i64 %28, i64* %30
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i64* nocapture %0, i64* nocapture writeonly %1) {
%3 = load i64, i64* %0
%4 = add i64 %3, -10089659
%5 = mul i64 %4, %4
%6 = add i64 %5, -114204063568655258
store i64 %6, i64* %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ SVCXPRT;

/* Variables and functions */
void svcraw_destroy(SVCXPRT *__xprt) {}


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

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

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

LLVM IR (-O2):
define void @svcraw_destroy(i32* nocapture %0) {
ret void
}
/* Variables and functions */
double log10f(float);
float AmpToDb(float amplitude) { return 20.0 * log10f(amplitude); }


x86 assembly (clang, -O0):
<AmpToDb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <log10f@plt>
movaps %xmm0,%xmm1
movsd  0xece(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AmpToDb>:
push   %rax
call   1030 <log10f@plt>
mulsd  0xee2(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @AmpToDb(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call double @log10f(float %3)
%5 = fmul double 2.000000e+01, %4
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @AmpToDb(float %0) {
%2 = tail call double @log10f(float %0)
%3 = fmul double %2, 2.000000e+01
%4 = fptrunc double %3 to float
ret float %4
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
scalar_t__ getpid();
scalar_t__ sys_vfork();
pid_t vfork(void) {
  pid_t newpid = sys_vfork();
  if (newpid == getpid())
    return 0;
  return newpid;
}


x86 assembly (clang, -O0):
<vfork>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1040 <sys_vfork@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
jne    115f <vfork+0x3f>
movq   $0x0,-0x8(%rbp)
jmp    1167 <vfork+0x47>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vfork>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <sys_vfork@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1030 <getpid@plt>
cmp    %rax,%r14
cmovne %r14,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @vfork() {
%1 = tail call i64 (...) @sys_vfork()
%2 = tail call i64 (...) @getpid()
%3 = icmp eq i64 %1, %2
%4 = select i1 %3, i64 0, i64 %1
ret i64 %4
}
/* Variables and functions */
bool GAOptionExists(char **argv_end, char **argv) {
  while (argv < argv_end)
    if ((*argv++)[0] == '-')
      return true;
  return false;
}


x86 assembly (clang, -O0):
<GAOptionExists>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1149 <GAOptionExists+0x49>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1144 <GAOptionExists+0x44>
movl   $0x1,-0x4(%rbp)
jmp    1150 <GAOptionExists+0x50>
jmp    110c <GAOptionExists+0xc>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GAOptionExists>:
cmp    %rdi,%rsi
jae    1117 <GAOptionExists+0x17>
mov    (%rsi),%rax
add    $0x8,%rsi
cmpb   $0x2d,(%rax)
jne    1100 <GAOptionExists>
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @GAOptionExists(i8** readnone %0, i8** %1) {
br label %3
3: ; preds = %6, %2
%4 = phi i8** [ %1, %2 ], [ %7, %6 ]
%5 = icmp ult i8** %4, %0
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = getelementptr inbounds i8*, i8** %4, i64 1
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 45
br i1 %10, label %11, label %3
11: ; preds = %3, %6
%12 = phi i32 [ 1, %6 ], [ 0, %3 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, int, int);
main() {
  int i;
  for (i = 1; i < 100; ++i)
    printf("\n i=%d i<<1 = %d i<<5 = %d     i>>2=%d i>>5=%d", i, i << 1, i << 5,
           i >> 2, i >> 5);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    1169 <main+0x59>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
shl    $0x1,%edx
mov    -0x8(%rbp),%ecx
shl    $0x5,%ecx
mov    -0x8(%rbp),%r8d
sar    $0x2,%r8d
mov    -0x8(%rbp),%r9d
sar    $0x5,%r9d
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
mov    $0x2,%ebp
mov    $0x20,%r14d
lea    0xed2(%rip),%r15
xchg   %ax,%ax
mov    %ebx,%r8d
shr    $0x2,%r8d
mov    %ebx,%r9d
shr    $0x5,%r9d
mov    %r15,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %r14d,%ecx
call   1030 <printf@plt>
add    $0x1,%ebx
add    $0x2,%ebp
add    $0x20,%r14d
cmp    $0xc8,%ebp
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [47 x i8] c"\0A i=%d i<<1 = %d i<<5 = %d i>>2=%d i>>5=%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
br label %3
3: ; preds = %17, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 100
br i1 %5, label %6, label %20
6: ; preds = %3
%7 = load i32, i32* %2
%8 = load i32, i32* %2
%9 = shl i32 %8, 1
%10 = load i32, i32* %2
%11 = shl i32 %10, 5
%12 = load i32, i32* %2
%13 = ashr i32 %12, 2
%14 = load i32, i32* %2
%15 = ashr i32 %14, 5
%16 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %9, i32 %11, i32 %13, i32 %15)
br label %17
17: ; preds = %6
%18 = load i32, i32* %2
%19 = add nsw i32 %18, 1
store i32 %19, i32* %2
br label %3
20: ; preds = %3
%21 = load i32, i32* %1
ret i32 %21
}

LLVM IR (-O2):
@.str = [47 x i8] c"\0A i=%d i<<1 = %d i<<5 = %d i>>2=%d i>>5=%d\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 1, %0 ], [ %8, %1 ]
%3 = shl nuw nsw i32 %2, 1
%4 = shl nuw nsw i32 %2, 5
%5 = lshr i32 %2, 2
%6 = lshr i32 %2, 5
%7 = tail call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3, i32 %4, i32 %5, i32 %6)
%8 = add nuw nsw i32 %2, 1
%9 = icmp eq i32 %8, 100
br i1 %9, label %10, label %1
10: ; preds = %1
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t uint16_decode(const uint8_t *p_encoded_data) {
  return ((((uint16_t)((uint8_t *)p_encoded_data)[0])) |
          (((uint16_t)((uint8_t *)p_encoded_data)[1]) << 8));
}


x86 assembly (clang, -O0):
<uint16_decode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%rcx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uint16_decode>:
mov    0x8(%rdi),%eax
shl    $0x8,%eax
or     (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @uint16_decode(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = getelementptr inbounds i64, i64* %3, i64 0
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = load i64*, i64** %2
%8 = getelementptr inbounds i64, i64* %7, i64 1
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = shl i32 %10, 8
%12 = or i32 %6, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @uint16_decode(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = trunc i64 %2 to i32
%4 = getelementptr inbounds i64, i64* %0, i64 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = shl i32 %6, 8
%8 = or i32 %7, %3
ret i32 %8
}
void default_reset_instr_callback(void) {}


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

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

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

LLVM IR (-O2):
define void @default_reset_instr_callback() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gooey();
int /*<<< orphan*/ sticky();
int main() {
  sticky();
  gooey();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <sticky@plt>
mov    $0x0,%al
call   1040 <gooey@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @sticky()
%2 = call i32 (...) @gooey()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @sticky()
%2 = tail call i32 (...) @gooey()
ret i32 0
}
int tcsetattr(int fd, int mode, struct termios *t) { return 0; }


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

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

LLVM IR (-O0):
%struct.termios = type opaque
define i32 @tcsetattr(i32 %0, i32 %1, %struct.termios* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.termios*
store i32 %0, i32* %4
store i32 %1, i32* %5
store %struct.termios* %2, %struct.termios** %6
ret i32 0
}

LLVM IR (-O2):
%struct.termios = type opaque
define i32 @tcsetattr(i32 %0, i32 %1, %struct.termios* nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
int new_symbol(char *, int, int);
int new_object_symbol(char *str, int object_type) {
  int symbol_number;
  symbol_number = new_symbol(str, 1, object_type);
  return (symbol_number);
}


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

x86 assembly (clang, -O2):
<new_object_symbol>:
mov    %esi,%edx
mov    $0x1,%esi
jmp    1030 <new_symbol@plt>

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

LLVM IR (-O2):
define i32 @new_object_symbol(i8* %0, i32 %1) {
%3 = tail call i32 @new_symbol(i8* %0, i32 1, i32 %1)
ret i32 %3
}
/* Variables and functions */
double HUGE_VAL;
double bestPossibleValue() { return (HUGE_VAL); }


x86 assembly (clang, -O0):
<bestPossibleValue>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
movsd  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<bestPossibleValue>:
mov    0x2ee1(%rip),%rax
movsd  (%rax),%xmm0
ret

LLVM IR (-O0):
@HUGE_VAL = global double 0.000000e+00
define double @bestPossibleValue() {
%1 = load double, double* @HUGE_VAL
ret double %1
}

LLVM IR (-O2):
@HUGE_VAL = global double 0.000000e+00
define double @bestPossibleValue() {
%1 = load double, double* @HUGE_VAL
ret double %1
}
/* Type definitions */
struct tcb {
  int dummy;
};
struct rtc_time {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ print_rtc_time(struct tcb *, struct rtc_time *);
int /*<<< orphan*/ tprints(char *);
int /*<<< orphan*/ umoven_or_printaddr(struct tcb *, long const, int, void *);
void decode_rtc_time(struct tcb *tcp, const long addr) {
  struct rtc_time rt;
  tprints(", ");
  if (!umoven_or_printaddr((tcp), (addr), sizeof(*(&rt)), (void *)(&rt)))
    print_rtc_time(tcp, &rt);
}


x86 assembly (clang, -O0):
<decode_rtc_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb9(%rip),%rdi
call   1050 <tprints@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rcx
mov    $0x4,%edx
call   1040 <umoven_or_printaddr@plt>
cmp    $0x0,%eax
jne    1178 <decode_rtc_time+0x48>
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <print_rtc_time@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_rtc_time>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xebf(%rip),%rdi
call   1050 <tprints@plt>
mov    %rsp,%rcx
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x4,%edx
call   1040 <umoven_or_printaddr@plt>
test   %eax,%eax
jne    1168 <decode_rtc_time+0x38>
mov    %rsp,%rsi
mov    %r14,%rdi
call   1030 <print_rtc_time@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.tcb = type { i32 }
%struct.rtc_time = type { i32 }
@.str = [3 x i8] c", \00"
define void @decode_rtc_time(%struct.tcb* %0, i64 %1) {
%3 = alloca %struct.tcb*
%4 = alloca i64
%5 = alloca %struct.rtc_time
store %struct.tcb* %0, %struct.tcb** %3
store i64 %1, i64* %4
%6 = call i32 @tprints(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%7 = load %struct.tcb*, %struct.tcb** %3
%8 = load i64, i64* %4
%9 = bitcast %struct.rtc_time* %5 to i8*
%10 = call i32 @umoven_or_printaddr(%struct.tcb* %7, i64 %8, i32 4, i8* %9)
%11 = icmp ne i32 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %2
%13 = load %struct.tcb*, %struct.tcb** %3
%14 = call i32 @print_rtc_time(%struct.tcb* %13, %struct.rtc_time* %5)
br label %15
15: ; preds = %12, %2
ret void
}

LLVM IR (-O2):
%struct.tcb = type { i32 }
%struct.rtc_time = type { i32 }
@.str = [3 x i8] c", \00"
define void @decode_rtc_time(%struct.tcb* %0, i64 %1) {
%3 = alloca %struct.rtc_time
%4 = bitcast %struct.rtc_time* %3 to i8*
%5 = tail call i32 @tprints(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @umoven_or_printaddr(%struct.tcb* %0, i64 %1, i32 4, i8* %4)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @print_rtc_time(%struct.tcb* %0, %struct.rtc_time* %3)
br label %10
10: ; preds = %8, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getch();
int /*<<< orphan*/ printf(char *);
void main() {
  printf("Hello, World!");
  getch();
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello, World!\00"
define void @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @getch()
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello, World!\00"
define void @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @getch()
ret void
}
/* Variables and functions */
float acosf(float);
float gb_arccos(float a) { return acosf(a); }


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

x86 assembly (clang, -O2):
<gb_arccos>:
jmp    1030 <acosf@plt>

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

LLVM IR (-O2):
define float @gb_arccos(float %0) {
%2 = tail call float @acosf(float %0)
ret float %2
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_join(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ puts(char *);
void *tf1(void *arg) {
  pthread_join((pthread_t)arg, NULL);
  puts("1st join returned");
  return (void *)1l;
}


x86 assembly (clang, -O0):
<tf1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <pthread_join@plt>
lea    0xebe(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tf1>:
push   %rax
xor    %esi,%esi
call   1040 <pthread_join@plt>
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"1st join returned\00"
define i8* @tf1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i32
%5 = call i32 @pthread_join(i32 %4, i32* null)
%6 = call i32 @puts(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i8* inttoptr (i64 1 to i8*)
}

LLVM IR (-O2):
@.str = [18 x i8] c"1st join returned\00"
define i8* @tf1(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i32 @pthread_join(i32 %3, i32* null)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i8* inttoptr (i64 1 to i8*)
}
/* Variables and functions */
int snprintf(char *, int, char *, int);
int f5(char *s) { return snprintf(s, 8, "%d", 123); }


x86 assembly (clang, -O0):
<f5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x8,%esi
lea    0xed4(%rip),%rdx
mov    $0x7b,%ecx
call   1030 <snprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f5>:
lea    0xee9(%rip),%rdx
mov    $0x8,%esi
mov    $0x7b,%ecx
jmp    1030 <snprintf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @f5(i8* %0) {
%2 = tail call i32 @snprintf(i8* %0, i32 8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 123)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ xclip_notify_change();
int /*<<< orphan*/ xclip_probe_selections();
void xclip_handle_SelectionClear(void) {
  ;
  xclip_notify_change();
  xclip_probe_selections();
}


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

x86 assembly (clang, -O2):
<xclip_handle_SelectionClear>:
push   %rax
xor    %eax,%eax
call   1030 <xclip_notify_change@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <xclip_probe_selections@plt>

LLVM IR (-O0):
define void @xclip_handle_SelectionClear() {
%1 = call i32 (...) @xclip_notify_change()
%2 = call i32 (...) @xclip_probe_selections()
ret void
}

LLVM IR (-O2):
define void @xclip_handle_SelectionClear() {
%1 = tail call i32 (...) @xclip_notify_change()
%2 = tail call i32 (...) @xclip_probe_selections()
ret void
}
unsigned int nearZeroVelocity(double r) {
  if (r >= 0.0) {
    return r < 0.01;
  } else {
    return -r < 0.01;
  }
  __builtin_unreachable();
}


x86 assembly (clang, -O0):
<nearZeroVelocity>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1138 <nearZeroVelocity+0x38>
movsd  0xedd(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    116b <nearZeroVelocity+0x6b>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xea4(%rip),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nearZeroVelocity>:
movsd  0xef8(%rip),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
xor    %ecx,%ecx
ucomisd 0xeed(%rip),%xmm0
seta   %cl
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
cmovae %eax,%ecx
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @nearZeroVelocity(double %0) {
%2 = alloca i32
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp oge double %4, 0.000000e+00
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load double, double* %3
%8 = fcmp olt double %7, 1.000000e-02
%9 = zext i1 %8 to i32
store i32 %9, i32* %2
br label %15
10: ; preds = %1
%11 = load double, double* %3
%12 = fneg double %11
%13 = fcmp olt double %12, 1.000000e-02
%14 = zext i1 %13 to i32
store i32 %14, i32* %2
br label %15
15: ; preds = %10, %6
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @nearZeroVelocity(double %0) {
%2 = fcmp ult double %0, 0.000000e+00
%3 = fcmp olt double %0, 1.000000e-02
%4 = fcmp ogt double %0, -1.000000e-02
%5 = select i1 %2, i1 %4, i1 %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int write(int /*<<< orphan*/, char *, int);
void generate_irq() {
  if (write(0, "I", 1) == -1) {
    printf("%s: Communication problems with Fiasco-UX, dying...!\n", "ux_tun");
    exit(0);
  }
}


x86 assembly (clang, -O0):
<generate_irq>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xec3(%rip),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
cmp    $0xffffffff,%eax
jne    116a <generate_irq+0x3a>
lea    0xeab(%rip),%rdi
lea    0xeda(%rip),%rsi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_irq>:
push   %rax
lea    0xec8(%rip),%rsi
xor    %edi,%edi
mov    $0x1,%edx
call   1030 <write@plt>
cmp    $0xffffffff,%eax
je     114b <generate_irq+0x1b>
pop    %rax
ret
lea    0xeb0(%rip),%rdi
lea    0xedf(%rip),%rsi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"I\00"
@.str.1 = [54 x i8] c"%s: Communication problems with Fiasco-UX, dying...!\0A\00"
@.str.2 = [7 x i8] c"ux_tun\00"
define void @generate_irq() {
%1 = call i32 @write(i32 0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @exit(i32 0)
unreachable
6: ; preds = %0
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"I\00"
@.str.1 = [54 x i8] c"%s: Communication problems with Fiasco-UX, dying...!\0A\00"
@.str.2 = [7 x i8] c"ux_tun\00"
define void @generate_irq() {
%1 = tail call i32 @write(i32 0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 @exit(i32 0)
unreachable
6: ; preds = %0
ret void
}
int c40_iof2(c40)
int c40;
{ return (ioctl(c40, (_IO('v', 14)), 0)); }


x86 assembly (clang, -O0):
<c40_iof2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x76,%edi
mov    $0xe,%esi
mov    $0x0,%al
call   1030 <_IO@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
xor    %edx,%edx
mov    $0x0,%al
call   1040 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c40_iof2>:
push   %rbx
mov    %edi,%ebx
mov    $0x76,%edi
mov    $0xe,%esi
xor    %eax,%eax
call   1030 <_IO@plt>
mov    %ebx,%edi
mov    %eax,%esi
xor    %edx,%edx
xor    %eax,%eax
pop    %rbx
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
define i32 @c40_iof2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, i32, ...) bitcast (i32 (...)* @_IO to i32 (i32, i32, ...)*)(i32 118, i32 14)
%5 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @ioctl to i32 (i32, i32, i32, ...)*)(i32 %3, i32 %4, i32 0)
ret i32 %5
}

LLVM IR (-O2):
define i32 @c40_iof2(i32 %0) {
%2 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @_IO to i32 (i32, i32, ...)*)(i32 118, i32 14)
%3 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @ioctl to i32 (i32, i32, i32, ...)*)(i32 %0, i32 %2, i32 0)
ret i32 %3
}
/* Type definitions */
struct leaf {
  int dummy;
};

/* Variables and functions */
scalar_t__ error();
int /*<<< orphan*/ free_object(int, short *);
void free_leaf(struct leaf *lef) {
  free_object(27, (short *)lef);
  if (error())
    return;
}


x86 assembly (clang, -O0):
<free_leaf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x1b,%edi
call   1030 <free_object@plt>
mov    $0x0,%al
call   1040 <error@plt>
cmp    $0x0,%rax
je     1150 <free_leaf+0x30>
jmp    1150 <free_leaf+0x30>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_leaf>:
push   %rax
mov    %rdi,%rsi
mov    $0x1b,%edi
call   1030 <free_object@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <error@plt>

LLVM IR (-O0):
%struct.leaf = type { i32 }
define void @free_leaf(%struct.leaf* %0) {
%2 = alloca %struct.leaf*
store %struct.leaf* %0, %struct.leaf** %2
%3 = load %struct.leaf*, %struct.leaf** %2
%4 = bitcast %struct.leaf* %3 to i16*
%5 = call i32 @free_object(i32 27, i16* %4)
%6 = call i64 (...) @error()
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
%struct.leaf = type { i32 }
define void @free_leaf(%struct.leaf* %0) {
%2 = bitcast %struct.leaf* %0 to i16*
%3 = tail call i32 @free_object(i32 27, i16* %2)
%4 = tail call i64 (...) @error()
ret void
}
/* Variables and functions */
char *mallocx(int);
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char const *);
char *str_dup(const char *str) {
  char *p = mallocx((strlen(str) + 1) * sizeof(char));
  strcpy(p, str);
  return p;
}


x86 assembly (clang, -O0):
<str_dup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <mallocx@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_dup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
call   1050 <mallocx@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @str_dup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = add nsw i32 %5, 1
%7 = sext i32 %6 to i64
%8 = mul i64 %7, 1
%9 = trunc i64 %8 to i32
%10 = call i8* @mallocx(i32 %9)
store i8* %10, i8** %3
%11 = load i8*, i8** %3
%12 = load i8*, i8** %2
%13 = call i32 @strcpy(i8* %11, i8* %12)
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
define i8* @str_dup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i8* @mallocx(i32 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ system(char *);
dump_memory_usage() {
  char cmd[256];
  strcpy(cmd, "ps -u");
  strcat(cmd, " | awk '$11==\"zz\" {print \"RSS=\" $6}'");
  system(cmd);
  return 1;
}


x86 assembly (clang, -O0):
<dump_memory_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
lea    0xeb7(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x100(%rbp),%rdi
lea    0xeaa(%rip),%rsi
call   1050 <strcat@plt>
lea    -0x100(%rbp),%rdi
call   1040 <system@plt>
mov    $0x1,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_memory_usage>:
push   %rbx
sub    $0x100,%rsp
lea    0xec1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xeb5(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcat@plt>
mov    %rbx,%rdi
call   1040 <system@plt>
mov    $0x1,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"ps -u\00"
@.str.1 = [37 x i8] c" | awk '$11==\22zz\22 {print \22RSS=\22 $6}'\00"
define i32 @dump_memory_usage() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = call i32 @strcat(i8* %4, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%7 = call i32 @system(i8* %6)
ret i32 1
}

LLVM IR (-O2):
@.str = [6 x i8] c"ps -u\00"
@.str.1 = [37 x i8] c" | awk '$11==\22zz\22 {print \22RSS=\22 $6}'\00"
define i32 @dump_memory_usage() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @strcat(i8* %2, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @system(i8* %2)
ret i32 1
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
scalar_t__ internal_fiat_p434_nonzero(uintptr_t);
void fiat_p434_nonzero(uint64_t *out1, const uint64_t arg1[7]) {
  *out1 = (uint64_t)internal_fiat_p434_nonzero((uintptr_t)arg1);
}


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

x86 assembly (clang, -O2):
<fiat_p434_nonzero>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <internal_fiat_p434_nonzero@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @fiat_p434_nonzero(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
store i64* %0, i64** %3
store i64* %1, i64** %4
%5 = load i64*, i64** %4
%6 = ptrtoint i64* %5 to i64
%7 = call i64 @internal_fiat_p434_nonzero(i64 %6)
%8 = load i64*, i64** %3
store i64 %7, i64* %8
ret void
}

LLVM IR (-O2):
define void @fiat_p434_nonzero(i64* nocapture writeonly %0, i64* %1) {
%3 = ptrtoint i64* %1 to i64
%4 = tail call i64 @internal_fiat_p434_nonzero(i64 %3)
store i64 %4, i64* %0
ret void
}
void free_charptrarray(char **array, int len) {
  for (; len > 0; len--)
    free(array[len - 1]);
  free(array);
}


x86 assembly (clang, -O0):
<free_charptrarray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    114d <free_charptrarray+0x3d>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    111f <free_charptrarray+0xf>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_charptrarray>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
test   %esi,%esi
jle    1146 <free_charptrarray+0x36>
mov    %esi,%ebx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    -0x2(%rbx),%eax
mov    (%r14,%rax,8),%rdi
call   1030 <free@plt>
add    $0xffffffffffffffff,%rbx
cmp    $0x1,%rbx
ja     1130 <free_charptrarray+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_charptrarray(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %5, %4 ], [ %8, %6 ]
%8 = add nsw i64 %7, -1
%9 = and i64 %8, 4294967295
%10 = getelementptr inbounds i8*, i8** %0, i64 %9
%11 = load i8*, i8** %10
tail call void @free(i8* %11)
%12 = icmp ugt i64 %7, 1
br i1 %12, label %6, label %13
13: ; preds = %6, %2
%14 = bitcast i8** %0 to i8*
tail call void @free(i8* %14)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ epapr_platform_init(unsigned long, unsigned long,
                                       unsigned long, unsigned long,
                                       unsigned long);
int /*<<< orphan*/ of_platform_init(unsigned long, unsigned long, void *);
void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
                   unsigned long r6, unsigned long r7) {
  if (r5) {
    of_platform_init(r3, r4, (void *)r5);
  } else {
    epapr_platform_init(r3, r4, r5, r6, r7);
  }
}


x86 assembly (clang, -O0):
<platform_init>:
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)
cmpq   $0x0,-0x18(%rbp)
je     115d <platform_init+0x3d>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <of_platform_init@plt>
jmp    1176 <platform_init+0x56>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <epapr_platform_init@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<platform_init>:
test   %rdx,%rdx
je     112a <platform_init+0xa>
jmp    1040 <of_platform_init@plt>
xor    %edx,%edx
jmp    1030 <epapr_platform_init@plt>

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

LLVM IR (-O2):
define void @platform_init(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = icmp eq i64 %2, 0
br i1 %6, label %10, label %7
7: ; preds = %5
%8 = inttoptr i64 %2 to i8*
%9 = tail call i32 @of_platform_init(i64 %0, i64 %1, i8* %8)
br label %12
10: ; preds = %5
%11 = tail call i32 @epapr_platform_init(i64 %0, i64 %1, i64 0, i64 %3, i64 %4)
br label %12
12: ; preds = %10, %7
ret void
}
int cmp(const void *a, const void *b) {
  return (int)(*(long long *)a - *(long long *)b);
}


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

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

LLVM IR (-O0):
define i32 @cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i64*
%7 = load i64, i64* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i64*
%10 = load i64, i64* %9
%11 = sub nsw i64 %7, %10
%12 = trunc i64 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = sub nsw i64 %4, %6
%8 = trunc i64 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ assertf(int, char *, int);
void cttestfmt() {
  return;
  int n = 1;
  assertf(n == 2, "n is %d", n);
}


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

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

LLVM IR (-O0):
define void @cttestfmt() {
%1 = alloca i32
ret void
}

LLVM IR (-O2):
define void @cttestfmt() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("a\tb\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [4 x i8] c"a\09b\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int comparison(void *a, void *b) {
  int x = *(int *)a;
  int y = *(int *)b;
  if (x < y)
    return -1;
  if (x > y)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<comparison>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1136 <comparison+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <comparison+0x55>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jle    114e <comparison+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    1155 <comparison+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @comparison(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp slt i32 %4, %6
%8 = icmp sgt i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}