xunge/DecIR huggingface dataset:
/* Variables and functions */
int fibonnaci_iterative(int);
int fibonnaci_recursive(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", fibonnaci_iterative(10));
  printf("%d\n", fibonnaci_recursive(10));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
call   1040 <fibonnaci_iterative@plt>
mov    %eax,%esi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
mov    $0xa,%edi
call   1050 <fibonnaci_recursive@plt>
mov    %eax,%esi
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xa,%edi
call   1040 <fibonnaci_iterative@plt>
lea    0xebe(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0xa,%edi
call   1050 <fibonnaci_recursive@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @fibonnaci_iterative(i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @fibonnaci_recursive(i32 10)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printSpaces(int num) {
  for (int i = 0; i < num; ++i) {
    printf(" ");
  }
}


x86 assembly (clang, -O0):
<printSpaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1148 <printSpaces+0x38>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <printSpaces+0x12>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @printSpaces(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %4, label %3
3: ; preds = %4, %1
ret void
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = tail call i32 @putchar(i32 32)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %0
br i1 %8, label %3, label %4
}
/* Variables and functions */
bool nrf51_errata_19(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf51_errata_19() {
ret i32 0
}
void restore_links_stackF(void) {
  void **ANext, *A;
  return;
}


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

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

LLVM IR (-O0):
define void @restore_links_stackF() {
%1 = alloca i8**
%2 = alloca i8*
ret void
}

LLVM IR (-O2):
define void @restore_links_stackF() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free_block(void *);
scalar_t__ is_large_allocation(void *);
int /*<<< orphan*/ lfree(void *);
void wffree(void *ptr) {
  if (is_large_allocation(ptr)) {
    lfree(ptr);
  } else {
    free_block(ptr);
  }
}


x86 assembly (clang, -O0):
<wffree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <is_large_allocation@plt>
cmp    $0x0,%rax
je     115d <wffree+0x2d>
mov    -0x8(%rbp),%rdi
call   1030 <lfree@plt>
jmp    1166 <wffree+0x36>
mov    -0x8(%rbp),%rdi
call   1050 <free_block@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wffree>:
push   %rbx
mov    %rdi,%rbx
call   1040 <is_large_allocation@plt>
mov    %rbx,%rdi
test   %rax,%rax
je     1147 <wffree+0x17>
pop    %rbx
jmp    1030 <lfree@plt>
pop    %rbx
jmp    1050 <free_block@plt>

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

LLVM IR (-O2):
define void @wffree(i8* %0) {
%2 = tail call i64 @is_large_allocation(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @lfree(i8* %0)
br label %8
6: ; preds = %1
%7 = tail call i32 @free_block(i8* %0)
br label %8
8: ; preds = %6, %4
ret void
}
/* Type definitions */
struct iovec {
  int /*<<< orphan*/ member_0;
};
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int process_vm_writev(int /*<<< orphan*/, struct iovec *, unsigned long,
                      struct iovec *, unsigned long, unsigned long);
int main(void) {
  pid_t pid = 0;
  struct iovec local_iov = {0};
  struct iovec remote_iov = {0};
  unsigned long liovcnt = 1;
  unsigned long riovcnt = 1;
  unsigned long flags = 0;
  return process_vm_writev(pid, &local_iov, liovcnt, &remote_iov, riovcnt,
                           flags);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
movq   $0x1,-0x20(%rbp)
movq   $0x1,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rcx
call   1040 <process_vm_writev@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movl   $0x0,0x10(%rsp)
movl   $0x0,0x8(%rsp)
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rcx
mov    $0x1,%edx
mov    $0x1,%r8d
xor    %edi,%edi
xor    %r9d,%r9d
call   1030 <process_vm_writev@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.iovec = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca %struct.iovec
%4 = alloca %struct.iovec
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i32 0, i32* %1
store i32 0, i32* %2
%8 = bitcast %struct.iovec* %3 to i8*
%9 = bitcast %struct.iovec* %4 to i8*
store i64 1, i64* %5
store i64 1, i64* %6
store i64 0, i64* %7
%10 = load i32, i32* %2
%11 = load i64, i64* %5
%12 = load i64, i64* %6
%13 = load i64, i64* %7
%14 = call i32 @process_vm_writev(i32 %10, %struct.iovec* %3, i64 %11, %struct.iovec* %4, i64 %12, i64 %13)
ret i32 %14
}

LLVM IR (-O2):
%struct.iovec = type { i32 }
define i32 @main() {
%1 = alloca %struct.iovec
%2 = alloca %struct.iovec
%3 = bitcast %struct.iovec* %1 to i8*
%4 = getelementptr inbounds %struct.iovec, %struct.iovec* %1, i64 0, i32 0
store i32 0, i32* %4
%5 = bitcast %struct.iovec* %2 to i8*
%6 = getelementptr inbounds %struct.iovec, %struct.iovec* %2, i64 0, i32 0
store i32 0, i32* %6
%7 = call i32 @process_vm_writev(i32 0, %struct.iovec* %1, i64 1, %struct.iovec* %2, i64 1, i64 0)
ret i32 %7
}
int test_enc_interpolate_speed() { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @test_enc_interpolate_speed() {
ret i32 0
}
unsigned long long Read_Timer() {
  unsigned int cycles_high = 0;
  unsigned int cycles_low = 0;
  unsigned long long cycles_total = 0;
  asm("cpuid");
  asm("rdtsc");
  asm("mov %%edx, %0" : "=a"(cycles_high));
  asm("mov %%eax, %0" : "=a"(cycles_low));
  return (((cycles_total | cycles_high) << 32) | cycles_low);
}


x86 assembly (clang, -O0):
<Read_Timer>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cpuid
rdtsc
mov    %edx,%eax
mov    %eax,-0x4(%rbp)
mov    %eax,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
or     %rcx,%rax
shl    $0x20,%rax
mov    -0x8(%rbp),%ecx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Read_Timer>:
cpuid
rdtsc
mov    %edx,%eax
mov    %eax,%ecx
mov    %eax,%eax
shl    $0x20,%rcx
mov    %eax,%eax
or     %rcx,%rax
ret

LLVM IR (-O0):
define i64 @Read_Timer() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
store i32 0, i32* %1
store i32 0, i32* %2
store i64 0, i64* %3
%4 = call i32 asm "mov %edx, $0", "={ax},~{dirflag},~{fpsr},~{flags}"()
store i32 %4, i32* %1
%5 = call i32 asm "mov %eax, $0", "={ax},~{dirflag},~{fpsr},~{flags}"()
store i32 %5, i32* %2
%6 = load i64, i64* %3
%7 = load i32, i32* %1
%8 = zext i32 %7 to i64
%9 = or i64 %6, %8
%10 = shl i64 %9, 32
%11 = load i32, i32* %2
%12 = zext i32 %11 to i64
%13 = or i64 %10, %12
ret i64 %13
}

LLVM IR (-O2):
define i64 @Read_Timer() {
tail call void asm sideeffect "cpuid", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "rdtsc", "~{dirflag},~{fpsr},~{flags}"()
%1 = tail call i32 asm "mov %edx, $0", "={ax},~{dirflag},~{fpsr},~{flags}"()
%2 = tail call i32 asm "mov %eax, $0", "={ax},~{dirflag},~{fpsr},~{flags}"()
%3 = zext i32 %1 to i64
%4 = shl nuw i64 %3, 32
%5 = zext i32 %2 to i64
%6 = or i64 %4, %5
ret i64 %6
}
_Complex long double test_casinhl(_Complex long double x) {
  return __builtin_casinhl(x);
}


x86 assembly (clang, -O0):
<test_casinhl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
lea    0x10(%rbp),%rax
fldt   (%rax)
fldt   0x10(%rax)
fxch   %st(1)
fstpt  -0x40(%rbp)
fstpt  -0x30(%rbp)
movaps -0x40(%rbp),%xmm0
movaps -0x30(%rbp),%xmm1
mov    %rsp,%rax
movaps %xmm1,0x10(%rax)
movaps %xmm0,(%rax)
call   1030 <casinhl@plt>
fstpt  -0x20(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_casinhl>:
sub    $0x48,%rsp
fldt   0x50(%rsp)
fldt   0x60(%rsp)
fxch   %st(1)
fstpt  0x20(%rsp)
fstpt  0x30(%rsp)
movaps 0x20(%rsp),%xmm0
movaps 0x30(%rsp),%xmm1
movaps %xmm1,0x10(%rsp)
movaps %xmm0,(%rsp)
call   1030 <casinhl@plt>
add    $0x48,%rsp
ret

LLVM IR (-O0):
define { x86_fp80, x86_fp80 } @test_casinhl({ x86_fp80, x86_fp80 }* byval({ x86_fp80, x86_fp80 }) align 16 %0) {
%2 = alloca { x86_fp80, x86_fp80 }
%3 = alloca { x86_fp80, x86_fp80 }
%4 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 0
%5 = load x86_fp80, x86_fp80* %4
%6 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 1
%7 = load x86_fp80, x86_fp80* %6
%8 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %3, i32 0, i32 0
%9 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %3, i32 0, i32 1
store x86_fp80 %5, x86_fp80* %8
store x86_fp80 %7, x86_fp80* %9
%10 = call { x86_fp80, x86_fp80 } @casinhl({ x86_fp80, x86_fp80 }* byval({ x86_fp80, x86_fp80 }) align 16 %3)
%11 = extractvalue { x86_fp80, x86_fp80 } %10, 0
%12 = extractvalue { x86_fp80, x86_fp80 } %10, 1
%13 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %2, i32 0, i32 0
%14 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %2, i32 0, i32 1
store x86_fp80 %11, x86_fp80* %13
store x86_fp80 %12, x86_fp80* %14
%15 = load { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %2
ret { x86_fp80, x86_fp80 } %15
}

LLVM IR (-O2):
define { x86_fp80, x86_fp80 } @test_casinhl({ x86_fp80, x86_fp80 }* nocapture byval({ x86_fp80, x86_fp80 }) align 16 %0) {
%2 = alloca { x86_fp80, x86_fp80 }
%3 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i64 0, i32 0
%4 = load x86_fp80, x86_fp80* %3
%5 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i64 0, i32 1
%6 = load x86_fp80, x86_fp80* %5
%7 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %2, i64 0, i32 0
%8 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %2, i64 0, i32 1
store x86_fp80 %4, x86_fp80* %7
store x86_fp80 %6, x86_fp80* %8
%9 = tail call { x86_fp80, x86_fp80 } @casinhl({ x86_fp80, x86_fp80 }* byval({ x86_fp80, x86_fp80 }) align 16 %2)
ret { x86_fp80, x86_fp80 } %9
}
/* Variables and functions */
scalar_t__ getpid();
unsigned int r_sys_getpid() { return (unsigned int)getpid(); }


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

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

LLVM IR (-O0):
define i32 @r_sys_getpid() {
%1 = call i64 (...) @getpid()
%2 = trunc i64 %1 to i32
ret i32 %2
}

LLVM IR (-O2):
define i32 @r_sys_getpid() {
%1 = tail call i64 (...) @getpid()
%2 = trunc i64 %1 to i32
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Inner();
int Replaced();
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i;
  Inner();
  i = Replaced();
  printf("i=%d\n", i);
  Inner();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <Inner@plt>
mov    $0x0,%al
call   1050 <Replaced@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xea6(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <Inner@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <Inner@plt>
xor    %eax,%eax
call   1050 <Replaced@plt>
lea    0xeba(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <Inner@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"i=%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @Inner()
%2 = tail call i32 (...) @Replaced()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 (...) @Inner()
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int, unsigned char);
void fprint_mov_atRi_to_direct(FILE *stream, unsigned char i, uint8_t direct) {
  fprintf(stream,
          "MOV   "
          "0x%02X"
          ", @R%X                 ",
          direct, i);
}


x86 assembly (clang, -O0):
<fprint_mov_atRi_to_direct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%edx
lea    0xecd(%rip),%rsi
movzbl -0x9(%rbp),%ecx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fprint_mov_atRi_to_direct>:
mov    %esi,%ecx
lea    0xee7(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"MOV 0x%02X, @R%X \00"
define void @fprint_mov_atRi_to_direct(i32* %0, i8 zeroext %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8
%6 = alloca i32
store i32* %0, i32** %4
store i8 %1, i8* %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %6
%9 = load i8, i8* %5
%10 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %8, i8 zeroext %9)
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"MOV 0x%02X, @R%X \00"
define void @fprint_mov_atRi_to_direct(i32* nocapture %0, i8 zeroext %1, i32 %2) {
%4 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %2, i8 zeroext %1)
ret void
}
void setjmp() {}


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

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

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

LLVM IR (-O2):
define void @setjmp() {
ret void
}
void setNextEntry(int *entry, int *next) { *entry = (int)next; }


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

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

LLVM IR (-O0):
define void @setNextEntry(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 = ptrtoint i32* %5 to i32
%7 = load i32*, i32** %3
store i32 %6, i32* %7
ret void
}

LLVM IR (-O2):
define void @setNextEntry(i32* nocapture writeonly %0, i32* %1) {
%3 = ptrtoint i32* %1 to i64
%4 = trunc i64 %3 to i32
store i32 %4, i32* %0
ret void
}
noretnoarg(x) { return x; }


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

x86 assembly (clang, -O2):
<noretnoarg>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @noretnoarg(i32 returned %0) {
ret i32 %0
}
printf(fmt, args) char *fmt;
unsigned args;
{
  int putchar();
  format(putchar, fmt, &args);
}


x86 assembly (clang, -O0):
<printf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rsi
mov    0x2eae(%rip),%rdi
lea    -0x14(%rbp),%rdx
mov    $0x0,%al
call   1030 <format@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printf>:
push   %rax
mov    %rdi,%rax
mov    %esi,0x4(%rsp)
mov    0x2eb9(%rip),%rdi
lea    0x4(%rsp),%rdx
mov    %rax,%rsi
xor    %eax,%eax
call   1030 <format@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @printf(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i8*, i8** %4
%7 = call i32 (i32 (...)*, i8*, i32*, ...) bitcast (i32 (...)* @format to i32 (i32 (...)*, i8*, i32*, ...)*)(i32 (...)* @putchar, i8* %6, i32* %5)
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @printf(i8* %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 (i32 (...)*, i8*, i32*, ...) bitcast (i32 (...)* @format to i32 (i32 (...)*, i8*, i32*, ...)*)(i32 (...)* @putchar, i8* %0, i32* %3)
ret i32 undef
}
int test_imm_E7int8_reg(signed char val) {
  return ((val) & (-0xE7 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_E7int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffff19,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_E7int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, -231
%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_E7int8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -231
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int close(int);
int /*<<< orphan*/ perror(char *);
int cornet_close(int fd) {
  int rc;
  if ((rc = close(fd)) == -1) {
    perror("close");
    return -1;
  }
  return rc;
}


x86 assembly (clang, -O0):
<cornet_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <close@plt>
mov    %eax,-0xc(%rbp)
cmp    $0xffffffff,%eax
jne    1157 <cornet_close+0x37>
lea    0xeba(%rip),%rdi
call   1040 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    115d <cornet_close+0x3d>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cornet_close>:
push   %rbx
call   1030 <close@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
je     1131 <cornet_close+0x11>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xec8(%rip),%rdi
call   1040 <perror@plt>
jmp    112d <cornet_close+0xd>

LLVM IR (-O0):
@.str = [6 x i8] c"close\00"
define i32 @cornet_close(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @close(i32 %5)
store i32 %6, i32* %4
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %2
br label %12
10: ; preds = %1
%11 = load i32, i32* %4
store i32 %11, i32* %2
br label %12
12: ; preds = %10, %8
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@.str = [6 x i8] c"close\00"
define i32 @cornet_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %1, %4
ret i32 %2
}
int mmmm2hhmm(int mmmm) {
  int hh, mm;
  hh = mmmm / 60;
  mm = mmmm % 60;
  return (hh * 100) + mm;
}


x86 assembly (clang, -O0):
<mmmm2hhmm>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
imul   $0x64,-0x8(%rbp),%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mmmm2hhmm>:
movslq %edi,%rcx
imul   $0xffffffff88888889,%rcx,%rax
shr    $0x20,%rax
add    %ecx,%eax
mov    %eax,%edx
shr    $0x1f,%edx
sar    $0x5,%eax
add    %edx,%eax
imul   $0x3c,%eax,%edx
sub    %edx,%ecx
imul   $0x64,%eax,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @mmmm2hhmm(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = sdiv i32 %5, 60
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = srem i32 %7, 60
store i32 %8, i32* %4
%9 = load i32, i32* %3
%10 = mul nsw i32 %9, 100
%11 = load i32, i32* %4
%12 = add nsw i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @mmmm2hhmm(i32 %0) {
%2 = sdiv i32 %0, 60
%3 = srem i32 %0, 60
%4 = mul nsw i32 %2, 100
%5 = add nsw i32 %4, %3
ret i32 %5
}
/* Variables and functions */
scalar_t__ calloc(scalar_t__, int);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *append(char *a, char *b) {
  char *result = (char *)calloc(strlen(a) + strlen(b) + 1, sizeof(char));
  strcpy(result, a);
  strcat(result, b);
  return result;
}


x86 assembly (clang, -O0):
<append>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
add    %rax,%rdi
add    $0x1,%rdi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <strcat@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<append>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r12
call   1040 <strlen@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1040 <strlen@plt>
lea    (%r15,%rax,1),%rdi
add    $0x1,%rdi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r12,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <strcat@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @append(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
%8 = load i8*, i8** %4
%9 = call i64 @strlen(i8* %8)
%10 = add nsw i64 %7, %9
%11 = add nsw i64 %10, 1
%12 = call i64 @calloc(i64 %11, i32 1)
%13 = inttoptr i64 %12 to i8*
store i8* %13, i8** %5
%14 = load i8*, i8** %5
%15 = load i8*, i8** %3
%16 = call i32 @strcpy(i8* %14, i8* %15)
%17 = load i8*, i8** %5
%18 = load i8*, i8** %4
%19 = call i32 @strcat(i8* %17, i8* %18)
%20 = load i8*, i8** %5
ret i8* %20
}

LLVM IR (-O2):
define i8* @append(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = add i64 %3, 1
%6 = add i64 %5, %4
%7 = tail call i64 @calloc(i64 %6, i32 1)
%8 = inttoptr i64 %7 to i8*
%9 = tail call i32 @strcpy(i8* %8, i8* %0)
%10 = tail call i32 @strcat(i8* %8, i8* %1)
ret i8* %8
}
void swapIntegerElements(int *array, int p1, int p2) {
  int tmp;
  tmp = array[p1];
  array[p1] = array[p2];
  array[p2] = tmp;
}


x86 assembly (clang, -O0):
<swapIntegerElements>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swapIntegerElements>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

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

LLVM IR (-O2):
define void @swapIntegerElements(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
int f_bgt_mr2(float *a1, float a2) { return !(__builtin_isgreater(*a1, a2)); }


x86 assembly (clang, -O0):
<f_bgt_mr2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
ucomiss -0xc(%rbp),%xmm0
seta   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_bgt_mr2>:
movss  (%rdi),%xmm1
xor    %eax,%eax
ucomiss %xmm0,%xmm1
setbe  %al
ret

LLVM IR (-O0):
define i32 @f_bgt_mr2(float* %0, float %1) {
%3 = alloca float*
%4 = alloca float
store float* %0, float** %3
store float %1, float* %4
%5 = load float*, float** %3
%6 = load float, float* %5
%7 = load float, float* %4
%8 = fcmp ogt float %6, %7
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @f_bgt_mr2(float* nocapture %0, float %1) {
%3 = load float, float* %0
%4 = fcmp ule float %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
int notifyServiceReady(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @notifyServiceReady() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main() {
  puts("Hello");
  puts("ptrace!");
  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 <puts@plt>
lea    0xed4(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"Hello\00"
@.str.1 = [8 x i8] c"ptrace!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"Hello\00"
@.str.1 = [8 x i8] c"ptrace!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
char *arch_sanCodeToStr(int exitCode) {
  switch (exitCode) {
  case 103:
    return "MSAN";
    break;
  case 104:
    return "ASAN";
    break;
  case 105:
    return "UBSAN";
    break;
  default:
    return "UNKNW";
    break;
  }
}


x86 assembly (clang, -O0):
<arch_sanCodeToStr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x67,%eax
je     113d <arch_sanCodeToStr+0x3d>
jmp    111b <arch_sanCodeToStr+0x1b>
mov    -0x10(%rbp),%eax
sub    $0x68,%eax
je     114d <arch_sanCodeToStr+0x4d>
jmp    112c <arch_sanCodeToStr+0x2c>
mov    -0x10(%rbp),%eax
sub    $0x69,%eax
je     115d <arch_sanCodeToStr+0x5d>
jmp    116d <arch_sanCodeToStr+0x6d>
lea    0xebc(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1178 <arch_sanCodeToStr+0x78>
lea    0xeb1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1178 <arch_sanCodeToStr+0x78>
lea    0xea6(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1178 <arch_sanCodeToStr+0x78>
lea    0xe9c(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<arch_sanCodeToStr>:
add    $0xffffff99,%edi
cmp    $0x2,%edi
ja     111a <arch_sanCodeToStr+0x1a>
movslq %edi,%rax
lea    0xf06(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
ret
lea    0xeef(%rip),%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"MSAN\00"
@.str.1 = [5 x i8] c"ASAN\00"
@.str.2 = [6 x i8] c"UBSAN\00"
@.str.3 = [6 x i8] c"UNKNW\00"
define i8* @arch_sanCodeToStr(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %8 [
i32 103, label %5
i32 104, label %6
i32 105, label %7
]
5: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %2
br label %9
6: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %9
7: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %9
8: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %9
9: ; preds = %8, %7, %6, %5
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [5 x i8] c"MSAN\00"
@.str.1 = [5 x i8] c"ASAN\00"
@.str.2 = [6 x i8] c"UBSAN\00"
@.str.3 = [6 x i8] c"UNKNW\00"
@reltable.arch_sanCodeToStr = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str to i64), i64 ptrtoint ([3 x i32]* @reltable.arch_sanCodeToStr to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.1 to i64), i64 ptrtoint ([3 x i32]* @reltable.arch_sanCodeToStr to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.2 to i64), i64 ptrtoint ([3 x i32]* @reltable.arch_sanCodeToStr to i64)) to i32)]
define i8* @arch_sanCodeToStr(i32 %0) {
%2 = add i32 %0, -103
%3 = icmp ult i32 %2, 3
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = shl i64 %5, 2
%7 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.arch_sanCodeToStr to i8*), i64 %6)
br label %8
8: ; preds = %1, %4
%9 = phi i8* [ %7, %4 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), %1 ]
ret i8* %9
}
int __ccv_floor(float x) {
  int xi = (int)x;
  if (x >= 0 || (float)xi == x)
    return xi;
  return xi - 1;
}


x86 assembly (clang, -O0):
<__ccv_floor>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
cvttss2si -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jae    1137 <__ccv_floor+0x37>
cvtsi2ssl -0xc(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jne    1142 <__ccv_floor+0x42>
jp     1142 <__ccv_floor+0x42>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114b <__ccv_floor+0x4b>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ccv_floor>:
cvttss2si %xmm0,%eax
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
setb   %sil
cvttps2dq %xmm0,%xmm1
cvtdq2ps %xmm1,%xmm1
ucomiss %xmm0,%xmm1
setp   %dl
setne  %cl
or     %dl,%cl
and    %sil,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @__ccv_floor(float %0) {
%2 = alloca i32
%3 = alloca float
%4 = alloca i32
store float %0, float* %3
%5 = load float, float* %3
%6 = fptosi float %5 to i32
store i32 %6, i32* %4
%7 = load float, float* %3
%8 = fcmp oge float %7, 0.000000e+00
br i1 %8, label %14, label %9
9: ; preds = %1
%10 = load i32, i32* %4
%11 = sitofp i32 %10 to float
%12 = load float, float* %3
%13 = fcmp oeq float %11, %12
br i1 %13, label %14, label %16
14: ; preds = %9, %1
%15 = load i32, i32* %4
store i32 %15, i32* %2
br label %19
16: ; preds = %9
%17 = load i32, i32* %4
%18 = sub nsw i32 %17, 1
store i32 %18, i32* %2
br label %19
19: ; preds = %16, %14
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @__ccv_floor(float %0) {
%2 = fptosi float %0 to i32
%3 = fcmp ult float %0, 0.000000e+00
%4 = sitofp i32 %2 to float
%5 = fcmp une float %4, %0
%6 = select i1 %3, i1 %5, i1 false
%7 = sext i1 %6 to i32
%8 = add nsw i32 %7, %2
ret i32 %8
}
/* Variables and functions */
scalar_t__ istty();
char *rdz_cy() { return istty() ? "[0;36m" : ""; }


x86 assembly (clang, -O0):
<rdz_cy>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <istty@plt>
mov    %rax,%rdx
lea    0xee2(%rip),%rax
lea    0xed4(%rip),%rcx
cmp    $0x0,%rdx
cmovne %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdz_cy>:
push   %rax
xor    %eax,%eax
call   1030 <istty@plt>
test   %rax,%rax
lea    0xee5(%rip),%rcx
lea    0xed7(%rip),%rax
cmove  %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"\1B[0;36m\00"
@.str.1 = [1 x i8] zeroinitializer
define i8* @rdz_cy() {
%1 = call i64 (...) @istty()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i64
%4 = select i1 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0)
ret i8* %4
}

LLVM IR (-O2):
@.str = [8 x i8] c"\1B[0;36m\00"
@.str.1 = [1 x i8] zeroinitializer
define i8* @rdz_cy() {
%1 = tail call i64 (...) @istty()
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
int batadv_bla_backbone_table_seq_print_text(struct seq_file *seq,
                                             void *offset) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.seq_file = type opaque
define i32 @batadv_bla_backbone_table_seq_print_text(%struct.seq_file* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void fb_GfxImageDestroy(void *image) { free(((void **)image)[-1]); }


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

x86 assembly (clang, -O2):
<fb_GfxImageDestroy>:
mov    -0x8(%rdi),%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @fb_GfxImageDestroy(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i8**
%5 = getelementptr inbounds i8*, i8** %4, i64 -1
%6 = load i8*, i8** %5
%7 = call i32 @free(i8* %6)
ret void
}

LLVM IR (-O2):
define void @fb_GfxImageDestroy(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 -8
%3 = bitcast i8* %2 to i8**
%4 = load i8*, i8** %3
%5 = tail call i32 @free(i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_cmake_comment_entities();
int /*<<< orphan*/ test_cmake_comments();
int /*<<< orphan*/ test_cmake_empty_comments();
void all_cmake_tests() {
  test_cmake_comments();
  test_cmake_empty_comments();
  test_cmake_comment_entities();
}


x86 assembly (clang, -O0):
<all_cmake_tests>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <test_cmake_comments@plt>
mov    $0x0,%al
call   1030 <test_cmake_empty_comments@plt>
mov    $0x0,%al
call   1050 <test_cmake_comment_entities@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<all_cmake_tests>:
push   %rax
xor    %eax,%eax
call   1040 <test_cmake_comments@plt>
xor    %eax,%eax
call   1030 <test_cmake_empty_comments@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <test_cmake_comment_entities@plt>

LLVM IR (-O0):
define void @all_cmake_tests() {
%1 = call i32 (...) @test_cmake_comments()
%2 = call i32 (...) @test_cmake_empty_comments()
%3 = call i32 (...) @test_cmake_comment_entities()
ret void
}

LLVM IR (-O2):
define void @all_cmake_tests() {
%1 = tail call i32 (...) @test_cmake_comments()
%2 = tail call i32 (...) @test_cmake_empty_comments()
%3 = tail call i32 (...) @test_cmake_comment_entities()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int test();
int main(int argc, char *argv[]) {
  printf("user 1\n");
  return test();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <test@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [7 x i8] c"user 1\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @test()
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void WriteSlaveSyncFile(void) {
  FILE *fsync;
  fsync = fopen("sync", "w");
  fprintf(fsync, "sync");
  fclose(fsync);
}


x86 assembly (clang, -O0):
<WriteSlaveSyncFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xebf(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea6(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteSlaveSyncFile>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%r14
lea    0xec3(%rip),%rsi
mov    %r14,%rdi
call   1040 <fopen@plt>
mov    %rax,%rbx
mov    $0x4,%esi
mov    $0x1,%edx
mov    %r14,%rdi
mov    %rax,%rcx
call   1050 <fwrite@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"sync\00"
@.str.1 = [2 x i8] c"w\00"
define void @WriteSlaveSyncFile() {
%1 = alloca i32*
%2 = call i32* @fopen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = load i32*, i32** %1
%6 = call i32 @fclose(i32* %5)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"sync\00"
@.str.1 = [2 x i8] c"w\00"
define void @WriteSlaveSyncFile() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 4, i64 1, i32* %1)
%3 = tail call i32 @fclose(i32* %1)
ret void
}
double mult_precise(double x, double y) { return (x * y); }


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

x86 assembly (clang, -O2):
<mult_precise>:
mulsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @mult_precise(double %0, double %1) {
%3 = fmul double %0, %1
ret double %3
}
/* Variables and functions */
char *basename(char *);
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *file_basename(const char *path) {
  char *ret;
  char *fname;
  fname = basename((char *)path);
  ret = (char *)malloc(strlen(fname) + 1);
  if (ret != NULL) {
    strcpy(ret, fname);
  }
  return ret;
}


x86 assembly (clang, -O0):
<file_basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <basename@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     118a <file_basename+0x4a>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_basename>:
push   %r14
push   %rbx
push   %rax
call   1050 <basename@plt>
mov    %rax,%r14
mov    %rax,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1060 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1170 <file_basename+0x30>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @file_basename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @basename(i8* %5)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = call i64 @strlen(i8* %7)
%9 = add nsw i64 %8, 1
%10 = call i64 @malloc(i64 %9)
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %3
%12 = load i8*, i8** %3
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %18
14: ; preds = %1
%15 = load i8*, i8** %3
%16 = load i8*, i8** %4
%17 = call i32 @strcpy(i8* %15, i8* %16)
br label %18
18: ; preds = %14, %1
%19 = load i8*, i8** %3
ret i8* %19
}

LLVM IR (-O2):
define i8* @file_basename(i8* %0) {
%2 = tail call i8* @basename(i8* %0)
%3 = tail call i64 @strlen(i8* dereferenceable(1) %2)
%4 = add nsw i64 %3, 1
%5 = tail call i64 @malloc(i64 %4)
%6 = inttoptr i64 %5 to i8*
%7 = icmp eq i64 %5, 0
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = tail call i32 @strcpy(i8* %6, i8* %2)
br label %10
10: ; preds = %8, %1
ret i8* %6
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
scalar_t__ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
unsigned int get_time_in_ms() {
  struct timeval tv;
  if (gettimeofday(&tv, NULL) < 0)
    return 0;
  return tv.tv_sec * 1000 + tv.tv_usec / 1000;
}


x86 assembly (clang, -O0):
<get_time_in_ms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cmp    $0x0,%rax
jge    113b <get_time_in_ms+0x2b>
movl   $0x0,-0x4(%rbp)
jmp    115a <get_time_in_ms+0x4a>
imul   $0x3e8,-0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time_in_ms>:
push   %rbx
sub    $0x10,%rsp
xor    %ebx,%ebx
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
test   %rax,%rax
js     114b <get_time_in_ms+0x3b>
imul   $0x3e8,0x8(%rsp),%eax
movslq 0xc(%rsp),%rcx
imul   $0x10624dd3,%rcx,%rbx
mov    %rbx,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rbx
add    %ecx,%ebx
add    %eax,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @get_time_in_ms() {
%1 = alloca i32
%2 = alloca %struct.timeval
%3 = call i64 @gettimeofday(%struct.timeval* %2, i32* null)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
store i32 0, i32* %1
br label %14
6: ; preds = %0
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%8 = load i32, i32* %7
%9 = mul nsw i32 %8, 1000
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
%11 = load i32, i32* %10
%12 = sdiv i32 %11, 1000
%13 = add nsw i32 %9, %12
store i32 %13, i32* %1
br label %14
14: ; preds = %6, %5
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @get_time_in_ms() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i64 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = icmp slt i64 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %0
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%7 = load i32, i32* %6
%8 = mul nsw i32 %7, 1000
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%10 = load i32, i32* %9
%11 = sdiv i32 %10, 1000
%12 = add nsw i32 %11, %8
br label %13
13: ; preds = %0, %5
%14 = phi i32 [ %12, %5 ], [ 0, %0 ]
ret i32 %14
}