xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ foo(int *);
int main(void) {
  int a[] = {17, 23};
l1:
  foo(a);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movabs $0x1700000011,%rax
mov    %rax,(%rsp)
mov    %rsp,%rdi
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.a = [2 x i32] [i32 17, i32 23]
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x i32]
store i32 0, i32* %1
%3 = bitcast [2 x i32]* %2 to i8*
br label %4
4: ; preds = %0
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%6 = call i32 @foo(i32* %5)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
store i64 98784247825, i64* %1
%3 = bitcast i64* %1 to i32*
%4 = call i32 @foo(i32* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ alarm(int);
int /*<<< orphan*/ m();
int main(void) {
  alarm(5);
  m();
  return 42;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1030 <alarm@plt>
xor    %eax,%eax
call   1040 <m@plt>
mov    $0x2a,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @alarm(i32 5)
%2 = tail call i32 (...) @m()
ret i32 42
}
/* Variables and functions */
int japi_dialog(int, char *);
int j_dialog(int arg0, char *arg1) { return (japi_dialog(arg0, arg1)); }


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

x86 assembly (clang, -O2):
<j_dialog>:
jmp    1030 <japi_dialog@plt>

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

LLVM IR (-O2):
define i32 @j_dialog(i32 %0, i8* %1) {
%3 = tail call i32 @japi_dialog(i32 %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void grpcsharp_completion_queue_destroy() {
  fprintf(stderr, "Should never reach here");
  abort();
}


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

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

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_completion_queue_destroy() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
void bcd(int **a) {
  int b = 20;
  *a = &b;
}


x86 assembly (clang, -O0):
<bcd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
mov    -0x8(%rbp),%rax
lea    -0xc(%rbp),%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bcd>:
lea    -0x4(%rsp),%rax
mov    %rax,(%rdi)
ret

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

LLVM IR (-O2):
define void @bcd(i32** nocapture writeonly %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32* %2, i32** %0
ret void
}
int absdiff(int x, int y) {
  if (x < y) {
    return y - x;
  } else {
    return x - y;
  }
}


x86 assembly (clang, -O0):
<absdiff>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1124 <absdiff+0x24>
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    112d <absdiff+0x2d>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<absdiff>:
mov    %edi,%eax
sub    %esi,%eax
neg    %eax
sub    %esi,%edi
cmovge %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @absdiff(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = sub nsw i32 %1, %0
%5 = sub nsw i32 %0, %1
%6 = select i1 %3, i32 %4, i32 %5
ret i32 %6
}
/* Type definitions */
struct btree {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ bch_btree_sort_partial(struct btree *, int /*<<< orphan*/);
void bch_btree_sort(struct btree *b) { bch_btree_sort_partial(b, 0); }


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

x86 assembly (clang, -O2):
<bch_btree_sort>:
xor    %esi,%esi
jmp    1030 <bch_btree_sort_partial@plt>

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

LLVM IR (-O2):
%struct.btree = type { i32 }
define void @bch_btree_sort(%struct.btree* %0) {
%2 = tail call i32 @bch_btree_sort_partial(%struct.btree* %0, i32 0)
ret void
}
void f1(x) int *x;
{}


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

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

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

LLVM IR (-O2):
define void @f1(i32* nocapture %0) {
ret void
}
void generic_clear_bit(int nr, volatile unsigned long *addr) {
  unsigned long mask = (1UL << ((nr) % 32));
  unsigned long *p = ((unsigned long *)addr) + ((nr) / 32);
  *p &= ~mask;
}


x86 assembly (clang, -O0):
<generic_clear_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rcx
xor    $0xffffffffffffffff,%rcx
mov    -0x20(%rbp),%rax
and    (%rax),%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<generic_clear_bit>:
mov    %edi,%ecx
lea    0x1f(%rcx),%eax
test   %edi,%edi
cmovns %edi,%eax
mov    %eax,%edx
and    $0xffffffe0,%edx
sub    %edx,%ecx
sar    $0x5,%eax
mov    $0xfffffffffffffffe,%rdx
rol    %cl,%rdx
cltq
and    %rdx,(%rsi,%rax,8)
ret

LLVM IR (-O0):
define void @generic_clear_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64*
store i32 %0, i32* %3
store i64* %1, i64** %4
%7 = load i32, i32* %3
%8 = srem i32 %7, 32
%9 = zext i32 %8 to i64
%10 = shl i64 1, %9
store i64 %10, i64* %5
%11 = load i64*, i64** %4
%12 = load i32, i32* %3
%13 = sdiv i32 %12, 32
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i64, i64* %11, i64 %14
store i64* %15, i64** %6
%16 = load i64, i64* %5
%17 = xor i64 %16, -1
%18 = load i64*, i64** %6
%19 = load i64, i64* %18
%20 = and i64 %19, %17
store i64 %20, i64* %18
ret void
}

LLVM IR (-O2):
define void @generic_clear_bit(i32 %0, i64* nocapture %1) {
%3 = srem i32 %0, 32
%4 = zext i32 %3 to i64
%5 = shl nuw i64 1, %4
%6 = sdiv i32 %0, 32
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i64, i64* %1, i64 %7
%9 = xor i64 %5, -1
%10 = load i64, i64* %8
%11 = and i64 %10, %9
store i64 %11, i64* %8
ret void
}
void glVertexAttribI4iv(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glVertexAttribI4iv() {
ret void
}
int checksum_cx_xinfo_func(void *data, int flag) { return 1; }


x86 assembly (clang, -O0):
<checksum_cx_xinfo_func>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @checksum_cx_xinfo_func(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
ret i32 1
}

LLVM IR (-O2):
define i32 @checksum_cx_xinfo_func(i8* nocapture readnone %0, i32 %1) {
ret i32 1
}
/* Variables and functions */
int rand();
int unsafe_load_select(int *p) {
  int r;
  int y = 7;
  r = rand();
  if (0 == r) {
    y = *p;
  }
  return y;
}


x86 assembly (clang, -O0):
<unsafe_load_select>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x7,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmp    -0xc(%rbp),%eax
jne    1141 <unsafe_load_select+0x31>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unsafe_load_select>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,%ecx
mov    $0x7,%eax
test   %ecx,%ecx
je     1128 <unsafe_load_select+0x18>
pop    %rbx
ret
mov    (%rbx),%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @unsafe_load_select(i32* nocapture %0) {
%2 = tail call i32 (...) @rand()
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = load i32, i32* %0
br label %6
6: ; preds = %4, %1
%7 = phi i32 [ %5, %4 ], [ 7, %1 ]
ret i32 %7
}
/* Type definitions */
struct device_module_set {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ sound_s3c44b0x_init(struct device_module_set *);
void sound_init(struct device_module_set *mod_set) {
  sound_s3c44b0x_init(mod_set);
}


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

x86 assembly (clang, -O2):
<sound_init>:
jmp    1030 <sound_s3c44b0x_init@plt>

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

LLVM IR (-O2):
%struct.device_module_set = type { i32 }
define void @sound_init(%struct.device_module_set* %0) {
%2 = tail call i32 @sound_s3c44b0x_init(%struct.device_module_set* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void escribirArchivo(char filename[140], char text[300]) {
  FILE *file;
  file = fopen(filename, "a");
  if (file) {
    fprintf(file, "%s\n", text);
    fclose(file);
  }
}


x86 assembly (clang, -O0):
<escribirArchivo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     117c <escribirArchivo+0x4c>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xe94(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<escribirArchivo>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
lea    0xec2(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     116c <escribirArchivo+0x3c>
mov    %rax,%rbx
lea    0xeb0(%rip),%rsi
mov    %rax,%rdi
mov    %r14,%rdx
call   1040 <fprintf@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fclose@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [2 x i8] c"a\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @escribirArchivo(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i32* @fopen(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = icmp ne i32* %8, null
br i1 %9, label %10, label %16
10: ; preds = %2
%11 = load i32*, i32** %5
%12 = load i8*, i8** %4
%13 = call i32 @fprintf(i32* %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %12)
%14 = load i32*, i32** %5
%15 = call i32 @fclose(i32* %14)
br label %16
16: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"a\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @escribirArchivo(i8* nocapture %0, i8* %1) {
%3 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32* %3, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%7 = tail call i32 @fclose(i32* %3)
br label %8
8: ; preds = %5, %2
ret void
}
/* Variables and functions */
scalar_t__ l3enc_read_stat(unsigned int *);
int /*<<< orphan*/ printf(char *, float);
int /*<<< orphan*/ usleep(double);
int main(int argc, char **argv) {
  unsigned int percent = 0;
  while (1) {
    if (l3enc_read_stat(&percent) == 0)
      printf("[P %f]\n", ((float)(percent)) / 100.0);
    usleep(0.5 * 1000000);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    -0x14(%rbp),%rdi
call   1040 <l3enc_read_stat@plt>
cmp    $0x0,%rax
jne    1188 <main+0x58>
mov    -0x14(%rbp),%eax
cvtsi2ss %rax,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe8c(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe78(%rip),%xmm0
call   1050 <usleep@plt>
jmp    114d <main+0x1d>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rbx
lea    0xec8(%rip),%r14
jmp    115d <main+0x2d>
nopw   0x0(%rax,%rax,1)
movsd  0xeb0(%rip),%xmm0
call   1050 <usleep@plt>
mov    %rbx,%rdi
call   1040 <l3enc_read_stat@plt>
test   %rax,%rax
jne    1150 <main+0x20>
mov    0x4(%rsp),%eax
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
divss  0xe82(%rip),%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
jmp    1150 <main+0x20>

LLVM IR (-O0):
@.str = [8 x i8] c"[P %f]\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
br label %7
7: ; preds = %2, %17
%8 = call i64 @l3enc_read_stat(i32* %6)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %17
10: ; preds = %7
%11 = load i32, i32* %6
%12 = uitofp i32 %11 to float
%13 = fpext float %12 to double
%14 = fdiv double %13, 1.000000e+02
%15 = fptrunc double %14 to float
%16 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), float %15)
br label %17
17: ; preds = %10, %7
%18 = call i32 @usleep(double 5.000000e+05)
br label %7
}

LLVM IR (-O2):
@.str = [8 x i8] c"[P %f]\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
br label %5
5: ; preds = %13, %2
%6 = call i64 @l3enc_read_stat(i32* %3)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %5
%9 = load i32, i32* %3
%10 = uitofp i32 %9 to float
%11 = fdiv float %10, 1.000000e+02
%12 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), float %11)
br label %13
13: ; preds = %8, %5
%14 = call i32 @usleep(double 5.000000e+05)
br label %5
}
int test2(int p) {
  static int q = 0;
  q += p;
  return p * q;
}


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    0x2f14(%rip),%eax
mov    %eax,0x2f0e(%rip)
mov    -0x4(%rbp),%eax
imul   0x2f04(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
mov    0x2f1e(%rip),%eax
add    %edi,%eax
mov    %eax,0x2f16(%rip)
imul   %edi,%eax
ret

LLVM IR (-O0):
@test2.q = internal global i32 0
define i32 @test2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @test2.q
%5 = add nsw i32 %4, %3
store i32 %5, i32* @test2.q
%6 = load i32, i32* %2
%7 = load i32, i32* @test2.q
%8 = mul nsw i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
@test2.q = internal unnamed_addr global i32 0
define i32 @test2(i32 %0) {
%2 = load i32, i32* @test2.q
%3 = add nsw i32 %2, %0
store i32 %3, i32* @test2.q
%4 = mul nsw i32 %3, %0
ret i32 %4
}
_Noreturn void b() { d2(); }


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

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

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

LLVM IR (-O2):
define void @b() {
%1 = tail call i32 (...) @d2()
ret void
}
/* Variables and functions */
bool nrfx_usbd_errata_199(void) { return (1 && true); }


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

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

LLVM IR (-O0):
define i32 @nrfx_usbd_errata_199() {
ret i32 1
}

LLVM IR (-O2):
define i32 @nrfx_usbd_errata_199() {
ret i32 1
}
double f(double x) {
  double y = 0.0;
  int i;
  for (i = 0; i < 8; i++) {
    y += x * i;
  }
  return y;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
jge    114c <f+0x4c>
movsd  -0x8(%rbp),%xmm0
cvtsi2sdl -0x14(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1118 <f+0x18>
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
xorpd  %xmm1,%xmm1
movapd %xmm0,%xmm2
mulsd  %xmm1,%xmm2
addsd  %xmm1,%xmm2
addsd  %xmm0,%xmm2
movapd %xmm0,%xmm1
addsd  %xmm0,%xmm1
addsd  %xmm2,%xmm1
movsd  0xed8(%rip),%xmm2
mulsd  %xmm0,%xmm2
addsd  %xmm1,%xmm2
movsd  0xed0(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  %xmm2,%xmm1
movsd  0xec8(%rip),%xmm2
mulsd  %xmm0,%xmm2
addsd  %xmm1,%xmm2
movsd  0xec0(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  %xmm2,%xmm1
mulsd  0xeb8(%rip),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @f(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca i32
store double %0, double* %2
store double 0.000000e+00, double* %3
store i32 0, i32* %4
br label %5
5: ; preds = %14, %1
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 8
br i1 %7, label %8, label %17
8: ; preds = %5
%9 = load double, double* %2
%10 = load i32, i32* %4
%11 = sitofp i32 %10 to double
%12 = load double, double* %3
%13 = call double @llvm.fmuladd.f64(double %9, double %11, double %12)
store double %13, double* %3
br label %14
14: ; preds = %8
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 1
store i32 %16, i32* %4
br label %5
17: ; preds = %5
%18 = load double, double* %3
ret double %18
}

LLVM IR (-O2):
define double @f(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double 0.000000e+00, double 0.000000e+00)
%3 = fadd double %2, %0
%4 = tail call double @llvm.fmuladd.f64(double %0, double 2.000000e+00, double %3)
%5 = tail call double @llvm.fmuladd.f64(double %0, double 3.000000e+00, double %4)
%6 = tail call double @llvm.fmuladd.f64(double %0, double 4.000000e+00, double %5)
%7 = tail call double @llvm.fmuladd.f64(double %0, double 5.000000e+00, double %6)
%8 = tail call double @llvm.fmuladd.f64(double %0, double 6.000000e+00, double %7)
%9 = tail call double @llvm.fmuladd.f64(double %0, double 7.000000e+00, double %8)
ret double %9
}
int __TBB_machine_fetchadd4(volatile void *ptr, long addend) {
  int result;
  __asm__ __volatile__("lock\nxaddl %0,%1"
                       : "=r"(result), "=m"(*(long *)ptr)
                       : "0"((int)addend), "m"(*(long *)ptr)
                       : "memory");
  return result;
}


x86 assembly (clang, -O0):
<__TBB_machine_fetchadd4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
lock xadd %eax,(%rcx)
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__TBB_machine_fetchadd4>:
mov    %rsi,%rax
lock xadd %eax,(%rdi)
ret

LLVM IR (-O0):
define i32 @__TBB_machine_fetchadd4(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i64*
%8 = load i64, i64* %4
%9 = trunc i64 %8 to i32
%10 = load i8*, i8** %3
%11 = bitcast i8* %10 to i64*
%12 = call i32 asm sideeffect "lock\0Axaddl $0,$1", "=r,=*m,0,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %7, i32 %9, i64* elementtype(i64) %11)
store i32 %12, i32* %5
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
define i32 @__TBB_machine_fetchadd4(i8* %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
%4 = trunc i64 %1 to i32
%5 = tail call i32 asm sideeffect "lock\0Axaddl $0,$1", "=r,=*m,0,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %3, i32 %4, i64* elementtype(i64) %3)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void GenHomeLocation(FILE *outfile) {
  char *topic, *topicFile, *topicPos;
  fprintf(outfile, "# Topic Home Locations\n");
  fprintf(outfile, "*topTopic: _HOMETOPIC\n");
  fprintf(outfile, "\n\n");
}


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

x86 assembly (clang, -O2):
<GenHomeLocation>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
mov    $0x17,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fwrite@plt>
lea    0xee4(%rip),%rdi
mov    $0x16,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fwrite@plt>
lea    0xee2(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
pop    %rbx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"# Topic Home Locations\0A\00"
@.str.1 = [23 x i8] c"*topTopic: _HOMETOPIC\0A\00"
@.str.2 = [3 x i8] c"\0A\0A\00"
define void @GenHomeLocation(i32* %0) {
%2 = alloca i32*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i32* %0, i32** %2
%6 = load i32*, i32** %2
%7 = call i32 @fprintf(i32* %6, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%8 = load i32*, i32** %2
%9 = call i32 @fprintf(i32* %8, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%10 = load i32*, i32** %2
%11 = call i32 @fprintf(i32* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"# Topic Home Locations\0A\00"
@.str.1 = [23 x i8] c"*topTopic: _HOMETOPIC\0A\00"
@.str.2 = [3 x i8] c"\0A\0A\00"
define void @GenHomeLocation(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i64 23, i64 1, i32* %0)
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i64 22, i64 1, i32* %0)
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i64 2, i64 1, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ myutoa(int, char *, int);
void myitoa(int num, char *string, int radix) {
  if (num < 0) {
    *string++ = '-';
    num = -num;
  }
  myutoa(num, string, radix);
}


x86 assembly (clang, -O0):
<myitoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1146 <myitoa+0x36>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x2d,(%rax)
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <myutoa@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myitoa>:
test   %edi,%edi
js     1119 <myitoa+0x9>
jmp    1030 <myutoa@plt>
movb   $0x2d,(%rsi)
add    $0x1,%rsi
neg    %edi
jmp    1030 <myutoa@plt>

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

LLVM IR (-O2):
define void @myitoa(i32 %0, i8* %1, i32 %2) {
%4 = icmp slt i32 %0, 0
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = getelementptr inbounds i8, i8* %1, i64 1
store i8 45, i8* %1
%7 = sub nsw i32 0, %0
br label %8
8: ; preds = %5, %3
%9 = phi i8* [ %6, %5 ], [ %1, %3 ]
%10 = phi i32 [ %7, %5 ], [ %0, %3 ]
%11 = tail call i32 @myutoa(i32 %10, i8* %9, i32 %2)
ret void
}
int GetCompileHour(void) {
  int hour = ((("16:58:43"[0] - '0') * 10) + ("16:58:43"[1] - '0'));
  return (hour);
}


x86 assembly (clang, -O0):
<GetCompileHour>:
push   %rbp
mov    %rsp,%rbp
movsbl 0xef5(%rip),%eax
sub    $0x30,%eax
imul   $0xa,%eax,%eax
movsbl 0xee9(%rip),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [9 x i8] c"16:58:43\00"
define i32 @GetCompileHour() {
%1 = alloca i32
%2 = load i8, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
%3 = sext i8 %2 to i32
%4 = sub nsw i32 %3, 48
%5 = mul nsw i32 %4, 10
%6 = load i8, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 1)
%7 = sext i8 %6 to i32
%8 = sub nsw i32 %7, 48
%9 = add nsw i32 %5, %8
store i32 %9, i32* %1
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @GetCompileHour() {
ret i32 16
}
unsigned int get_722(void *pnt) {
  unsigned char *p = (unsigned char *)pnt;
  return ((unsigned int)p[0] << 8) + ((unsigned int)p[1]);
}


x86 assembly (clang, -O0):
<get_722>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
shl    $0x8,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_722>:
movzwl (%rdi),%eax
shl    $0x10,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @get_722(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 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = shl i32 %8, 8
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = add i32 %9, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @get_722(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = or i32 %4, %7
ret i32 %8
}
/* Type definitions */
struct item {
  int dummy;
};

/* Variables and functions */
struct item *alloc_item();
struct item *init_item_by_default(struct item *);
struct item *new_item_by_default(void) {
  struct item *item;
  item = alloc_item();
  if (NULL != item)
    item = init_item_by_default(item);
  return (item);
}


x86 assembly (clang, -O0):
<new_item_by_default>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <alloc_item@plt>
mov    %rax,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
je     114c <new_item_by_default+0x2c>
mov    -0x8(%rbp),%rdi
call   1040 <init_item_by_default@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_item_by_default>:
push   %rax
xor    %eax,%eax
call   1030 <alloc_item@plt>
test   %rax,%rax
je     1136 <new_item_by_default+0x16>
mov    %rax,%rdi
pop    %rax
jmp    1040 <init_item_by_default@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.item = type { i32 }
define %struct.item* @new_item_by_default() {
%1 = alloca %struct.item*
%2 = call %struct.item* (...) @alloc_item()
store %struct.item* %2, %struct.item** %1
%3 = load %struct.item*, %struct.item** %1
%4 = icmp ne %struct.item* null, %3
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = load %struct.item*, %struct.item** %1
%7 = call %struct.item* @init_item_by_default(%struct.item* %6)
store %struct.item* %7, %struct.item** %1
br label %8
8: ; preds = %5, %0
%9 = load %struct.item*, %struct.item** %1
ret %struct.item* %9
}

LLVM IR (-O2):
%struct.item = type { i32 }
define %struct.item* @new_item_by_default() {
%1 = tail call %struct.item* (...) @alloc_item()
%2 = icmp eq %struct.item* %1, null
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call %struct.item* @init_item_by_default(%struct.item* %1)
br label %5
5: ; preds = %3, %0
%6 = phi %struct.item* [ %4, %3 ], [ null, %0 ]
ret %struct.item* %6
}
char *pasa_komen(char *s) {
  do
    s++;
  while (*s != '\42');
  s++;
  return (s);
}


x86 assembly (clang, -O0):
<pasa_komen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x22,%eax
jne    1108 <pasa_komen+0x8>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i8* @pasa_komen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %4, %2 ]
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 34
br i1 %6, label %7, label %2
7: ; preds = %2
%8 = getelementptr inbounds i8, i8* %3, i64 2
ret i8* %8
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
void ccnl_get_timeval(struct timeval *tv) { gettimeofday(tv, NULL); }


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

x86 assembly (clang, -O2):
<ccnl_get_timeval>:
xor    %esi,%esi
jmp    1030 <gettimeofday@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
define void @ccnl_get_timeval(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %2
%3 = load %struct.timeval*, %struct.timeval** %2
%4 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define void @ccnl_get_timeval(%struct.timeval* nocapture %0) {
%2 = tail call i32 @gettimeofday(%struct.timeval* %0, i32* null)
ret void
}
char *wby_skipws(char *p) {
  for (;;) {
    char ch = *p;
    if (' ' == ch || '\t' == ch)
      ++p;
    else
      break;
  }
  return p;
}


x86 assembly (clang, -O0):
<wby_skipws>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%ecx
mov    $0x20,%eax
cmp    %ecx,%eax
je     1133 <wby_skipws+0x33>
movsbl -0x9(%rbp),%ecx
mov    $0x9,%eax
cmp    %ecx,%eax
jne    1144 <wby_skipws+0x44>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1149 <wby_skipws+0x49>
jmp    114e <wby_skipws+0x4e>
jmp    1108 <wby_skipws+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wby_skipws>:
mov    %rdi,%rax
jmp    1114 <wby_skipws+0x14>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rax
movzbl (%rax),%ecx
cmp    $0x20,%cl
je     1110 <wby_skipws+0x10>
cmp    $0x9,%cl
je     1110 <wby_skipws+0x10>
ret

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

LLVM IR (-O2):
define i8* @wby_skipws(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 32, label %5
i8 9, label %5
]
5: ; preds = %2, %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile int64_t;

/* Variables and functions */
int64_t aeron_counter_get(volatile int64_t *addr) { return *addr; }


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

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

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

LLVM IR (-O2):
define i32 @aeron_counter_get(i32* %0) {
%2 = load volatile i32, i32* %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() {
  printf("Hello World!\n");
  printf("What's Up everyone!\n");
}


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"Hello World!\00"
@str.2 = [20 x i8] c"What's Up everyone!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int expect_and_skip(FILE *fp, int (*check)(FILE *)) {
  int rv = 0;
  while (check(fp)) {
    if (!rv)
      rv = 1;
  }
  return rv;
}


x86 assembly (clang, -O0):
<expect_and_skip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdi
call   *%rax
cmp    $0x0,%eax
je     1140 <expect_and_skip+0x40>
cmpl   $0x0,-0x14(%rbp)
jne    113b <expect_and_skip+0x3b>
movl   $0x1,-0x14(%rbp)
jmp    1117 <expect_and_skip+0x17>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expect_and_skip>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   *%rsi
xor    %ebp,%ebp
test   %eax,%eax
je     1130 <expect_and_skip+0x30>
mov    $0x1,%r15d
nopl   0x0(%rax,%rax,1)
test   %ebp,%ebp
cmove  %r15d,%ebp
mov    %rbx,%rdi
call   *%r14
test   %eax,%eax
jne    1120 <expect_and_skip+0x20>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @expect_and_skip(i32* %0, i32 (i32*)* nocapture %1) {
%3 = tail call i32 %1(i32* %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %11, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %8, %5 ], [ 0, %2 ]
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i32 1, i32 %6
%9 = tail call i32 %1(i32* %0)
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %5
11: ; preds = %5, %2
%12 = phi i32 [ 0, %2 ], [ %8, %5 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ unlock_database();
void unlock_and_exit(int code) {
  unlock_database();
  exit(code);
}


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

x86 assembly (clang, -O2):
<unlock_and_exit>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <unlock_database@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @unlock_and_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @unlock_database()
%4 = load i32, i32* %2
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
define void @unlock_and_exit(i32 %0) {
%2 = tail call i32 (...) @unlock_database()
%3 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
char *strdup(char const *);
char *xstrdup(const char *s) {
  char *n;
  if (s && (n = strdup(s)) == NULL)
    fatal("Can't allocate memory!");
  return s ? n : NULL;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     115a <xstrdup+0x3a>
mov    -0x8(%rbp),%rdi
call   1030 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    115a <xstrdup+0x3a>
lea    0xeab(%rip),%rdi
call   1040 <fatal@plt>
cmpq   $0x0,-0x8(%rbp)
je     1172 <xstrdup+0x52>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    117d <xstrdup+0x5d>
xor    %eax,%eax
mov    %rax,-0x18(%rbp)
jmp    117d <xstrdup+0x5d>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rax
test   %rdi,%rdi
je     113e <xstrdup+0x1e>
call   1030 <strdup@plt>
test   %rax,%rax
je     1132 <xstrdup+0x12>
pop    %rcx
ret
lea    0xec7(%rip),%rdi
call   1040 <fatal@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Can't allocate memory!\00"
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i8* @strdup(i8* %7)
store i8* %8, i8** %3
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %12
10: ; preds = %6
%11 = call i32 @fatal(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %6, %1
%13 = load i8*, i8** %2
%14 = icmp ne i8* %13, null
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = load i8*, i8** %3
br label %18
17: ; preds = %12
br label %18
18: ; preds = %17, %15
%19 = phi i8* [ %16, %15 ], [ null, %17 ]
ret i8* %19
}

LLVM IR (-O2):
@.str = [23 x i8] c"Can't allocate memory!\00"
define noalias i8* @xstrdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i8* @strdup(i8* %0)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @fatal(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3, %1
%9 = phi i8* [ null, %6 ], [ %4, %3 ], [ null, %1 ]
ret i8* %9
}
void UI_method_set_flusher(void) {}


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

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

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

LLVM IR (-O2):
define void @UI_method_set_flusher() {
ret void
}
/* Type definitions */
struct __sk_buff {
  int dummy;
};
typedef int /*<<< orphan*/ fmt;

/* Variables and functions */
int TC_H_MAKE(int, int);
int /*<<< orphan*/ trace_printk(char *, int);
__attribute__((section("aaa"), used)) int cls_aaa(struct __sk_buff *skb) {
  char fmt[] = "aaa\n";
  trace_printk(fmt, sizeof(fmt));
  return TC_H_MAKE(1, 42);
}


x86 assembly (clang, -O0):
<cls_aaa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0xece(%rip),%eax
mov    %eax,-0xd(%rbp)
mov    0xec9(%rip),%al
mov    %al,-0x9(%rbp)
lea    -0xd(%rbp),%rdi
mov    $0x5,%esi
call   1030 <trace_printk@plt>
mov    $0x1,%edi
mov    $0x2a,%esi
call   1040 <TC_H_MAKE@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cls_aaa>:
push   %rax
movb   $0x0,0x4(%rsp)
movl   $0xa616161,(%rsp)
mov    %rsp,%rdi
mov    $0x5,%esi
call   1030 <trace_printk@plt>
mov    $0x1,%edi
mov    $0x2a,%esi
call   1040 <TC_H_MAKE@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.__sk_buff = type { i32 }
@__const.cls_aaa.fmt = [5 x i8] c"aaa\0A\00"
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 (%struct.__sk_buff*)* @cls_aaa to i8*)], section "llvm.metadata"
define i32 @cls_aaa(%struct.__sk_buff* %0) section "aaa" {
%2 = alloca %struct.__sk_buff*
%3 = alloca [5 x i8]
store %struct.__sk_buff* %0, %struct.__sk_buff** %2
%4 = bitcast [5 x i8]* %3 to i8*
%5 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%6 = call i32 @trace_printk(i8* %5, i32 5)
%7 = call i32 @TC_H_MAKE(i32 1, i32 42)
ret i32 %7
}

LLVM IR (-O2):
%struct.__sk_buff = type { i32 }
@__const.cls_aaa.fmt = [5 x i8] c"aaa\0A\00"
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 (%struct.__sk_buff*)* @cls_aaa to i8*)], section "llvm.metadata"
define i32 @cls_aaa(%struct.__sk_buff* nocapture readnone %0) section "aaa" {
%2 = alloca [5 x i8]
%3 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%4 = call i32 @trace_printk(i8* %3, i32 5)
%5 = call i32 @TC_H_MAKE(i32 1, i32 42)
ret i32 %5
}
long double _dot(long double *a, long double *b) {
  return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
}


x86 assembly (clang, -O0):
<_dot>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
fldt   (%rcx)
mov    -0x10(%rbp),%rax
fldt   (%rax)
fldt   0x10(%rcx)
fldt   0x10(%rax)
fmulp  %st,%st(1)
fxch   %st(2)
fmulp  %st,%st(1)
faddp  %st,%st(1)
fldt   0x20(%rcx)
fldt   0x20(%rax)
fmulp  %st,%st(1)
faddp  %st,%st(1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_dot>:
fldt   (%rdi)
fldt   (%rsi)
fmulp  %st,%st(1)
fldt   0x10(%rdi)
fldt   0x10(%rsi)
fmulp  %st,%st(1)
faddp  %st,%st(1)
fldt   0x20(%rdi)
fldt   0x20(%rsi)
fmulp  %st,%st(1)
faddp  %st,%st(1)
ret

LLVM IR (-O0):
define x86_fp80 @_dot(x86_fp80* %0, x86_fp80* %1) {
%3 = alloca x86_fp80*
%4 = alloca x86_fp80*
store x86_fp80* %0, x86_fp80** %3
store x86_fp80* %1, x86_fp80** %4
%5 = load x86_fp80*, x86_fp80** %3
%6 = getelementptr inbounds x86_fp80, x86_fp80* %5, i64 0
%7 = load x86_fp80, x86_fp80* %6
%8 = load x86_fp80*, x86_fp80** %4
%9 = getelementptr inbounds x86_fp80, x86_fp80* %8, i64 0
%10 = load x86_fp80, x86_fp80* %9
%11 = load x86_fp80*, x86_fp80** %3
%12 = getelementptr inbounds x86_fp80, x86_fp80* %11, i64 1
%13 = load x86_fp80, x86_fp80* %12
%14 = load x86_fp80*, x86_fp80** %4
%15 = getelementptr inbounds x86_fp80, x86_fp80* %14, i64 1
%16 = load x86_fp80, x86_fp80* %15
%17 = fmul x86_fp80 %13, %16
%18 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %7, x86_fp80 %10, x86_fp80 %17)
%19 = load x86_fp80*, x86_fp80** %3
%20 = getelementptr inbounds x86_fp80, x86_fp80* %19, i64 2
%21 = load x86_fp80, x86_fp80* %20
%22 = load x86_fp80*, x86_fp80** %4
%23 = getelementptr inbounds x86_fp80, x86_fp80* %22, i64 2
%24 = load x86_fp80, x86_fp80* %23
%25 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %21, x86_fp80 %24, x86_fp80 %18)
ret x86_fp80 %25
}

LLVM IR (-O2):
define x86_fp80 @_dot(x86_fp80* nocapture %0, x86_fp80* nocapture %1) {
%3 = load x86_fp80, x86_fp80* %0
%4 = load x86_fp80, x86_fp80* %1
%5 = getelementptr inbounds x86_fp80, x86_fp80* %0, i64 1
%6 = load x86_fp80, x86_fp80* %5
%7 = getelementptr inbounds x86_fp80, x86_fp80* %1, i64 1
%8 = load x86_fp80, x86_fp80* %7
%9 = fmul x86_fp80 %6, %8
%10 = tail call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %3, x86_fp80 %4, x86_fp80 %9)
%11 = getelementptr inbounds x86_fp80, x86_fp80* %0, i64 2
%12 = load x86_fp80, x86_fp80* %11
%13 = getelementptr inbounds x86_fp80, x86_fp80* %1, i64 2
%14 = load x86_fp80, x86_fp80* %13
%15 = tail call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %12, x86_fp80 %14, x86_fp80 %10)
ret x86_fp80 %15
}