xunge/DecIR huggingface dataset:
int main() {
  int a;
  a = 5;
  int b;
  b = a;
  return b;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 5
}
/* Variables and functions */
int /*<<< orphan*/ noly_hexdump(unsigned char *, int);
int bee_ext_message_handler(char *msg, int len) {
  noly_hexdump((unsigned char *)msg, len);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @bee_ext_message_handler(i8* %0, i32 %1) {
%3 = tail call i32 @noly_hexdump(i8* %0, i32 %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ __pmp_inline_atomic_xadd32(int /*<<< orphan*/ volatile *,
                                              int /*<<< orphan*/);
int32_t __pmp_atomic_xadd32(volatile int32_t *p, int32_t addend) {
  return __pmp_inline_atomic_xadd32(p, addend);
}


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

x86 assembly (clang, -O2):
<__pmp_atomic_xadd32>:
jmp    1030 <__pmp_inline_atomic_xadd32@plt>

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

LLVM IR (-O2):
define i32 @__pmp_atomic_xadd32(i32* %0, i32 %1) {
%3 = tail call i32 @__pmp_inline_atomic_xadd32(i32* %0, i32 %1)
ret i32 %3
}
double FixAngle(x)
double x;
{
  while (x > 6.28318530717958623)
    x -= 6.28318530717958623;
  return x;
}


x86 assembly (clang, -O0):
<FixAngle>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    113b <FixAngle+0x3b>
movsd  -0x8(%rbp),%xmm0
movsd  0xed3(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1109 <FixAngle+0x9>
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<FixAngle>:
ucomisd 0xef8(%rip),%xmm0
jbe    112a <FixAngle+0x2a>
movsd  0xef6(%rip),%xmm1
movsd  0xee6(%rip),%xmm2
nopw   0x0(%rax,%rax,1)
addsd  %xmm1,%xmm0
ucomisd %xmm2,%xmm0
ja     1120 <FixAngle+0x20>
ret

LLVM IR (-O0):
define double @FixAngle(double %0) {
%2 = alloca double
store double %0, double* %2
br label %3
3: ; preds = %6, %1
%4 = load double, double* %2
%5 = fcmp ogt double %4, 0x401921FB54442D18
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load double, double* %2
%8 = fsub double %7, 0x401921FB54442D18
store double %8, double* %2
br label %3
9: ; preds = %3
%10 = load double, double* %2
ret double %10
}

LLVM IR (-O2):
define double @FixAngle(double %0) {
%2 = fcmp ogt double %0, 0x401921FB54442D18
br i1 %2, label %3, label %7
3: ; preds = %1, %3
%4 = phi double [ %5, %3 ], [ %0, %1 ]
%5 = fadd double %4, 0xC01921FB54442D18
%6 = fcmp ogt double %5, 0x401921FB54442D18
br i1 %6, label %3, label %7
7: ; preds = %3, %1
%8 = phi double [ %0, %1 ], [ %5, %3 ]
ret double %8
}
/* Type definitions */
struct grid_db {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int get_epa_info(char *name, struct grid_db *db) {
  printf("Warning:  Can't read EPA mm4 files on this system\n");
  return 0;
}


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

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

LLVM IR (-O0):
%struct.grid_db = type { i32 }
@.str = [51 x i8] c"Warning: Can't read EPA mm4 files on this system\0A\00"
define i32 @get_epa_info(i8* %0, %struct.grid_db* %1) {
%3 = alloca i8*
%4 = alloca %struct.grid_db*
store i8* %0, i8** %3
store %struct.grid_db* %1, %struct.grid_db** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
%struct.grid_db = type { i32 }
@str = [50 x i8] c"Warning: Can't read EPA mm4 files on this system\00"
define i32 @get_epa_info(i8* nocapture readnone %0, %struct.grid_db* nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void cgiHeader() { printf("Content-type: text/html\n\n"); }


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"Content-type: text/html\0A\0A\00"
define void @cgiHeader() {
%1 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [25 x i8] c"Content-type: text/html\0A\00"
define void @cgiHeader() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret void
}
char ligne_de_indice(int i) { return i + '0' - 1; }


x86 assembly (clang, -O0):
<ligne_de_indice>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%eax
sub    $0x1,%eax
movsbl %al,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define signext i8 @ligne_de_indice(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = add i8 %2, 47
ret i8 %3
}
/* Variables and functions */
int sqrt(int);
int isprime(int prime) {
  int i, flag = 1;
  for (i = 2; i <= sqrt(prime); i++) {
    if (prime % i == 0) {
      flag = 0;
      return flag;
    }
  }
  return flag;
}


x86 assembly (clang, -O0):
<isprime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x1,-0x10(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <sqrt@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cmp    %ecx,%eax
jg     1179 <isprime+0x69>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1166 <isprime+0x56>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    117f <isprime+0x6f>
jmp    116b <isprime+0x5b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1129 <isprime+0x19>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprime>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1030 <sqrt@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0x2,%ecx
jl     1150 <isprime+0x40>
mov    $0x1,%ebp
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebp
mov    %ebx,%eax
cltd
idiv   %ebp
test   %edx,%edx
je     114e <isprime+0x3e>
mov    %ebx,%edi
call   1030 <sqrt@plt>
cmp    %eax,%ebp
jl     1130 <isprime+0x20>
mov    $0x1,%eax
jmp    1150 <isprime+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @isprime(i32 %0) {
%2 = tail call i32 @sqrt(i32 %0)
%3 = icmp slt i32 %2, 2
br i1 %3, label %12, label %8
4: ; preds = %8
%5 = add nuw nsw i32 %9, 1
%6 = tail call i32 @sqrt(i32 %0)
%7 = icmp slt i32 %9, %6
br i1 %7, label %8, label %12
8: ; preds = %1, %4
%9 = phi i32 [ %5, %4 ], [ 2, %1 ]
%10 = srem i32 %0, %9
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %8, %4, %1
%13 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %8 ]
ret i32 %13
}
/* Variables and functions */
void cc3_camera_set_power_state(bool state) {}


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

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

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

LLVM IR (-O2):
define void @cc3_camera_set_power_state(i32 %0) {
ret void
}
void p7_mpi_DoAbsolutelyNothing(void) { return; }


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

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

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

LLVM IR (-O2):
define void @p7_mpi_DoAbsolutelyNothing() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abms_system(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *, char *);
void abms_net_linkdown(char *devname) {
  char lcmd[255];
  sprintf(lcmd, "%s%s link set %s down", "/app/os/sys/bin/", "ip", devname);
  abms_system(lcmd);
  return;
}


x86 assembly (clang, -O0):
<abms_net_linkdown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%r8
lea    0xebf(%rip),%rsi
lea    0xece(%rip),%rdx
lea    0xed8(%rip),%rcx
call   1040 <sprintf@plt>
lea    -0x110(%rbp),%rdi
call   1030 <abms_system@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<abms_net_linkdown>:
push   %rbx
sub    $0x100,%rsp
mov    %rdi,%r8
lea    0xece(%rip),%rsi
lea    0xedd(%rip),%rdx
lea    0xee7(%rip),%rcx
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <abms_system@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"%s%s link set %s down\00"
@.str.1 = [17 x i8] c"/app/os/sys/bin/\00"
@.str.2 = [3 x i8] c"ip\00"
define void @abms_net_linkdown(i8* %0) {
%2 = alloca i8*
%3 = alloca [255 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%8 = call i32 @abms_system(i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"%s%s link set %s down\00"
@.str.1 = [17 x i8] c"/app/os/sys/bin/\00"
@.str.2 = [3 x i8] c"ip\00"
define void @abms_net_linkdown(i8* %0) {
%2 = alloca [255 x i8]
%3 = getelementptr inbounds [255 x i8], [255 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %0)
%5 = call i32 @abms_system(i8* %3)
ret void
}
long ndb_alloc_done(void) { return 0; }


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

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

LLVM IR (-O0):
define i64 @ndb_alloc_done() {
ret i64 0
}

LLVM IR (-O2):
define i64 @ndb_alloc_done() {
ret i64 0
}
int gcd(int x, int y) {
  int rem;
  while (y > 0) {
    rem = x % y;
    x = y;
    y = rem;
  }
  return x;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    112f <gcd+0x2f>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    110a <gcd+0xa>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %edi,%eax
test   %esi,%esi
jle    111d <gcd+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jg     1110 <gcd+0x10>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @gcd(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
br label %6
6: ; preds = %9, %2
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %6
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = srem i32 %10, %11
store i32 %12, i32* %5
%13 = load i32, i32* %4
store i32 %13, i32* %3
%14 = load i32, i32* %5
store i32 %14, i32* %4
br label %6
15: ; preds = %6
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %0, %2 ]
%6 = phi i32 [ %7, %4 ], [ %1, %2 ]
%7 = srem i32 %5, %6
%8 = icmp sgt i32 %7, 0
br i1 %8, label %4, label %9
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %6, %4 ]
ret i32 %10
}
/* Variables and functions */
int slk_attron(unsigned int);
int wrap_slk_attron(unsigned int attrs) { return slk_attron(attrs); }


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

x86 assembly (clang, -O2):
<wrap_slk_attron>:
jmp    1030 <slk_attron@plt>

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

LLVM IR (-O2):
define i32 @wrap_slk_attron(i32 %0) {
%2 = tail call i32 @slk_attron(i32 %0)
ret i32 %2
}
double business_sum(double in, double in2) { return in + in2; }


x86 assembly (clang, -O0):
<business_sum>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<business_sum>:
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @business_sum(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 = fadd double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @business_sum(double %0, double %1) {
%3 = fadd double %0, %1
ret double %3
}
double dadd(double a, double b) { return a + b; }


x86 assembly (clang, -O0):
<dadd>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dadd>:
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @dadd(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 = fadd double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @dadd(double %0, double %1) {
%3 = fadd double %0, %1
ret double %3
}
/* Variables and functions */
int read_data_cmd();
int /*<<< orphan*/ send_ctrl_cmd(int);
unsigned int lcm_compare_id(void) {
  unsigned int id = 0;
  send_ctrl_cmd(0x1180);
  id = read_data_cmd();
  send_ctrl_cmd(0x1080);
  id |= (read_data_cmd() << 8);
  return ((0x5582) == id) ? 1 : 0;
}


x86 assembly (clang, -O0):
<lcm_compare_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1180,%edi
call   1040 <send_ctrl_cmd@plt>
mov    $0x0,%al
call   1030 <read_data_cmd@plt>
mov    %eax,-0x4(%rbp)
mov    $0x1080,%edi
call   1040 <send_ctrl_cmd@plt>
mov    $0x0,%al
call   1030 <read_data_cmd@plt>
shl    $0x8,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x5582,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcm_compare_id>:
push   %rbx
mov    $0x1180,%edi
call   1040 <send_ctrl_cmd@plt>
xor    %eax,%eax
call   1030 <read_data_cmd@plt>
mov    %eax,%ebx
mov    $0x1080,%edi
call   1040 <send_ctrl_cmd@plt>
xor    %eax,%eax
call   1030 <read_data_cmd@plt>
shl    $0x8,%eax
or     %ebx,%eax
xor    %ecx,%ecx
cmp    $0x5582,%eax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @lcm_compare_id() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @send_ctrl_cmd(i32 4480)
%3 = call i32 (...) @read_data_cmd()
store i32 %3, i32* %1
%4 = call i32 @send_ctrl_cmd(i32 4224)
%5 = call i32 (...) @read_data_cmd()
%6 = shl i32 %5, 8
%7 = load i32, i32* %1
%8 = or i32 %7, %6
store i32 %8, i32* %1
%9 = load i32, i32* %1
%10 = icmp eq i32 21890, %9
%11 = zext i1 %10 to i64
%12 = select i1 %10, i32 1, i32 0
ret i32 %12
}

LLVM IR (-O2):
define i32 @lcm_compare_id() {
%1 = tail call i32 @send_ctrl_cmd(i32 4480)
%2 = tail call i32 (...) @read_data_cmd()
%3 = tail call i32 @send_ctrl_cmd(i32 4224)
%4 = tail call i32 (...) @read_data_cmd()
%5 = shl i32 %4, 8
%6 = or i32 %5, %2
%7 = icmp eq i32 %6, 21890
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int /*<<< orphan*/ _SC_CLK_TCK;
int sysconf(int /*<<< orphan*/);
uint64_t jiffies_to_usec(uint64_t jiffies) {
  return jiffies * (1000 / sysconf(_SC_CLK_TCK)) * 1000;
}


x86 assembly (clang, -O0):
<jiffies_to_usec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
mov    %eax,%ecx
mov    $0x3e8,%eax
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
imul   %ecx,%eax
imul   $0x3e8,%eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jiffies_to_usec>:
push   %rbx
mov    %edi,%ebx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
mov    %eax,%ecx
mov    $0x3e8,%eax
xor    %edx,%edx
idiv   %ecx
imul   %ebx,%eax
imul   $0x3e8,%eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@_SC_CLK_TCK = global i32 0
define i32 @jiffies_to_usec(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @_SC_CLK_TCK
%5 = call i32 @sysconf(i32 %4)
%6 = sdiv i32 1000, %5
%7 = mul nsw i32 %3, %6
%8 = mul nsw i32 %7, 1000
ret i32 %8
}

LLVM IR (-O2):
@_SC_CLK_TCK = global i32 0
define i32 @jiffies_to_usec(i32 %0) {
%2 = load i32, i32* @_SC_CLK_TCK
%3 = tail call i32 @sysconf(i32 %2)
%4 = sdiv i32 1000, %3
%5 = mul i32 %0, 1000
%6 = mul i32 %5, %4
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ cstring_free(void *);
void __free_fn__(void *privdata, void *val) {
  ((void)privdata);
  cstring_free(val);
}


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

x86 assembly (clang, -O2):
<__free_fn__>:
mov    %rsi,%rdi
jmp    1030 <cstring_free@plt>

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

LLVM IR (-O2):
define void @__free_fn__(i8* nocapture readnone %0, i8* %1) {
%3 = tail call i32 @cstring_free(i8* %1)
ret void
}
unsigned int m3dIsPOW2(unsigned int iValue) {
  unsigned int nPow2 = 1;
  while (iValue > nPow2)
    nPow2 = (nPow2 << 1);
  return nPow2;
}


x86 assembly (clang, -O0):
<m3dIsPOW2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jbe    1128 <m3dIsPOW2+0x28>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <m3dIsPOW2+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<m3dIsPOW2>:
mov    $0x1,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ecx,%eax
lea    (%rax,%rax,1),%ecx
cmp    %edi,%eax
jb     1110 <m3dIsPOW2+0x10>
ret

LLVM IR (-O0):
define i32 @m3dIsPOW2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
br label %4
4: ; preds = %8, %1
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = icmp ugt i32 %5, %6
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = load i32, i32* %3
%10 = shl i32 %9, 1
store i32 %10, i32* %3
br label %4
11: ; preds = %4
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @m3dIsPOW2(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 1, %1 ], [ %5, %2 ]
%4 = icmp ult i32 %3, %0
%5 = shl i32 %3, 1
br i1 %4, label %2, label %6
6: ; preds = %2
ret i32 %3
}
char f2(char *x) {
  *x = 'a';
  return *x;
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x61,(%rax)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
movb   $0x61,(%rdi)
mov    $0x61,%al
ret

LLVM IR (-O0):
define signext i8 @f2(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
store i8 97, i8* %3
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
ret i8 %5
}

LLVM IR (-O2):
define signext i8 @f2(i8* nocapture writeonly %0) {
store i8 97, i8* %0
ret i8 97
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, short, float);
void newdef(char a, short b, float c) {
  printf("char =%c,short=%d,float=%f\n", a, b, c);
}


x86 assembly (clang, -O0):
<newdef>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
mov    -0x1(%rbp),%cl
mov    -0x4(%rbp),%ax
movss  -0x8(%rbp),%xmm0
lea    0xec3(%rip),%rdi
movsbl %cl,%esi
movswl %ax,%edx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<newdef>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"char =%c,short=%d,float=%f\0A\00"
define void @newdef(i8 signext %0, i16 signext %1, float %2) {
%4 = alloca i8
%5 = alloca i16
%6 = alloca float
store i8 %0, i8* %4
store i16 %1, i16* %5
store float %2, float* %6
%7 = load i8, i8* %4
%8 = load i16, i16* %5
%9 = load float, float* %6
%10 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8 signext %7, i16 signext %8, float %9)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"char =%c,short=%d,float=%f\0A\00"
define void @newdef(i8 signext %0, i16 signext %1, float %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8 signext %0, i16 signext %1, float %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ keccak_squeezeblocks(unsigned char *, unsigned long long,
                                        int /*<<< orphan*/ *, int);
void shake128_squeezeblocks(unsigned char *output, unsigned long long nblocks,
                            uint64_t *s) {
  keccak_squeezeblocks(output, nblocks, s, 168);
}


x86 assembly (clang, -O0):
<shake128_squeezeblocks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0xa8,%ecx
call   1030 <keccak_squeezeblocks@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shake128_squeezeblocks>:
mov    $0xa8,%ecx
jmp    1030 <keccak_squeezeblocks@plt>

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

LLVM IR (-O2):
define void @shake128_squeezeblocks(i8* %0, i64 %1, i32* %2) {
%4 = tail call i32 @keccak_squeezeblocks(i8* %0, i64 %1, i32* %2, i32 168)
ret void
}
void AR30ToAB30Row_C() {}


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

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

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

LLVM IR (-O2):
define void @AR30ToAB30Row_C() {
ret void
}
float returnanfloat() {}


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

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

LLVM IR (-O0):
define float @returnanfloat() {
%1 = alloca float
%2 = load float, float* %1
ret float %2
}

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

/* Variables and functions */
void pack_int32(uint8_t *buf, uint32_t x) {
  *buf++ = x >> 24;
  *buf++ = x >> 16;
  *buf++ = x >> 8;
  *buf++ = x;
}


x86 assembly (clang, -O0):
<pack_int32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x18,%ecx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x8(%rbp)
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x10,%ecx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x8(%rbp)
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x8(%rbp)
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x8(%rbp)
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<pack_int32>:
mov    %esi,%eax
sar    $0x18,%eax
mov    %eax,(%rdi)
mov    %esi,%eax
sar    $0x10,%eax
mov    %eax,0x4(%rdi)
mov    %esi,%eax
sar    $0x8,%eax
mov    %eax,0x8(%rdi)
mov    %esi,0xc(%rdi)
ret

LLVM IR (-O0):
define void @pack_int32(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 24
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i32 1
store i32* %8, i32** %3
store i32 %6, i32* %7
%9 = load i32, i32* %4
%10 = ashr i32 %9, 16
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i32 1
store i32* %12, i32** %3
store i32 %10, i32* %11
%13 = load i32, i32* %4
%14 = ashr i32 %13, 8
%15 = load i32*, i32** %3
%16 = getelementptr inbounds i32, i32* %15, i32 1
store i32* %16, i32** %3
store i32 %14, i32* %15
%17 = load i32, i32* %4
%18 = load i32*, i32** %3
%19 = getelementptr inbounds i32, i32* %18, i32 1
store i32* %19, i32** %3
store i32 %17, i32* %18
ret void
}

LLVM IR (-O2):
define void @pack_int32(i32* nocapture writeonly %0, i32 %1) {
%3 = ashr i32 %1, 24
%4 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %3, i32* %0
%5 = ashr i32 %1, 16
%6 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %5, i32* %4
%7 = ashr i32 %1, 8
%8 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %7, i32* %6
store i32 %1, i32* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __delay_cycles(int);
void delay_us(int us) {
  while (us--) {
    __delay_cycles(12);
  }
}


x86 assembly (clang, -O0):
<delay_us>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     113e <delay_us+0x2e>
mov    $0xc,%edi
call   1030 <__delay_cycles@plt>
jmp    111b <delay_us+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay_us>:
push   %rbx
test   %edi,%edi
je     112f <delay_us+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0xc,%edi
call   1030 <__delay_cycles@plt>
add    $0xffffffff,%ebx
jne    1120 <delay_us+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @delay_us(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load i32, i32* %2
%5 = add nsw i32 %4, -1
store i32 %5, i32* %2
%6 = icmp ne i32 %4, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = call i32 @__delay_cycles(i32 12)
br label %3
9: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @delay_us(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add nsw i32 %4, -1
%6 = tail call i32 @__delay_cycles(i32 12)
%7 = icmp eq i32 %5, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ srand48(long);
__attribute__((__weak__, __always___)) void
softboundmpx_srand48(long int seed) {
  srand48(seed);
}


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

x86 assembly (clang, -O2):
<softboundmpx_srand48>:
jmp    1030 <srand48@plt>

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

LLVM IR (-O2):
define weak void @softboundmpx_srand48(i64 %0) {
%2 = tail call i32 @srand48(i64 %0)
ret void
}
int f() {
  int x = 3;
  {
    extern int x;
    return x;
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movl   $0x3,-0x4(%rbp)
mov    0x2ece(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@x = external global i32
define i32 @f() {
%1 = alloca i32
store i32 3, i32* %1
%2 = load i32, i32* @x
ret i32 %2
}

LLVM IR (-O2):
@x = external global i32
define i32 @f() {
%1 = load i32, i32* @x
ret i32 %1
}
/* Type definitions */
struct sockaddr_in {
  int dummy;
};
struct rudp {
  int dummy;
};

/* Variables and functions */
int rudpReceiveTimeOut(struct rudp *, void *, int, struct sockaddr_in *,
                       int /*<<< orphan*/);
int rudpReceiveFrom(struct rudp *ru, void *messageBuf, int bufSize,
                    struct sockaddr_in *retFrom) {
  return rudpReceiveTimeOut(ru, messageBuf, bufSize, retFrom, 0);
}


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

x86 assembly (clang, -O2):
<rudpReceiveFrom>:
xor    %r8d,%r8d
jmp    1030 <rudpReceiveTimeOut@plt>

LLVM IR (-O0):
%struct.rudp = type { i32 }
%struct.sockaddr_in = type { i32 }
define i32 @rudpReceiveFrom(%struct.rudp* %0, i8* %1, i32 %2, %struct.sockaddr_in* %3) {
%5 = alloca %struct.rudp*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca %struct.sockaddr_in*
store %struct.rudp* %0, %struct.rudp** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store %struct.sockaddr_in* %3, %struct.sockaddr_in** %8
%9 = load %struct.rudp*, %struct.rudp** %5
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = load %struct.sockaddr_in*, %struct.sockaddr_in** %8
%13 = call i32 @rudpReceiveTimeOut(%struct.rudp* %9, i8* %10, i32 %11, %struct.sockaddr_in* %12, i32 0)
ret i32 %13
}

LLVM IR (-O2):
%struct.rudp = type { i32 }
%struct.sockaddr_in = type { i32 }
define i32 @rudpReceiveFrom(%struct.rudp* %0, i8* %1, i32 %2, %struct.sockaddr_in* %3) {
%5 = tail call i32 @rudpReceiveTimeOut(%struct.rudp* %0, i8* %1, i32 %2, %struct.sockaddr_in* %3, i32 0)
ret i32 %5
}
/* Variables and functions */
bool nrf52_errata_27(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_27() {
ret i32 0
}
void willus_mem_init(void) {}


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

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

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

LLVM IR (-O2):
define void @willus_mem_init() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
struct timeval {
  int dummy;
};
struct ip {
  int dummy;
};
struct in_addr {
  int dummy;
};

/* Variables and functions */
long long outbound(struct timeval, struct in_addr, struct in_addr,
                   int /*<<< orphan*/, int /*<<< orphan*/, struct ip const *);
long long client_inbound(struct timeval tv, struct in_addr laddr,
                         struct in_addr raddr, uint16_t lport, uint16_t rport,
                         const struct ip *ip) {
  return outbound(tv, laddr, raddr, lport, rport, ip);
}


x86 assembly (clang, -O0):
<client_inbound>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0x10(%rbp)
mov    %edx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
mov    -0x28(%rbp),%r9
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <outbound@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<client_inbound>:
jmp    1030 <outbound@plt>

LLVM IR (-O0):
%struct.ip = type { i32 }
%struct.timeval = type { i32 }
%struct.in_addr = type { i32 }
define i64 @client_inbound(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, %struct.ip* %5) {
%7 = alloca %struct.timeval
%8 = alloca %struct.in_addr
%9 = alloca %struct.in_addr
%10 = alloca i32
%11 = alloca i32
%12 = alloca %struct.ip*
%13 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i32 0, i32 0
store i32 %0, i32* %13
%14 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %8, i32 0, i32 0
store i32 %1, i32* %14
%15 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %9, i32 0, i32 0
store i32 %2, i32* %15
store i32 %3, i32* %10
store i32 %4, i32* %11
store %struct.ip* %5, %struct.ip** %12
%16 = load i32, i32* %10
%17 = load i32, i32* %11
%18 = load %struct.ip*, %struct.ip** %12
%19 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i32 0, i32 0
%20 = load i32, i32* %19
%21 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %8, i32 0, i32 0
%22 = load i32, i32* %21
%23 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %9, i32 0, i32 0
%24 = load i32, i32* %23
%25 = call i64 @outbound(i32 %20, i32 %22, i32 %24, i32 %16, i32 %17, %struct.ip* %18)
ret i64 %25
}

LLVM IR (-O2):
%struct.ip = type { i32 }
define i64 @client_inbound(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, %struct.ip* %5) {
%7 = tail call i64 @outbound(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, %struct.ip* %5)
ret i64 %7
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ send_event;
};
typedef TYPE_1__ XConfigureRequestEvent;

/* Variables and functions */
int get_XConfigureRequestEvent_send_event(void *_p) {
  return (int)((XConfigureRequestEvent *)_p)->send_event;
}


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

x86 assembly (clang, -O2):
<get_XConfigureRequestEvent_send_event>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XConfigureRequestEvent_send_event(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XConfigureRequestEvent_send_event(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
int main() {
  static int data;
  data = 0x5A;
  return (data);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x5a,0x2f0f(%rip)
mov    0x2f09(%rip),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@main.data = internal global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
store i32 90, i32* @main.data
%2 = load i32, i32* @main.data
ret i32 %2
}

LLVM IR (-O2):
define i32 @main() {
ret i32 90
}
/* Variables and functions */
int /*<<< orphan*/ fn1(char *);
int main() {
  fn1("");
  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 <fn1@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @fn1(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @main() {
%1 = tail call i32 @fn1(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void Store_String(rep, pos, str) int *rep;
int pos;
int *str;
{
  int ss, Base_Seqstr_tok;
  valIth_flags(&Base_Seqstr_tok, 26);
  valIth_seqstr(&ss, Base_Seqstr_tok, pos);
  mod_string(rep, ss, (int *)str);
}


x86 assembly (clang, -O0):
<Store_String>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x1a,%esi
mov    $0x0,%al
call   1050 <valIth_flags@plt>
mov    -0x20(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    -0x1c(%rbp),%rdi
mov    $0x0,%al
call   1030 <valIth_seqstr@plt>
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    $0x0,%al
call   1040 <mod_string@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Store_String>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0x8(%rsp),%rdi
mov    $0x1a,%esi
xor    %eax,%eax
call   1050 <valIth_flags@plt>
mov    0x8(%rsp),%esi
lea    0xc(%rsp),%rdi
mov    %ebp,%edx
xor    %eax,%eax
call   1030 <valIth_seqstr@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <mod_string@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @Store_String(i32* %0, i32 %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%9 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @valIth_flags to i32 (i32*, i32, ...)*)(i32* %8, i32 26)
%10 = load i32, i32* %8
%11 = load i32, i32* %5
%12 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @valIth_seqstr to i32 (i32*, i32, i32, ...)*)(i32* %7, i32 %10, i32 %11)
%13 = load i32*, i32** %4
%14 = load i32, i32* %7
%15 = load i32*, i32** %6
%16 = call i32 (i32*, i32, i32*, ...) bitcast (i32 (...)* @mod_string to i32 (i32*, i32, i32*, ...)*)(i32* %13, i32 %14, i32* %15)
ret void
}

LLVM IR (-O2):
define void @Store_String(i32* %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %4 to i8*
%7 = bitcast i32* %5 to i8*
%8 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @valIth_flags to i32 (i32*, i32, ...)*)(i32* %5, i32 26)
%9 = load i32, i32* %5
%10 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @valIth_seqstr to i32 (i32*, i32, i32, ...)*)(i32* %4, i32 %9, i32 %1)
%11 = load i32, i32* %4
%12 = call i32 (i32*, i32, i32*, ...) bitcast (i32 (...)* @mod_string to i32 (i32*, i32, i32*, ...)*)(i32* %0, i32 %11, i32* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char const *);
void fatal(const char *message) {
  printf("%s\n", message);
  fflush(NULL);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <fflush@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<fatal>:
push   %rax
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <fflush@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@EXIT_FAILURE = global i32 0
define void @fatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @fflush(i32* null)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@EXIT_FAILURE = global i32 0
define void @fatal(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @fflush(i32* null)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
void rubysdl_init_TTF(void) {}


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

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

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

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

/* Variables and functions */
int pthread_mutex_lock(int /*<<< orphan*/ *);
int Thread_lock_mutex(pthread_mutex_t *mutex) {
  int rc = -1;
  if ((rc = pthread_mutex_lock(mutex)) == 0)
    rc = 0;
  return rc;
}


x86 assembly (clang, -O0):
<Thread_lock_mutex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pthread_mutex_lock@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jne    113f <Thread_lock_mutex+0x2f>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Thread_lock_mutex>:
jmp    1030 <pthread_mutex_lock@plt>

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

LLVM IR (-O2):
define i32 @Thread_lock_mutex(i32* %0) {
%2 = tail call i32 @pthread_mutex_lock(i32* %0)
ret i32 %2
}
extern double oosmos_AnalogMapAccurate(double Value, double InMin, double InMax,
                                       double OutMin, double OutMax) {
  return (Value - InMin) * (OutMax - OutMin) / (InMax - InMin) + OutMin;
}


x86 assembly (clang, -O0):
<oosmos_AnalogMapAccurate>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
subsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
addsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<oosmos_AnalogMapAccurate>:
subsd  %xmm1,%xmm0
subsd  %xmm3,%xmm4
mulsd  %xmm4,%xmm0
subsd  %xmm1,%xmm2
divsd  %xmm2,%xmm0
addsd  %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @oosmos_AnalogMapAccurate(double %0, double %1, double %2, double %3, double %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
%11 = load double, double* %6
%12 = load double, double* %7
%13 = fsub double %11, %12
%14 = load double, double* %10
%15 = load double, double* %9
%16 = fsub double %14, %15
%17 = fmul double %13, %16
%18 = load double, double* %8
%19 = load double, double* %7
%20 = fsub double %18, %19
%21 = fdiv double %17, %20
%22 = load double, double* %9
%23 = fadd double %21, %22
ret double %23
}

LLVM IR (-O2):
define double @oosmos_AnalogMapAccurate(double %0, double %1, double %2, double %3, double %4) {
%6 = fsub double %0, %1
%7 = fsub double %4, %3
%8 = fmul double %6, %7
%9 = fsub double %2, %1
%10 = fdiv double %8, %9
%11 = fadd double %10, %3
ret double %11
}
int test_imm_5Bint16_reg(short val) {
  return ((val) & (-0x5B << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_5Bint16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -91
%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_5Bint16_reg(i16 signext %0) {
%2 = and i16 %0, -91
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double, char const *, char const *);
void hv_printHook(double timestamp, const char *name, const char *s,
                  void *userData) {
  printf("[@h %.3fms] %s: %s\n", timestamp, name, s);
}


x86 assembly (clang, -O0):
<hv_printHook>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [20 x i8] c"[@h %.3fms] %s: %s\0A\00"
define void @hv_printHook(double %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca double
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store double %0, double* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load double, double* %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), double %9, i8* %10, i8* %11)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"[@h %.3fms] %s: %s\0A\00"
define void @hv_printHook(double %0, i8* %1, i8* %2, i8* nocapture readnone %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), double %0, i8* %1, i8* %2)
ret void
}