xunge/DecIR huggingface dataset:
int unlink(const char *path) {
  check_wl(path, "remove");
  int (*real_unlink_with_mode)(const char *);
  real_unlink_with_mode = dlsym(((void *)(-1l)), "unlink");
  return (*real_unlink_with_mode)(path);
}


x86 assembly (clang, -O0):
<unlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
mov    $0x0,%al
call   1040 <check_wl@plt>
mov    $0xffffffffffffffff,%rdi
lea    0xebb(%rip),%rsi
mov    $0x0,%al
call   1030 <dlsym@plt>
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlink>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
xor    %eax,%eax
call   1040 <check_wl@plt>
lea    0xece(%rip),%rsi
mov    $0xffffffffffffffff,%rdi
xor    %eax,%eax
call   1030 <dlsym@plt>
cltq
mov    %rbx,%rdi
pop    %rbx
jmp    *%rax

LLVM IR (-O0):
@.str = [7 x i8] c"remove\00"
@.str.1 = [7 x i8] c"unlink\00"
define i32 @unlink(i8* %0) {
%2 = alloca i8*
%3 = alloca i32 (i8*)*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @check_wl to i32 (i8*, i8*, ...)*)(i8* %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @dlsym to i32 (i8*, i8*, ...)*)(i8* inttoptr (i64 -1 to i8*), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i32 (i8*)*
store i32 (i8*)* %8, i32 (i8*)** %3
%9 = load i32 (i8*)*, i32 (i8*)** %3
%10 = load i8*, i8** %2
%11 = call i32 %9(i8* %10)
ret i32 %11
}

LLVM IR (-O2):
@.str = [7 x i8] c"remove\00"
@.str.1 = [7 x i8] c"unlink\00"
define i32 @unlink(i8* %0) {
%2 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @check_wl to i32 (i8*, i8*, ...)*)(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @dlsym to i32 (i8*, i8*, ...)*)(i8* inttoptr (i64 -1 to i8*), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i32 (i8*)*
%6 = tail call i32 %5(i8* %0)
ret i32 %6
}
/* Type definitions */
struct osc {
  int dummy;
};

/* Variables and functions */
double osc_tick_box(struct osc *, double, double);
double osc_tick(struct osc *osc, double dt, double freq) {
  return osc_tick_box(osc, dt, freq);
}


x86 assembly (clang, -O0):
<osc_tick>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1030 <osc_tick_box@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<osc_tick>:
jmp    1030 <osc_tick_box@plt>

LLVM IR (-O0):
%struct.osc = type { i32 }
define double @osc_tick(%struct.osc* %0, double %1, double %2) {
%4 = alloca %struct.osc*
%5 = alloca double
%6 = alloca double
store %struct.osc* %0, %struct.osc** %4
store double %1, double* %5
store double %2, double* %6
%7 = load %struct.osc*, %struct.osc** %4
%8 = load double, double* %5
%9 = load double, double* %6
%10 = call double @osc_tick_box(%struct.osc* %7, double %8, double %9)
ret double %10
}

LLVM IR (-O2):
%struct.osc = type { i32 }
define double @osc_tick(%struct.osc* %0, double %1, double %2) {
%4 = tail call double @osc_tick_box(%struct.osc* %0, double %1, double %2)
ret double %4
}
/* Type definitions */
struct atsha_handle {
  int dummy;
};

/* Variables and functions */
struct atsha_handle *atsha_open_ni2c_dev(char *, int);
struct atsha_handle *atsha_open() {
  struct atsha_handle *handle;
  handle = atsha_open_ni2c_dev((char *)"/dev/i2c-0", 0x64);
  return handle;
}


x86 assembly (clang, -O0):
<atsha_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
mov    $0x64,%esi
call   1030 <atsha_open_ni2c_dev@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atsha_open>:
lea    0xee9(%rip),%rdi
mov    $0x64,%esi
jmp    1030 <atsha_open_ni2c_dev@plt>

