xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ F_OK;
int access(char *, int /*<<< orphan*/);
int /*<<< orphan*/ assert(int);
void testAccess() {
  int res = access("/data/data/edu.ptu.java.myapplication/lib/libnative-lib.so",
                   F_OK);
  assert(res == 0);
}


x86 assembly (clang, -O0):
<testAccess>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
lea    0xec8(%rip),%rdi
call   1040 <access@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testAccess>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1040 <access@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
@.str = [59 x i8] c"/data/data/edu.ptu.java.myapplication/lib/libnative-lib.so\00"
@F_OK = global i32 0
define void @testAccess() {
%1 = alloca i32
%2 = load i32, i32* @F_OK
%3 = call i32 @access(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i32 %2)
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [59 x i8] c"/data/data/edu.ptu.java.myapplication/lib/libnative-lib.so\00"
@F_OK = global i32 0
define void @testAccess() {
%1 = load i32, i32* @F_OK
%2 = tail call i32 @access(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
ret void
}
int baudrate() { return (19200); }


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

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

LLVM IR (-O0):
define i32 @baudrate() {
ret i32 19200
}

LLVM IR (-O2):
define i32 @baudrate() {
ret i32 19200
}
void RTSha256Update(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSha256Update() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ inside_f3();
int usleep(int);
void *f3(void *arg) {
  int rc;
  rc = usleep(100);
  assert(rc == 0);
  inside_f3();
  return NULL;
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x64,%edi
call   1050 <usleep@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x0,%al
call   1040 <inside_f3@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
push   %rax
mov    $0x64,%edi
call   1050 <usleep@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
call   1040 <inside_f3@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @f3(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = call i32 @usleep(i32 100)
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = call i32 (...) @inside_f3()
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @f3(i8* nocapture readnone %0) {
%2 = tail call i32 @usleep(i32 100)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 (...) @inside_f3()
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ distance_sq(double *, double *);
double sqrt(int /*<<< orphan*/);
double distance(double *p1, double *p2) { return sqrt(distance_sq(p1, p2)); }


x86 assembly (clang, -O0):
<distance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <distance_sq@plt>
mov    %eax,%edi
call   1040 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<distance>:
push   %rax
call   1030 <distance_sq@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
define double @distance(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 = call i32 @distance_sq(double* %5, double* %6)
%8 = call double @sqrt(i32 %7)
ret double %8
}

LLVM IR (-O2):
define double @distance(double* %0, double* %1) {
%3 = tail call i32 @distance_sq(double* %0, double* %1)
%4 = tail call double @sqrt(i32 %3)
ret double %4
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int tm_mday;
  scalar_t__ tm_mon;
  scalar_t__ tm_hour;
  scalar_t__ tm_min;
  scalar_t__ tm_sec;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ mktime(struct tm *);
time_t getCurrentLocalYearForTs(time_t ts) {
  struct tm *t = localtime(&ts);
  t->tm_sec = 0;
  t->tm_min = 0;
  t->tm_hour = 0;
  t->tm_mday = 1;
  t->tm_mon = 0;
  return mktime(t);
}


x86 assembly (clang, -O0):
<getCurrentLocalYearForTs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movq   $0x0,0x20(%rax)
mov    -0x10(%rbp),%rax
movq   $0x0,0x18(%rax)
mov    -0x10(%rbp),%rax
movq   $0x0,0x10(%rax)
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x10(%rbp),%rax
movq   $0x0,0x8(%rax)
mov    -0x10(%rbp),%rdi
call   1040 <mktime@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCurrentLocalYearForTs>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <localtime@plt>
xorps  %xmm0,%xmm0
movups %xmm0,0x10(%rax)
movq   $0x0,0x20(%rax)
movl   $0x1,(%rax)
movq   $0x0,0x8(%rax)
mov    %rax,%rdi
call   1040 <mktime@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.tm = type { i32, i64, i64, i64, i64 }
define i32 @getCurrentLocalYearForTs(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.tm*
store i32 %0, i32* %2
%4 = call %struct.tm* @localtime(i32* %2)
store %struct.tm* %4, %struct.tm** %3
%5 = load %struct.tm*, %struct.tm** %3
%6 = getelementptr inbounds %struct.tm, %struct.tm* %5, i32 0, i32 4
store i64 0, i64* %6
%7 = load %struct.tm*, %struct.tm** %3
%8 = getelementptr inbounds %struct.tm, %struct.tm* %7, i32 0, i32 3
store i64 0, i64* %8
%9 = load %struct.tm*, %struct.tm** %3
%10 = getelementptr inbounds %struct.tm, %struct.tm* %9, i32 0, i32 2
store i64 0, i64* %10
%11 = load %struct.tm*, %struct.tm** %3
%12 = getelementptr inbounds %struct.tm, %struct.tm* %11, i32 0, i32 0
store i32 1, i32* %12
%13 = load %struct.tm*, %struct.tm** %3
%14 = getelementptr inbounds %struct.tm, %struct.tm* %13, i32 0, i32 1
store i64 0, i64* %14
%15 = load %struct.tm*, %struct.tm** %3
%16 = call i32 @mktime(%struct.tm* %15)
ret i32 %16
}

LLVM IR (-O2):
%struct.tm = type { i32, i64, i64, i64, i64 }
define i32 @getCurrentLocalYearForTs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call %struct.tm* @localtime(i32* %2)
%4 = getelementptr inbounds %struct.tm, %struct.tm* %3, i64 0, i32 2
%5 = getelementptr inbounds %struct.tm, %struct.tm* %3, i64 0, i32 0
%6 = bitcast i64* %4 to i8*
store i32 1, i32* %5
%7 = getelementptr inbounds %struct.tm, %struct.tm* %3, i64 0, i32 1
store i64 0, i64* %7
%8 = call i32 @mktime(%struct.tm* %3)
ret i32 %8
}
const char *get_pdir_asm(const char *dir) {
  asm volatile("movq %%rcx, %%rdx\n"
               "movb $2, %%al\n"
               "len_loop:\n"
               "cmpb $0, (%%rcx)\n"
               "je main_loop\n"
               "incq %%rcx\n"
               "jmp len_loop\n"
               "main_loop:\n"
               "decq %%rcx\n"
               "cmpq %%rdx, %%rcx\n"
               "jl insufficient\n"
               "cmpb $47, (%%rcx)\n"
               "jne main_loop\n"
               "decb %%al\n"
               "jz success\n"
               "jmp main_loop\n"
               "insufficient:\n"
               "xorq %%rcx, %%rcx\n"
               "success:\n"
               : "=c"(dir)
               : "c"(dir)
               : "%rdx", "%al");
  return dir;
}


x86 assembly (clang, -O0):
<get_pdir_asm>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
mov    $0x2,%al

x86 assembly (clang, -O2):
<get_pdir_asm>:
mov    %rdi,%rcx
mov    %rcx,%rdx
mov    $0x2,%al

LLVM IR (-O0):
define i8* @get_pdir_asm(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* asm sideeffect "movq %rcx, %rdx\0Amovb $$2, %al\0Alen_loop:\0Acmpb $$0, (%rcx)\0Aje main_loop\0Aincq %rcx\0Ajmp len_loop\0Amain_loop:\0Adecq %rcx\0Acmpq %rdx, %rcx\0Ajl insufficient\0Acmpb $$47, (%rcx)\0Ajne main_loop\0Adecb %al\0Ajz success\0Ajmp main_loop\0Ainsufficient:\0Axorq %rcx, %rcx\0Asuccess:\0A", "={cx},{cx},~{rdx},~{al},~{dirflag},~{fpsr},~{flags}"(i8* %3)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
define i8* @get_pdir_asm(i8* %0) {
%2 = tail call i8* asm sideeffect "movq %rcx, %rdx\0Amovb $$2, %al\0Alen_loop:\0Acmpb $$0, (%rcx)\0Aje main_loop\0Aincq %rcx\0Ajmp len_loop\0Amain_loop:\0Adecq %rcx\0Acmpq %rdx, %rcx\0Ajl insufficient\0Acmpb $$47, (%rcx)\0Ajne main_loop\0Adecb %al\0Ajz success\0Ajmp main_loop\0Ainsufficient:\0Axorq %rcx, %rcx\0Asuccess:\0A", "={cx},{cx},~{rdx},~{al},~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ cblByteOrderSwap64(int /*<<< orphan*/);
uint64_t cblByteOrderSwap64BigToHost(uint64_t swap) {
  return cblByteOrderSwap64(swap);
}


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

x86 assembly (clang, -O2):
<cblByteOrderSwap64BigToHost>:
jmp    1030 <cblByteOrderSwap64@plt>

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

LLVM IR (-O2):
define i32 @cblByteOrderSwap64BigToHost(i32 %0) {
%2 = tail call i32 @cblByteOrderSwap64(i32 %0)
ret i32 %2
}
int f() {
  int n = 0;
foo:
  n++;
  if (n < 10) {
    goto foo;
  } else {
  }
  return n;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    1123 <f+0x23>
jmp    110b <f+0xb>
jmp    1128 <f+0x28>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @f() {
ret i32 10
}
short test_52_2(short *mem) { return __atomic_or_fetch(mem + 0, 1, 4); }


x86 assembly (clang, -O0):
<test_52_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movw   $0x1,-0xa(%rbp)
mov    -0xa(%rbp),%cx
mov    %cx,-0x10(%rbp)
mov    (%rax),%ax
mov    %ax,-0xe(%rbp)
mov    -0xe(%rbp),%ax
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%dx
mov    %dx,%si
mov    %ax,%dx
mov    %edx,-0x24(%rbp)
or     %esi,%edx
mov    %edx,-0x20(%rbp)
lock cmpxchg %dx,(%rcx)
sete   %cl
mov    %ax,-0x1a(%rbp)
test   $0x1,%cl
mov    %ax,-0xe(%rbp)
jne    115d <test_52_2+0x5d>
jmp    1125 <test_52_2+0x25>
mov    -0x10(%rbp),%cx
mov    -0x1a(%rbp),%ax
or     %cx,%ax
mov    %ax,-0xc(%rbp)
movswl -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_52_2>:
movzwl (%rdi),%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%ecx
or     $0x1,%ecx
lock cmpxchg %cx,(%rdi)
jne    1110 <test_52_2+0x10>
or     $0x1,%eax
ret

LLVM IR (-O0):
define signext i16 @test_52_2(i16* %0) {
%2 = alloca i16*
%3 = alloca i16
%4 = alloca i16
store i16* %0, i16** %2
%5 = load i16*, i16** %2
%6 = getelementptr inbounds i16, i16* %5, i64 0
store i16 1, i16* %3
%7 = load i16, i16* %3
%8 = atomicrmw or i16* %6, i16 %7 acq_rel
%9 = or i16 %8, %7
store i16 %9, i16* %4
%10 = load i16, i16* %4
ret i16 %10
}

LLVM IR (-O2):
define signext i16 @test_52_2(i16* nocapture %0) {
%2 = atomicrmw or i16* %0, i16 1 acq_rel
%3 = or i16 %2, 1
ret i16 %3
}
int test_bit(int nr, const void *_addr) {
  const char *addr = _addr;
  return (((addr))[(nr) / 8] >> ((nr) % 8)) & 1;
}


x86 assembly (clang, -O0):
<test_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    -0x1c(%rbp),%eax
mov    %edx,%ecx
sar    %cl,%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_bit>:
mov    %edi,%ecx
lea    0x7(%rcx),%eax
test   %edi,%edi
cmovns %edi,%eax
sar    $0x3,%eax
cltq
movsbl (%rsi,%rax,1),%eax
and    $0x7,%cl
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @test_bit(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
store i8* %6, i8** %5
%7 = load i8*, i8** %5
%8 = load i32, i32* %3
%9 = sdiv i32 %8, 8
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %7, i64 %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = load i32, i32* %3
%15 = srem i32 %14, 8
%16 = ashr i32 %13, %15
%17 = and i32 %16, 1
ret i32 %17
}

LLVM IR (-O2):
define i32 @test_bit(i32 %0, i8* nocapture %1) {
%3 = sdiv i32 %0, 8
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %1, i64 %4
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = and i32 %0, 7
%9 = lshr i32 %7, %8
%10 = and i32 %9, 1
ret i32 %10
}
void kolibri_download_error(struct gui_download_window *dw,
                            const char *error_msg) {}


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

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

LLVM IR (-O0):
%struct.gui_download_window = type opaque
define void @kolibri_download_error(%struct.gui_download_window* %0, i8* %1) {
%3 = alloca %struct.gui_download_window*
%4 = alloca i8*
store %struct.gui_download_window* %0, %struct.gui_download_window** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
%struct.gui_download_window = type opaque
define void @kolibri_download_error(%struct.gui_download_window* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
void _xalloc_error(void) {
  write(1, "ERROR: can't allocate memory (xalloc)\n",
        strlen("ERROR: can't allocate memory (xalloc)\n"));
  exit(1);
}


x86 assembly (clang, -O0):
<_xalloc_error>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1040 <strlen@plt>
mov    %eax,%edx
mov    $0x1,%edi
lea    0xeb2(%rip),%rsi
call   1030 <write@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<_xalloc_error>:
push   %rbx
lea    0xec8(%rip),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"ERROR: can't allocate memory (xalloc)\0A\00"
define void @_xalloc_error() {
%1 = call i32 @strlen(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @write(i32 1, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [39 x i8] c"ERROR: can't allocate memory (xalloc)\0A\00"
define void @_xalloc_error() {
%1 = tail call i32 @strlen(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
scalar_t__ stm_cmd(int);
void stm_unk(void) {
  if (stm_cmd(0x12) == 0)
    error("UNK command rejected");
}


x86 assembly (clang, -O0):
<stm_unk>:
push   %rbp
mov    %rsp,%rbp
mov    $0x12,%edi
call   1030 <stm_cmd@plt>
cmp    $0x0,%rax
jne    1144 <stm_unk+0x24>
lea    0xec1(%rip),%rdi
call   1040 <error@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<stm_unk>:
push   %rax
mov    $0x12,%edi
call   1030 <stm_cmd@plt>
test   %rax,%rax
je     1132 <stm_unk+0x12>
pop    %rax
ret
lea    0xec7(%rip),%rdi
pop    %rax
jmp    1040 <error@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"UNK command rejected\00"
define void @stm_unk() {
%1 = call i64 @stm_cmd(i32 18)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @error(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"UNK command rejected\00"
define void @stm_unk() {
%1 = tail call i64 @stm_cmd(i32 18)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @error(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret void
}
int is_in_bound(int *arr, int size, int *elem) {
  if (elem >= arr && elem < arr + size) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_in_bound>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jb     1145 <is_in_bound+0x45>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%rdx
shl    $0x2,%rdx
add    %rdx,%rcx
cmp    %rcx,%rax
jae    1145 <is_in_bound+0x45>
movl   $0x1,-0x4(%rbp)
jmp    114c <is_in_bound+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_in_bound>:
cmp    %rdi,%rdx
setae  %al
movslq %esi,%rcx
lea    (%rdi,%rcx,4),%rcx
cmp    %rdx,%rcx
seta   %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_in_bound(i32* %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32*
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32* %2, i32** %7
%8 = load i32*, i32** %7
%9 = load i32*, i32** %5
%10 = icmp uge i32* %8, %9
br i1 %10, label %11, label %19
11: ; preds = %3
%12 = load i32*, i32** %7
%13 = load i32*, i32** %5
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = icmp ult i32* %12, %16
br i1 %17, label %18, label %19
18: ; preds = %11
store i32 1, i32* %4
br label %20
19: ; preds = %11, %3
store i32 0, i32* %4
br label %20
20: ; preds = %19, %18
%21 = load i32, i32* %4
ret i32 %21
}

LLVM IR (-O2):
define i32 @is_in_bound(i32* readnone %0, i32 %1, i32* readnone %2) {
%4 = icmp uge i32* %2, %0
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = icmp ugt i32* %6, %2
%8 = select i1 %4, i1 %7, i1 false
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isascii(int);
void t_isascii_0x52() {
  Assert_real((isascii(82)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isascii.c",
              415, ("isascii should be 1 for R"));
}


x86 assembly (clang, -O0):
<t_isascii_0x52>:
push   %rbp
mov    %rsp,%rbp
mov    $0x52,%edi
call   1030 <isascii@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x19f,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isascii_0x52>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0x19f,%edx
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for R\00"
define void @t_isascii_0x52() {
%1 = call i32 @isascii(i32 82)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 415, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for R\00"
define void @t_isascii_0x52() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 415, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ emit_andimm(int, int, int);
int /*<<< orphan*/ emit_orrmi_imm(int, int, int);
int /*<<< orphan*/ emit_rotl(int);
int /*<<< orphan*/ emit_test(int, int);
void emit_rotlsr(int t, int sr) {
  emit_andimm(sr, ~1, sr);
  emit_test(t, t);
  emit_rotl(t);
  emit_orrmi_imm(sr, 1, sr);
}


x86 assembly (clang, -O0):
<emit_rotlsr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    $0xfffffffe,%esi
call   1040 <emit_andimm@plt>
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1050 <emit_test@plt>
mov    -0x4(%rbp),%edi
call   1060 <emit_rotl@plt>
mov    -0x8(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    $0x1,%esi
call   1030 <emit_orrmi_imm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_rotlsr>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %esi,%edi
mov    $0xfffffffe,%esi
mov    %ebx,%edx
call   1040 <emit_andimm@plt>
mov    %ebp,%edi
mov    %ebp,%esi
call   1050 <emit_test@plt>
mov    %ebp,%edi
call   1060 <emit_rotl@plt>
mov    %ebx,%edi
mov    $0x1,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <emit_orrmi_imm@plt>

LLVM IR (-O0):
define void @emit_rotlsr(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 = load i32, i32* %4
%7 = call i32 @emit_andimm(i32 %5, i32 -2, i32 %6)
%8 = load i32, i32* %3
%9 = load i32, i32* %3
%10 = call i32 @emit_test(i32 %8, i32 %9)
%11 = load i32, i32* %3
%12 = call i32 @emit_rotl(i32 %11)
%13 = load i32, i32* %4
%14 = load i32, i32* %4
%15 = call i32 @emit_orrmi_imm(i32 %13, i32 1, i32 %14)
ret void
}

LLVM IR (-O2):
define void @emit_rotlsr(i32 %0, i32 %1) {
%3 = tail call i32 @emit_andimm(i32 %1, i32 -2, i32 %1)
%4 = tail call i32 @emit_test(i32 %0, i32 %0)
%5 = tail call i32 @emit_rotl(i32 %0)
%6 = tail call i32 @emit_orrmi_imm(i32 %1, i32 1, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ entropy();
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ initialize();
int random();
int choose_delay() {
  initialize();
  pid_t pid = getpid();
  int i;
  entropy();
  return random() % 100;
}


x86 assembly (clang, -O0):
<choose_delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <initialize@plt>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1050 <entropy@plt>
mov    $0x0,%al
call   1060 <random@plt>
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<choose_delay>:
push   %rax
xor    %eax,%eax
call   1040 <initialize@plt>
xor    %eax,%eax
call   1030 <getpid@plt>
xor    %eax,%eax
call   1050 <entropy@plt>
xor    %eax,%eax
call   1060 <random@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @choose_delay() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @initialize()
%4 = call i32 (...) @getpid()
store i32 %4, i32* %1
%5 = call i32 (...) @entropy()
%6 = call i32 (...) @random()
%7 = srem i32 %6, 100
ret i32 %7
}

LLVM IR (-O2):
define i32 @choose_delay() {
%1 = tail call i32 (...) @initialize()
%2 = tail call i32 (...) @getpid()
%3 = tail call i32 (...) @entropy()
%4 = tail call i32 (...) @random()
%5 = srem i32 %4, 100
ret i32 %5
}
float pmin(float a, float b) {
  if (a < b) {
    return a;
  } else {
    return b;
  }
}


x86 assembly (clang, -O0):
<pmin>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1130 <pmin+0x30>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    113a <pmin+0x3a>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmin>:
minss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @pmin(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %4
%7 = load float, float* %5
%8 = fcmp olt float %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load float, float* %4
store float %10, float* %3
br label %13
11: ; preds = %2
%12 = load float, float* %5
store float %12, float* %3
br label %13
13: ; preds = %11, %9
%14 = load float, float* %3
ret float %14
}

LLVM IR (-O2):
define float @pmin(float %0, float %1) {
%3 = fcmp olt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
int main_1(void *framep) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @main_1(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void *check_for_updates(void *arg) {
  while (1) {
    sleep(1);
  }
}


x86 assembly (clang, -O0):
<check_for_updates>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
call   1030 <sleep@plt>
jmp    111c <check_for_updates+0xc>

x86 assembly (clang, -O2):
<check_for_updates>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1030 <sleep@plt>
jmp    1120 <check_for_updates+0x10>

LLVM IR (-O0):
define i8* @check_for_updates(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1, %3
%4 = call i32 @sleep(i32 1)
br label %3
}

LLVM IR (-O2):
define noalias i8* @check_for_updates(i8* nocapture readnone %0) {
br label %2
2: ; preds = %1, %2
%3 = tail call i32 @sleep(i32 1)
br label %2
}
/* Variables and functions */
void *calloc(int, size_t);
int /*<<< orphan*/ die(char *, int, char *);
void *safecalloc(size_t size) {
  void *block = NULL;
  if ((block = calloc(1, size)) == NULL) {
    die("error: calloc fail on line %d in %s", 24,
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/michalmalik/pvm/refs/heads/testing/node.c");
  }
  return block;
}


x86 assembly (clang, -O0):
<safecalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1168 <safecalloc+0x48>
lea    0xea9(%rip),%rdi
mov    $0x18,%esi
lea    0xec1(%rip),%rdx
call   1040 <die@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safecalloc>:
push   %rbx
mov    %rdi,%rsi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114e <safecalloc+0x2e>
lea    0xec3(%rip),%rdi
lea    0xee0(%rip),%rdx
mov    $0x18,%esi
call   1040 <die@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"error: calloc fail on line %d in %s\00"
@.str.1 = [132 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/michalmalik/pvm/refs/heads/testing/node.c\00"
define i8* @safecalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
store i8* null, i8** %3
%4 = load i64, i64* %2
%5 = call i8* @calloc(i32 1, i64 %4)
store i8* %5, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @die(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 24, i8* getelementptr inbounds ([132 x i8], [132 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
@.str = [36 x i8] c"error: calloc fail on line %d in %s\00"
@.str.1 = [132 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/michalmalik/pvm/refs/heads/testing/node.c\00"
define i8* @safecalloc(i64 %0) {
%2 = tail call i8* @calloc(i32 1, i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @die(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 24, i8* getelementptr inbounds ([132 x i8], [132 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
double M_PI;
double deg(double rad) { return rad * 180.0 / M_PI; }


x86 assembly (clang, -O0):
<deg>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
mov    0x2ecb(%rip),%rax
divsd  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<deg>:
mulsd  0xef8(%rip),%xmm0
mov    0x2ed9(%rip),%rax
divsd  (%rax),%xmm0
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @deg(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 1.800000e+02
%5 = load double, double* @M_PI
%6 = fdiv double %4, %5
ret double %6
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @deg(double %0) {
%2 = fmul double %0, 1.800000e+02
%3 = load double, double* @M_PI
%4 = fdiv double %2, %3
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ cpc_key_press(int);
int /*<<< orphan*/ cpc_key_unpress(int);
void Joy_Cursor_Left(int value) {
  if (value) {
    cpc_key_press(0x10);
  } else {
    cpc_key_unpress(0x10);
  };
}


x86 assembly (clang, -O0):
<Joy_Cursor_Left>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1144 <Joy_Cursor_Left+0x24>
mov    $0x10,%edi
call   1030 <cpc_key_press@plt>
jmp    114e <Joy_Cursor_Left+0x2e>
mov    $0x10,%edi
call   1040 <cpc_key_unpress@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Joy_Cursor_Left>:
test   %edi,%edi
je     112e <Joy_Cursor_Left+0xe>
mov    $0x10,%edi
jmp    1030 <cpc_key_press@plt>
mov    $0x10,%edi
jmp    1040 <cpc_key_unpress@plt>

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

LLVM IR (-O2):
define void @Joy_Cursor_Left(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @cpc_key_press(i32 16)
br label %7
5: ; preds = %1
%6 = tail call i32 @cpc_key_unpress(i32 16)
br label %7
7: ; preds = %5, %3
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int colormap_size;
};
typedef TYPE_1__ XVisualInfo;

/* Variables and functions */
void set_XVisualInfo_colormap_size(void *_p, int _v) {
  ((XVisualInfo *)_p)->colormap_size = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XVisualInfo_colormap_size>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XVisualInfo_colormap_size(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
float fabs(float);
float fasterlog2(float);
float fasterpow2(float);
float fasterpow(float x, float p) {
  if (x < 0)
    return -fasterpow2(p * fasterlog2(fabs(x)));
  return fasterpow2(p * fasterlog2(x));
}


x86 assembly (clang, -O0):
<fasterpow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1190 <fasterpow+0x60>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
call   1050 <fabs@plt>
call   1030 <fasterlog2@plt>
movaps %xmm0,%xmm1
movss  -0x10(%rbp),%xmm0
mulss  %xmm1,%xmm0
call   1040 <fasterpow2@plt>
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    11ba <fasterpow+0x8a>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <fasterlog2@plt>
movaps %xmm0,%xmm1
movss  -0x14(%rbp),%xmm0
mulss  %xmm1,%xmm0
call   1040 <fasterpow2@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fasterpow>:
push   %rax
movss  %xmm1,0x4(%rsp)
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
jbe    114f <fasterpow+0x2f>
andps  0xeca(%rip),%xmm0
call   1030 <fasterlog2@plt>
mulss  0x4(%rsp),%xmm0
call   1040 <fasterpow2@plt>
xorps  0xec3(%rip),%xmm0
pop    %rax
ret
call   1030 <fasterlog2@plt>
mulss  0x4(%rsp),%xmm0
pop    %rax
jmp    1040 <fasterpow2@plt>

LLVM IR (-O0):
define float @fasterpow(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %4
%7 = fcmp olt float %6, 0.000000e+00
br i1 %7, label %8, label %16
8: ; preds = %2
%9 = load float, float* %5
%10 = load float, float* %4
%11 = call float @fabs(float %10)
%12 = call float @fasterlog2(float %11)
%13 = fmul float %9, %12
%14 = call float @fasterpow2(float %13)
%15 = fneg float %14
store float %15, float* %3
br label %22
16: ; preds = %2
%17 = load float, float* %5
%18 = load float, float* %4
%19 = call float @fasterlog2(float %18)
%20 = fmul float %17, %19
%21 = call float @fasterpow2(float %20)
store float %21, float* %3
br label %22
22: ; preds = %16, %8
%23 = load float, float* %3
ret float %23
}

LLVM IR (-O2):
define float @fasterpow(float %0, float %1) {
%3 = fcmp olt float %0, 0.000000e+00
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = tail call float @llvm.fabs.f32(float %0)
%6 = tail call float @fasterlog2(float %5)
%7 = fmul float %6, %1
%8 = tail call float @fasterpow2(float %7)
%9 = fneg float %8
br label %14
10: ; preds = %2
%11 = tail call float @fasterlog2(float %0)
%12 = fmul float %11, %1
%13 = tail call float @fasterpow2(float %12)
br label %14
14: ; preds = %10, %4
%15 = phi float [ %9, %4 ], [ %13, %10 ]
ret float %15
}
char toLow(char c) {
  char low = c + 32;
  return low;
}


x86 assembly (clang, -O0):
<toLow>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x20,%eax
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define signext i8 @toLow(i8 signext %0) {
%2 = add i8 %0, 32
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ wiResponseEnd();
int /*<<< orphan*/ wiResponseStart(int);
void wiSendAck(void) {
  wiResponseStart(((1)));
  wiResponseEnd();
}


x86 assembly (clang, -O0):
<wiSendAck>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <wiResponseStart@plt>
mov    $0x0,%al
call   1040 <wiResponseEnd@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wiSendAck>:
push   %rax
mov    $0x1,%edi
call   1030 <wiResponseStart@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <wiResponseEnd@plt>

LLVM IR (-O0):
define void @wiSendAck() {
%1 = call i32 @wiResponseStart(i32 1)
%2 = call i32 (...) @wiResponseEnd()
ret void
}

LLVM IR (-O2):
define void @wiSendAck() {
%1 = tail call i32 @wiResponseStart(i32 1)
%2 = tail call i32 (...) @wiResponseEnd()
ret void
}
void set_page_data(int potval, unsigned char *buf) {
  unsigned int word, *wordp;
  wordp = (unsigned int *)buf;
  word = potval;
  wordp[0] = word;
}


x86 assembly (clang, -O0):
<set_page_data>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_page_data>:
mov    %edi,(%rsi)
ret

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

LLVM IR (-O2):
define void @set_page_data(i32 %0, i8* nocapture writeonly %1) {
%3 = bitcast i8* %1 to i32*
store i32 %0, i32* %3
ret void
}
/* Type definitions */
struct perf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ perf_continue(struct perf *);
int /*<<< orphan*/ perf_init(struct perf *);
void perf_start(struct perf *p) {
  perf_init(p);
  perf_continue(p);
}


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

x86 assembly (clang, -O2):
<perf_start>:
push   %rbx
mov    %rdi,%rbx
call   1030 <perf_init@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <perf_continue@plt>

LLVM IR (-O0):
%struct.perf = type { i32 }
define void @perf_start(%struct.perf* %0) {
%2 = alloca %struct.perf*
store %struct.perf* %0, %struct.perf** %2
%3 = load %struct.perf*, %struct.perf** %2
%4 = call i32 @perf_init(%struct.perf* %3)
%5 = load %struct.perf*, %struct.perf** %2
%6 = call i32 @perf_continue(%struct.perf* %5)
ret void
}

LLVM IR (-O2):
%struct.perf = type { i32 }
define void @perf_start(%struct.perf* %0) {
%2 = tail call i32 @perf_init(%struct.perf* %0)
%3 = tail call i32 @perf_continue(%struct.perf* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fail();
int write(int, char *, int);
void term(int sock) {
  int status;
  status = write(sock, "\n", 1);
  if (status < 0)
    fail();
}


x86 assembly (clang, -O0):
<term>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xecb(%rip),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1153 <term+0x33>
mov    $0x0,%al
call   1040 <fail@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<term>:
push   %rax
lea    0xed8(%rip),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
test   %eax,%eax
js     1138 <term+0x18>
pop    %rax
ret
xor    %eax,%eax
pop    %rcx
jmp    1040 <fail@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @term(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @write(i32 %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @fail()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @term(i32 %0) {
%2 = tail call i32 @write(i32 %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @fail()
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ orbita_err(char *);
double _orbita_potential_miyamoto_disk_rho(const void *par, const double *pos) {
  orbita_err("Not implemented");
  return 0. / 0.;
}


x86 assembly (clang, -O0):
<_orbita_potential_miyamoto_disk_rho>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xee1(%rip),%rdi
call   1030 <orbita_err@plt>
movsd  0xecc(%rip),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_orbita_potential_miyamoto_disk_rho>:
push   %rax
lea    0xef0(%rip),%rdi
call   1030 <orbita_err@plt>
movsd  0xedb(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Not implemented\00"
define double @_orbita_potential_miyamoto_disk_rho(i8* %0, double* %1) {
%3 = alloca i8*
%4 = alloca double*
store i8* %0, i8** %3
store double* %1, double** %4
%5 = call i32 @orbita_err(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret double 0x7FF8000000000000
}

LLVM IR (-O2):
@.str = [16 x i8] c"Not implemented\00"
define double @_orbita_potential_miyamoto_disk_rho(i8* nocapture readnone %0, double* nocapture readnone %1) {
%3 = tail call i32 @orbita_err(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret double 0x7FF8000000000000
}
void run_program_unload(void) {}


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

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

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

LLVM IR (-O2):
define void @run_program_unload() {
ret void
}
signed short a_ss(signed short a, signed char *b, int *c) {
  signed short d = a + *b;
  *c = d == 0;
  return d;
}


x86 assembly (clang, -O0):
<a_ss>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movswl -0x2(%rbp),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %ax,-0x1a(%rbp)
movswl -0x1a(%rbp),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movswl -0x1a(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_ss>:
movsbl (%rsi),%eax
xor    %ecx,%ecx
add    %di,%ax
sete   %cl
mov    %ecx,(%rdx)
ret

LLVM IR (-O0):
define signext i16 @a_ss(i16 signext %0, i8* %1, i32* %2) {
%4 = alloca i16
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i16
store i16 %0, i16* %4
store i8* %1, i8** %5
store i32* %2, i32** %6
%8 = load i16, i16* %4
%9 = sext i16 %8 to i32
%10 = load i8*, i8** %5
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = add nsw i32 %9, %12
%14 = trunc i32 %13 to i16
store i16 %14, i16* %7
%15 = load i16, i16* %7
%16 = sext i16 %15 to i32
%17 = icmp eq i32 %16, 0
%18 = zext i1 %17 to i32
%19 = load i32*, i32** %6
store i32 %18, i32* %19
%20 = load i16, i16* %7
ret i16 %20
}

LLVM IR (-O2):
define signext i16 @a_ss(i16 signext %0, i8* nocapture %1, i32* nocapture writeonly %2) {
%4 = load i8, i8* %1
%5 = sext i8 %4 to i16
%6 = add i16 %5, %0
%7 = icmp eq i16 %6, 0
%8 = zext i1 %7 to i32
store i32 %8, i32* %2
ret i16 %6
}
/* Variables and functions */
int /*<<< orphan*/ ran_start(unsigned long);
void ran_init(long seed) { ran_start((unsigned long)seed % ((1L << 30) - 2)); }


x86 assembly (clang, -O0):
<ran_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x3ffffffe,%ecx
xor    %edx,%edx
div    %rcx
mov    %rdx,%rdi
call   1030 <ran_start@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ran_init>:
mov    %rdi,%rax
shr    %rax
movabs $0x8000000400000021,%rcx
mul    %rcx
shr    $0x1c,%rdx
mov    %rdx,%rax
shl    $0x1e,%rax
mov    %rdx,%rcx
sub    %rax,%rcx
add    %rdx,%rcx
add    %rcx,%rdi
jmp    1030 <ran_start@plt>

LLVM IR (-O0):
define void @ran_init(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = urem i64 %3, 1073741822
%5 = call i32 @ran_start(i64 %4)
ret void
}

LLVM IR (-O2):
define void @ran_init(i64 %0) {
%2 = urem i64 %0, 1073741822
%3 = tail call i32 @ran_start(i64 %2)
ret void
}
/* Variables and functions */
int S_ISREG(unsigned int);
int s_ifreg(unsigned int m) { return S_ISREG(m); }


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

x86 assembly (clang, -O2):
<s_ifreg>:
jmp    1030 <S_ISREG@plt>

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

LLVM IR (-O2):
define i32 @s_ifreg(i32 %0) {
%2 = tail call i32 @S_ISREG(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char);
int serialRead(int, unsigned char *);
int serialReadPrint(int fd, unsigned char *_byte) {
  int size = serialRead(fd, _byte);
  printf("read from port: 0x%02hx\n", _byte[0]);
  return size;
}


x86 assembly (clang, -O0):
<serialReadPrint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <serialRead@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
lea    0xeb7(%rip),%rdi
movzbl (%rax),%esi
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serialReadPrint>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1030 <serialRead@plt>
mov    %eax,%ebp
movzbl (%rbx),%esi
lea    0xec9(%rip),%rdi
call   1040 <printf@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [25 x i8] c"read from port: 0x%02hx\0A\00"
define i32 @serialReadPrint(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* %3
%7 = load i8*, i8** %4
%8 = call i32 @serialRead(i32 %6, i8* %7)
store i32 %8, i32* %5
%9 = load i8*, i8** %4
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = load i8, i8* %10
%12 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8 zeroext %11)
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
@.str = [25 x i8] c"read from port: 0x%02hx\0A\00"
define i32 @serialReadPrint(i32 %0, i8* %1) {
%3 = tail call i32 @serialRead(i32 %0, i8* %1)
%4 = load i8, i8* %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8 zeroext %4)
ret i32 %3
}