xunge/DecIR huggingface dataset:
/* Variables and functions */
int epoll_create(int);
int event_init(int max) { return epoll_create(max); }


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

x86 assembly (clang, -O2):
<event_init>:
jmp    1030 <epoll_create@plt>

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

LLVM IR (-O2):
define i32 @event_init(i32 %0) {
%2 = tail call i32 @epoll_create(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ foo();
int main(int argc, char *argv[]) {
  (void)argc;
  (void)argv;
  foo();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @foo()
ret i32 0
}
void XtMakeResizeRequest() {}


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

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

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

LLVM IR (-O2):
define void @XtMakeResizeRequest() {
ret void
}
int test1() {
  int a = 2;
label:
  a = a + 1;
  if (a != 20)
    goto label;
  int b = 3;
  b = b + 35 * 5 / 7;
  return a + b;
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x14,-0x4(%rbp)
je     1123 <test1+0x23>
jmp    110b <test1+0xb>
movl   $0x3,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x19,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test1() {
ret i32 48
}
void __t8() {}


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

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

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

LLVM IR (-O2):
define void @__t8() {
ret void
}
/* Variables and functions */
int strlen(char *);
void del_slash(char *buf) {
  int len = strlen(buf);
  int i;
  for (i = 0; i < len - 1; i++)
    buf[i] = buf[i + 1];
  buf[len - 1] = '\0';
}


x86 assembly (clang, -O0):
<del_slash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1169 <del_slash+0x59>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112f <del_slash+0x1f>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<del_slash>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <strlen@plt>
lea    -0x1(%rax),%ebp
cmp    $0x2,%eax
jl     1141 <del_slash+0x21>
lea    0x1(%rbx),%rsi
mov    %ebp,%edx
mov    %rbx,%rdi
call   1040 <memmove@plt>
movslq %ebp,%rax
movb   $0x0,(%rbx,%rax,1)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @del_slash(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
store i32 %6, i32* %3
store i32 0, i32* %4
br label %7
7: ; preds = %23, %1
%8 = load i32, i32* %4
%9 = load i32, i32* %3
%10 = sub nsw i32 %9, 1
%11 = icmp slt i32 %8, %10
br i1 %11, label %12, label %26
12: ; preds = %7
%13 = load i8*, i8** %2
%14 = load i32, i32* %4
%15 = add nsw i32 %14, 1
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %13, i64 %16
%18 = load i8, i8* %17
%19 = load i8*, i8** %2
%20 = load i32, i32* %4
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %19, i64 %21
store i8 %18, i8* %22
br label %23
23: ; preds = %12
%24 = load i32, i32* %4
%25 = add nsw i32 %24, 1
store i32 %25, i32* %4
br label %7
26: ; preds = %7
%27 = load i8*, i8** %2
%28 = load i32, i32* %3
%29 = sub nsw i32 %28, 1
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i8, i8* %27, i64 %30
store i8 0, i8* %31
ret void
}

LLVM IR (-O2):
define void @del_slash(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add i32 %2, -1
%4 = icmp sgt i32 %2, 1
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = getelementptr i8, i8* %0, i64 1
%7 = zext i32 %3 to i64
br label %8
8: ; preds = %5, %1
%9 = sext i32 %3 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
store i8 0, i8* %10
ret void
}
char cast_short_char_fast(short int x) { return (char)x; }


x86 assembly (clang, -O0):
<cast_short_char_fast>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%ax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cast_short_char_fast>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @cast_short_char_fast(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = trunc i16 %3 to i8
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @cast_short_char_fast(i16 signext %0) {
%2 = trunc i16 %0 to i8
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_warnIfReached();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void *malloc(int);
void test_single_cfg_block_sink() {
  void *p = malloc(1);
  clang_analyzer_warnIfReached();
  clang_analyzer_warnIfReached();
  exit(0);
}


x86 assembly (clang, -O0):
<test_single_cfg_block_sink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <clang_analyzer_warnIfReached@plt>
mov    $0x0,%al
call   1050 <clang_analyzer_warnIfReached@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
define void @test_single_cfg_block_sink() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 1)
store i8* %2, i8** %1
%3 = call i32 (...) @clang_analyzer_warnIfReached()
%4 = call i32 (...) @clang_analyzer_warnIfReached()
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @test_single_cfg_block_sink() {
%1 = tail call i32 (...) @clang_analyzer_warnIfReached()
%2 = tail call i32 (...) @clang_analyzer_warnIfReached()
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void flockfile(FILE *fp) {
  (void)fp;
  return;
}


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

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

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

LLVM IR (-O2):
define void @flockfile(i32* nocapture %0) {
ret void
}
void f2(struct { int i; } * a) {}


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

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

LLVM IR (-O0):
%struct.anon = type { i32 }
define void @f2(%struct.anon* %0) {
%2 = alloca %struct.anon*
store %struct.anon* %0, %struct.anon** %2
ret void
}

LLVM IR (-O2):
%struct.anon = type { i32 }
define void @f2(%struct.anon* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ chdir(char *);
int /*<<< orphan*/ system(char *);
int install_to_root(char *fakeroot) {
  chdir(fakeroot);
  system("tar cf - . | (cd / ; tar xf - )");
  return 0;
}


x86 assembly (clang, -O0):
<install_to_root>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <chdir@plt>
lea    0xec4(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<install_to_root>:
push   %rax
call   1030 <chdir@plt>
lea    0xed3(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"tar cf - . | (cd / ; tar xf - )\00"
define i32 @install_to_root(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @chdir(i8* %3)
%5 = call i32 @system(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"tar cf - . | (cd / ; tar xf - )\00"
define i32 @install_to_root(i8* %0) {
%2 = tail call i32 @chdir(i8* %0)
%3 = tail call i32 @system(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int func1(void) {
  auto h;
  static char i;
  register long j;
  extern int k;
  static unsigned long a;
  return 0;
}


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

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

LLVM IR (-O0):
@func1.i = internal global i8 0
@func1.a = internal global i64 0
define i32 @func1() {
%1 = alloca i32
%2 = alloca i64
ret i32 0
}

LLVM IR (-O2):
define i32 @func1() {
ret i32 0
}
int dmp_tm_set_countdown(int current) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @dmp_tm_set_countdown(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
void print(int a, int b) { printf("%d - %d = %d\n", a, b, a - b); }


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x4(%rbp),%ecx
sub    -0x8(%rbp),%ecx
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
mov    %esi,%edx
mov    %edi,%ecx
sub    %esi,%ecx
lea    0xee3(%rip),%rax
mov    %edi,%esi
mov    %rax,%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"%d - %d = %d\0A\00"
define void @print(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = sub nsw i32 %7, %8
%10 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"%d - %d = %d\0A\00"
define void @print(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %3)
ret void
}
int binary_file_p(buf, size)
char *buf;
int size;
{
  while (--size >= 0)
    if (*buf++ & 0200)
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<binary_file_p>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jl     114e <binary_file_p+0x4e>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     1149 <binary_file_p+0x49>
movl   $0x1,-0x4(%rbp)
jmp    1155 <binary_file_p+0x55>
jmp    110b <binary_file_p+0xb>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<binary_file_p>:
test   %esi,%esi
jle    1116 <binary_file_p+0x16>
add    $0xffffffff,%esi
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jns    1100 <binary_file_p>
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @binary_file_p(i8* nocapture %0, i32 %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i8* [ %0, %2 ], [ %9, %7 ]
%5 = phi i32 [ %1, %2 ], [ %8, %7 ]
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %3
%8 = add nsw i32 %5, -1
%9 = getelementptr inbounds i8, i8* %4, i64 1
%10 = load i8, i8* %4
%11 = icmp sgt i8 %10, -1
br i1 %11, label %3, label %12
12: ; preds = %3, %7
%13 = phi i32 [ 1, %7 ], [ 0, %3 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Hello, two!\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 = [13 x i8] c"Hello, two!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"Hello, two!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
double OP_BitXor(double op1, double op2) {
  return (double)((long int)op1 ^ (long int)op2);
}


x86 assembly (clang, -O0):
<OP_BitXor>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
cvttsd2si -0x8(%rbp),%rax
cvttsd2si -0x10(%rbp),%rcx
xor    %rcx,%rax
cvtsi2sd %rax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP_BitXor>:
cvttsd2si %xmm0,%rax
cvttsd2si %xmm1,%rcx
xor    %rax,%rcx
xorps  %xmm0,%xmm0
cvtsi2sd %rcx,%xmm0
ret

LLVM IR (-O0):
define double @OP_BitXor(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = fptosi double %5 to i64
%7 = load double, double* %4
%8 = fptosi double %7 to i64
%9 = xor i64 %6, %8
%10 = sitofp i64 %9 to double
ret double %10
}

LLVM IR (-O2):
define double @OP_BitXor(double %0, double %1) {
%3 = fptosi double %0 to i64
%4 = fptosi double %1 to i64
%5 = xor i64 %4, %3
%6 = sitofp i64 %5 to double
ret double %6
}
/* Variables and functions */
double M_PI;
int /*<<< orphan*/ wprintf(char *, double);
void loop(int count) {
  int i;
  for (i = 0; i < count; i++)
    wprintf(L"hi mom %g\n", (double)i * M_PI);
}


x86 assembly (clang, -O0):
<loop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1158 <loop+0x48>
cvtsi2sdl -0x8(%rbp),%xmm0
mov    0x2eae(%rip),%rax
mulsd  (%rax),%xmm0
lea    0xebb(%rip),%rdi
call   1030 <wprintf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <loop+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loop>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
test   %edi,%edi
jle    116a <loop+0x5a>
mov    %edi,%ebx
xorpd  %xmm1,%xmm1
mov    0x2ebe(%rip),%r15
lea    0xed7(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  %xmm1,0x8(%rsp)
movsd  (%r15),%xmm0
mulsd  %xmm1,%xmm0
mov    %r14,%rdi
call   1030 <wprintf@plt>
movsd  0x8(%rsp),%xmm1
addsd  0xe9b(%rip),%xmm1
add    $0xffffffff,%ebx
jne    1140 <loop+0x30>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [11 x i32] [i32 104, i32 105, i32 32, i32 109, i32 111, i32 109, i32 32, i32 37, i32 103, i32 10, i32 0]
@M_PI = global double 0.000000e+00
define void @loop(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %14, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %17
8: ; preds = %4
%9 = load i32, i32* %3
%10 = sitofp i32 %9 to double
%11 = load double, double* @M_PI
%12 = fmul double %10, %11
%13 = call i32 @wprintf(i8* bitcast ([11 x i32]* @.str to i8*), double %12)
br label %14
14: ; preds = %8
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %4
17: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [11 x i32] [i32 104, i32 105, i32 32, i32 109, i32 111, i32 109, i32 32, i32 37, i32 103, i32 10, i32 0]
@M_PI = global double 0.000000e+00
define void @loop(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %11
3: ; preds = %1, %3
%4 = phi i32 [ %9, %3 ], [ 0, %1 ]
%5 = sitofp i32 %4 to double
%6 = load double, double* @M_PI
%7 = fmul double %6, %5
%8 = tail call i32 @wprintf(i8* bitcast ([11 x i32]* @.str to i8*), double %7)
%9 = add nuw nsw i32 %4, 1
%10 = icmp eq i32 %9, %0
br i1 %10, label %11, label %3
11: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pciconfig_write(unsigned char, unsigned char, unsigned int,
                                   int, long);
void pci_config_write_long(unsigned char bus, unsigned char dev, int func,
                           unsigned cmd, long val) {
  pciconfig_write(bus, dev << 3, cmd, 4, val);
}


x86 assembly (clang, -O0):
<pci_config_write_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    %edx,-0x8(%rbp)
mov    %ecx,-0xc(%rbp)
mov    %r8,-0x18(%rbp)
mov    -0x1(%rbp),%sil
movzbl -0x2(%rbp),%eax
shl    $0x3,%eax
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%r8
mov    $0x4,%ecx
movzbl %sil,%edi
movzbl %al,%esi
call   1030 <pciconfig_write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pci_config_write_long>:
shl    $0x3,%sil
movzbl %sil,%esi
mov    %ecx,%edx
mov    $0x4,%ecx
jmp    1030 <pciconfig_write@plt>

LLVM IR (-O0):
define void @pci_config_write_long(i8 zeroext %0, i8 zeroext %1, i32 %2, i32 %3, i64 %4) {
%6 = alloca i8
%7 = alloca i8
%8 = alloca i32
%9 = alloca i32
%10 = alloca i64
store i8 %0, i8* %6
store i8 %1, i8* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i64 %4, i64* %10
%11 = load i8, i8* %6
%12 = load i8, i8* %7
%13 = zext i8 %12 to i32
%14 = shl i32 %13, 3
%15 = trunc i32 %14 to i8
%16 = load i32, i32* %9
%17 = load i64, i64* %10
%18 = call i32 @pciconfig_write(i8 zeroext %11, i8 zeroext %15, i32 %16, i32 4, i64 %17)
ret void
}

LLVM IR (-O2):
define void @pci_config_write_long(i8 zeroext %0, i8 zeroext %1, i32 %2, i32 %3, i64 %4) {
%6 = shl i8 %1, 3
%7 = tail call i32 @pciconfig_write(i8 zeroext %0, i8 zeroext %6, i32 %3, i32 4, i64 %4)
ret void
}
/* Variables and functions */
int gbser_read(void *, unsigned char *, int);
int gbser_readc(void *handle) {
  unsigned char buf;
  int rc;
  rc = gbser_read(handle, &buf, 1);
  if (rc > 0) {
    return buf;
  } else if (rc == 0) {
    return -1;
  } else {
    return -3;
  }
}


x86 assembly (clang, -O0):
<gbser_readc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x11(%rbp),%rsi
mov    $0x1,%edx
call   1030 <gbser_read@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jle    1147 <gbser_readc+0x37>
movzbl -0x11(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1164 <gbser_readc+0x54>
cmpl   $0x0,-0x18(%rbp)
jne    115d <gbser_readc+0x4d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1164 <gbser_readc+0x54>
movl   $0xfffffffd,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gbser_readc>:
push   %rax
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <gbser_read@plt>
cmp    $0x1,%eax
sbb    %ecx,%ecx
or     $0xfffffffd,%ecx
test   %eax,%eax
movzbl 0x7(%rsp),%eax
cmovle %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @gbser_readc(i8* %0) {
%2 = alloca i8
%3 = call i32 @gbser_read(i8* %0, i8* %2, i32 1)
%4 = icmp sgt i32 %3, 0
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
%7 = icmp eq i32 %3, 0
%8 = select i1 %7, i32 -1, i32 -3
%9 = select i1 %4, i32 %6, i32 %8
ret i32 %9
}
int test_imm_ABint16_reg(short val) {
  return ((val) & (-0xAB << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_ABint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffff55,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_ABint16_reg>:
test   $0xff55,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_ABint16_reg(i16 signext %0) {
%2 = and i16 %0, -171
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int f226(int *);
int f227(int *p) { return f226(p); }


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

x86 assembly (clang, -O2):
<f227>:
jmp    1030 <f226@plt>

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

LLVM IR (-O2):
define i32 @f227(i32* %0) {
%2 = tail call i32 @f226(i32* %0)
ret i32 %2
}
/* Variables and functions */
char *om_sysfs_path(char const *);
int om_sysfs_writefile(char const *, char const *);
int om_sysfs_set(const char *name, const char *val) {
  const char *path = om_sysfs_path(name);
  return om_sysfs_writefile(path, val);
}


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

x86 assembly (clang, -O2):
<om_sysfs_set>:
push   %rbx
mov    %rsi,%rbx
call   1030 <om_sysfs_path@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <om_sysfs_writefile@plt>

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

LLVM IR (-O2):
define i32 @om_sysfs_set(i8* %0, i8* %1) {
%3 = tail call i8* @om_sysfs_path(i8* %0)
%4 = tail call i32 @om_sysfs_writefile(i8* %3, i8* %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ initialise_prolog();
main(void) {
  int the_call_result;
  initialise_prolog();
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @initialise_prolog()
ret i32 0
}
void d(int x) {}


x86 assembly (clang, -O0):
<d>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @d(i32 %0) {
ret void
}
/* Variables and functions */
int PKCS5_PBKDF2_HMAC_SHA1(char const *, int /*<<< orphan*/,
                           unsigned char const *, int /*<<< orphan*/, int, int,
                           unsigned char *);
int /*<<< orphan*/ strlen(char const *);
int pbkdf2_hmac_sha1(const char *secret, const char *salt, int iters,
                     int keysize, unsigned char *derived) {
  return PKCS5_PBKDF2_HMAC_SHA1(secret, strlen(secret),
                                (const unsigned char *)salt, strlen(salt),
                                iters, keysize, derived);
}


x86 assembly (clang, -O0):
<pbkdf2_hmac_sha1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x38(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    -0x28(%rbp),%rdx
mov    %eax,%ecx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
mov    -0x20(%rbp),%rax
mov    %rax,(%rsp)
call   1040 <PKCS5_PBKDF2_HMAC_SHA1@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pbkdf2_hmac_sha1>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r8,%r12
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %rsi,%rbp
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%r13d
mov    %rbp,%rdi
call   1030 <strlen@plt>
mov    %r12,(%rsp)
mov    %rbx,%rdi
mov    %r13d,%esi
mov    %rbp,%rdx
mov    %eax,%ecx
mov    %r15d,%r8d
mov    %r14d,%r9d
call   1040 <PKCS5_PBKDF2_HMAC_SHA1@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @pbkdf2_hmac_sha1(i8* %0, i8* %1, i32 %2, i32 %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%11 = load i8*, i8** %6
%12 = load i8*, i8** %6
%13 = call i32 @strlen(i8* %12)
%14 = load i8*, i8** %7
%15 = load i8*, i8** %7
%16 = call i32 @strlen(i8* %15)
%17 = load i32, i32* %8
%18 = load i32, i32* %9
%19 = load i8*, i8** %10
%20 = call i32 @PKCS5_PBKDF2_HMAC_SHA1(i8* %11, i32 %13, i8* %14, i32 %16, i32 %17, i32 %18, i8* %19)
ret i32 %20
}

LLVM IR (-O2):
define i32 @pbkdf2_hmac_sha1(i8* %0, i8* %1, i32 %2, i32 %3, i8* %4) {
%6 = tail call i32 @strlen(i8* %0)
%7 = tail call i32 @strlen(i8* %1)
%8 = tail call i32 @PKCS5_PBKDF2_HMAC_SHA1(i8* %0, i32 %6, i8* %1, i32 %7, i32 %2, i32 %3, i8* %4)
ret i32 %8
}
int my_ceil(int val, int div) {
  if (div == 0)
    return -1;
  else
    return (val + div - 1) / div;
}


x86 assembly (clang, -O0):
<my_ceil>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1120 <my_ceil+0x20>
movl   $0xffffffff,-0x4(%rbp)
jmp    1130 <my_ceil+0x30>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
sub    $0x1,%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_ceil>:
test   %esi,%esi
je     110e <my_ceil+0xe>
lea    (%rdi,%rsi,1),%eax
add    $0xffffffff,%eax
cltd
idiv   %esi
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @my_ceil(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = add i32 %0, -1
%6 = add i32 %5, %1
%7 = sdiv i32 %6, %1
br label %8
8: ; preds = %2, %4
%9 = phi i32 [ %7, %4 ], [ -1, %2 ]
ret i32 %9
}
int httplib_system_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @httplib_system_init() {
ret i32 0
}
/* Type definitions */
struct timeval {
  int tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ select(int /*<<< orphan*/, int /*<<< orphan*/ *,
                          int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                          struct timeval *);
void delay_ms(int ms) {
  struct timeval tv;
  tv.tv_sec = 0;
  tv.tv_usec = ms * 1000;
  select(0, NULL, NULL, NULL, &tv);
}


x86 assembly (clang, -O0):
<delay_ms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
imul   $0x3e8,-0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
xor    %edi,%edi
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x18(%rbp),%r8
mov    %rcx,%rsi
mov    %rcx,%rdx
call   1030 <select@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay_ms>:
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
imul   $0x3e8,%edi,%eax
mov    %eax,0x8(%rsp)
lea    0x8(%rsp),%r8
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <select@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define void @delay_ms(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timeval
store i32 %0, i32* %2
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
store i64 0, i64* %4
%5 = load i32, i32* %2
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
store i32 %6, i32* %7
%8 = call i32 @select(i32 0, i32* null, i32* null, i32* null, %struct.timeval* %3)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define void @delay_ms(i32 %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
store i64 0, i64* %4
%5 = mul nsw i32 %0, 1000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
store i32 %5, i32* %6
%7 = call i32 @select(i32 0, i32* null, i32* null, i32* null, %struct.timeval* %2)
ret void
}
void IntRxUART0() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int file_exists(char *name) {
  FILE *f;
  f = fopen(name, "r");
  if (!f)
    return 0;
  fclose(f);
  return 1;
}


x86 assembly (clang, -O0):
<file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1157 <file_exists+0x37>
movl   $0x0,-0x4(%rbp)
jmp    1167 <file_exists+0x47>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exists>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1141 <file_exists+0x21>
mov    %rax,%rdi
call   1030 <fclose@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @file_exists(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Type definitions */
union bpf_attr {
  int /*<<< orphan*/ pathname;
};
typedef int /*<<< orphan*/ attr;

/* Variables and functions */
int /*<<< orphan*/ BPF_OBJ_GET;
int /*<<< orphan*/ bzero(union bpf_attr *, int);
int /*<<< orphan*/ ptr_to_u64(void *);
int sys_bpf(int /*<<< orphan*/, union bpf_attr *, int);
int bpf_obj_get(const char *pathname) {
  union bpf_attr attr;
  bzero(&attr, sizeof(attr));
  attr.pathname = ptr_to_u64((void *)pathname);
  return sys_bpf(BPF_OBJ_GET, &attr, sizeof(attr));
}


x86 assembly (clang, -O0):
<bpf_obj_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0x4,%esi
call   1050 <bzero@plt>
mov    -0x8(%rbp),%rdi
call   1040 <ptr_to_u64@plt>
mov    %eax,-0x10(%rbp)
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1030 <sys_bpf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bpf_obj_get>:
push   %rax
call   1040 <ptr_to_u64@plt>
mov    %eax,(%rsp)
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
mov    $0x4,%edx
call   1030 <sys_bpf@plt>
pop    %rcx
ret

LLVM IR (-O0):
%union.bpf_attr = type { i32 }
@BPF_OBJ_GET = global i32 0
define i32 @bpf_obj_get(i8* %0) {
%2 = alloca i8*
%3 = alloca %union.bpf_attr
store i8* %0, i8** %2
%4 = call i32 @bzero(%union.bpf_attr* %3, i32 4)
%5 = load i8*, i8** %2
%6 = call i32 @ptr_to_u64(i8* %5)
%7 = bitcast %union.bpf_attr* %3 to i32*
store i32 %6, i32* %7
%8 = load i32, i32* @BPF_OBJ_GET
%9 = call i32 @sys_bpf(i32 %8, %union.bpf_attr* %3, i32 4)
ret i32 %9
}

LLVM IR (-O2):
%union.bpf_attr = type { i32 }
@BPF_OBJ_GET = global i32 0
define i32 @bpf_obj_get(i8* %0) {
%2 = alloca %union.bpf_attr
%3 = bitcast %union.bpf_attr* %2 to i8*
%4 = tail call i32 @ptr_to_u64(i8* %0)
%5 = getelementptr inbounds %union.bpf_attr, %union.bpf_attr* %2, i64 0, i32 0
store i32 %4, i32* %5
%6 = load i32, i32* @BPF_OBJ_GET
%7 = call i32 @sys_bpf(i32 %6, %union.bpf_attr* %2, i32 4)
ret i32 %7
}
fatal(s) char *s;
{
  printk("%s\n", s);
  printk("fatal\n");
  exit(-1);
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printk@plt>
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printk@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fatal>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1030 <printk@plt>
lea    0xecb(%rip),%rdi
xor    %eax,%eax
call   1030 <printk@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [7 x i8] c"fatal\0A\00"
define i32 @fatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @printk to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @printk to i32 (i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
unreachable
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [7 x i8] c"fatal\0A\00"
define i32 @fatal(i8* %0) {
%2 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @printk to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @printk to i32 (i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
tail call void @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ LVD_LVW_DriverIRQHandler();
__attribute__((weak)) void LVD_LVW_IRQHandler(void) {
  LVD_LVW_DriverIRQHandler();
}


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

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

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

LLVM IR (-O2):
define weak void @LVD_LVW_IRQHandler() {
%1 = tail call i32 (...) @LVD_LVW_DriverIRQHandler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ QuickSort(int *, int /*<<< orphan*/, int);
void quicksort(int arr[], int size) { QuickSort(arr, 0, size - 1); }


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

x86 assembly (clang, -O2):
<quicksort>:
lea    -0x1(%rsi),%edx
xor    %esi,%esi
jmp    1030 <QuickSort@plt>

LLVM IR (-O0):
define void @quicksort(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %6, 1
%8 = call i32 @QuickSort(i32* %5, i32 0, i32 %7)
ret void
}

LLVM IR (-O2):
define void @quicksort(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call i32 @QuickSort(i32* %0, i32 0, i32 %3)
ret void
}
char *strcat(char *dest, char const *src) {
  return __builtin_strcat(dest, src);
}


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

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

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

LLVM IR (-O2):
define noalias i8* @strcat(i8* nocapture readnone %0, i8* nocapture readnone %1) {
br label %3
3: ; preds = %3, %2
br label %3
}
/* Variables and functions */
int txtarray_read1(char const *, double **, int *, int *);
int txtarray_read_stations(const char *filename, double **stations,
                           int *nstations) {
  int three;
  int ret;
  ret = txtarray_read1(filename, stations, nstations, &three);
  if (three != 3) {
    return -1;
  }
  return ret;
}


x86 assembly (clang, -O0):
<txtarray_read_stations>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    -0x24(%rbp),%rcx
call   1030 <txtarray_read1@plt>
mov    %eax,-0x28(%rbp)
cmpl   $0x3,-0x24(%rbp)
je     1152 <txtarray_read_stations+0x42>
movl   $0xffffffff,-0x4(%rbp)
jmp    1158 <txtarray_read_stations+0x48>
mov    -0x28(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<txtarray_read_stations>:
push   %rax
lea    0x4(%rsp),%rcx
call   1030 <txtarray_read1@plt>
cmpl   $0x3,0x4(%rsp)
mov    $0xffffffff,%ecx
cmovne %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @txtarray_read_stations(i8* %0, double** %1, i32* %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = call i32 @txtarray_read1(i8* %0, double** %1, i32* %2, i32* %4)
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 3
%9 = select i1 %8, i32 %6, i32 -1
ret i32 %9
}
int honai(int in) {
  if (in / 2 == 0) {
    return 4;
  } else {
    return 3 * honai(in - 2);
  }
}


x86 assembly (clang, -O0):
<honai>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%eax
jne    113b <honai+0x2b>
movl   $0x4,-0x4(%rbp)
jmp    114c <honai+0x3c>
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <honai@plt>
imul   $0x3,%eax,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<honai>:
lea    0x1(%rdi),%ecx
mov    $0x4,%eax
cmp    $0x3,%ecx
jb     1170 <honai+0x70>
add    $0xfffffffe,%edi
mov    %edi,%edx
shr    %edx
add    $0x1,%edx
mov    %edx,%eax
and    $0x7,%eax
cmp    $0xe,%edi
jae    112c <honai+0x2c>
mov    $0x1,%ecx
test   %eax,%eax
jne    1160 <honai+0x60>
jmp    116a <honai+0x6a>
and    $0xfffffff8,%edx
mov    $0x1,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %ecx,%esi
imul   $0x19a1,%ecx,%ecx
add    $0xfffffff8,%edx
jne    1140 <honai+0x40>
imul   $0x88b,%esi,%edx
test   %eax,%eax
je     116a <honai+0x6a>
nopw   0x0(%rax,%rax,1)
mov    %ecx,%edx
lea    (%rdx,%rdx,2),%ecx
add    $0xffffffff,%eax
jne    1160 <honai+0x60>
shl    $0x2,%edx
lea    (%rdx,%rdx,2),%eax
ret

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

LLVM IR (-O2):
define i32 @honai(i32 %0) {
%2 = add i32 %0, 1
%3 = icmp ult i32 %2, 3
br i1 %3, label %33, label %4
4: ; preds = %1
%5 = add i32 %0, -2
%6 = lshr i32 %5, 1
%7 = add nuw i32 %6, 1
%8 = and i32 %7, 7
%9 = icmp ult i32 %5, 14
br i1 %9, label %20, label %10
10: ; preds = %4
%11 = and i32 %7, -8
br label %12
12: ; preds = %12, %10
%13 = phi i32 [ 1, %10 ], [ %15, %12 ]
%14 = phi i32 [ 0, %10 ], [ %16, %12 ]
%15 = mul i32 %13, 6561
%16 = add i32 %14, 8
%17 = icmp eq i32 %16, %11
br i1 %17, label %18, label %12
18: ; preds = %12
%19 = mul i32 %13, 2187
br label %20
20: ; preds = %18, %4
%21 = phi i32 [ undef, %4 ], [ %19, %18 ]
%22 = phi i32 [ 1, %4 ], [ %15, %18 ]
%23 = icmp eq i32 %8, 0
br i1 %23, label %30, label %24
24: ; preds = %20, %24
%25 = phi i32 [ %27, %24 ], [ %22, %20 ]
%26 = phi i32 [ %28, %24 ], [ 0, %20 ]
%27 = mul nsw i32 %25, 3
%28 = add i32 %26, 1
%29 = icmp eq i32 %28, %8
br i1 %29, label %30, label %24
30: ; preds = %24, %20
%31 = phi i32 [ %21, %20 ], [ %25, %24 ]
%32 = mul i32 %31, 12
br label %33
33: ; preds = %30, %1
%34 = phi i32 [ 4, %1 ], [ %32, %30 ]
ret i32 %34
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
void multiplication(int x, int y, int z) {
  float III = (x * y) * z;
  printf("[!] multiplied (a*b)*c = %f\n", III);
}


x86 assembly (clang, -O0):
<multiplication>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<multiplication>:
imul   %esi,%edi
imul   %edx,%edi
cvtsi2ss %edi,%xmm0
lea    0xedf(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"[!] multiplied (a*b)*c = %f\0A\00"
define void @multiplication(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca float
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = mul nsw i32 %8, %9
%11 = load i32, i32* %6
%12 = mul nsw i32 %10, %11
%13 = sitofp i32 %12 to float
store float %13, float* %7
%14 = load float, float* %7
%15 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), float %14)
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"[!] multiplied (a*b)*c = %f\0A\00"
define void @multiplication(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %1, %0
%5 = mul nsw i32 %4, %2
%6 = sitofp i32 %5 to float
%7 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), float %6)
ret void
}