LLVM IR (-O0):
%struct.atsha_handle = type { i32 }
@.str = [11 x i8] c"/dev/i2c-0\00"
define %struct.atsha_handle* @atsha_open() {
%1 = alloca %struct.atsha_handle*
%2 = call %struct.atsha_handle* @atsha_open_ni2c_dev(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 100)
store %struct.atsha_handle* %2, %struct.atsha_handle** %1
%3 = load %struct.atsha_handle*, %struct.atsha_handle** %1
ret %struct.atsha_handle* %3
}

LLVM IR (-O2):
%struct.atsha_handle = type { i32 }
@.str = [11 x i8] c"/dev/i2c-0\00"
define %struct.atsha_handle* @atsha_open() {
%1 = tail call %struct.atsha_handle* @atsha_open_ni2c_dev(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 100)
ret %struct.atsha_handle* %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int recursive_sum(int, int);
int main() {
  int num = 5;
  int exponent = 3;
  printf("%d", recursive_sum(num, exponent));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
mov    $0x3,%esi
call   1040 <recursive_sum@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @recursive_sum(i32 5, i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ byte_diff(char const *, int, char const *);
int typematch(const char rtype[2], const char qtype[2]) {
  return (!byte_diff((qtype), (2), (rtype))) ||
         (!byte_diff((qtype), (2), ("\0\377")));
}


x86 assembly (clang, -O0):
<typematch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x2,%esi
call   1030 <byte_diff@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1162 <typematch+0x52>
mov    -0x10(%rbp),%rdi
mov    $0x2,%esi
lea    0xeae(%rip),%rdx
call   1030 <byte_diff@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<typematch>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rdx
mov    %rsi,%rdi
mov    $0x2,%esi
call   1030 <byte_diff@plt>
test   %eax,%eax
je     1147 <typematch+0x37>
lea    0xed1(%rip),%rdx
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <byte_diff@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"\00\FF\00"
define i32 @typematch(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
%7 = call i32 @byte_diff(i8* %5, i32 2, i8* %6)
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i8*, i8** %4
%11 = call i32 @byte_diff(i8* %10, i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%12 = icmp ne i32 %11, 0
%13 = xor i1 %12, true
br label %14
14: ; preds = %9, %2
%15 = phi i1 [ true, %2 ], [ %13, %9 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
@.str = [3 x i8] c"\00\FF\00"
define i32 @typematch(i8* %0, i8* %1) {
%3 = tail call i32 @byte_diff(i8* %1, i32 2, i8* %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @byte_diff(i8* %1, i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 1, %2 ], [ %8, %5 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ system(char *);
int x22_teardown() {
  char cmd[256];
  sprintf(cmd,
          "iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags "
          "SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d",
          1);
  system(cmd);
  return 0;
}


x86 assembly (clang, -O0):
<x22_teardown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x1,%edx
call   1040 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x22_teardown>:
push   %rbx
sub    $0x100,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [106 x i8] c"iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x22_teardown() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = call i32 @system(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [106 x i8] c"iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x22_teardown() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = call i32 @system(i8* %2)
ret i32 0
}
char letterToCode(char letter) { return (char)letter - 'A'; }


x86 assembly (clang, -O0):
<letterToCode>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x41,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<letterToCode>:
lea    -0x41(%rdi),%eax
ret

LLVM IR (-O0):
define signext i8 @letterToCode(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sub nsw i32 %4, 65
%6 = trunc i32 %5 to i8
ret i8 %6
}

LLVM IR (-O2):
define signext i8 @letterToCode(i8 signext %0) {
%2 = add i8 %0, -65
ret i8 %2
}
void uscF(int *x) {
  unsigned int *y;
  y = x;
}


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

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

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

LLVM IR (-O2):
define void @uscF(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_get_gid_of_group() {
  printf("NOT IMPLEMENTED:"
         "pa_get_gid_of_group"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [37 x i8] c"NOT IMPLEMENTED:pa_get_gid_of_group\0A\00"
define i32 @pa_get_gid_of_group() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [36 x i8] c"NOT IMPLEMENTED:pa_get_gid_of_group\00"
define i32 @pa_get_gid_of_group() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
struct timeval {
  int tv_sec;
  unsigned long long tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
unsigned long long current_time() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return tv.tv_sec * 1000000 + tv.tv_usec;
}


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

x86 assembly (clang, -O2):
<current_time>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movslq 0x8(%rsp),%rax
imul   $0xf4240,%rax,%rax
add    0x10(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i64 @current_time() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = mul nsw i32 %4, 1000000
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%8 = load i64, i64* %7
%9 = add i64 %6, %8
ret i64 %9
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i64 @current_time() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000000
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%9 = load i64, i64* %8
%10 = add i64 %9, %7
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ clear();
int /*<<< orphan*/ getmaxyx(int /*<<< orphan*/, int, int);
int /*<<< orphan*/ stdscr;
void get_terminal_dim_ncurses(int *w, int *h) {
  getmaxyx(stdscr, *h, *w);
  clear();
}


x86 assembly (clang, -O0):
<get_terminal_dim_ncurses>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
call   1030 <getmaxyx@plt>
mov    $0x0,%al
call   1040 <clear@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_terminal_dim_ncurses>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%eax
mov    (%rsi),%esi
mov    (%rdi),%edx
mov    %eax,%edi
call   1030 <getmaxyx@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <clear@plt>

LLVM IR (-O0):
@stdscr = global i32 0
define void @get_terminal_dim_ncurses(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32, i32* @stdscr
%6 = load i32*, i32** %4
%7 = load i32, i32* %6
%8 = load i32*, i32** %3
%9 = load i32, i32* %8
%10 = call i32 @getmaxyx(i32 %5, i32 %7, i32 %9)
%11 = call i32 (...) @clear()
ret void
}

LLVM IR (-O2):
@stdscr = global i32 0
define void @get_terminal_dim_ncurses(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* @stdscr
%4 = load i32, i32* %1
%5 = load i32, i32* %0
%6 = tail call i32 @getmaxyx(i32 %3, i32 %4, i32 %5)
%7 = tail call i32 (...) @clear()
ret void
}
char *xrealloc(ptr, size)
char *ptr;
unsigned int size;
{
  char *result = realloc(ptr, size);
  if (result == 0)
    fatal("virtual memory exhausted");
  return result;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%eax
mov    %eax,%esi
call   1030 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    115a <xrealloc+0x3a>
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1040 <fatal@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rbx
mov    %esi,%esi
call   1030 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113e <xrealloc+0x1e>
lea    0xec9(%rip),%rdi
xor    %eax,%eax
call   1040 <fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"virtual memory exhausted\00"
define i8* @xrealloc(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = zext i32 %7 to i64
%9 = call i8* @realloc(i8* %6, i64 %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 (i8*, ...) bitcast (i32 (...)* @fatal to i32 (i8*, ...)*)(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %12, %2
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
@.str = [25 x i8] c"virtual memory exhausted\00"
define i8* @xrealloc(i8* nocapture %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = tail call i8* @realloc(i8* %0, i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 (i8*, ...) bitcast (i32 (...)* @fatal to i32 (i8*, ...)*)(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %2
ret i8* %4
}
int test_bitNor(int x, int y) { return ~(x | y); }


x86 assembly (clang, -O0):
<test_bitNor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
or     -0x8(%rbp),%eax
xor    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_bitNor>:
mov    %edi,%eax
or     %esi,%eax
not    %eax
ret

LLVM IR (-O0):
define i32 @test_bitNor(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 = or i32 %5, %6
%8 = xor i32 %7, -1
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_bitNor(i32 %0, i32 %1) {
%3 = or i32 %1, %0
%4 = xor i32 %3, -1
ret i32 %4
}
/* Variables and functions */
double log(double);
double score_err(double p, void *data) {
  (void)data;
  return log(p);
}


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

x86 assembly (clang, -O2):
<score_err>:
jmp    1030 <log@plt>

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

LLVM IR (-O2):
define double @score_err(double %0, i8* nocapture readnone %1) {
%3 = tail call double @log(double %0)
ret double %3
}
__attribute__((__no__)) void
do_nothing_big_hole_zero(struct test_big_hole *ptr) {
  if ((unsigned long)ptr > 0x2)
    return;
  else
    return;
}


x86 assembly (clang, -O0):
<do_nothing_big_hole_zero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmp    $0x2,%rax
jbe    111b <do_nothing_big_hole_zero+0x1b>
jmp    1120 <do_nothing_big_hole_zero+0x20>
jmp    1120 <do_nothing_big_hole_zero+0x20>
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.test_big_hole = type opaque
define void @do_nothing_big_hole_zero(%struct.test_big_hole* %0) {
%2 = alloca %struct.test_big_hole*
store %struct.test_big_hole* %0, %struct.test_big_hole** %2
%3 = load %struct.test_big_hole*, %struct.test_big_hole** %2
%4 = ptrtoint %struct.test_big_hole* %3 to i64
%5 = icmp ugt i64 %4, 2
br i1 %5, label %6, label %7
6: ; preds = %1
br label %8
7: ; preds = %1
br label %8
8: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
%struct.test_big_hole = type opaque
define void @do_nothing_big_hole_zero(%struct.test_big_hole* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LOCK_EX;
int flock(int, int /*<<< orphan*/);
int EXlockB(int fd) { return flock(fd, LOCK_EX); }


x86 assembly (clang, -O0):
<EXlockB>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
call   1030 <flock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EXlockB>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <flock@plt>

LLVM IR (-O0):
@LOCK_EX = global i32 0
define i32 @EXlockB(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @LOCK_EX
%5 = call i32 @flock(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@LOCK_EX = global i32 0
define i32 @EXlockB(i32 %0) {
%2 = load i32, i32* @LOCK_EX
%3 = tail call i32 @flock(i32 %0, i32 %2)
ret i32 %3
}
void foo160(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo160(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ GLdouble;

/* Variables and functions */
int /*<<< orphan*/ glRasterPos2dv(int /*<<< orphan*/ *);
void RasterPos2dv(GLdouble v[2]) { glRasterPos2dv(v); }


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

x86 assembly (clang, -O2):
<RasterPos2dv>:
jmp    1030 <glRasterPos2dv@plt>

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

LLVM IR (-O2):
define void @RasterPos2dv(i32* %0) {
%2 = tail call i32 @glRasterPos2dv(i32* %0)
ret void
}
void DMA2_Stream2_IRQHandler() {}


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

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

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

LLVM IR (-O2):
define void @DMA2_Stream2_IRQHandler() {
ret void
}
int unblock_code(int fd) {}


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

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

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

LLVM IR (-O2):
define i32 @unblock_code(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ rtems_bsp_delay(int);
void zylons() {
  unsigned char *leds = (unsigned char *)0xd00003;
  unsigned char curled = 0xfe;
  while (1) {
    *leds = curled;
    curled = (curled >> 1) | (curled << 7);
    rtems_bsp_delay(8000);
  }
}


x86 assembly (clang, -O0):
<zylons>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0xd00003,%eax
mov    %rax,-0x8(%rbp)
movb   $0xfe,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
movzbl -0x9(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x18(%rbp)
movzbl -0x9(%rbp),%ecx
shl    $0x7,%ecx
mov    %ecx,-0x14(%rbp)
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    %al,-0x9(%rbp)
mov    $0x1f40,%edi
call   1030 <rtems_bsp_delay@plt>
jmp    1125 <zylons+0x15>

x86 assembly (clang, -O2):
<zylons>:
push   %rbx
mov    $0xfe,%bl
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %bl,0xd00003
ror    %bl
mov    $0x1f40,%edi
call   1030 <rtems_bsp_delay@plt>
jmp    1120 <zylons+0x10>

LLVM IR (-O0):
define void @zylons() {
%1 = alloca i8*
%2 = alloca i8
store i8* inttoptr (i64 13631491 to i8*), i8** %1
store i8 -2, i8* %2
br label %3
3: ; preds = %0, %3
%4 = load i8, i8* %2
%5 = load i8*, i8** %1
store i8 %4, i8* %5
%6 = load i8, i8* %2
%7 = zext i8 %6 to i32
%8 = ashr i32 %7, 1
%9 = load i8, i8* %2
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 7
%12 = or i32 %8, %11
%13 = trunc i32 %12 to i8
store i8 %13, i8* %2
%14 = call i32 @rtems_bsp_delay(i32 8000)
br label %3
}

LLVM IR (-O2):
define void @zylons() {
br label %1
1: ; preds = %1, %0
%2 = phi i8 [ -2, %0 ], [ %3, %1 ]
store i8 %2, i8* inttoptr (i64 13631491 to i8*)
%3 = tail call i8 @llvm.fshl.i8(i8 %2, i8 %2, i8 7)
%4 = tail call i32 @rtems_bsp_delay(i32 8000)
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ ASN1_VALUE;
typedef int /*<<< orphan*/ ASN1_SEQUENCE_ANY;

/* Variables and functions */
int /*<<< orphan*/ ASN1_SEQUENCE_ANY_it;
scalar_t__ ASN1_item_d2i(int /*<<< orphan*/ **, unsigned char const **, long,
                         int /*<<< orphan*/ *);
ASN1_SEQUENCE_ANY *d2i_ASN1_SEQUENCE_ANY(ASN1_SEQUENCE_ANY **a,
                                         const unsigned char **in, long len) {
  return (ASN1_SEQUENCE_ANY *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
                                            &ASN1_SEQUENCE_ANY_it);
}


x86 assembly (clang, -O0):
<d2i_ASN1_SEQUENCE_ANY>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    0x2ec1(%rip),%rcx
call   1030 <ASN1_item_d2i@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2i_ASN1_SEQUENCE_ANY>:
mov    0x2ee1(%rip),%rcx
jmp    1030 <ASN1_item_d2i@plt>

LLVM IR (-O0):
@ASN1_SEQUENCE_ANY_it = global i32 0
define i32* @d2i_ASN1_SEQUENCE_ANY(i32** %0, i8** %1, i64 %2) {
%4 = alloca i32**
%5 = alloca i8**
%6 = alloca i64
store i32** %0, i32*** %4
store i8** %1, i8*** %5
store i64 %2, i64* %6
%7 = load i32**, i32*** %4
%8 = load i8**, i8*** %5
%9 = load i64, i64* %6
%10 = call i64 @ASN1_item_d2i(i32** %7, i8** %8, i64 %9, i32* @ASN1_SEQUENCE_ANY_it)
%11 = inttoptr i64 %10 to i32*
ret i32* %11
}

LLVM IR (-O2):
@ASN1_SEQUENCE_ANY_it = global i32 0
define i32* @d2i_ASN1_SEQUENCE_ANY(i32** %0, i8** %1, i64 %2) {
%4 = tail call i64 @ASN1_item_d2i(i32** %0, i8** %1, i64 %2, i32* @ASN1_SEQUENCE_ANY_it)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0xd9() {
  Assert_real((isgraph(217) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isgraph.c",
              1090, ("isgraph should be 0 for 0xd9"));
}


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

x86 assembly (clang, -O2):
<t_isgraph_0xd9>:
push   %rax
mov    $0xd9,%edi
call   1040 <isgraph@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x442,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xd9\00"
define void @t_isgraph_0xd9() {
%1 = tail call i64 @isgraph(i32 217)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1090, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
char const *getenv(char *);
const char *_fetch_tssx_variable() { return getenv("USE_TSSX"); }


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"USE_TSSX\00"
define i8* @_fetch_tssx_variable() {
%1 = call i8* @getenv(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [9 x i8] c"USE_TSSX\00"
define i8* @_fetch_tssx_variable() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
double cos(double);
double degrees(int /*<<< orphan*/);
int /*<<< orphan*/ mean_ecliptic_obliquity(double);
double radians(double);
double corrected_mean_ecliptic_obliquity(double tm) {
  double rc = 0.00256 * cos(radians(-1934.136 * tm + 125.04));
  return radians(rc + degrees(mean_ecliptic_obliquity(tm)));
}


x86 assembly (clang, -O0):
<corrected_mean_ecliptic_obliquity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeae(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeaa(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1040 <radians@plt>
call   1050 <cos@plt>
movaps %xmm0,%xmm1
movsd  0xe81(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <mean_ecliptic_obliquity@plt>
mov    %eax,%edi
call   1060 <degrees@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
addsd  %xmm1,%xmm0
call   1040 <radians@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<corrected_mean_ecliptic_obliquity>:
sub    $0x18,%rsp
movapd %xmm0,%xmm1
movsd  %xmm0,0x10(%rsp)
movsd  0xeaa(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  0xea6(%rip),%xmm0
call   1040 <radians@plt>
call   1050 <cos@plt>
mulsd  0xe9c(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <mean_ecliptic_obliquity@plt>
mov    %eax,%edi
call   1060 <degrees@plt>
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
jmp    1040 <radians@plt>

LLVM IR (-O0):
define double @corrected_mean_ecliptic_obliquity(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @llvm.fmuladd.f64(double 0xC09E388B43958106, double %4, double 1.250400e+02)
%6 = call double @radians(double %5)
%7 = call double @cos(double %6)
%8 = fmul double 2.560000e-03, %7
store double %8, double* %3
%9 = load double, double* %3
%10 = load double, double* %2
%11 = call i32 @mean_ecliptic_obliquity(double %10)
%12 = call double @degrees(i32 %11)
%13 = fadd double %9, %12
%14 = call double @radians(double %13)
ret double %14
}

LLVM IR (-O2):
define double @corrected_mean_ecliptic_obliquity(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double 0xC09E388B43958106, double 1.250400e+02)
%3 = tail call double @radians(double %2)
%4 = tail call double @cos(double %3)
%5 = fmul double %4, 2.560000e-03
%6 = tail call i32 @mean_ecliptic_obliquity(double %0)
%7 = tail call double @degrees(i32 %6)
%8 = fadd double %5, %7
%9 = tail call double @radians(double %8)
ret double %9
}
int spt_fast_init1() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @spt_fast_init1() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ LCD4Bit_commandWrite(int);
int /*<<< orphan*/ LCD4Bit_delay(int);
void LCD4Bit_configureCursor(int onOff, int blinkOnOff) {
  LCD4Bit_commandWrite(0x0C | onOff << 1 | blinkOnOff);
  LCD4Bit_delay(1);
}


x86 assembly (clang, -O0):
<LCD4Bit_configureCursor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
shl    $0x1,%edi
or     $0xc,%edi
or     -0x8(%rbp),%edi
call   1030 <LCD4Bit_commandWrite@plt>
mov    $0x1,%edi
call   1040 <LCD4Bit_delay@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCD4Bit_configureCursor>:
push   %rax
add    %edi,%edi
or     %esi,%edi
or     $0xc,%edi
call   1030 <LCD4Bit_commandWrite@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <LCD4Bit_delay@plt>

LLVM IR (-O0):
define void @LCD4Bit_configureCursor(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 = shl i32 %5, 1
%7 = or i32 12, %6
%8 = load i32, i32* %4
%9 = or i32 %7, %8
%10 = call i32 @LCD4Bit_commandWrite(i32 %9)
%11 = call i32 @LCD4Bit_delay(i32 1)
ret void
}

LLVM IR (-O2):
define void @LCD4Bit_configureCursor(i32 %0, i32 %1) {
%3 = shl i32 %0, 1
%4 = or i32 %3, %1
%5 = or i32 %4, 12
%6 = tail call i32 @LCD4Bit_commandWrite(i32 %5)
%7 = tail call i32 @LCD4Bit_delay(i32 1)
ret void
}
/* Variables and functions */
int do_read_jedec(int);
int flash_read_jedec(int fd) { return do_read_jedec(fd); }


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

x86 assembly (clang, -O2):
<flash_read_jedec>:
jmp    1030 <do_read_jedec@plt>

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

LLVM IR (-O2):
define i32 @flash_read_jedec(i32 %0) {
%2 = tail call i32 @do_read_jedec(i32 %0)
ret i32 %2
}
/* Variables and functions */
float tdFade(float);
float tdFLerp(float a, float b, float t) {
  float fr = tdFade(t);
  return a * (1. - fr) + b * fr;
}


x86 assembly (clang, -O0):
<tdFLerp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
call   1030 <tdFade@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x10(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xeb0(%rip),%xmm2
subsd  %xmm1,%xmm2
movss  -0x8(%rbp),%xmm1
mulss  -0x10(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tdFLerp>:
push   %rax
movss  %xmm1,0x4(%rsp)
movss  %xmm0,(%rsp)
movaps %xmm2,%xmm0
call   1030 <tdFade@plt>
movss  (%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
xorps  %xmm2,%xmm2
cvtss2sd %xmm0,%xmm2
movsd  0xec4(%rip),%xmm3
subsd  %xmm2,%xmm3
mulsd  %xmm1,%xmm3
movss  0x4(%rsp),%xmm1
mulss  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
addsd  %xmm3,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @tdFLerp(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%8 = load float, float* %6
%9 = call float @tdFade(float %8)
store float %9, float* %7
%10 = load float, float* %4
%11 = fpext float %10 to double
%12 = load float, float* %7
%13 = fpext float %12 to double
%14 = fsub double 1.000000e+00, %13
%15 = load float, float* %5
%16 = load float, float* %7
%17 = fmul float %15, %16
%18 = fpext float %17 to double
%19 = call double @llvm.fmuladd.f64(double %11, double %14, double %18)
%20 = fptrunc double %19 to float
ret float %20
}

LLVM IR (-O2):
define float @tdFLerp(float %0, float %1, float %2) {
%4 = tail call float @tdFade(float %2)
%5 = fpext float %0 to double
%6 = fpext float %4 to double
%7 = fsub double 1.000000e+00, %6
%8 = fmul float %4, %1
%9 = fpext float %8 to double
%10 = tail call double @llvm.fmuladd.f64(double %5, double %7, double %9)
%11 = fptrunc double %10 to float
ret float %11
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void __aos_udelay(int usecs) {
  usleep(usecs);
  return;
}


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

x86 assembly (clang, -O2):
<__aos_udelay>:
jmp    1030 <usleep@plt>

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

LLVM IR (-O2):
define void @__aos_udelay(i32 %0) {
%2 = tail call i32 @usleep(i32 %0)
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int solcon_write_standard_solutions(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(31, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<solcon_write_standard_solutions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x1f,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solcon_write_standard_solutions>:
mov    $0x1f,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @solcon_write_standard_solutions() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 31, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @solcon_write_standard_solutions() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 31, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
void __attribute__((destructor)) tiz_platform_unload(void) {}


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

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

LLVM IR (-O0):
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @tiz_platform_unload, i8* null }]
define void @tiz_platform_unload() {
ret void
}

LLVM IR (-O2):
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @tiz_platform_unload, i8* null }]
define void @tiz_platform_unload() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ timer_t;

/* Variables and functions */
int timer_delete(int /*<<< orphan*/);
int timeout_del(timer_t tid) { return timer_delete(tid); }


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

x86 assembly (clang, -O2):
<timeout_del>:
jmp    1030 <timer_delete@plt>

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

LLVM IR (-O2):
define i32 @timeout_del(i32 %0) {
%2 = tail call i32 @timer_delete(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ test();
void main(void) { test(); }


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

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

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @test()
ret void
}
__attribute__((always_)) void cpu_relax(void) {
  __asm__ __volatile__("rep;nop" : : : "memory");
}


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

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

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

LLVM IR (-O2):
define void @cpu_relax() {
tail call void asm sideeffect "rep;nop", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t chunks_inode_hash_fn(uint32_t inode) {
  return ((inode * 0x72B5F387U) & (65536 - 1));
}


x86 assembly (clang, -O0):
<chunks_inode_hash_fn>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x72b5f387,-0x4(%rbp),%eax
and    $0xffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chunks_inode_hash_fn>:
imul   $0x72b5f387,%edi,%eax
movzwl %ax,%eax
ret

LLVM IR (-O0):
define i32 @chunks_inode_hash_fn(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul i32 %3, 1924526983
%5 = and i32 %4, 65535
ret i32 %5
}

LLVM IR (-O2):
define i32 @chunks_inode_hash_fn(i32 %0) {
%2 = mul i32 %0, 1924526983
%3 = and i32 %2, 65535
ret i32 %3
}
void freenode(struct filenode *n) {}


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

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

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

LLVM IR (-O2):
%struct.filenode = type opaque
define void @freenode(%struct.filenode* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _hmt_register_covercase(char *, char *);
void _hmt_covercase_HMM_ExpF_init(void) {
  _hmt_register_covercase("HMM_ExpF", "1");
}


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

x86 assembly (clang, -O2):
<_hmt_covercase_HMM_ExpF_init>:
lea    0xee9(%rip),%rdi
lea    0xeeb(%rip),%rsi
jmp    1030 <_hmt_register_covercase@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"HMM_ExpF\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_ExpF_init() {
%1 = call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"HMM_ExpF\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_ExpF_init() {
%1 = tail call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int getOperationPriority(char operation) {
  switch (operation) {
  case '*':
  case '/':
    return 1;
  case '+':
  case '-':
    return 0;
  }
  return -1;
}


x86 assembly (clang, -O0):
<getOperationPriority>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0xffffffd6,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x5,%eax
ja     114c <getOperationPriority+0x4c>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x4(%rbp)
jmp    1153 <getOperationPriority+0x53>
movl   $0x0,-0x4(%rbp)
jmp    1153 <getOperationPriority+0x53>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getOperationPriority>:
add    $0xffffffd6,%edi
mov    $0xffffffff,%eax
cmp    $0x5,%edi
ja     111a <getOperationPriority+0x1a>
movslq %edi,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

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

LLVM IR (-O2):
@switch.table.getOperationPriority = [6 x i32] [i32 1, i32 0, i32 -1, i32 0, i32 -1, i32 1]
define i32 @getOperationPriority(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -42
%4 = icmp ult i32 %3, 6
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = sext i32 %3 to i64
%7 = getelementptr inbounds [6 x i32], [6 x i32]* @switch.table.getOperationPriority, i64 0, i64 %6
%8 = load i32, i32* %7
br label %9
9: ; preds = %1, %5
%10 = phi i32 [ %8, %5 ], [ -1, %1 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void __attribute__((weak)) f(void) {
  printf("2nd weak f from %s\n",
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/wcnnbdk1/hello_world/refs/heads/master/"
         "CLearning/CPrimerPlus/chap09/w2.c");
}


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

x86 assembly (clang, -O2):
<f>:
lea    0xee9(%rip),%rdi
lea    0xef6(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"2nd weak f from %s\0A\00"
@.str.1 = [163 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/wcnnbdk1/hello_world/refs/heads/master/CLearning/CPrimerPlus/chap09/w2.c\00"
define weak void @f() {
%1 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([163 x i8], [163 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"2nd weak f from %s\0A\00"
@.str.1 = [163 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/wcnnbdk1/hello_world/refs/heads/master/CLearning/CPrimerPlus/chap09/w2.c\00"
define weak void @f() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([163 x i8], [163 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void window_manager_shutdown_notify(void) {}


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

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

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

LLVM IR (-O2):
define void @window_manager_shutdown_notify() {
ret void
}
float f(float x) {
  float return_val;
  return_val = x * x;
  return return_val;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mulss  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @f(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = load float, float* %2
%6 = fmul float %4, %5
store float %6, float* %3
%7 = load float, float* %3
ret float %7
}

LLVM IR (-O2):
define float @f(float %0) {
%2 = fmul float %0, %0
ret float %2
}