xunge/DecIR huggingface dataset:
double sunmodel_time_julian_cent(double jd) {
  return (jd - 2451545.0) / 36525.0;
}


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

x86 assembly (clang, -O2):
<sunmodel_time_julian_cent>:
addsd  0xef8(%rip),%xmm0
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @sunmodel_time_julian_cent(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double %3, 0x4142B42C80000000
%5 = fdiv double %4, 3.652500e+04
ret double %5
}

LLVM IR (-O2):
define double @sunmodel_time_julian_cent(double %0) {
%2 = fadd double %0, 0xC142B42C80000000
%3 = fdiv double %2, 3.652500e+04
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ a(int);
int main(void) { a(5); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
call   1030 <a@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @a(i32 5)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @a(i32 5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ close_ficxx_ficfunc();
void close_all_ficfunc() { close_ficxx_ficfunc(); }


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

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

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

LLVM IR (-O2):
define void @close_all_ficfunc() {
%1 = tail call i32 (...) @close_ficxx_ficfunc()
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ pci_read_cfgb(int, int, int);
uint32_t pci_read_config_byte(uint8_t bus, uint8_t dev_fn, uint8_t reg) {
  return pci_read_cfgb((0xb1 << 8) | 0x08, (bus << 8) | dev_fn, reg);
}


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

x86 assembly (clang, -O2):
<pci_read_config_byte>:
shl    $0x8,%edi
or     %edi,%esi
mov    $0xb108,%edi
jmp    1030 <pci_read_cfgb@plt>

LLVM IR (-O0):
define i32 @pci_read_config_byte(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = shl i32 %7, 8
%9 = load i32, i32* %5
%10 = or i32 %8, %9
%11 = load i32, i32* %6
%12 = call i32 @pci_read_cfgb(i32 45320, i32 %10, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @pci_read_config_byte(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %0, 8
%5 = or i32 %4, %1
%6 = tail call i32 @pci_read_cfgb(i32 45320, i32 %5, i32 %2)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ abc(int, int, int);
int main(int argc, char **argv) {
  abc(1, 2, 4);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x4,%edx
call   1030 <abc@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @abc(i32 1, i32 2, i32 4)
ret i32 0
}
void f4() { char *rindex(); }


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

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

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

LLVM IR (-O2):
define void @f4() {
ret void
}
/* Type definitions */
struct libalias {
  int dummy;
};

/* Variables and functions */
int LibAliasInLocked(struct libalias *, char *, int);
int /*<<< orphan*/ NOREF(struct libalias *);
int LibAliasIn(struct libalias *la, char *ptr, int maxpacketsize) {
  int res;
  NOREF((la));
  ;
  res = LibAliasInLocked(la, ptr, maxpacketsize);
  NOREF((la));
  return (res);
}


x86 assembly (clang, -O0):
<LibAliasIn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <NOREF@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <LibAliasInLocked@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <NOREF@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LibAliasIn>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
call   1040 <NOREF@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1030 <LibAliasInLocked@plt>
mov    %eax,%ebx
mov    %rbp,%rdi
call   1040 <NOREF@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.libalias = type { i32 }
define i32 @LibAliasIn(%struct.libalias* %0, i8* %1, i32 %2) {
%4 = alloca %struct.libalias*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store %struct.libalias* %0, %struct.libalias** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load %struct.libalias*, %struct.libalias** %4
%9 = call i32 @NOREF(%struct.libalias* %8)
%10 = load %struct.libalias*, %struct.libalias** %4
%11 = load i8*, i8** %5
%12 = load i32, i32* %6
%13 = call i32 @LibAliasInLocked(%struct.libalias* %10, i8* %11, i32 %12)
store i32 %13, i32* %7
%14 = load %struct.libalias*, %struct.libalias** %4
%15 = call i32 @NOREF(%struct.libalias* %14)
%16 = load i32, i32* %7
ret i32 %16
}

LLVM IR (-O2):
%struct.libalias = type { i32 }
define i32 @LibAliasIn(%struct.libalias* %0, i8* %1, i32 %2) {
%4 = tail call i32 @NOREF(%struct.libalias* %0)
%5 = tail call i32 @LibAliasInLocked(%struct.libalias* %0, i8* %1, i32 %2)
%6 = tail call i32 @NOREF(%struct.libalias* %0)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_usage(void) {
  fprintf(stderr, "Usage: fstest [options]\n"
                  "  Options:\n"
                  "  -r         Read test\n"
                  "  -w         Write test\n"
                  "  -d         Delete test\n"
                  "  -s <size>  Size in bytes. Can specify using k, M and G.\n"
                  "  -b <size>  Number of bytes to read/write per operation. "
                  "Can specify using k, M and G.\n"
                  "  -t <secs>  Duration in seconds. \n"
                  "  -f <name>  File name (including path)\n"
                  "  -v         Display version information\n"
                  "  -h         Display this text\n\n"
                  "For bug reporting and suggestions, mail peter@torpman.se\n");
}


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

x86 assembly (clang, -O2):
<print_usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [459 x i8] c"Usage: fstest [options]\0A Options:\0A -r Read test\0A -w Write test\0A -d Delete test\0A -s <size> Size in bytes. Can specify using k, M and G.\0A -b <size> Number of bytes to read/write per operation. Can specify using k, M and G.\0A -t <secs> Duration in seconds. \0A -f <name> File name (including path)\0A -v Display version information\0A -h Display this text\0A\0AFor bug reporting and suggestions, mail peter@torpman.se\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([459 x i8], [459 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [459 x i8] c"Usage: fstest [options]\0A Options:\0A -r Read test\0A -w Write test\0A -d Delete test\0A -s <size> Size in bytes. Can specify using k, M and G.\0A -b <size> Number of bytes to read/write per operation. Can specify using k, M and G.\0A -t <secs> Duration in seconds. \0A -f <name> File name (including path)\0A -v Display version information\0A -h Display this text\0A\0AFor bug reporting and suggestions, mail peter@torpman.se\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([459 x i8], [459 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int count = 0;
  int i;
  for (i = 1; i < 6; i++) {
    count += i;
  }
  printf("the sum of the numbers from 1 to 5 is %d", count);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x6,-0xc(%rbp)
jge    114e <main+0x3e>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <main+0x1d>
mov    -0x8(%rbp),%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [41 x i8] c"the sum of the numbers from 1 to 5 is %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 1, i32* %3
br label %4
4: ; preds = %11, %0
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 6
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = add nsw i32 %9, %8
store i32 %10, i32* %2
br label %11
11: ; preds = %7
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
br label %4
14: ; preds = %4
%15 = load i32, i32* %2
%16 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
@.str = [41 x i8] c"the sum of the numbers from 1 to 5 is %d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 15)
ret i32 0
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMR5C_set(void) { return U_WMRCORENONE_set("U_WMR5C"); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR5C\00"
define i8* @U_WMR5C_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
int tgetnum(char *name) {
  if (name[0] == 'l' && name[1] == 'i')
    return 25;
  if (name[0] == 'c' && name[1] == 'o')
    return 80;
  return -1;
}


x86 assembly (clang, -O0):
<tgetnum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x6c,%eax
jne    1135 <tgetnum+0x35>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x69,%eax
jne    1135 <tgetnum+0x35>
movl   $0x19,-0x4(%rbp)
jmp    1169 <tgetnum+0x69>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x63,%eax
jne    1162 <tgetnum+0x62>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x6f,%eax
jne    1162 <tgetnum+0x62>
movl   $0x50,-0x4(%rbp)
jmp    1169 <tgetnum+0x69>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tgetnum>:
mov    (%rdi),%al
cmp    $0x63,%al
je     1117 <tgetnum+0x17>
cmp    $0x6c,%al
jne    1122 <tgetnum+0x22>
mov    $0x19,%eax
cmpb   $0x69,0x1(%rdi)
jne    1122 <tgetnum+0x22>
jmp    1127 <tgetnum+0x27>
mov    $0x50,%eax
cmpb   $0x6f,0x1(%rdi)
je     1127 <tgetnum+0x27>
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @tgetnum(i8* nocapture %0) {
%2 = load i8, i8* %0
switch i8 %2, label %11 [
i8 108, label %3
i8 99, label %7
]
3: ; preds = %1
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 105
br i1 %6, label %12, label %11
7: ; preds = %1
%8 = getelementptr inbounds i8, i8* %0, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 111
br i1 %10, label %12, label %11
11: ; preds = %1, %3, %7
br label %12
12: ; preds = %7, %3, %11
%13 = phi i32 [ -1, %11 ], [ 25, %3 ], [ 80, %7 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ __local_send_IPI_allbutself(int);
int num_online_cpus();
void send_IPI_allbutself(int vector) {
  if (!(num_online_cpus() > 1))
    return;
  __local_send_IPI_allbutself(vector);
  return;
}


x86 assembly (clang, -O0):
<send_IPI_allbutself>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <num_online_cpus@plt>
cmp    $0x1,%eax
jg     1140 <send_IPI_allbutself+0x20>
jmp    1148 <send_IPI_allbutself+0x28>
mov    -0x4(%rbp),%edi
call   1040 <__local_send_IPI_allbutself@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_IPI_allbutself>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <num_online_cpus@plt>
cmp    $0x2,%eax
jl     1137 <send_IPI_allbutself+0x17>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <__local_send_IPI_allbutself@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @send_IPI_allbutself(i32 %0) {
%2 = tail call i32 (...) @num_online_cpus()
%3 = icmp sgt i32 %2, 1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @__local_send_IPI_allbutself(i32 %0)
br label %6
6: ; preds = %1, %4
ret void
}
void INT_Excep_PERIA_INTA251(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_PERIA_INTA251() {
ret void
}
/* Type definitions */
struct timeval {
  double tv_sec;
  double tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double time_now(void) {
  struct timeval now;
  gettimeofday(&now, NULL);
  return now.tv_sec + now.tv_usec / 1000000.0;
}


x86 assembly (clang, -O0):
<time_now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xec9(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_now>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movsd  0x10(%rsp),%xmm0
divsd  0xed2(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, double }
define double @time_now() {
%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 double, double* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%6 = load double, double* %5
%7 = fdiv double %6, 1.000000e+06
%8 = fadd double %4, %7
ret double %8
}

LLVM IR (-O2):
%struct.timeval = type { double, double }
define double @time_now() {
%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 double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load double, double* %6
%8 = fdiv double %7, 1.000000e+06
%9 = fadd double %5, %8
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ SIGSEGV;
int /*<<< orphan*/ do_exit(int /*<<< orphan*/);
int /*<<< orphan*/ printk(char *);
extern volatile void oom(void) {
  printk("out of memory\n\r");
  do_exit(SIGSEGV);
}


x86 assembly (clang, -O0):
<oom>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printk@plt>
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
call   1040 <do_exit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<oom>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printk@plt>
mov    0x2eb4(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <do_exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"out of memory\0A\0D\00"
@SIGSEGV = global i32 0
define void @oom() {
%1 = call i32 @printk(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @SIGSEGV
%3 = call i32 @do_exit(i32 %2)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"out of memory\0A\0D\00"
@SIGSEGV = global i32 0
define void @oom() {
%1 = tail call i32 @printk(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @SIGSEGV
%3 = tail call i32 @do_exit(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void show_cursor() { fprintf(stdout, "\33[?25h"); }


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

x86 assembly (clang, -O2):
<show_cursor>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [7 x i8] c"\1B[?25h\00"
define void @show_cursor() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [7 x i8] c"\1B[?25h\00"
define void @show_cursor() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
long long shft_ll(long long *, long long *);
long long intr_wrap_560(long long p1, long long p2) {
  return shft_ll(&p1, &p2);
}


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

x86 assembly (clang, -O2):
<intr_wrap_560>:
sub    $0x18,%rsp
mov    %rdi,0x10(%rsp)
mov    %rsi,0x8(%rsp)
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <shft_ll@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i64 @intr_wrap_560(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = call i64 @shft_ll(i64* %3, i64* %4)
ret i64 %5
}

LLVM IR (-O2):
define i64 @intr_wrap_560(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = call i64 @shft_ll(i64* %3, i64* %4)
ret i64 %5
}
/* Variables and functions */
char *OICStrcpyPartial(char *, size_t, char const *, size_t);
char *OICStrcpy(char *dest, size_t destSize, const char *source) {
  return OICStrcpyPartial(dest, destSize, source,
                          destSize == 0 ? 0 : destSize - 1);
}


x86 assembly (clang, -O0):
<OICStrcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1152 <OICStrcpy+0x42>
xor    %eax,%eax
mov    %rax,-0x38(%rbp)
jmp    115e <OICStrcpy+0x4e>
mov    -0x10(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x38(%rbp)
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rcx
call   1030 <OICStrcpyPartial@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OICStrcpy>:
xor    %ecx,%ecx
mov    %rsi,%rax
sub    $0x1,%rax
cmovae %rax,%rcx
jmp    1030 <OICStrcpyPartial@plt>

LLVM IR (-O0):
define i8* @OICStrcpy(i8* %0, i64 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = load i8*, i8** %6
%10 = load i64, i64* %5
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %3
br label %16
13: ; preds = %3
%14 = load i64, i64* %5
%15 = sub i64 %14, 1
br label %16
16: ; preds = %13, %12
%17 = phi i64 [ 0, %12 ], [ %15, %13 ]
%18 = call i8* @OICStrcpyPartial(i8* %7, i64 %8, i8* %9, i64 %17)
ret i8* %18
}

LLVM IR (-O2):
define i8* @OICStrcpy(i8* %0, i64 %1, i8* %2) {
%4 = icmp eq i64 %1, 0
%5 = add i64 %1, -1
%6 = select i1 %4, i64 0, i64 %5
%7 = tail call i8* @OICStrcpyPartial(i8* %0, i64 %1, i8* %2, i64 %6)
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ putln(char const *);
void print_banner(void) {
  static const char msg[] = "Buri Microcomputer System\n\r"
                            "Rich Wareham\n\r";
  putln(msg);
}


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

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

LLVM IR (-O0):
@print_banner.msg = internal constant [42 x i8] c"Buri Microcomputer System\0A\0DRich Wareham\0A\0D\00"
define void @print_banner() {
%1 = call i32 @putln(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @print_banner.msg, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@print_banner.msg = internal constant [42 x i8] c"Buri Microcomputer System\0A\0DRich Wareham\0A\0D\00"
define void @print_banner() {
%1 = tail call i32 @putln(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @print_banner.msg, i64 0, i64 0))
ret void
}
int smux_loopback_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @smux_loopback_init() {
ret i32 0
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *Malloc(size_t size) {
  void *tmp = malloc(size);
  if (tmp) {
    memset(tmp, 0, size);
  }
  return tmp;
}


x86 assembly (clang, -O0):
<Malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1153 <Malloc+0x33>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Malloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1141 <Malloc+0x21>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @Malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = load i64, i64* %2
%11 = call i32 @memset(i8* %9, i32 0, i64 %10)
br label %12
12: ; preds = %8, %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
define i8* @Malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
int test_imm_22int16_mem(short *val) {
  return ((*val) & (0x22 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_22int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 34
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
long mini_crt_init_io() { return 1; }


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

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

LLVM IR (-O0):
define i64 @mini_crt_init_io() {
ret i64 1
}

LLVM IR (-O2):
define i64 @mini_crt_init_io() {
ret i64 1
}
/* Variables and functions */
int /*<<< orphan*/ syslog(int, char *);
int MIME_base64_init(void) {
  syslog(1, "MIME_base64_init(): WARNING - This function is depricated. Please "
            "remove from your code");
  return 0;
}


x86 assembly (clang, -O0):
<MIME_base64_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rsi
call   1030 <syslog@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MIME_base64_init>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x1,%edi
call   1030 <syslog@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [88 x i8] c"MIME_base64_init(): WARNING - This function is depricated. Please remove from your code\00"
define i32 @MIME_base64_init() {
%1 = call i32 @syslog(i32 1, i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [88 x i8] c"MIME_base64_init(): WARNING - This function is depricated. Please remove from your code\00"
define i32 @MIME_base64_init() {
%1 = tail call i32 @syslog(i32 1, i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
double pow(double, double);
double gammafn(double x, double gamma) {
  if (x == 0.0)
    return 0.0;
  return pow(x, gamma);
}


x86 assembly (clang, -O0):
<gammafn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1147 <gammafn+0x37>
jp     1147 <gammafn+0x37>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    115b <gammafn+0x4b>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1030 <pow@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gammafn>:
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
jne    1121 <gammafn+0x11>
jp     1121 <gammafn+0x11>
xorpd  %xmm0,%xmm0
ret
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @gammafn(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = fcmp oeq double %6, 0.000000e+00
br i1 %7, label %8, label %9
8: ; preds = %2
store double 0.000000e+00, double* %3
br label %13
9: ; preds = %2
%10 = load double, double* %4
%11 = load double, double* %5
%12 = call double @pow(double %10, double %11)
store double %12, double* %3
br label %13
13: ; preds = %9, %8
%14 = load double, double* %3
ret double %14
}

LLVM IR (-O2):
define double @gammafn(double %0, double %1) {
%3 = fcmp oeq double %0, 0.000000e+00
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call double @pow(double %0, double %1)
br label %6
6: ; preds = %2, %4
%7 = phi double [ %5, %4 ], [ 0.000000e+00, %2 ]
ret double %7
}
/* Variables and functions */
int abs(int);
int main() { return !(abs(15) == 15); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xf,%edi
call   1030 <abs@plt>
cmp    $0xf,%eax
sete   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @abs(i32 15)
%3 = icmp eq i32 %2, 15
%4 = xor i1 %3, true
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void foo_2_1_1_2_2_2_1_1_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_1_1_2_2_2_1_1_1() {
ret void
}
unsigned long http_parser_version(void) {
  return 2 * 0x10000 | 7 * 0x00100 | 1 * 0x00001;
}


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

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

LLVM IR (-O0):
define i64 @http_parser_version() {
ret i64 132865
}

LLVM IR (-O2):
define i64 @http_parser_version() {
ret i64 132865
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printUsage(void) {
  printf("./whodunit [inputfile] [outputfile]\n");
  printf("[inputfile] - name of file to be converted\n");
  printf("[outputfile] - name of file to write to.\n");
  return;
}


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

x86 assembly (clang, -O2):
<printUsage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf00(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1f(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"./whodunit [inputfile] [outputfile]\0A\00"
@.str.1 = [44 x i8] c"[inputfile] - name of file to be converted\0A\00"
@.str.2 = [42 x i8] c"[outputfile] - name of file to write to.\0A\00"
define void @printUsage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [36 x i8] c"./whodunit [inputfile] [outputfile]\00"
@str.3 = [43 x i8] c"[inputfile] - name of file to be converted\00"
@str.4 = [41 x i8] c"[outputfile] - name of file to write to.\00"
define void @printUsage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int datetime_stamp_now();
void case_datetime_stamp_now() {
  assert(datetime_stamp_now() > 1447502650543);
  assert((long)datetime_stamp_now() == (long)datetime_stamp_now());
}


x86 assembly (clang, -O0):
<case_datetime_stamp_now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <datetime_stamp_now@plt>
cltq
movabs $0x15105e19caf,%rcx
cmp    %rcx,%rax
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x0,%al
call   1030 <datetime_stamp_now@plt>
cltq
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <datetime_stamp_now@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<case_datetime_stamp_now>:
push   %rbx
xor    %eax,%eax
call   1030 <datetime_stamp_now@plt>
xor    %edi,%edi
call   1040 <assert@plt>
xor    %eax,%eax
call   1030 <datetime_stamp_now@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <datetime_stamp_now@plt>
xor    %edi,%edi
cmp    %eax,%ebx
sete   %dil
pop    %rbx
jmp    1040 <assert@plt>

LLVM IR (-O0):
define void @case_datetime_stamp_now() {
%1 = call i32 (...) @datetime_stamp_now()
%2 = sext i32 %1 to i64
%3 = icmp sgt i64 %2, 1447502650543
%4 = zext i1 %3 to i32
%5 = call i32 @assert(i32 %4)
%6 = call i32 (...) @datetime_stamp_now()
%7 = sext i32 %6 to i64
%8 = call i32 (...) @datetime_stamp_now()
%9 = sext i32 %8 to i64
%10 = icmp eq i64 %7, %9
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
ret void
}

LLVM IR (-O2):
define void @case_datetime_stamp_now() {
%1 = tail call i32 (...) @datetime_stamp_now()
%2 = tail call i32 @assert(i32 0)
%3 = tail call i32 (...) @datetime_stamp_now()
%4 = tail call i32 (...) @datetime_stamp_now()
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
double pow(int, int);
double mass(double joules) {
  double retVal;
  if (joules < 0)
    die("Input cannot be negative.\n");
  retVal = joules / pow(299792458, 2);
  return retVal;
}


x86 assembly (clang, -O0):
<mass>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1147 <mass+0x27>
lea    0xebe(%rip),%rdi
call   1030 <die@plt>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    $0x11de784a,%edi
mov    $0x2,%esi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mass>:
push   %rax
xorpd  %xmm1,%xmm1
movsd  %xmm0,(%rsp)
ucomisd %xmm0,%xmm1
jbe    113c <mass+0x1c>
lea    0xec9(%rip),%rdi
call   1030 <die@plt>
mov    $0x11de784a,%edi
mov    $0x2,%esi
call   1040 <pow@plt>
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Input cannot be negative.\0A\00"
define double @mass(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @die(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
%9 = load double, double* %2
%10 = call double @pow(i32 299792458, i32 2)
%11 = fdiv double %9, %10
store double %11, double* %3
%12 = load double, double* %3
ret double %12
}

LLVM IR (-O2):
@.str = [27 x i8] c"Input cannot be negative.\0A\00"
define double @mass(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @die(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
%6 = tail call double @pow(i32 299792458, i32 2)
%7 = fdiv double %0, %6
ret double %7
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t rmsafe(int32_t addr) { return addr & 0x100 - 1; }


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

x86 assembly (clang, -O2):
<rmsafe>:
movzbl %dil,%eax
ret

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

LLVM IR (-O2):
define i32 @rmsafe(i32 %0) {
%2 = and i32 %0, 255
ret i32 %2
}
void op_code_normal_case0x6D(void) {}


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

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

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

LLVM IR (-O2):
define void @op_code_normal_case0x6D() {
ret void
}
void quat_copy(const float q[4], float qnew[4]) {
  qnew[0] = q[0];
  qnew[1] = q[1];
  qnew[2] = q[2];
  qnew[3] = q[3];
}


x86 assembly (clang, -O0):
<quat_copy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
movss  0xc(%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<quat_copy>:
movss  (%rdi),%xmm0
movss  %xmm0,(%rsi)
movss  0x4(%rdi),%xmm0
movss  %xmm0,0x4(%rsi)
movss  0x8(%rdi),%xmm0
movss  %xmm0,0x8(%rsi)
movss  0xc(%rdi),%xmm0
movss  %xmm0,0xc(%rsi)
ret

LLVM IR (-O0):
define void @quat_copy(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = load float*, float** %4
%9 = getelementptr inbounds float, float* %8, i64 0
store float %7, float* %9
%10 = load float*, float** %3
%11 = getelementptr inbounds float, float* %10, i64 1
%12 = load float, float* %11
%13 = load float*, float** %4
%14 = getelementptr inbounds float, float* %13, i64 1
store float %12, float* %14
%15 = load float*, float** %3
%16 = getelementptr inbounds float, float* %15, i64 2
%17 = load float, float* %16
%18 = load float*, float** %4
%19 = getelementptr inbounds float, float* %18, i64 2
store float %17, float* %19
%20 = load float*, float** %3
%21 = getelementptr inbounds float, float* %20, i64 3
%22 = load float, float* %21
%23 = load float*, float** %4
%24 = getelementptr inbounds float, float* %23, i64 3
store float %22, float* %24
ret void
}

LLVM IR (-O2):
define void @quat_copy(float* nocapture %0, float* nocapture writeonly %1) {
%3 = load float, float* %0
store float %3, float* %1
%4 = getelementptr inbounds float, float* %0, i64 1
%5 = load float, float* %4
%6 = getelementptr inbounds float, float* %1, i64 1
store float %5, float* %6
%7 = getelementptr inbounds float, float* %0, i64 2
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %1, i64 2
store float %8, float* %9
%10 = getelementptr inbounds float, float* %0, i64 3
%11 = load float, float* %10
%12 = getelementptr inbounds float, float* %1, i64 3
store float %11, float* %12
ret void
}
/* Variables and functions */
void *memdup_suffix0(void const *, size_t);
scalar_t__ size_multiply_overflow(size_t, size_t);
__attribute__((alloc_size(2, 3))) void *
memdup_suffix0_multiply(const void *p, size_t size, size_t need) {
  if (size_multiply_overflow(size, need))
    return NULL;
  return memdup_suffix0(p, size * need);
}


x86 assembly (clang, -O0):
<memdup_suffix0_multiply>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <size_multiply_overflow@plt>
cmp    $0x0,%rax
je     1158 <memdup_suffix0_multiply+0x38>
movq   $0x0,-0x8(%rbp)
jmp    116e <memdup_suffix0_multiply+0x4e>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
imul   -0x20(%rbp),%rsi
call   1040 <memdup_suffix0@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memdup_suffix0_multiply>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r15
mov    %rdi,%r14
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1030 <size_multiply_overflow@plt>
test   %rax,%rax
je     1146 <memdup_suffix0_multiply+0x26>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret
imul   %r15,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <memdup_suffix0@plt>

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

LLVM IR (-O2):
define i8* @memdup_suffix0_multiply(i8* %0, i64 %1, i64 %2) {
%4 = tail call i64 @size_multiply_overflow(i64 %1, i64 %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = mul i64 %2, %1
%8 = tail call i8* @memdup_suffix0(i8* %0, i64 %7)
br label %9
9: ; preds = %3, %6
%10 = phi i8* [ %8, %6 ], [ null, %3 ]
ret i8* %10
}
int audio_play_samples(struct audio_info_struct *ai, unsigned char *buf,
                       int len) {
  return len;
}


x86 assembly (clang, -O0):
<audio_play_samples>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<audio_play_samples>:
mov    %edx,%eax
ret

LLVM IR (-O0):
%struct.audio_info_struct = type opaque
define i32 @audio_play_samples(%struct.audio_info_struct* %0, i8* %1, i32 %2) {
%4 = alloca %struct.audio_info_struct*
%5 = alloca i8*
%6 = alloca i32
store %struct.audio_info_struct* %0, %struct.audio_info_struct** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
%struct.audio_info_struct = type opaque
define i32 @audio_play_samples(%struct.audio_info_struct* nocapture readnone %0, i8* nocapture readnone %1, i32 returned %2) {
ret i32 %2
}
int cm_init() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @cm_init() {
ret i32 1
}
/* Variables and functions */
void Reserved_Handler8(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<Reserved_Handler8>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <Reserved_Handler8+0x9>
jmp    1109 <Reserved_Handler8+0x9>

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

LLVM IR (-O0):
define void @Reserved_Handler8() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @Reserved_Handler8() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, int);
void vga_map_mask(int mask) {
  outb(0x02, 0x3c4);
  outb(mask, 0x3c5);
}


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

x86 assembly (clang, -O2):
<vga_map_mask>:
push   %rbx
mov    %edi,%ebx
mov    $0x2,%edi
mov    $0x3c4,%esi
call   1030 <outb@plt>
mov    %ebx,%edi
mov    $0x3c5,%esi
pop    %rbx
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @vga_map_mask(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @outb(i32 2, i32 964)
%4 = load i32, i32* %2
%5 = call i32 @outb(i32 %4, i32 965)
ret void
}

LLVM IR (-O2):
define void @vga_map_mask(i32 %0) {
%2 = tail call i32 @outb(i32 2, i32 964)
%3 = tail call i32 @outb(i32 %0, i32 965)
ret void
}
/* Type definitions */
struct comp {
  int dummy;
};
struct BrzArbiter_ {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SEND_REQDOWN(int);
void BrzArbiter_reqdown(struct comp *comp, int port) {
  struct BrzArbiter_ *c = (struct BrzArbiter_ *)comp;
  SEND_REQDOWN(port + 2);
}


x86 assembly (clang, -O0):
<BrzArbiter_reqdown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
add    $0x2,%edi
call   1030 <SEND_REQDOWN@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BrzArbiter_reqdown>:
lea    0x2(%rsi),%edi
jmp    1030 <SEND_REQDOWN@plt>

LLVM IR (-O0):
%struct.comp = type { i32 }
%struct.BrzArbiter_ = type { i32 }
define void @BrzArbiter_reqdown(%struct.comp* %0, i32 %1) {
%3 = alloca %struct.comp*
%4 = alloca i32
%5 = alloca %struct.BrzArbiter_*
store %struct.comp* %0, %struct.comp** %3
store i32 %1, i32* %4
%6 = load %struct.comp*, %struct.comp** %3
%7 = bitcast %struct.comp* %6 to %struct.BrzArbiter_*
store %struct.BrzArbiter_* %7, %struct.BrzArbiter_** %5
%8 = load i32, i32* %4
%9 = add nsw i32 %8, 2
%10 = call i32 @SEND_REQDOWN(i32 %9)
ret void
}

LLVM IR (-O2):
%struct.comp = type { i32 }
define void @BrzArbiter_reqdown(%struct.comp* nocapture readnone %0, i32 %1) {
%3 = add nsw i32 %1, 2
%4 = tail call i32 @SEND_REQDOWN(i32 %3)
ret void
}