xunge/DecIR huggingface dataset:
double grib_op_ge_d(double a, double b) { return a >= b; }


x86 assembly (clang, -O0):
<grib_op_ge_d>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<grib_op_ge_d>:
cmplesd %xmm0,%xmm1
movsd  0xef3(%rip),%xmm0
andpd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @grib_op_ge_d(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp oge double %5, %6
%8 = zext i1 %7 to i32
%9 = sitofp i32 %8 to double
ret double %9
}

LLVM IR (-O2):
define double @grib_op_ge_d(double %0, double %1) {
%3 = fcmp oge double %0, %1
%4 = uitofp i1 %3 to double
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("\n{{projectName}} started\n\n");
  printf("{{projectName}} ended\n\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"\0A{{projectName}} started\0A\0A\00"
@.str.1 = [24 x i8] c"{{projectName}} ended\0A\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [26 x i8] c"\0A{{projectName}} started\0A\00"
@str.2 = [23 x i8] c"{{projectName}} ended\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int rmmod_usage() {
  fprintf(stderr, "usage: rmmod <module>\n");
  return 1;
}


x86 assembly (clang, -O0):
<rmmod_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rmmod_usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"usage: rmmod <module>\0A\00"
define i32 @rmmod_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"usage: rmmod <module>\0A\00"
define i32 @rmmod_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
void ft_striter(char *s, void (*f)(char *)) {
  unsigned int u;
  u = 0;
  if (s && f)
    while (*(s + u))
      f(s + u++);
}


x86 assembly (clang, -O0):
<ft_striter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1167 <ft_striter+0x67>
cmpq   $0x0,-0x10(%rbp)
je     1167 <ft_striter+0x67>
jmp    1132 <ft_striter+0x32>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
cmpb   $0x0,(%rax,%rcx,1)
je     1162 <ft_striter+0x62>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x14(%rbp)
mov    %ecx,%ecx
add    %rcx,%rdi
call   *%rax
jmp    1132 <ft_striter+0x32>
jmp    1167 <ft_striter+0x67>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_striter>:
push   %rbp
push   %r14
push   %rbx
test   %rdi,%rdi
je     1142 <ft_striter+0x42>
mov    %rsi,%r14
test   %rsi,%rsi
je     1142 <ft_striter+0x42>
mov    %rdi,%rbx
cmpb   $0x0,(%rdi)
je     1142 <ft_striter+0x42>
mov    $0x1,%ebp
mov    %rbx,%rdi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
call   *%r14
mov    %ebp,%eax
lea    (%rbx,%rax,1),%rdi
add    $0x1,%ebp
cmpb   $0x0,(%rbx,%rax,1)
jne    1130 <ft_striter+0x30>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @ft_striter(i8* %0, void (i8*)* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne void (i8*)* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %17
6: ; preds = %2
%7 = load i8, i8* %0
%8 = icmp eq i8 %7, 0
br i1 %8, label %17, label %9
9: ; preds = %6, %9
%10 = phi i8* [ %14, %9 ], [ %0, %6 ]
%11 = phi i32 [ %12, %9 ], [ 0, %6 ]
%12 = add i32 %11, 1
tail call void %1(i8* %10)
%13 = zext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %0, i64 %13
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %9
17: ; preds = %9, %6, %2
ret void
}
/* Variables and functions */
long *extended_gcd(long, long);
long modinv(long a, long m) {
  long *temp;
  temp = extended_gcd(a, m);
  long x = temp[1], g = temp[0];
  if (g == 1)
    return (x % m);
}


x86 assembly (clang, -O0):
<modinv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <extended_gcd@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x30(%rbp)
cmpq   $0x1,-0x30(%rbp)
jne    1161 <modinv+0x51>
mov    -0x28(%rbp),%rax
cqto
idivq  -0x18(%rbp)
mov    %rdx,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<modinv>:
push   %rbx
mov    %rsi,%rbx
call   1030 <extended_gcd@plt>
mov    %rax,%rcx
cmpq   $0x1,(%rax)
jne    113a <modinv+0x2a>
mov    0x8(%rcx),%rax
mov    %rax,%rcx
or     %rbx,%rcx
shr    $0x20,%rcx
je     113c <modinv+0x2c>
cqto
idiv   %rbx
mov    %rdx,%rax
pop    %rbx
ret
xor    %edx,%edx
div    %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @modinv(i64 %0, i64 %1) {
%3 = alloca i64
%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
%9 = load i64, i64* %4
%10 = load i64, i64* %5
%11 = call i64* @extended_gcd(i64 %9, i64 %10)
store i64* %11, i64** %6
%12 = load i64*, i64** %6
%13 = getelementptr inbounds i64, i64* %12, i64 1
%14 = load i64, i64* %13
store i64 %14, i64* %7
%15 = load i64*, i64** %6
%16 = getelementptr inbounds i64, i64* %15, i64 0
%17 = load i64, i64* %16
store i64 %17, i64* %8
%18 = load i64, i64* %8
%19 = icmp eq i64 %18, 1
br i1 %19, label %20, label %24
20: ; preds = %2
%21 = load i64, i64* %7
%22 = load i64, i64* %5
%23 = srem i64 %21, %22
store i64 %23, i64* %3
br label %24
24: ; preds = %20, %2
%25 = load i64, i64* %3
ret i64 %25
}

LLVM IR (-O2):
define i64 @modinv(i64 %0, i64 %1) {
%3 = tail call i64* @extended_gcd(i64 %0, i64 %1)
%4 = load i64, i64* %3
%5 = icmp eq i64 %4, 1
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = getelementptr inbounds i64, i64* %3, i64 1
%8 = load i64, i64* %7
%9 = srem i64 %8, %1
br label %10
10: ; preds = %2, %6
%11 = phi i64 [ %9, %6 ], [ undef, %2 ]
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int sanity_test(int exi) {
  if (exi)
    exit(0);
  return 0;
}


x86 assembly (clang, -O0):
<sanity_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112c <sanity_test+0x1c>
xor    %edi,%edi
call   1030 <exit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sanity_test>:
test   %edi,%edi
jne    1117 <sanity_test+0x7>
xor    %eax,%eax
ret
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define i32 @sanity_test(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @exit(i32 0)
unreachable
7: ; preds = %1
ret i32 0
}

LLVM IR (-O2):
define i32 @sanity_test(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @exit(i32 0)
unreachable
5: ; preds = %1
ret i32 0
}
/* Variables and functions */
int fabs(int);
int /*<<< orphan*/ printf(char *, int, int);
main() {
  printf("\n%d   %d", 10 - 10 > 0 ? 10 : -10, -10 > 0 ? -10 : - -10 + 1);
  printf("\n%d   %d", (((10) >= 0) ? (10) : -(10)) + 1,
         (((-10) >= 0) ? (-10) : -(-10)) + 1);
  printf("\n%d   %d\n", fabs(10) + 1, fabs(-10) + 1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0xfffffff6,%esi
mov    $0xb,%edx
call   1030 <printf@plt>
lea    0xebb(%rip),%rdi
mov    $0xb,%edx
mov    %edx,%esi
call   1030 <printf@plt>
mov    $0xa,%edi
call   1040 <fabs@plt>
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    $0xfffffff6,%edi
call   1040 <fabs@plt>
mov    -0x4(%rbp),%esi
mov    %eax,%edx
add    $0x1,%edx
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
mov    $0xfffffff6,%esi
mov    $0xb,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xb,%esi
mov    $0xb,%edx
call   1030 <printf@plt>
mov    $0xa,%edi
call   1040 <fabs@plt>
lea    0x1(%rax),%ebx
mov    $0xfffffff6,%edi
call   1040 <fabs@plt>
lea    0x1(%rax),%edx
lea    0xe9c(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"\0A%d %d\00"
@.str.1 = [10 x i8] c"\0A%d %d\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 -10, i32 11)
%2 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 11, i32 11)
%3 = call i32 @fabs(i32 10)
%4 = add nsw i32 %3, 1
%5 = call i32 @fabs(i32 -10)
%6 = add nsw i32 %5, 1
%7 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %4, i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"\0A%d %d\00"
@.str.1 = [10 x i8] c"\0A%d %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 -10, i32 11)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 11, i32 11)
%3 = tail call i32 @fabs(i32 10)
%4 = add nsw i32 %3, 1
%5 = tail call i32 @fabs(i32 -10)
%6 = add nsw i32 %5, 1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %4, i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ set_mode(int /*<<< orphan*/);
int f_v0(int mode, unsigned char **sec, float *data, unsigned int ndata,
         char *inv_out, void **local) {
  set_mode(0);
  return 0;
}


x86 assembly (clang, -O0):
<f_v0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
xor    %edi,%edi
call   1030 <set_mode@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f_v0(i32 %0, i8** %1, float* %2, i32 %3, i8* %4, i8** %5) {
%7 = alloca i32
%8 = alloca i8**
%9 = alloca float*
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i8**
store i32 %0, i32* %7
store i8** %1, i8*** %8
store float* %2, float** %9
store i32 %3, i32* %10
store i8* %4, i8** %11
store i8** %5, i8*** %12
%13 = call i32 @set_mode(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @f_v0(i32 %0, i8** nocapture readnone %1, float* nocapture readnone %2, i32 %3, i8* nocapture readnone %4, i8** nocapture readnone %5) {
%7 = tail call i32 @set_mode(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printk(char *, void *, void *);
void print_ip_sym(unsigned long ip) {
  printk("[<%p>] %pS\n", (void *)ip, (void *)ip);
}


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

x86 assembly (clang, -O2):
<print_ip_sym>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
mov    %rdx,%rsi
jmp    1030 <printk@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"[<%p>] %pS\0A\00"
define void @print_ip_sym(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
%5 = load i64, i64* %2
%6 = inttoptr i64 %5 to i8*
%7 = call i32 @printk(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"[<%p>] %pS\0A\00"
define void @print_ip_sym(i64 %0) {
%2 = inttoptr i64 %0 to i8*
%3 = tail call i32 @printk(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %2)
ret void
}
int dns_v_abi(void) { return 0x20100412; }


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

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

LLVM IR (-O0):
define i32 @dns_v_abi() {
ret i32 537920530
}

LLVM IR (-O2):
define i32 @dns_v_abi() {
ret i32 537920530
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ bug(char *, char *);
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
void start_timer(struct timeval *sttime) {
  if (!sttime) {
    bug("%s", "Start_timer: NULL sttime.");
    return;
  }
  gettimeofday(sttime, NULL);
  return;
}


x86 assembly (clang, -O0):
<start_timer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    114f <start_timer+0x2f>
lea    0xec2(%rip),%rdi
lea    0xebe(%rip),%rsi
call   1030 <bug@plt>
jmp    115c <start_timer+0x3c>
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <gettimeofday@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<start_timer>:
test   %rdi,%rdi
je     112c <start_timer+0xc>
xor    %esi,%esi
jmp    1040 <gettimeofday@plt>
lea    0xecd(%rip),%rdi
lea    0xec9(%rip),%rsi
jmp    1030 <bug@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
@.str = [3 x i8] c"%s\00"
@.str.1 = [26 x i8] c"Start_timer: NULL sttime.\00"
define void @start_timer(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %2
%3 = load %struct.timeval*, %struct.timeval** %2
%4 = icmp ne %struct.timeval* %3, null
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = call i32 @bug(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
br label %10
7: ; preds = %1
%8 = load %struct.timeval*, %struct.timeval** %2
%9 = call i32 @gettimeofday(%struct.timeval* %8, i32* null)
br label %10
10: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
@.str = [3 x i8] c"%s\00"
@.str.1 = [26 x i8] c"Start_timer: NULL sttime.\00"
define void @start_timer(%struct.timeval* %0) {
%2 = icmp eq %struct.timeval* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @bug(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
br label %7
5: ; preds = %1
%6 = tail call i32 @gettimeofday(%struct.timeval* %0, i32* null)
br label %7
7: ; preds = %5, %3
ret void
}
int WinMain() { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @WinMain() {
ret i32 0
}
/* Variables and functions */
int GLUT_VISIBLE;
int /*<<< orphan*/ glutIdleFunc(int /*<<< orphan*/ *);
int /*<<< orphan*/ *glutPostRedisplay;
void visible(int vis) {
  if (vis == GLUT_VISIBLE)
    glutIdleFunc(glutPostRedisplay);
  else
    glutIdleFunc(NULL);
}


x86 assembly (clang, -O0):
<visible>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ec3(%rip),%rcx
cmp    (%rcx),%eax
jne    1141 <visible+0x31>
mov    0x2eac(%rip),%rax
mov    (%rax),%rdi
call   1030 <glutIdleFunc@plt>
jmp    114a <visible+0x3a>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <glutIdleFunc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<visible>:
mov    0x2ed1(%rip),%rax
cmp    %edi,(%rax)
jne    112a <visible+0x1a>
mov    0x2ebe(%rip),%rax
mov    (%rax),%rdi
jmp    1030 <glutIdleFunc@plt>
xor    %edi,%edi
jmp    1030 <glutIdleFunc@plt>

LLVM IR (-O0):
@GLUT_VISIBLE = global i32 0
@glutPostRedisplay = global i32* null
define void @visible(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @GLUT_VISIBLE
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32*, i32** @glutPostRedisplay
%8 = call i32 @glutIdleFunc(i32* %7)
br label %11
9: ; preds = %1
%10 = call i32 @glutIdleFunc(i32* null)
br label %11
11: ; preds = %9, %6
ret void
}

LLVM IR (-O2):
@GLUT_VISIBLE = global i32 0
@glutPostRedisplay = global i32* null
define void @visible(i32 %0) {
%2 = load i32, i32* @GLUT_VISIBLE
%3 = icmp eq i32 %2, %0
%4 = load i32*, i32** @glutPostRedisplay
%5 = select i1 %3, i32* %4, i32* null
%6 = tail call i32 @glutIdleFunc(i32* %5)
ret void
}
/* Variables and functions */
int gcd(int, int);
int main() { return gcd(16574, 21654); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x40be,%edi
mov    $0x5496,%esi
call   1030 <gcd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x40be,%edi
mov    $0x5496,%esi
jmp    1030 <gcd@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @gcd(i32 16574, i32 21654)
ret i32 %2
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @gcd(i32 16574, i32 21654)
ret i32 %1
}
int ToLower(int c) { return c >= 'A' && c <= 'Z' ? c + ' ' : c; }


x86 assembly (clang, -O0):
<ToLower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x41,-0x4(%rbp)
jl     1129 <ToLower+0x29>
cmpl   $0x5a,-0x4(%rbp)
jg     1129 <ToLower+0x29>
mov    -0x4(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    112f <ToLower+0x2f>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ToLower>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @ToLower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 32
br label %13
11: ; preds = %5, %1
%12 = load i32, i32* %2
br label %13
13: ; preds = %11, %8
%14 = phi i32 [ %10, %8 ], [ %12, %11 ]
ret i32 %14
}

LLVM IR (-O2):
define i32 @ToLower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
int fun1193() { return 1193; }


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

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

LLVM IR (-O0):
define i32 @fun1193() {
ret i32 1193
}

LLVM IR (-O2):
define i32 @fun1193() {
ret i32 1193
}
void get_dependencies_fmt(char **fmt) {
  *fmt = "repoquery --requires --resolve %s --qf %{NAME}";
}


x86 assembly (clang, -O0):
<get_dependencies_fmt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
lea    0xeed(%rip),%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_dependencies_fmt>:
lea    0xef9(%rip),%rax
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
@.str = [47 x i8] c"repoquery --requires --resolve %s --qf %{NAME}\00"
define void @get_dependencies_fmt(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
store i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8** %3
ret void
}

LLVM IR (-O2):
@.str = [47 x i8] c"repoquery --requires --resolve %s --qf %{NAME}\00"
define void @get_dependencies_fmt(i8** nocapture writeonly %0) {
store i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8** %0
ret void
}
void over() {}


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

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

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

LLVM IR (-O2):
define void @over() {
ret void
}
struct ab8500_fg *ab8500_fg_get(void) {}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
ret

LLVM IR (-O0):
%struct.ab8500_fg = type opaque
define %struct.ab8500_fg* @ab8500_fg_get() {
%1 = alloca %struct.ab8500_fg*
%2 = load %struct.ab8500_fg*, %struct.ab8500_fg** %1
ret %struct.ab8500_fg* %2
}

LLVM IR (-O2):
%struct.ab8500_fg = type opaque
define noalias %struct.ab8500_fg* @ab8500_fg_get() {
ret %struct.ab8500_fg* undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float C, K;
  printf("Celsius: ");
  scanf("%f", &K);
  C = K + 273.15;
  printf("Celsius para Kelvin: %f\n", C);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xea2(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe9a(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0xeae(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeb4(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Celsius: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [25 x i8] c"Celsius para Kelvin: %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%6 = load float, float* %3
%7 = fpext float %6 to double
%8 = fadd double %7, 2.731500e+02
%9 = fptrunc double %8 to float
store float %9, float* %2
%10 = load float, float* %2
%11 = fpext float %10 to double
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), double %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"Celsius: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [25 x i8] c"Celsius para Kelvin: %f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = fpext float %5 to double
%7 = fadd double %6, 2.731500e+02
%8 = fptrunc double %7 to float
%9 = fpext float %8 to double
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), double %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ shutdown(int /*<<< orphan*/, int /*<<< orphan*/);
int main(void) {
  shutdown(0, 0);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @shutdown(i32 0, i32 0)
ret i32 0
}
/* Type definitions */
struct queue {
  int dummy;
};

/* Variables and functions */
struct queue *queue_new(int, int);
struct queue *queue_new_int(int size) {
  return queue_new(size, sizeof(int));
}


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

x86 assembly (clang, -O2):
<queue_new_int>:
mov    $0x4,%esi
jmp    1030 <queue_new@plt>

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

LLVM IR (-O2):
%struct.queue = type { i32 }
define %struct.queue* @queue_new_int(i32 %0) {
%2 = tail call %struct.queue* @queue_new(i32 %0, i32 4)
ret %struct.queue* %2
}
/* Variables and functions */
int /*<<< orphan*/ __invpcid(unsigned long, unsigned long, int /*<<< orphan*/);
void invpcid_flush_one(unsigned long pcid, unsigned long addr) {
  __invpcid(pcid, addr, 0);
}


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

x86 assembly (clang, -O2):
<invpcid_flush_one>:
xor    %edx,%edx
jmp    1030 <__invpcid@plt>

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

LLVM IR (-O2):
define void @invpcid_flush_one(i64 %0, i64 %1) {
%3 = tail call i32 @__invpcid(i64 %0, i64 %1, i32 0)
ret void
}
int test_imm_7Dint32_mem(int *val) {
  return ((*val) & (0x7D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_7Dint32_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
and    $0x7d,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_7Dint32_mem>:
testb  $0x7d,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_7Dint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 125
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void printString(char *s) { printf("%s", s); }


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

x86 assembly (clang, -O2):
<printString>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @printString(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Use:\n");
  fprintf(stderr, "   nsfix <netscape.bin> <config-file>\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xed7(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [6 x i8] c"Use:\0A\00"
@.str.1 = [39 x i8] c" nsfix <netscape.bin> <config-file>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [6 x i8] c"Use:\0A\00"
@.str.1 = [39 x i8] c" nsfix <netscape.bin> <config-file>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *malloc(int);
int sprintf(char *, char const *, float, float, float);
char *msg_app_flt3(const char *msg1, float n1, float n2, float n3) {
  char *p = malloc(200);
  int b = sprintf(p, msg1, n1, n2, n3);
  return p;
}


x86 assembly (clang, -O0):
<msg_app_flt3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
mov    $0xc8,%edi
call   1030 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
movss  -0x14(%rbp),%xmm2
call   1040 <sprintf@plt>
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msg_app_flt3>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movss  %xmm2,0x14(%rsp)
movss  %xmm1,0x10(%rsp)
movss  %xmm0,0xc(%rsp)
mov    %rdi,%r14
mov    $0xc8,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
movss  0xc(%rsp),%xmm0
movss  0x10(%rsp),%xmm1
movss  0x14(%rsp),%xmm2
call   1040 <sprintf@plt>
mov    %rbx,%rax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @msg_app_flt3(i8* %0, float %1, float %2, float %3) {
%5 = alloca i8*
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca i8*
%10 = alloca i32
store i8* %0, i8** %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%11 = call i8* @malloc(i32 200)
store i8* %11, i8** %9
%12 = load i8*, i8** %9
%13 = load i8*, i8** %5
%14 = load float, float* %6
%15 = load float, float* %7
%16 = load float, float* %8
%17 = call i32 @sprintf(i8* %12, i8* %13, float %14, float %15, float %16)
store i32 %17, i32* %10
%18 = load i8*, i8** %9
ret i8* %18
}

LLVM IR (-O2):
define noalias i8* @msg_app_flt3(i8* nocapture %0, float %1, float %2, float %3) {
%5 = tail call dereferenceable_or_null(200) i8* @malloc(i32 200)
%6 = tail call i32 @sprintf(i8* dereferenceable(1) %5, i8* dereferenceable(1) %0, float %1, float %2, float %3)
ret i8* %5
}
void V_loaderclose() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ imgfile_seek_internal(int /*<<< orphan*/, int /*<<< orphan*/,
                                         int);
bool imgfile_seek(uint32_t sec, uint8_t mode) {
  if (!imgfile_seek_internal(sec, mode, true)) {
    do {
    } while (0);
    do {
      (void)(mode);
    } while (0);
    do {
    } while (0);
    return false;
  }
  return true;
}


x86 assembly (clang, -O0):
<imgfile_seek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    $0x1,%edx
call   1030 <imgfile_seek_internal@plt>
cmp    $0x0,%eax
jne    115c <imgfile_seek+0x4c>
jmp    113c <imgfile_seek+0x2c>
jmp    1141 <imgfile_seek+0x31>
jmp    1146 <imgfile_seek+0x36>
jmp    114b <imgfile_seek+0x3b>
jmp    1150 <imgfile_seek+0x40>
movl   $0x0,-0x4(%rbp)
jmp    1163 <imgfile_seek+0x53>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imgfile_seek>:
push   %rax
mov    $0x1,%edx
call   1030 <imgfile_seek_internal@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @imgfile_seek(i32 %0, i32 %1) {
%3 = tail call i32 @imgfile_seek_internal(i32 %0, i32 %1, i32 1)
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int mockup_2(void *user_data) {
  if (user_data != NULL) {
    *((int *)user_data) = 2;
  }
  return 2;
}


x86 assembly (clang, -O0):
<mockup_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     111d <mockup_2+0x1d>
mov    -0x8(%rbp),%rax
movl   $0x2,(%rax)
mov    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mockup_2>:
test   %rdi,%rdi
je     110b <mockup_2+0xb>
movl   $0x2,(%rdi)
mov    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @mockup_2(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = bitcast i8* %6 to i32*
store i32 2, i32* %7
br label %8
8: ; preds = %5, %1
ret i32 2
}

LLVM IR (-O2):
define i32 @mockup_2(i8* writeonly %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = bitcast i8* %0 to i32*
store i32 2, i32* %4
br label %5
5: ; preds = %3, %1
ret i32 2
}
void init_sub_rel_color_pt_funcs_c(void) {}


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

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

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

LLVM IR (-O2):
define void @init_sub_rel_color_pt_funcs_c() {
ret void
}
void subr(int parm) {}


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

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

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

LLVM IR (-O2):
define void @subr(i32 %0) {
ret void
}
/* Variables and functions */
unsigned int pow_mod(unsigned int, int, int);
unsigned short rsa_encrypt(unsigned short c_short) {
  unsigned c = c_short;
  c = pow_mod(c, 55543, 65509);
  return (unsigned short)c;
}


x86 assembly (clang, -O0):
<rsa_encrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0xd8f7,%esi
mov    $0xffe5,%edx
call   1030 <pow_mod@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rsa_encrypt>:
push   %rax
mov    $0xd8f7,%esi
mov    $0xffe5,%edx
call   1030 <pow_mod@plt>
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i16 @rsa_encrypt(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i32
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = zext i16 %4 to i32
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i32 @pow_mod(i32 %6, i32 55543, i32 65509)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = trunc i32 %8 to i16
ret i16 %9
}

LLVM IR (-O2):
define zeroext i16 @rsa_encrypt(i16 zeroext %0) {
%2 = zext i16 %0 to i32
%3 = tail call i32 @pow_mod(i32 %2, i32 55543, i32 65509)
%4 = trunc i32 %3 to i16
ret i16 %4
}
/* Variables and functions */
int /*<<< orphan*/ MODULE_ERR(char *);
int /*<<< orphan*/ cleanup(int /*<<< orphan*/);
void STRMOVE(short N, char *S1_, short P1, char *S2, short P2) {
  MODULE_ERR("STRMOVE not supported yet");
  cleanup(0);
  return;
}


x86 assembly (clang, -O0):
<STRMOVE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %r8w,%ax
mov    %di,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %dx,-0x12(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %ax,-0x22(%rbp)
lea    0xeb9(%rip),%rdi
call   1040 <MODULE_ERR@plt>
xor    %edi,%edi
call   1030 <cleanup@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<STRMOVE>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <MODULE_ERR@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <cleanup@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"STRMOVE not supported yet\00"
define void @STRMOVE(i16 signext %0, i8* %1, i16 signext %2, i8* %3, i16 signext %4) {
%6 = alloca i16
%7 = alloca i8*
%8 = alloca i16
%9 = alloca i8*
%10 = alloca i16
store i16 %0, i16* %6
store i8* %1, i8** %7
store i16 %2, i16* %8
store i8* %3, i8** %9
store i16 %4, i16* %10
%11 = call i32 @MODULE_ERR(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @cleanup(i32 0)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"STRMOVE not supported yet\00"
define void @STRMOVE(i16 signext %0, i8* nocapture readnone %1, i16 signext %2, i8* nocapture readnone %3, i16 signext %4) {
%6 = tail call i32 @MODULE_ERR(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @cleanup(i32 0)
ret void
}
signed long long f12(signed long long v_foo) {
  signed long long v_shr = v_foo << 2;
  signed long long v_and = v_shr & -241;
  return v_and;
}


x86 assembly (clang, -O0):
<f12>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x2,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0xffffffffffffff0f,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f12>:
and    $0xffffffffffffffc3,%rdi
lea    0x0(,%rdi,4),%rax
ret

LLVM IR (-O0):
define i64 @f12(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %2
%5 = load i64, i64* %2
%6 = shl i64 %5, 2
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = and i64 %7, -241
store i64 %8, i64* %4
%9 = load i64, i64* %4
ret i64 %9
}

LLVM IR (-O2):
define i64 @f12(i64 %0) {
%2 = shl i64 %0, 2
%3 = and i64 %2, -244
ret i64 %3
}
int func1() {
  int a = 1;
  int b = 2;
  return a + b;
}


x86 assembly (clang, -O0):
<func1>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @func1() {
ret i32 3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ ofl_port_print(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ *open_memstream(char **, size_t *);
char *ofl_port_to_string(uint32_t port) {
  char *str;
  size_t str_size;
  FILE *stream = open_memstream(&str, &str_size);
  ofl_port_print(stream, port);
  fclose(stream);
  return str;
}


x86 assembly (clang, -O0):
<ofl_port_to_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <open_memstream@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1050 <ofl_port_print@plt>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ofl_port_to_string>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    %edi,%ebp
lea    0x8(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1030 <open_memstream@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %ebp,%esi
call   1050 <ofl_port_print@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    0x8(%rsp),%rax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @ofl_port_to_string(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32*
store i32 %0, i32* %2
%6 = call i32* @open_memstream(i8** %3, i64* %4)
store i32* %6, i32** %5
%7 = load i32*, i32** %5
%8 = load i32, i32* %2
%9 = call i32 @ofl_port_print(i32* %7, i32 %8)
%10 = load i32*, i32** %5
%11 = call i32 @fclose(i32* %10)
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define i8* @ofl_port_to_string(i32 %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = bitcast i8** %2 to i8*
%5 = bitcast i64* %3 to i8*
%6 = call i32* @open_memstream(i8** %2, i64* %3)
%7 = call i32 @ofl_port_print(i32* %6, i32 %0)
%8 = call i32 @fclose(i32* %6)
%9 = load i8*, i8** %2
ret i8* %9
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ transmit(int, int, int /*<<< orphan*/);
void send_sync(uint32_t pulse_len) { transmit(1, 31, pulse_len); }


x86 assembly (clang, -O0):
<send_sync>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x1,%edi
mov    $0x1f,%esi
call   1030 <transmit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_sync>:
mov    %edi,%edx
mov    $0x1,%edi
mov    $0x1f,%esi
jmp    1030 <transmit@plt>

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

LLVM IR (-O2):
define void @send_sync(i32 %0) {
%2 = tail call i32 @transmit(i32 1, i32 31, i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fputc(int const, int /*<<< orphan*/ *const);
__attribute__((__unused__)) int(cheat_unwrapped_fputc)(int const character,
                                                       FILE *const stream) {
  return fputc(character, stream);
}


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

x86 assembly (clang, -O2):
<cheat_unwrapped_fputc>:
jmp    1030 <fputc@plt>

LLVM IR (-O0):
define i32 @cheat_unwrapped_fputc(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 @fputc(i32 %5, i32* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @cheat_unwrapped_fputc(i32 %0, i32* nocapture %1) {
%3 = tail call i32 @fputc(i32 %0, i32* %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int /*<<< orphan*/ getegid();
int /*<<< orphan*/ setresgid(int /*<<< orphan*/, int /*<<< orphan*/,
                             int /*<<< orphan*/);
int /*<<< orphan*/ system(char *);
void give_shell() {
  gid_t gid = getegid();
  setresgid(gid, gid, gid);
  system("/bin/sh -i");
}


x86 assembly (clang, -O0):
<give_shell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <getegid@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%edx
call   1030 <setresgid@plt>
lea    0xea9(%rip),%rdi
call   1040 <system@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<give_shell>:
push   %rax
xor    %eax,%eax
call   1050 <getegid@plt>
mov    %eax,%edi
mov    %eax,%esi
mov    %eax,%edx
call   1030 <setresgid@plt>
lea    0xeb6(%rip),%rdi
pop    %rax
jmp    1040 <system@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"/bin/sh -i\00"
define void @give_shell() {
%1 = alloca i32
%2 = call i32 (...) @getegid()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = load i32, i32* %1
%5 = load i32, i32* %1
%6 = call i32 @setresgid(i32 %3, i32 %4, i32 %5)
%7 = call i32 @system(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"/bin/sh -i\00"
define void @give_shell() {
%1 = tail call i32 (...) @getegid()
%2 = tail call i32 @setresgid(i32 %1, i32 %1, i32 %1)
%3 = tail call i32 @system(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}
double half(double x) { return x / 2; }


x86 assembly (clang, -O0):
<half>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<half>:
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @half(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 2.000000e+00
ret double %4
}

LLVM IR (-O2):
define double @half(double %0) {
%2 = fmul double %0, 5.000000e-01
ret double %2
}
void FlashUsecSet(unsigned long ulClocks) {
  (*((volatile unsigned long *)(0x400FE140))) = ulClocks - 1;
}


x86 assembly (clang, -O0):
<FlashUsecSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
sub    $0x1,%rcx
mov    $0x400fe140,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<FlashUsecSet>:
add    $0xffffffffffffffff,%rdi
mov    %rdi,0x400fe140
40
ret

LLVM IR (-O0):
define void @FlashUsecSet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sub i64 %3, 1
store volatile i64 %4, i64* inttoptr (i64 1074782528 to i64*)
ret void
}

LLVM IR (-O2):
define void @FlashUsecSet(i64 %0) {
%2 = add i64 %0, -1
store volatile i64 %2, i64* inttoptr (i64 1074782528 to i64*)
ret void
}