xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ copy_code_to_dram();
void board_init_f_mmc() { copy_code_to_dram(); }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ get_next_input_from_fuzzer();
ulong map2check_non_det_ulong() { return (ulong)get_next_input_from_fuzzer(); }


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

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

LLVM IR (-O0):
define i32 @map2check_non_det_ulong() {
%1 = call i32 (...) @get_next_input_from_fuzzer()
ret i32 %1
}

LLVM IR (-O2):
define i32 @map2check_non_det_ulong() {
%1 = tail call i32 (...) @get_next_input_from_fuzzer()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isalnum(int);
void t_isalnum_0x61() {
  Assert_real((isalnum(97)),
              "/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_isalnum.c",
              490, ("isalnum should be 1 for a"));
}


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

x86 assembly (clang, -O2):
<t_isalnum_0x61>:
push   %rax
mov    $0x61,%edi
call   1030 <isalnum@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x1ea,%edx
pop    %rax
jmp    1040 <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_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 1 for a\00"
define void @t_isalnum_0x61() {
%1 = call i32 @isalnum(i32 97)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 490, 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_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 1 for a\00"
define void @t_isalnum_0x61() {
%1 = tail call i32 @isalnum(i32 97)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 490, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
double exp(double);
double sinh(double x) {
  double y = exp(x);
  return (y - 1. / y) * 0.5;
}


x86 assembly (clang, -O0):
<sinh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xecf(%rip),%xmm1
divsd  -0x10(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  0xeb6(%rip),%xmm1
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sinh>:
push   %rax
call   1030 <exp@plt>
movsd  0xee2(%rip),%xmm1
divsd  %xmm0,%xmm1
addsd  %xmm1,%xmm0
mulsd  0xeda(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @sinh(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @exp(double %4)
store double %5, double* %3
%6 = load double, double* %3
%7 = load double, double* %3
%8 = fdiv double 1.000000e+00, %7
%9 = fsub double %6, %8
%10 = fmul double %9, 5.000000e-01
ret double %10
}

LLVM IR (-O2):
define double @sinh(double %0) {
%2 = tail call double @exp(double %0)
%3 = fdiv double 1.000000e+00, %2
%4 = fsub double %2, %3
%5 = fmul double %4, 5.000000e-01
ret double %5
}
void release(void) {
  printf("%s, %s, %d\n",
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/sczzq/symmetrical-spoon/refs/heads/master/"
         "base-usage/make_study/utils.c",
         __func__, 25);
}


x86 assembly (clang, -O0):
<release>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeea(%rip),%rsi
lea    0xf85(%rip),%rdx
mov    $0x19,%ecx
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<release>:
lea    0xee9(%rip),%rdi
lea    0xeee(%rip),%rsi
lea    0xf89(%rip),%rdx
mov    $0x19,%ecx
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"%s, %s, %d\0A\00"
@.str.1 = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/sczzq/symmetrical-spoon/refs/heads/master/base-usage/make_study/utils.c\00"
@__func__.release = [8 x i8] c"release\00"
define void @release() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__func__.release, i64 0, i64 0), i32 25)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"%s, %s, %d\0A\00"
@.str.1 = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/sczzq/symmetrical-spoon/refs/heads/master/base-usage/make_study/utils.c\00"
@__func__.release = [8 x i8] c"release\00"
define void @release() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__func__.release, i64 0, i64 0), i32 25)
ret void
}
void disableWatchdog(void) {
  _serverPanic("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/"
               "heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c",
               63, "Function '%s' is disabled.", __func__);
}


x86 assembly (clang, -O0):
<disableWatchdog>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x3f,%esi
lea    0xf79(%rip),%rdx
lea    0xf8d(%rip),%rcx
mov    $0x0,%al
call   1030 <_serverPanic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<disableWatchdog>:
lea    0xee9(%rip),%rdi
lea    0xf82(%rip),%rdx
lea    0xf96(%rip),%rcx
mov    $0x3f,%esi
xor    %eax,%eax
jmp    1030 <_serverPanic@plt>

