xunge/DecIR huggingface dataset:
/* Variables and functions */
int __builtin_arc_fls(int);
int foo(int x) { return __builtin_arc_fls(x); }


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

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

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = tail call i32 @__builtin_arc_fls(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
int int_cmp(const void *a, const void *b) {
  int64_t aa = *(int64_t *)(a);
  int64_t bb = *(int64_t *)(b);
  if (aa == bb)
    return 0;
  else if (aa < bb)
    return -1;
  else
    return 1;
}


x86 assembly (clang, -O0):
<int_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jne    113c <int_cmp+0x3c>
movl   $0x0,-0x4(%rbp)
jmp    115d <int_cmp+0x5d>
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jge    1156 <int_cmp+0x56>
movl   $0xffffffff,-0x4(%rbp)
jmp    115d <int_cmp+0x5d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_cmp>:
mov    (%rdi),%rax
xor    %ecx,%ecx
xor    %edx,%edx
cmp    (%rsi),%rax
setge  %dl
lea    -0x1(%rdx,%rdx,1),%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @int_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp eq i64 %4, %6
%8 = icmp slt i64 %4, %6
%9 = select i1 %8, i32 -1, i32 1
%10 = select i1 %7, i32 0, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ japi_setvgap(int, int);
void j_setvgap(int arg0, int arg1) { japi_setvgap(arg0, arg1); }


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

x86 assembly (clang, -O2):
<j_setvgap>:
jmp    1030 <japi_setvgap@plt>

LLVM IR (-O0):
define void @j_setvgap(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 = call i32 @japi_setvgap(i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @j_setvgap(i32 %0, i32 %1) {
%3 = tail call i32 @japi_setvgap(i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ aj();
int /*<<< orphan*/ mapnew();
int /*<<< orphan*/ moveb();
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ show();
int /*<<< orphan*/ start();
int main() {
  start();
  show();
  mapnew();
  puts("j");
  show();
  for (int i = 0; i < 100; i) {
    aj();
    moveb();
    mapnew();
    show();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <start@plt>
mov    $0x0,%al
call   1050 <show@plt>
mov    $0x0,%al
call   1040 <mapnew@plt>
lea    0xe75(%rip),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1050 <show@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    11c9 <main+0x69>
mov    $0x0,%al
call   1080 <aj@plt>
mov    $0x0,%al
call   1070 <moveb@plt>
mov    $0x0,%al
call   1040 <mapnew@plt>
mov    $0x0,%al
call   1050 <show@plt>
jmp    119e <main+0x3e>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <start@plt>
xor    %eax,%eax
call   1050 <show@plt>
xor    %eax,%eax
call   1040 <mapnew@plt>
lea    0xe83(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <show@plt>
nopl   0x0(%rax)
xor    %eax,%eax
call   1080 <aj@plt>
xor    %eax,%eax
call   1070 <moveb@plt>
xor    %eax,%eax
call   1040 <mapnew@plt>
xor    %eax,%eax
call   1050 <show@plt>
jmp    1190 <main+0x30>

LLVM IR (-O0):
@.str = [2 x i8] c"j\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @start()
%4 = call i32 (...) @show()
%5 = call i32 (...) @mapnew()
%6 = call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @show()
store i32 0, i32* %2
br label %8
8: ; preds = %16, %0
%9 = load i32, i32* %2
%10 = icmp slt i32 %9, 100
br i1 %10, label %11, label %18
11: ; preds = %8
%12 = call i32 (...) @aj()
%13 = call i32 (...) @moveb()
%14 = call i32 (...) @mapnew()
%15 = call i32 (...) @show()
br label %16
16: ; preds = %11
%17 = load i32, i32* %2
br label %8
18: ; preds = %8
%19 = load i32, i32* %1
ret i32 %19
}

LLVM IR (-O2):
@.str = [2 x i8] c"j\00"
define i32 @main() {
%1 = tail call i32 (...) @start()
%2 = tail call i32 (...) @show()
%3 = tail call i32 (...) @mapnew()
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 (...) @show()
br label %6
6: ; preds = %6, %0
%7 = tail call i32 (...) @aj()
%8 = tail call i32 (...) @moveb()
%9 = tail call i32 (...) @mapnew()
%10 = tail call i32 (...) @show()
br label %6
}
char *my_strcpy(char *dest, char *src) {
  int i;
  i = 0;
  while (src[i]) {
    dest[i] = src[i];
    i++;
  }
  dest[i] = src[i];
  return (dest);
}


x86 assembly (clang, -O0):
<my_strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1149 <my_strcpy+0x49>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <my_strcpy+0x13>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
test   %cl,%cl
je     1127 <my_strcpy+0x27>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
mov    %cl,(%rax,%rdx,1)
movzbl 0x1(%rsi,%rdx,1),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <my_strcpy+0x10>
mov    %edx,%ecx
movb   $0x0,(%rax,%rcx,1)
ret
xor    %ecx,%ecx
movb   $0x0,(%rax,%rcx,1)
ret

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

LLVM IR (-O2):
define i8* @my_strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %9, %5 ], [ 0, %2 ]
%7 = phi i8 [ %11, %5 ], [ %3, %2 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 %7, i8* %8
%9 = add nuw nsw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5
%14 = and i64 %9, 4294967295
br label %15
15: ; preds = %13, %2
%16 = phi i64 [ 0, %2 ], [ %14, %13 ]
%17 = getelementptr inbounds i8, i8* %0, i64 %16
store i8 0, i8* %17
ret i8* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_get_name_creds(void *bus, const char *name, uint64_t mask,
                      void **creds) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_get_name_creds>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
mov    0x2ec4(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_get_name_creds>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_get_name_creds(i8* %0, i8* %1, i32 %2, i8** %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8**
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8** %3, i8*** %8
%9 = load i32, i32* @EINVAL
%10 = sub nsw i32 0, %9
ret i32 %10
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_get_name_creds(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i8** nocapture readnone %3) {
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}
/* Type definitions */
typedef scalar_t__ b1;

/* Variables and functions */
int /*<<< orphan*/ use_int(int);
unsigned goo(unsigned m_param, unsigned n_param) {
  unsigned b1 = m_param * (n_param + 2);
  unsigned b2 = m_param * (n_param + 1);
  int r = (int)(b1) - (int)(b2);
  use_int(r);
  return r;
}


x86 assembly (clang, -O0):
<goo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    $0x2,%ecx
imul   %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <use_int@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<goo>:
push   %rbx
mov    %edi,%ebx
call   1030 <use_int@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @goo(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = add i32 %9, 2
%11 = mul i32 %8, %10
store i32 %11, i32* %5
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = add i32 %13, 1
%15 = mul i32 %12, %14
store i32 %15, i32* %6
%16 = load i32, i32* %5
%17 = load i32, i32* %6
%18 = sub nsw i32 %16, %17
store i32 %18, i32* %7
%19 = load i32, i32* %7
%20 = call i32 @use_int(i32 %19)
%21 = load i32, i32* %7
ret i32 %21
}

LLVM IR (-O2):
define i32 @goo(i32 returned %0, i32 %1) {
%3 = tail call i32 @use_int(i32 %0)
ret i32 %0
}
/* Variables and functions */
int find_pid_by_name(char *);
int proc_is_running(int pid_num, char *prg_name) {
  return pid_num == find_pid_by_name(prg_name);
}


x86 assembly (clang, -O0):
<proc_is_running>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <find_pid_by_name@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<proc_is_running>:
push   %rbx
mov    %edi,%ebx
mov    %rsi,%rdi
call   1030 <find_pid_by_name@plt>
xor    %ecx,%ecx
cmp    %ebx,%eax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @proc_is_running(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 @find_pid_by_name(i8* %6)
%8 = icmp eq i32 %5, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @proc_is_running(i32 %0, i8* %1) {
%3 = tail call i32 @find_pid_by_name(i8* %1)
%4 = icmp eq i32 %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
char *element_password_get_heading(char *element_name, char *heading) {
  if (heading && *heading)
    return heading;
  else
    return element_name;
}


x86 assembly (clang, -O0):
<element_password_get_heading>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1134 <element_password_get_heading+0x34>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1134 <element_password_get_heading+0x34>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    113c <element_password_get_heading+0x3c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<element_password_get_heading>:
test   %rsi,%rsi
je     110e <element_password_get_heading+0xe>
mov    %rsi,%rax
cmpb   $0x0,(%rsi)
je     110e <element_password_get_heading+0xe>
ret
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @element_password_get_heading(i8* readnone %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i8, i8* %1
%6 = icmp eq i8 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %4, %2
br label %8
8: ; preds = %4, %7
%9 = phi i8* [ %0, %7 ], [ %1, %4 ]
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void genksyms_usage(void) {
  fputs(
      "Usage:\n"
      "genksyms [-adDTwqhVR] > /path/to/.tmp_obj.ver\n"
      "\n"
      "  -s                    Select symbol prefix\n"
      "  -d                    Increment the debug level (repeatable)\n"
      "  -D                    Dump expanded symbol defs (for debugging only)\n"
      "  -r file               Read reference symbols from a file\n"
      "  -T file               Dump expanded types into file\n"
      "  -p                    Preserve reference modversions or fail\n"
      "  -w                    Enable warnings\n"
      "  -q                    Disable warnings (default)\n"
      "  -h                    Print this message\n"
      "  -V                    Print the release version\n"
      "  -R                    Emit section relative symbol CRCs\n",
      stderr);
}


x86 assembly (clang, -O0):
<genksyms_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<genksyms_usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@.str = [652 x i8] c"Usage:\0Agenksyms [-adDTwqhVR] > /path/to/.tmp_obj.ver\0A\0A -s Select symbol prefix\0A -d Increment the debug level (repeatable)\0A -D Dump expanded symbol defs (for debugging only)\0A -r file Read reference symbols from a file\0A -T file Dump expanded types into file\0A -p Preserve reference modversions or fail\0A -w Enable warnings\0A -q Disable warnings (default)\0A -h Print this message\0A -V Print the release version\0A -R Emit section relative symbol CRCs\0A\00"
@stderr = global i32 0
define void @genksyms_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([652 x i8], [652 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [652 x i8] c"Usage:\0Agenksyms [-adDTwqhVR] > /path/to/.tmp_obj.ver\0A\0A -s Select symbol prefix\0A -d Increment the debug level (repeatable)\0A -D Dump expanded symbol defs (for debugging only)\0A -r file Read reference symbols from a file\0A -T file Dump expanded types into file\0A -p Preserve reference modversions or fail\0A -w Enable warnings\0A -q Disable warnings (default)\0A -h Print this message\0A -V Print the release version\0A -R Emit section relative symbol CRCs\0A\00"
@stderr = global i32 0
define void @genksyms_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([652 x i8], [652 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
int unprivileged_ask_for_bpf(const char *s) {
  (void)s;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @unprivileged_ask_for_bpf(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _rl_reset_argument();
int /*<<< orphan*/ rl_clear_message();
int /*<<< orphan*/ rl_ding();
int rl_discard_argument() {
  rl_ding();
  rl_clear_message();
  _rl_reset_argument();
  return 0;
}


x86 assembly (clang, -O0):
<rl_discard_argument>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rl_ding@plt>
mov    $0x0,%al
call   1040 <rl_clear_message@plt>
mov    $0x0,%al
call   1050 <_rl_reset_argument@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rl_discard_argument>:
push   %rax
xor    %eax,%eax
call   1030 <rl_ding@plt>
xor    %eax,%eax
call   1040 <rl_clear_message@plt>
xor    %eax,%eax
call   1050 <_rl_reset_argument@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @rl_discard_argument() {
%1 = call i32 (...) @rl_ding()
%2 = call i32 (...) @rl_clear_message()
%3 = call i32 (...) @_rl_reset_argument()
ret i32 0
}

LLVM IR (-O2):
define i32 @rl_discard_argument() {
%1 = tail call i32 (...) @rl_ding()
%2 = tail call i32 (...) @rl_clear_message()
%3 = tail call i32 (...) @_rl_reset_argument()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void bar(int x, int y) {
  if (x == 5 || y != 3)
    abort();
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x5,-0x4(%rbp)
je     1132 <bar+0x22>
cmpl   $0x3,-0x8(%rbp)
je     1139 <bar+0x29>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
cmp    $0x5,%edi
je     111b <bar+0xb>
cmp    $0x3,%esi
jne    111b <bar+0xb>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @bar(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 = icmp eq i32 %5, 5
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 3
br i1 %9, label %10, label %12
10: ; preds = %7, %2
%11 = call i32 (...) @abort()
unreachable
12: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @bar(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 5
%4 = icmp ne i32 %1, 3
%5 = or i1 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %2
ret void
}
void gas_query_deinit(struct gas_query *gas) {}


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

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

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

LLVM IR (-O2):
%struct.gas_query = type opaque
define void @gas_query_deinit(%struct.gas_query* nocapture %0) {
ret void
}
/* Variables and functions */
int getIntValue(char);
int /*<<< orphan*/ scanf(char *, char *);
int validateInput(int, char);
int getUserChoice() {
  int userInput;
  char charValue;
  scanf("\n%c", &charValue);
  userInput = getIntValue(charValue);
  if (validateInput(userInput, charValue) != -1) {
    return userInput;
  } else {
    return -1;
    ;
  }
}


x86 assembly (clang, -O0):
<getUserChoice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    -0x9(%rbp),%rsi
call   1050 <scanf@plt>
movsbl -0x9(%rbp),%edi
call   1040 <getIntValue@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
movsbl -0x9(%rbp),%esi
call   1030 <validateInput@plt>
cmp    $0xffffffff,%eax
je     1174 <getUserChoice+0x44>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    117b <getUserChoice+0x4b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getUserChoice>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
lea    0xf(%rsp),%rsi
call   1050 <scanf@plt>
movsbl 0xf(%rsp),%edi
call   1040 <getIntValue@plt>
mov    %eax,%ebx
movsbl 0xf(%rsp),%esi
mov    %eax,%edi
call   1030 <validateInput@plt>
cmp    $0xffffffff,%eax
cmovne %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"\0A%c\00"
define i32 @getUserChoice() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i8, i8* %1
%4 = call i32 @getIntValue(i8 signext %3)
%5 = load i8, i8* %1
%6 = call i32 @validateInput(i32 %4, i8 signext %5)
%7 = icmp eq i32 %6, -1
%8 = select i1 %7, i32 -1, i32 %4
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ pcibios_write_config_byte(int /*<<< orphan*/, scalar_t__,
                                             int, int);
void set_sdramc(void) {
  pcibios_write_config_byte(0, ((0x00 << 3) + 0), 0x76, 0x13);
}


x86 assembly (clang, -O0):
<set_sdramc>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x76,%edx
mov    $0x13,%ecx
call   1030 <pcibios_write_config_byte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_sdramc>:
xor    %edi,%edi
xor    %esi,%esi
mov    $0x76,%edx
mov    $0x13,%ecx
jmp    1030 <pcibios_write_config_byte@plt>

LLVM IR (-O0):
define void @set_sdramc() {
%1 = call i32 @pcibios_write_config_byte(i32 0, i64 0, i32 118, i32 19)
ret void
}

LLVM IR (-O2):
define void @set_sdramc() {
%1 = tail call i32 @pcibios_write_config_byte(i32 0, i64 0, i32 118, i32 19)
ret void
}
void linear() {
  int x, y, z;
  x = 0;
  y = 10;
  z = x + y;
}


x86 assembly (clang, -O0):
<linear>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @linear() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = add nsw i32 %4, %5
store i32 %6, i32* %3
ret void
}

LLVM IR (-O2):
define void @linear() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _fatal(int, int /*<<< orphan*/ *, char *, int);
void resize(void) {
  _fatal((40), NULL,
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/PlanTool/plantool/refs/heads/master/code/"
         "Deterministic/HSP/hsp-planners/hsp-1.12/planner/planner.c",
         470);
}


x86 assembly (clang, -O0):
<resize>:
push   %rbp
mov    %rsp,%rbp
mov    $0x28,%edi
xor    %eax,%eax
mov    %eax,%esi
lea    0xedc(%rip),%rdx
mov    $0x1d6,%ecx
call   1030 <_fatal@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<resize>:
lea    0xee9(%rip),%rdx
mov    $0x28,%edi
xor    %esi,%esi
mov    $0x1d6,%ecx
jmp    1030 <_fatal@plt>

LLVM IR (-O0):
@.str = [189 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/PlanTool/plantool/refs/heads/master/code/Deterministic/HSP/hsp-planners/hsp-1.12/planner/planner.c\00"
define void @resize() {
%1 = call i32 @_fatal(i32 40, i32* null, i8* getelementptr inbounds ([189 x i8], [189 x i8]* @.str, i64 0, i64 0), i32 470)
ret void
}

LLVM IR (-O2):
@.str = [189 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/PlanTool/plantool/refs/heads/master/code/Deterministic/HSP/hsp-planners/hsp-1.12/planner/planner.c\00"
define void @resize() {
%1 = tail call i32 @_fatal(i32 40, i32* null, i8* getelementptr inbounds ([189 x i8], [189 x i8]* @.str, i64 0, i64 0), i32 470)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo();
void isr1(void) { foo(); }


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

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

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

LLVM IR (-O2):
define void @isr1() {
%1 = tail call i32 (...) @foo()
ret void
}
double laplacian_u(double (*u)(double x, double y), double h, double x,
                   double y) {}


x86 assembly (clang, -O0):
<laplacian_u>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
movsd  %xmm2,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @laplacian_u(double (double, double)* %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double (double, double)*
%7 = alloca double
%8 = alloca double
%9 = alloca double
store double (double, double)* %0, double (double, double)** %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
%10 = load double, double* %5
ret double %10
}

LLVM IR (-O2):
define double @laplacian_u(double (double, double)* nocapture readnone %0, double %1, double %2, double %3) {
ret double undef
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef unsigned int uint16_t;

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


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

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

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

LLVM IR (-O2):
define i32 @read16le(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = trunc i64 %2 to i32
%4 = getelementptr inbounds i64, i64* %0, i64 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = shl i32 %6, 8
%8 = or i32 %7, %3
ret i32 %8
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int UP3D_GetParameter(int);
int32_t UP3D_GetMachineState() {
  int32_t state = UP3D_GetParameter(0x00);
  if ((state < 0) || (state > 4))
    state = 5;
  return state;
}


x86 assembly (clang, -O0):
<UP3D_GetMachineState>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1030 <UP3D_GetParameter@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1136 <UP3D_GetMachineState+0x26>
cmpl   $0x4,-0x4(%rbp)
jle    113d <UP3D_GetMachineState+0x2d>
movl   $0x5,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UP3D_GetMachineState>:
push   %rax
xor    %edi,%edi
call   1030 <UP3D_GetParameter@plt>
cmp    $0x5,%eax
mov    $0x5,%ecx
cmovae %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @UP3D_GetMachineState() {
%1 = alloca i32
%2 = call i32 @UP3D_GetParameter(i32 0)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %0
%6 = load i32, i32* %1
%7 = icmp sgt i32 %6, 4
br i1 %7, label %8, label %9
8: ; preds = %5, %0
store i32 5, i32* %1
br label %9
9: ; preds = %8, %5
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @UP3D_GetMachineState() {
%1 = tail call i32 @UP3D_GetParameter(i32 0)
%2 = icmp ult i32 %1, 5
%3 = select i1 %2, i32 %1, i32 5
ret i32 %3
}
void cfi(void (*fp)()) { fp(); }


x86 assembly (clang, -O0):
<cfi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cfi>:
xor    %eax,%eax
jmp    *%rdi

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

LLVM IR (-O2):
define void @cfi(void (...)* nocapture %0) {
tail call void (...) %0()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glNormal3i(int, int, int);
void Normal3i(int x, int y, int z) { glNormal3i(x, y, z); }


x86 assembly (clang, -O0):
<Normal3i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <glNormal3i@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Normal3i>:
jmp    1030 <glNormal3i@plt>

LLVM IR (-O0):
define void @Normal3i(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @glNormal3i(i32 %7, i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @Normal3i(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @glNormal3i(i32 %0, i32 %1, i32 %2)
ret void
}
/* Variables and functions */
int epoll_create(int);
int set_cloexec_or_close(int);
int os_epoll_create_cloexec(void) {
  int fd;
  fd = epoll_create(1);
  return set_cloexec_or_close(fd);
}


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

x86 assembly (clang, -O2):
<os_epoll_create_cloexec>:
push   %rax
mov    $0x1,%edi
call   1040 <epoll_create@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <set_cloexec_or_close@plt>

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

LLVM IR (-O2):
define i32 @os_epoll_create_cloexec() {
%1 = tail call i32 @epoll_create(i32 1)
%2 = tail call i32 @set_cloexec_or_close(i32 %1)
ret i32 %2
}
ftime(t) struct timeb *t;
{ ; }


x86 assembly (clang, -O0):
<ftime>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.timeb = type opaque
define i32 @ftime(%struct.timeb* %0) {
%2 = alloca i32
%3 = alloca %struct.timeb*
store %struct.timeb* %0, %struct.timeb** %3
%4 = load i32, i32* %2
ret i32 %4
}

LLVM IR (-O2):
%struct.timeb = type opaque
define i32 @ftime(%struct.timeb* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void init_error(char *msg) {
  fprintf(stderr, "%s\n", msg);
  fprintf(stderr, "Be sure the BOOT0 jumper is set to 1\n");
  fprintf(stderr, "Press RESET on the target and try again\n");
  exit(1);
}


x86 assembly (clang, -O0):
<init_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    0xead(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<init_error>:
push   %rbx
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rbx
mov    (%rbx),%edi
lea    0xecc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xec0(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xed6(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [38 x i8] c"Be sure the BOOT0 jumper is set to 1\0A\00"
@.str.2 = [41 x i8] c"Press RESET on the target and try again\0A\00"
define void @init_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32, i32* @stderr
%9 = call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [38 x i8] c"Be sure the BOOT0 jumper is set to 1\0A\00"
@.str.2 = [41 x i8] c"Press RESET on the target and try again\0A\00"
define void @init_error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* @stderr
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
}
int startWinsock(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @startWinsock() {
ret i32 0
}
/* Type definitions */
struct t_weelist {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct t_weelist *);
int /*<<< orphan*/ weelist_remove_all(struct t_weelist *);
void weelist_free(struct t_weelist *weelist) {
  if (!weelist)
    return;
  weelist_remove_all(weelist);
  free(weelist);
}


x86 assembly (clang, -O0):
<weelist_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113c <weelist_free+0x1c>
jmp    114e <weelist_free+0x2e>
mov    -0x8(%rbp),%rdi
call   1040 <weelist_remove_all@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<weelist_free>:
test   %rdi,%rdi
je     1137 <weelist_free+0x17>
push   %rbx
mov    %rdi,%rbx
call   1040 <weelist_remove_all@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
%struct.t_weelist = type { i32 }
define void @weelist_free(%struct.t_weelist* %0) {
%2 = alloca %struct.t_weelist*
store %struct.t_weelist* %0, %struct.t_weelist** %2
%3 = load %struct.t_weelist*, %struct.t_weelist** %2
%4 = icmp ne %struct.t_weelist* %3, null
br i1 %4, label %6, label %5
5: ; preds = %1
br label %11
6: ; preds = %1
%7 = load %struct.t_weelist*, %struct.t_weelist** %2
%8 = call i32 @weelist_remove_all(%struct.t_weelist* %7)
%9 = load %struct.t_weelist*, %struct.t_weelist** %2
%10 = call i32 @free(%struct.t_weelist* %9)
br label %11
11: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
%struct.t_weelist = type { i32 }
define void @weelist_free(%struct.t_weelist* %0) {
%2 = icmp eq %struct.t_weelist* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @weelist_remove_all(%struct.t_weelist* %0)
%5 = tail call i32 @free(%struct.t_weelist* %0)
br label %6
6: ; preds = %1, %3
ret void
}
/* Type definitions */
typedef union ui_state {
  int dummy;
} ui_state;

/* Variables and functions */
int /*<<< orphan*/ render_text();
int /*<<< orphan*/ ui_render_board_state();
void redraw(union ui_state *state) {
  ui_render_board_state();
  render_text();
}


x86 assembly (clang, -O0):
<redraw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <ui_render_board_state@plt>
mov    $0x0,%al
call   1030 <render_text@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%union.ui_state = type { i32 }
define void @redraw(%union.ui_state* %0) {
%2 = alloca %union.ui_state*
store %union.ui_state* %0, %union.ui_state** %2
%3 = call i32 (...) @ui_render_board_state()
%4 = call i32 (...) @render_text()
ret void
}

LLVM IR (-O2):
%union.ui_state = type { i32 }
define void @redraw(%union.ui_state* nocapture readnone %0) {
%2 = tail call i32 (...) @ui_render_board_state()
%3 = tail call i32 (...) @render_text()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write_break();
int /*<<< orphan*/ write_line(char *);
int /*<<< orphan*/ write_nl();
void html_enumerate(void) {
  write_break();
  write_line("<OL>");
  write_nl();
}


x86 assembly (clang, -O0):
<html_enumerate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <write_break@plt>
lea    0xebe(%rip),%rdi
call   1050 <write_line@plt>
mov    $0x0,%al
call   1030 <write_nl@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<html_enumerate>:
push   %rax
xor    %eax,%eax
call   1040 <write_break@plt>
lea    0xec1(%rip),%rdi
call   1050 <write_line@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <write_nl@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"<OL>\00"
define void @html_enumerate() {
%1 = call i32 (...) @write_break()
%2 = call i32 @write_line(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @write_nl()
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"<OL>\00"
define void @html_enumerate() {
%1 = tail call i32 (...) @write_break()
%2 = tail call i32 @write_line(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @write_nl()
ret void
}
unsigned long bn_div_words(unsigned long h, unsigned long l, unsigned long d) {
  unsigned long ret, waste;
  asm("divq      %4" : "=a"(ret), "=d"(waste) : "a"(l), "d"(h), "r"(d) : "cc");
  return ret;
}


x86 assembly (clang, -O0):
<bn_div_words>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
mov    -0x18(%rbp),%rcx
div    %rcx
mov    %rax,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bn_div_words>:
mov    %rdx,%rcx
mov    %rsi,%rax
mov    %rdi,%rdx
div    %rcx
ret

LLVM IR (-O0):
define i64 @bn_div_words(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%9 = load i64, i64* %5
%10 = load i64, i64* %4
%11 = load i64, i64* %6
%12 = call { i64, i64 } asm "divq $4", "={ax},={dx},{ax},{dx},r,~{cc},~{dirflag},~{fpsr},~{flags}"(i64 %9, i64 %10, i64 %11)
%13 = extractvalue { i64, i64 } %12, 0
%14 = extractvalue { i64, i64 } %12, 1
store i64 %13, i64* %7
store i64 %14, i64* %8
%15 = load i64, i64* %7
ret i64 %15
}

LLVM IR (-O2):
define i64 @bn_div_words(i64 %0, i64 %1, i64 %2) {
%4 = tail call { i64, i64 } asm "divq $4", "={ax},={dx},{ax},{dx},r,~{cc},~{dirflag},~{fpsr},~{flags}"(i64 %1, i64 %0, i64 %2)
%5 = extractvalue { i64, i64 } %4, 0
ret i64 %5
}
/* Type definitions */
struct tslib_module_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct tslib_module_info *);
int linear_fini(struct tslib_module_info *info) { free(info); }


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

x86 assembly (clang, -O2):
<linear_fini>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.tslib_module_info = type { i32 }
define i32 @linear_fini(%struct.tslib_module_info* %0) {
%2 = alloca i32
%3 = alloca %struct.tslib_module_info*
store %struct.tslib_module_info* %0, %struct.tslib_module_info** %3
%4 = load %struct.tslib_module_info*, %struct.tslib_module_info** %3
%5 = call i32 @free(%struct.tslib_module_info* %4)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
%struct.tslib_module_info = type { i32 }
define i32 @linear_fini(%struct.tslib_module_info* nocapture %0) {
%2 = tail call i32 @free(%struct.tslib_module_info* %0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: tty [-s]\n");
  exit(2);
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [17 x i8] c"usage: tty [-s]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [17 x i8] c"usage: tty [-s]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 2)
unreachable
}
double simple_interest(double capital, double rate, int time) {
  return capital * (1 + (rate * time));
}


x86 assembly (clang, -O0):
<simple_interest>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
cvtsi2sdl -0x14(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xed4(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<simple_interest>:
cvtsi2sd %edi,%xmm2
mulsd  %xmm1,%xmm2
addsd  0xef0(%rip),%xmm2
mulsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @simple_interest(double %0, double %1, i32 %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca i32
store double %0, double* %4
store double %1, double* %5
store i32 %2, i32* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = load i32, i32* %6
%10 = sitofp i32 %9 to double
%11 = call double @llvm.fmuladd.f64(double %8, double %10, double 1.000000e+00)
%12 = fmul double %7, %11
ret double %12
}

LLVM IR (-O2):
define double @simple_interest(double %0, double %1, i32 %2) {
%4 = sitofp i32 %2 to double
%5 = tail call double @llvm.fmuladd.f64(double %1, double %4, double 1.000000e+00)
%6 = fmul double %5, %0
ret double %6
}
/* Variables and functions */
double atoi(char *);
int main(int argc, char **argv) {
  double x = atoi(argv[1]);
  return 0;
}


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)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <atoi@plt>
movsd  %xmm0,-0x18(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = call double @atoi(i8* %9)
store double %10, double* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
void *recvpkta(int, int /*<<< orphan*/ *);
void *recvpkt(int sfd) { return recvpkta(sfd, NULL); }


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

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

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

LLVM IR (-O2):
define i8* @recvpkt(i32 %0) {
%2 = tail call i8* @recvpkta(i32 %0, i32* null)
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
scalar_t__ read(int, int /*<<< orphan*/ *, int);
void flush_all(int fd) {
  uint8_t buf[4096];
  while (read(fd, buf, sizeof(buf)) > 0) {
  }
}


x86 assembly (clang, -O0):
<flush_all>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4010,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x4010(%rbp),%rsi
mov    $0x4000,%edx
call   1030 <read@plt>
cmp    $0x0,%rax
jle    1141 <flush_all+0x31>
jmp    111e <flush_all+0xe>
add    $0x4010,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flush_all>:
push   %r14
push   %rbx
sub    $0x4008,%rsp
mov    %edi,%ebx
mov    %rsp,%r14
nop
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x4000,%edx
call   1030 <read@plt>
test   %rax,%rax
jg     1120 <flush_all+0x10>
add    $0x4008,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @flush_all(i32 %0) {
%2 = alloca i32
%3 = alloca [4096 x i32]
store i32 %0, i32* %2
br label %4
4: ; preds = %9, %1
%5 = load i32, i32* %2
%6 = getelementptr inbounds [4096 x i32], [4096 x i32]* %3, i64 0, i64 0
%7 = call i64 @read(i32 %5, i32* %6, i32 16384)
%8 = icmp sgt i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %4
br label %4
10: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @flush_all(i32 %0) {
%2 = alloca [4096 x i32]
%3 = bitcast [4096 x i32]* %2 to i8*
%4 = getelementptr inbounds [4096 x i32], [4096 x i32]* %2, i64 0, i64 0
br label %5
5: ; preds = %5, %1
%6 = call i64 @read(i32 %0, i32* %4, i32 16384)
%7 = icmp sgt i64 %6, 0
br i1 %7, label %5, label %8
8: ; preds = %5
ret void
}