LLVM IR (-O0):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.disableWatchdog = [16 x i8] c"disableWatchdog\00"
define void @disableWatchdog() {
%1 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 63, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__func__.disableWatchdog, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.disableWatchdog = [16 x i8] c"disableWatchdog\00"
define void @disableWatchdog() {
%1 = tail call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 63, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__func__.disableWatchdog, i64 0, i64 0))
ret void
}
unsigned int gcd(unsigned int high, unsigned int low) {
  if (high < low) {
    gcd(low, high);
  }
  unsigned int rest = high % low;
  return (rest == 0) ? low : gcd(low, rest);
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jae    1135 <gcd+0x25>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1030 <gcd@plt>
mov    -0x4(%rbp),%eax
xor    %edx,%edx
divl   -0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1155 <gcd+0x45>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1163 <gcd+0x53>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <gcd@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%edx
mov    %edi,%ebp
jmp    112c <gcd+0x1c>
nopl   0x0(%rax)
mov    %ebp,%eax
xor    %edx,%edx
div    %ebx
mov    %ebx,%ebp
test   %edx,%edx
je     113d <gcd+0x2d>
mov    %edx,%ebx
cmp    %edx,%ebp
jae    1120 <gcd+0x10>
mov    %ebx,%edi
mov    %ebp,%esi
call   1030 <gcd@plt>
jmp    1120 <gcd+0x10>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
br label %3
3: ; preds = %9, %2
%4 = phi i32 [ %0, %2 ], [ %5, %9 ]
%5 = phi i32 [ %1, %2 ], [ %10, %9 ]
%6 = icmp ult i32 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @gcd(i32 %5, i32 %4)
br label %9
9: ; preds = %7, %3
%10 = urem i32 %4, %5
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %3
12: ; preds = %9
ret i32 %5
}
double max(double a, double b) {
  if (a >= b)
    return a;
  else
    return b;
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jb     112d <max+0x2d>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1137 <max+0x37>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
movapd %xmm1,%xmm2
cmplesd %xmm0,%xmm2
andpd  %xmm2,%xmm0
andnpd %xmm1,%xmm2
orpd   %xmm2,%xmm0
ret

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

LLVM IR (-O2):
define double @max(double %0, double %1) {
%3 = fcmp oge double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
int fun1310() { return 1310; }


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

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

LLVM IR (-O0):
define i32 @fun1310() {
ret i32 1310
}

LLVM IR (-O2):
define i32 @fun1310() {
ret i32 1310
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ I2CMasterBaseValid(unsigned long);
void I2CMasterIntClear(unsigned long ulBase) {
  DEBUG_ASSERT(I2CMasterBaseValid(ulBase));
  (*((volatile unsigned long *)(ulBase + 0x0000001C))) = 0x00000001;
  (*((volatile unsigned long *)(ulBase + 0x00000018))) = 0x00000001;
}


x86 assembly (clang, -O0):
<I2CMasterIntClear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <I2CMasterBaseValid@plt>
mov    %eax,%edi
call   1040 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
movq   $0x1,0x1c(%rax)
mov    -0x8(%rbp),%rax
movq   $0x1,0x18(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CMasterIntClear>:
push   %rbx
mov    %rdi,%rbx
call   1030 <I2CMasterBaseValid@plt>
mov    %eax,%edi
call   1040 <DEBUG_ASSERT@plt>
movq   $0x1,0x1c(%rbx)
movq   $0x1,0x18(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @I2CMasterIntClear(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @I2CMasterBaseValid(i64 %3)
%5 = call i32 @DEBUG_ASSERT(i32 %4)
%6 = load i64, i64* %2
%7 = add i64 %6, 28
%8 = inttoptr i64 %7 to i64*
store volatile i64 1, i64* %8
%9 = load i64, i64* %2
%10 = add i64 %9, 24
%11 = inttoptr i64 %10 to i64*
store volatile i64 1, i64* %11
ret void
}

LLVM IR (-O2):
define void @I2CMasterIntClear(i64 %0) {
%2 = tail call i32 @I2CMasterBaseValid(i64 %0)
%3 = tail call i32 @DEBUG_ASSERT(i32 %2)
%4 = add i64 %0, 28
%5 = inttoptr i64 %4 to i64*
store volatile i64 1, i64* %5
%6 = add i64 %0, 24
%7 = inttoptr i64 %6 to i64*
store volatile i64 1, i64* %7
ret void
}
int flsnz(const int x) {
  int r;
  __asm__("bsrl %1,%0\n" : "=r"(r) : "rm"(x));
  return r + 1;
}


x86 assembly (clang, -O0):
<flsnz>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
bsr    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<flsnz>:
mov    %edi,-0x4(%rsp)
bsr    -0x4(%rsp),%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @flsnz(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 asm "bsrl $1,$0\0A", "=r,rm,~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 1
ret i32 %7
}

LLVM IR (-O2):
define i32 @flsnz(i32 %0) {
%2 = tail call i32 asm "bsrl $1,$0\0A", "=r,rm,~{dirflag},~{fpsr},~{flags}"(i32 %0)
%3 = add nsw i32 %2, 1
ret i32 %3
}
__attribute__((no, noclone)) void foo(int x) {
  if (x != -3161)
    __builtin_abort();
  asm volatile("" : : : "memory");
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xfffff3a7,-0x4(%rbp)
je     112d <foo+0x1d>
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
cmp    $0xfffff3a7,%edi
jne    111b <foo+0xb>
pop    %rax
ret
call   1030 <abort@plt>

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

LLVM IR (-O2):
define void @foo(i32 %0) {
%2 = icmp eq i32 %0, -3161
br i1 %2, label %4, label %3
3: ; preds = %1
tail call void @abort()
unreachable
4: ; preds = %1
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
void bb(int sz, int ar[sz][sz]) {}


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

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

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

LLVM IR (-O2):
define void @bb(i32 %0, i32* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SerialWriteChar(int);
void iRobot_Start() { SerialWriteChar(128); }


x86 assembly (clang, -O0):
<iRobot_Start>:
push   %rbp
mov    %rsp,%rbp
mov    $0x80,%edi
call   1030 <SerialWriteChar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<iRobot_Start>:
mov    $0x80,%edi
jmp    1030 <SerialWriteChar@plt>

LLVM IR (-O0):
define void @iRobot_Start() {
%1 = call i32 @SerialWriteChar(i32 128)
ret void
}

LLVM IR (-O2):
define void @iRobot_Start() {
%1 = tail call i32 @SerialWriteChar(i32 128)
ret void
}
/* Variables and functions */
float gb_log(float);
float gb_log2(float x) {
  return gb_log(x) / 0.693147180559945309417232121458176568f;
}


x86 assembly (clang, -O0):
<gb_log2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <gb_log@plt>
movss  0xed1(%rip),%xmm1
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gb_log2>:
push   %rax
call   1030 <gb_log@plt>
divss  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @gb_log2(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @gb_log(float %3)
%5 = fdiv float %4, 0x3FE62E4300000000
ret float %5
}

LLVM IR (-O2):
define float @gb_log2(float %0) {
%2 = tail call float @gb_log(float %0)
%3 = fdiv float %2, 0x3FE62E4300000000
ret float %3
}
void av_int2i() {}


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

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

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

LLVM IR (-O2):
define void @av_int2i() {
ret void
}
/* Variables and functions */
int strlen(char *str) {
  int result = 0;
  while (*str++)
    result++;
  return result;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1135 <strlen+0x35>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111c <strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @strlen(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %9, %1
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i32 1
store i8* %6, i8** %2
%7 = load i8, i8* %5
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %4
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
br label %4
12: ; preds = %4
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
/* Variables and functions */
int dir_is_empty(char const *);
int dir_is_populated(const char *path) {
  int r;
  r = dir_is_empty(path);
  if (r < 0)
    return r;
  return !r;
}


x86 assembly (clang, -O0):
<dir_is_populated>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <dir_is_empty@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    113d <dir_is_populated+0x2d>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114e <dir_is_populated+0x3e>
cmpl   $0x0,-0x14(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dir_is_populated>:
push   %rax
call   1030 <dir_is_empty@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
cmovns %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @dir_is_populated(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @dir_is_empty(i8* %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i32, i32* %4
store i32 %10, i32* %2
br label %16
11: ; preds = %1
%12 = load i32, i32* %4
%13 = icmp ne i32 %12, 0
%14 = xor i1 %13, true
%15 = zext i1 %14 to i32
store i32 %15, i32* %2
br label %16
16: ; preds = %11, %9
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @dir_is_populated(i8* %0) {
%2 = tail call i32 @dir_is_empty(i8* %0)
%3 = icmp slt i32 %2, 0
%4 = icmp eq i32 %2, 0
%5 = zext i1 %4 to i32
%6 = select i1 %3, i32 %2, i32 %5
ret i32 %6
}
int plusone(int x) { return x + 1; }


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

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

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

LLVM IR (-O2):
define i32 @plusone(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
int zempty(const void *ptr) { return ((!ptr) || (!(*(const char *)(ptr)))); }


x86 assembly (clang, -O0):
<zempty>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%al
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1127 <zempty+0x27>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zempty>:
test   %rdi,%rdi
je     110e <zempty+0xe>
xor    %eax,%eax
cmpb   $0x0,(%rdi)
sete   %al
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @zempty(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
%9 = xor i1 %8, true
br label %10
10: ; preds = %5, %1
%11 = phi i1 [ true, %1 ], [ %9, %5 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @zempty(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 1, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void freeCString(char *str) {
  free(str);
  str = NULL;
}


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

x86 assembly (clang, -O2):
<freeCString>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @freeCString(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @free(i8* %3)
store i8* null, i8** %2
ret void
}

LLVM IR (-O2):
define void @freeCString(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void glTexSubImage3D(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glTexSubImage3D() {
ret void
}
/* Variables and functions */
int num_cores_per_package();
int num_threads_per_package();
int num_threads_per_core() {
  return num_threads_per_package() / num_cores_per_package();
}


x86 assembly (clang, -O0):
<num_threads_per_core>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <num_threads_per_package@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <num_cores_per_package@plt>
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<num_threads_per_core>:
push   %rbx
xor    %eax,%eax
call   1040 <num_threads_per_package@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <num_cores_per_package@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
pop    %rbx
ret

LLVM IR (-O0):
define i32 @num_threads_per_core() {
%1 = call i32 (...) @num_threads_per_package()
%2 = call i32 (...) @num_cores_per_package()
%3 = sdiv i32 %1, %2
ret i32 %3
}

LLVM IR (-O2):
define i32 @num_threads_per_core() {
%1 = tail call i32 (...) @num_threads_per_package()
%2 = tail call i32 (...) @num_cores_per_package()
%3 = sdiv i32 %1, %2
ret i32 %3
}
/* Variables and functions */
int pow(float, float);
float sqrt(int);
float getValue(float Vr, float r, float c, float w) {
  float va1 = 1.0f / pow(c * w * r, 2.0f);
  float value = sqrt(pow(Vr, 2.0f) / (1 + va1));
  return value;
}


x86 assembly (clang, -O0):
<getValue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  0xeb1(%rip),%xmm1
call   1030 <pow@plt>
cvtsi2ss %eax,%xmm1
movss  0xe9c(%rip),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xe8a(%rip),%xmm1
call   1030 <pow@plt>
cvtsi2ss %eax,%xmm0
movss  0xe75(%rip),%xmm1
addss  -0x14(%rbp),%xmm1
divss  %xmm1,%xmm0
cvttss2si %xmm0,%edi
call   1040 <sqrt@plt>
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getValue>:
push   %rax
movss  %xmm0,0x4(%rsp)
mulss  %xmm3,%xmm2
mulss  %xmm1,%xmm2
movss  0xec9(%rip),%xmm1
movaps %xmm2,%xmm0
call   1030 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  0xeb6(%rip),%xmm1
divss  %xmm0,%xmm1
movss  %xmm1,(%rsp)
movss  0x4(%rsp),%xmm0
movss  0xe9b(%rip),%xmm1
call   1030 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  (%rsp),%xmm1
addss  0xe86(%rip),%xmm1
divss  %xmm1,%xmm0
cvttss2si %xmm0,%edi
pop    %rax
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
define float @getValue(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%11 = load float, float* %7
%12 = load float, float* %8
%13 = fmul float %11, %12
%14 = load float, float* %6
%15 = fmul float %13, %14
%16 = call i32 @pow(float %15, float 2.000000e+00)
%17 = sitofp i32 %16 to float
%18 = fdiv float 1.000000e+00, %17
store float %18, float* %9
%19 = load float, float* %5
%20 = call i32 @pow(float %19, float 2.000000e+00)
%21 = sitofp i32 %20 to float
%22 = load float, float* %9
%23 = fadd float 1.000000e+00, %22
%24 = fdiv float %21, %23
%25 = fptosi float %24 to i32
%26 = call float @sqrt(i32 %25)
store float %26, float* %10
%27 = load float, float* %10
ret float %27
}

LLVM IR (-O2):
define float @getValue(float %0, float %1, float %2, float %3) {
%5 = fmul float %2, %3
%6 = fmul float %5, %1
%7 = tail call i32 @pow(float %6, float 2.000000e+00)
%8 = sitofp i32 %7 to float
%9 = fdiv float 1.000000e+00, %8
%10 = tail call i32 @pow(float %0, float 2.000000e+00)
%11 = sitofp i32 %10 to float
%12 = fadd float %9, 1.000000e+00
%13 = fdiv float %11, %12
%14 = fptosi float %13 to i32
%15 = tail call float @sqrt(i32 %14)
ret float %15
}
/* Variables and functions */
int HZ;
int rcu_jiffies_till_stall_check(void) { return 21 * HZ; }


x86 assembly (clang, -O0):
<rcu_jiffies_till_stall_check>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
imul   $0x15,(%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rcu_jiffies_till_stall_check>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
lea    (%rax,%rax,4),%ecx
lea    (%rax,%rcx,4),%eax
ret

LLVM IR (-O0):
@HZ = global i32 0
define i32 @rcu_jiffies_till_stall_check() {
%1 = load i32, i32* @HZ
%2 = mul nsw i32 21, %1
ret i32 %2
}

LLVM IR (-O2):
@HZ = global i32 0
define i32 @rcu_jiffies_till_stall_check() {
%1 = load i32, i32* @HZ
%2 = mul nsw i32 %1, 21
ret i32 %2
}
float ease_linear(float t, float b, float c, float d) { return c * t / d + b; }


x86 assembly (clang, -O0):
<ease_linear>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
divss  -0x10(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ease_linear>:
mulss  %xmm2,%xmm0
divss  %xmm3,%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @ease_linear(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %7
%10 = load float, float* %5
%11 = fmul float %9, %10
%12 = load float, float* %8
%13 = fdiv float %11, %12
%14 = load float, float* %6
%15 = fadd float %13, %14
ret float %15
}

LLVM IR (-O2):
define float @ease_linear(float %0, float %1, float %2, float %3) {
%5 = fmul float %0, %2
%6 = fdiv float %5, %3
%7 = fadd float %6, %1
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int);
int main(void) {
  for (int i = 0;; i++)
    putchar(((i * (i >> 17 | i >> 9) & 46 & i >> 3)) ^
            (i & i >> 10 | i >> 100));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x8(%rbp),%eax
sar    $0x11,%eax
mov    -0x8(%rbp),%ecx
sar    $0x9,%ecx
or     %ecx,%eax
imul   %eax,%edi
and    $0x2e,%edi
mov    -0x8(%rbp),%eax
sar    $0x3,%eax
and    %eax,%edi
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    $0xa,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%edx
mov    $0x64,%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
xor    %eax,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
call   1030 <putchar@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %24, %0
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = ashr i32 %5, 17
%7 = load i32, i32* %2
%8 = ashr i32 %7, 9
%9 = or i32 %6, %8
%10 = mul nsw i32 %4, %9
%11 = and i32 %10, 46
%12 = load i32, i32* %2
%13 = ashr i32 %12, 3
%14 = and i32 %11, %13
%15 = load i32, i32* %2
%16 = load i32, i32* %2
%17 = ashr i32 %16, 10
%18 = and i32 %15, %17
%19 = load i32, i32* %2
%20 = ashr i32 %19, 100
%21 = or i32 %18, %20
%22 = xor i32 %14, %21
%23 = call i32 @putchar(i32 %22)
br label %24
24: ; preds = %3
%25 = load i32, i32* %2
%26 = add nsw i32 %25, 1
store i32 %26, i32* %2
br label %3
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @putchar(i32 poison)
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ PrioUitmeldenID(int, int, int /*<<< orphan*/);
void PrioUitmelden(int prio, int iUitmelding) {
  PrioUitmeldenID(prio, iUitmelding, 0);
}


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

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

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

LLVM IR (-O2):
define void @PrioUitmelden(i32 %0, i32 %1) {
%3 = tail call i32 @PrioUitmeldenID(i32 %0, i32 %1, i32 0)
ret void
}
void eputxc(char chr, int x, int y, int modifier) {
  char *mem = (char *)(0x8000 + x + y * 32);
  *mem = chr + modifier;
}


x86 assembly (clang, -O0):
<eputxc>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x8000,%eax
mov    -0xc(%rbp),%ecx
shl    $0x5,%ecx
add    %ecx,%eax
cltq
mov    %rax,-0x18(%rbp)
movsbl -0x1(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<eputxc>:
movslq %esi,%rax
movslq %edx,%rdx
shl    $0x5,%rdx
add    %dil,%cl
mov    %cl,0x8000(%rax,%rdx,1)
ret

LLVM IR (-O0):
define void @eputxc(i8 signext %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
store i8 %0, i8* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %6
%11 = add nsw i32 32768, %10
%12 = load i32, i32* %7
%13 = mul nsw i32 %12, 32
%14 = add nsw i32 %11, %13
%15 = sext i32 %14 to i64
%16 = inttoptr i64 %15 to i8*
store i8* %16, i8** %9
%17 = load i8, i8* %5
%18 = sext i8 %17 to i32
%19 = load i32, i32* %8
%20 = add nsw i32 %18, %19
%21 = trunc i32 %20 to i8
%22 = load i8*, i8** %9
store i8 %21, i8* %22
ret void
}

LLVM IR (-O2):
define void @eputxc(i8 signext %0, i32 %1, i32 %2, i32 %3) {
%5 = add nsw i32 %1, 32768
%6 = shl nsw i32 %2, 5
%7 = add nsw i32 %5, %6
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
%10 = trunc i32 %3 to i8
%11 = add i8 %10, %0
store i8 %11, i8* %9
ret void
}
void g_list_find() {}


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

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

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

LLVM IR (-O2):
define void @g_list_find() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  int i = 0;
  for (i = -15; i < 15; ++i) {
    printf("%d mod 10 = %d\n", i, i % 10);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0xfffffff1,-0x8(%rbp)
cmpl   $0xf,-0x8(%rbp)
jge    115f <main+0x4f>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0xfffffff1,%ebx
lea    0xee0(%rip),%r14
movslq %ebx,%rbx
imul   $0x66666667,%rbx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
mov    %ebx,%edx
sub    %eax,%edx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0xf,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [16 x i8] c"%d mod 10 = %d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ -15, %0 ], [ %5, %1 ]
%3 = srem i32 %2, 10
%4 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3)
%5 = add nsw i32 %2, 1
%6 = icmp eq i32 %5, 15
br i1 %6, label %7, label %1
7: ; preds = %1
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

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

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


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

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

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

LLVM IR (-O2):
define i32 @get_XVisibilityEvent_send_event(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Type definitions */
struct slice {
  int dummy;
};

/* Variables and functions */
int readBulkFrom(int, struct slice *);
int syncReadBulkFrom(int fd, struct slice *slice) {
  int read = 0;
  do {
    read = readBulkFrom(fd, slice);
  } while (read == 0);
  return read;
}


x86 assembly (clang, -O0):
<syncReadBulkFrom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <readBulkFrom@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1126 <syncReadBulkFrom+0x16>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syncReadBulkFrom>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <readBulkFrom@plt>
test   %eax,%eax
je     1120 <syncReadBulkFrom+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.slice = type { i32 }
define i32 @syncReadBulkFrom(i32 %0, %struct.slice* %1) {
%3 = alloca i32
%4 = alloca %struct.slice*
%5 = alloca i32
store i32 %0, i32* %3
store %struct.slice* %1, %struct.slice** %4
store i32 0, i32* %5
br label %6
6: ; preds = %10, %2
%7 = load i32, i32* %3
%8 = load %struct.slice*, %struct.slice** %4
%9 = call i32 @readBulkFrom(i32 %7, %struct.slice* %8)
store i32 %9, i32* %5
br label %10
10: ; preds = %6
%11 = load i32, i32* %5
%12 = icmp eq i32 %11, 0
br i1 %12, label %6, label %13
13: ; preds = %10
%14 = load i32, i32* %5
ret i32 %14
}

LLVM IR (-O2):
%struct.slice = type { i32 }
define i32 @syncReadBulkFrom(i32 %0, %struct.slice* %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 @readBulkFrom(i32 %0, %struct.slice* %1)
%5 = icmp eq i32 %4, 0
br i1 %5, label %3, label %6
6: ; preds = %3
ret i32 %4
}
int getAlphabeticY(int i, int boardSize) { return 97 + boardSize / 2 - i; }


x86 assembly (clang, -O0):
<getAlphabeticY>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    $0x61,%eax
sub    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getAlphabeticY>:
mov    %esi,%eax
shr    $0x1f,%eax
add    %esi,%eax
sar    %eax
sub    %edi,%eax
add    $0x61,%eax
ret

LLVM IR (-O0):
define i32 @getAlphabeticY(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 = sdiv i32 %5, 2
%7 = add nsw i32 97, %6
%8 = load i32, i32* %3
%9 = sub nsw i32 %7, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @getAlphabeticY(i32 %0, i32 %1) {
%3 = sdiv i32 %1, 2
%4 = sub i32 97, %0
%5 = add i32 %4, %3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int c1 = 1, c2 = 2, c3;
  c3 = 1.0 / c2 * c1;
  printf("%d", 4 > 3 && 7 < 5 - !0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  0xec6(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 2, i32* %3
%5 = load i32, i32* %3
%6 = sitofp i32 %5 to double
%7 = fdiv double 1.000000e+00, %6
%8 = load i32, i32* %2
%9 = sitofp i32 %8 to double
%10 = fmul double %7, %9
%11 = fptosi double %10 to i32
store i32 %11, i32* %4
%12 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}
void v2div(float *restrict a, const float *b, const float *c) {
  a[0] = b[0] / c[0];
  a[1] = b[1] / c[1];
}


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

x86 assembly (clang, -O2):
<v2div>:
movss  (%rsi),%xmm0
divss  (%rdx),%xmm0
movss  %xmm0,(%rdi)
movss  0x4(%rsi),%xmm0
divss  0x4(%rdx),%xmm0
movss  %xmm0,0x4(%rdi)
ret

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

LLVM IR (-O2):
define void @v2div(float* noalias nocapture writeonly %0, float* nocapture %1, float* nocapture %2) {
%4 = load float, float* %1
%5 = load float, float* %2
%6 = fdiv float %4, %5
store float %6, float* %0
%7 = getelementptr inbounds float, float* %1, i64 1
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %2, i64 1
%10 = load float, float* %9
%11 = fdiv float %8, %10
%12 = getelementptr inbounds float, float* %0, i64 1
store float %11, float* %12
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ arr;

/* Variables and functions */
int count(int *, int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int arr[] = {1, 2, 3};
  int m = sizeof(arr) / sizeof(arr[0]);
  int n = 4;
  printf(" %d ", count(arr, m, n));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec8(%rip),%eax
mov    %eax,-0x8(%rbp)
movl   $0x3,-0x14(%rbp)
movl   $0x4,-0x18(%rbp)
lea    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <count@plt>
mov    %eax,%esi
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xede(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xecb(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
mov    $0x3,%esi
mov    $0x4,%edx
call   1030 <count@plt>
lea    0xeb7(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.arr = [3 x i32] [i32 1, i32 2, i32 3]
@.str = [5 x i8] c" %d \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i32]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [3 x i32]* %2 to i8*
store i32 3, i32* %3
store i32 4, i32* %4
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 @count(i32* %6, i32 %7, i32 %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr = [3 x i32] [i32 1, i32 2, i32 3]
@.str = [5 x i8] c" %d \00"
define i32 @main() {
%1 = alloca [3 x i32]
%2 = bitcast [3 x i32]* %1 to i8*
%3 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%4 = call i32 @count(i32* %3, i32 3, i32 4)
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ bootloader_util_reset(int /*<<< orphan*/);
void bootloader_util_app_start(uint32_t start_addr) {
  bootloader_util_reset(start_addr);
}


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

x86 assembly (clang, -O2):
<bootloader_util_app_start>:
jmp    1030 <bootloader_util_reset@plt>

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

LLVM IR (-O2):
define void @bootloader_util_app_start(i32 %0) {
%2 = tail call i32 @bootloader_util_reset(i32 %0)
ret void
}