xunge/DecIR huggingface dataset:
/* Variables and functions */
float bar0(float);
int /*<<< orphan*/ dummy0(float *);
void foo0(long a, long b) {
  float c[0];
  b = 0;
  for (; b < a; b++)
    c[b] = bar0(c[b]);
  dummy0(c);
}


x86 assembly (clang, -O0):
<foo0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jge    1170 <foo0+0x50>
mov    -0x10(%rbp),%rax
movss  -0x14(%rbp,%rax,4),%xmm0
call   1030 <bar0@plt>
mov    -0x10(%rbp),%rax
movss  %xmm0,-0x14(%rbp,%rax,4)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1138 <foo0+0x18>
lea    -0x14(%rbp),%rdi
call   1040 <dummy0@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo0>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <dummy0@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @foo0(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca [0 x float]
store i64 %0, i64* %3
store i64 %1, i64* %4
store i64 0, i64* %4
br label %6
6: ; preds = %17, %2
%7 = load i64, i64* %4
%8 = load i64, i64* %3
%9 = icmp slt i64 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i64, i64* %4
%12 = getelementptr inbounds [0 x float], [0 x float]* %5, i64 0, i64 %11
%13 = load float, float* %12
%14 = call float @bar0(float %13)
%15 = load i64, i64* %4
%16 = getelementptr inbounds [0 x float], [0 x float]* %5, i64 0, i64 %15
store float %14, float* %16
br label %17
17: ; preds = %10
%18 = load i64, i64* %4
%19 = add nsw i64 %18, 1
store i64 %19, i64* %4
br label %6
20: ; preds = %6
%21 = getelementptr inbounds [0 x float], [0 x float]* %5, i64 0, i64 0
%22 = call i32 @dummy0(float* %21)
ret void
}

LLVM IR (-O2):
define void @foo0(i64 %0, i64 %1) {
%3 = alloca [0 x float]
%4 = bitcast [0 x float]* %3 to i8*
%5 = icmp slt i64 %0, 1
%6 = getelementptr inbounds [0 x float], [0 x float]* %3, i64 0, i64 0
%7 = call i32 @dummy0(float* %6)
ret void
}
/* Variables and functions */
int ebbrt_newlib_close(int);
int close(int file) { return ebbrt_newlib_close(file); }


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

x86 assembly (clang, -O2):
<close>:
jmp    1030 <ebbrt_newlib_close@plt>

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

LLVM IR (-O2):
define i32 @close(i32 %0) {
%2 = tail call i32 @ebbrt_newlib_close(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ execl(char *, char *, char *, char *);
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Calling ps f --------------\n");
  execl("/bin/ps", "ps", "-f", (char *)NULL);
  printf("End calling --------------\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
lea    0xedb(%rip),%rsi
lea    0xed7(%rip),%rdx
xor    %eax,%eax
mov    %eax,%ecx
call   1040 <execl@plt>
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
lea    0xeca(%rip),%rsi
lea    0xec6(%rip),%rdx
xor    %ecx,%ecx
call   1040 <execl@plt>
lea    0xed9(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Calling ps \C2\96f --------------\0A\00"
@.str.1 = [8 x i8] c"/bin/ps\00"
@.str.2 = [3 x i8] c"ps\00"
@.str.3 = [3 x i8] c"-f\00"
@.str.4 = [28 x i8] c"End calling --------------\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @execl(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* null)
%4 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [8 x i8] c"/bin/ps\00"
@.str.2 = [3 x i8] c"ps\00"
@.str.3 = [3 x i8] c"-f\00"
@str = [30 x i8] c"Calling ps \C2\96f --------------\00"
@str.5 = [27 x i8] c"End calling --------------\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @execl(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* null)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.5, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int partition(int *, int, int);
void quick_sort(int data[], int p, int r) {
  if (p < r) {
    int q = partition(data, p, r);
    quick_sort(data, p, q - 1);
    quick_sort(data, q + 1, r);
  }
}


x86 assembly (clang, -O0):
<quick_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <quick_sort+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quick_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quick_sort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quick_sort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quick_sort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <quick_sort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quick_sort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @quick_sort(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* %5
%9 = load i32, i32* %6
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %24
11: ; preds = %3
%12 = load i32*, i32** %4
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = call i32 @partition(i32* %12, i32 %13, i32 %14)
store i32 %15, i32* %7
%16 = load i32*, i32** %4
%17 = load i32, i32* %5
%18 = load i32, i32* %7
%19 = sub nsw i32 %18, 1
%20 = load i32*, i32** %4
%21 = load i32, i32* %7
%22 = add nsw i32 %21, 1
%23 = load i32, i32* %6
br label %24
24: ; preds = %11, %3
ret void
}

LLVM IR (-O2):
define void @quick_sort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quick_sort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
int clef(int x, int y) { return (y + ((x + y) * (x + y + 1) / 2)); }


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

x86 assembly (clang, -O2):
<clef>:
lea    (%rsi,%rdi,1),%eax
lea    (%rsi,%rdi,1),%ecx
add    $0x1,%ecx
imul   %eax,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
add    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @clef(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = add nsw i32 %3, 1
%5 = mul nsw i32 %4, %3
%6 = sdiv i32 %5, 2
%7 = add nsw i32 %6, %1
ret i32 %7
}
/* Variables and functions */
double exp(double);
double tanh(double x) {
  double x0 = exp(x);
  double x1 = 1.0 / x0;
  return ((x0 + x1) / (x0 - x1));
}


x86 assembly (clang, -O0):
<tanh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  0xecc(%rip),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
subsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define double @tanh(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
%5 = load double, double* %2
%6 = call double @exp(double %5)
store double %6, double* %3
%7 = load double, double* %3
%8 = fdiv double 1.000000e+00, %7
store double %8, double* %4
%9 = load double, double* %3
%10 = load double, double* %4
%11 = fadd double %9, %10
%12 = load double, double* %3
%13 = load double, double* %4
%14 = fsub double %12, %13
%15 = fdiv double %11, %14
ret double %15
}

LLVM IR (-O2):
define double @tanh(double %0) {
%2 = tail call double @exp(double %0)
%3 = fdiv double 1.000000e+00, %2
%4 = fadd double %2, %3
%5 = fsub double %2, %3
%6 = fdiv double %4, %5
ret double %6
}
void caller_1_1_2_1_1_2_1() {}


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

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

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

LLVM IR (-O2):
define void @caller_1_1_2_1_1_2_1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ willus_mem_free(double **, char *);
void freex(double **x) { willus_mem_free(x, "freex"); }


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

x86 assembly (clang, -O2):
<freex>:
lea    0xee9(%rip),%rsi
jmp    1030 <willus_mem_free@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"freex\00"
define void @freex(double** %0) {
%2 = alloca double**
store double** %0, double*** %2
%3 = load double**, double*** %2
%4 = call i32 @willus_mem_free(double** %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"freex\00"
define void @freex(double** %0) {
%2 = tail call i32 @willus_mem_free(double** %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M909_f(char *s) {
  debug("M909_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M909_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M909_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M909_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M909_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M909_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M909_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
X_Interface(Unit, Function, par1, par2, par3, par4, par5, par6, par7, par8,
            par9, par10) int *Unit,
    Function;
int par1, par2, par3, par4, par5, par6, par7, par8, par9, par10;
{ return (0); }


x86 assembly (clang, -O0):
<X_Interface>:
push   %rbp
mov    %rsp,%rbp
mov    0x38(%rbp),%eax
mov    0x30(%rbp),%eax
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @X_Interface(i32* nocapture readnone %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9, i32 %10, i32 %11) {
ret i32 0
}
/* Variables and functions */
int ksft_exit_pass();
int /*<<< orphan*/ ksft_print_header();
int /*<<< orphan*/ test_pidfd_send_signal_exited_fail();
int /*<<< orphan*/ test_pidfd_send_signal_recycled_pid_fail();
int /*<<< orphan*/ test_pidfd_send_signal_simple_success();
int /*<<< orphan*/ test_pidfd_send_signal_syscall_support();
int main(int argc, char **argv) {
  ksft_print_header();
  test_pidfd_send_signal_syscall_support();
  test_pidfd_send_signal_simple_success();
  test_pidfd_send_signal_exited_fail();
  test_pidfd_send_signal_recycled_pid_fail();
  return ksft_exit_pass();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1080 <ksft_print_header@plt>
mov    $0x0,%al
call   1060 <test_pidfd_send_signal_syscall_support@plt>
mov    $0x0,%al
call   1070 <test_pidfd_send_signal_simple_success@plt>
mov    $0x0,%al
call   1050 <test_pidfd_send_signal_exited_fail@plt>
mov    $0x0,%al
call   1040 <test_pidfd_send_signal_recycled_pid_fail@plt>
mov    $0x0,%al
call   1030 <ksft_exit_pass@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1080 <ksft_print_header@plt>
xor    %eax,%eax
call   1060 <test_pidfd_send_signal_syscall_support@plt>
xor    %eax,%eax
call   1070 <test_pidfd_send_signal_simple_success@plt>
xor    %eax,%eax
call   1050 <test_pidfd_send_signal_exited_fail@plt>
xor    %eax,%eax
call   1040 <test_pidfd_send_signal_recycled_pid_fail@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <ksft_exit_pass@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @ksft_print_header()
%7 = call i32 (...) @test_pidfd_send_signal_syscall_support()
%8 = call i32 (...) @test_pidfd_send_signal_simple_success()
%9 = call i32 (...) @test_pidfd_send_signal_exited_fail()
%10 = call i32 (...) @test_pidfd_send_signal_recycled_pid_fail()
%11 = call i32 (...) @ksft_exit_pass()
ret i32 %11
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @ksft_print_header()
%4 = tail call i32 (...) @test_pidfd_send_signal_syscall_support()
%5 = tail call i32 (...) @test_pidfd_send_signal_simple_success()
%6 = tail call i32 (...) @test_pidfd_send_signal_exited_fail()
%7 = tail call i32 (...) @test_pidfd_send_signal_recycled_pid_fail()
%8 = tail call i32 (...) @ksft_exit_pass()
ret i32 %8
}
int __mp_getoption(long o, unsigned long *v) { return 0; }


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

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

LLVM IR (-O0):
define i32 @__mp_getoption(i64 %0, i64* %1) {
%3 = alloca i64
%4 = alloca i64*
store i64 %0, i64* %3
store i64* %1, i64** %4
ret i32 0
}

LLVM IR (-O2):
define i32 @__mp_getoption(i64 %0, i64* nocapture readnone %1) {
ret i32 0
}
void socfpga_cyclone5_qspi_init(void) { return; }


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

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

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

LLVM IR (-O2):
define void @socfpga_cyclone5_qspi_init() {
ret void
}
/* Variables and functions */
int EPOLLET;
int EPOLLIN;
int EPOLLOUT;
int EPOLLRDHUP;
int /*<<< orphan*/ kore_platform_event_schedule(int, int, int /*<<< orphan*/,
                                                void *);
void kore_platform_event_all(int fd, void *c) {
  kore_platform_event_schedule(fd, EPOLLIN | EPOLLOUT | EPOLLRDHUP | EPOLLET, 0,
                               c);
}


x86 assembly (clang, -O0):
<kore_platform_event_all>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebf(%rip),%rax
mov    (%rax),%esi
mov    0x2ea6(%rip),%rax
or     (%rax),%esi
mov    0x2e95(%rip),%rax
or     (%rax),%esi
mov    0x2e84(%rip),%rax
or     (%rax),%esi
mov    -0x10(%rbp),%rcx
xor    %edx,%edx
call   1030 <kore_platform_event_schedule@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kore_platform_event_all>:
mov    0x2ed1(%rip),%rcx
mov    0x2eba(%rip),%rax
mov    (%rax),%eax
or     (%rcx),%eax
mov    %rsi,%rcx
mov    0x2ea4(%rip),%rdx
or     (%rdx),%eax
mov    0x2e93(%rip),%rdx
or     (%rdx),%eax
mov    %eax,%esi
xor    %edx,%edx
jmp    1030 <kore_platform_event_schedule@plt>

LLVM IR (-O0):
@EPOLLIN = global i32 0
@EPOLLOUT = global i32 0
@EPOLLRDHUP = global i32 0
@EPOLLET = global i32 0
define void @kore_platform_event_all(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i32, i32* @EPOLLIN
%7 = load i32, i32* @EPOLLOUT
%8 = or i32 %6, %7
%9 = load i32, i32* @EPOLLRDHUP
%10 = or i32 %8, %9
%11 = load i32, i32* @EPOLLET
%12 = or i32 %10, %11
%13 = load i8*, i8** %4
%14 = call i32 @kore_platform_event_schedule(i32 %5, i32 %12, i32 0, i8* %13)
ret void
}

LLVM IR (-O2):
@EPOLLIN = global i32 0
@EPOLLOUT = global i32 0
@EPOLLRDHUP = global i32 0
@EPOLLET = global i32 0
define void @kore_platform_event_all(i32 %0, i8* %1) {
%3 = load i32, i32* @EPOLLIN
%4 = load i32, i32* @EPOLLOUT
%5 = or i32 %4, %3
%6 = load i32, i32* @EPOLLRDHUP
%7 = or i32 %5, %6
%8 = load i32, i32* @EPOLLET
%9 = or i32 %7, %8
%10 = tail call i32 @kore_platform_event_schedule(i32 %0, i32 %9, i32 0, i8* %1)
ret void
}
/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
int test_parse_file_size();
int main(void) {
  int ret;
  ret = test_parse_file_size();
  if (ret) {
    return EXIT_FAILURE;
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <test_parse_file_size@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1144 <main+0x34>
mov    0x2ea6(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1150 <main+0x40>
mov    0x2e8d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_parse_file_size@plt>
test   %eax,%eax
jne    1125 <main+0x15>
mov    0x2eb5(%rip),%rax
jmp    112c <main+0x1c>
mov    0x2eb4(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @test_parse_file_size()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = load i32, i32* @EXIT_FAILURE
store i32 %7, i32* %1
br label %10
8: ; preds = %0
%9 = load i32, i32* @EXIT_SUCCESS
store i32 %9, i32* %1
br label %10
10: ; preds = %8, %6
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @test_parse_file_size()
%2 = icmp eq i32 %1, 0
%3 = load i32, i32* @EXIT_SUCCESS
%4 = load i32, i32* @EXIT_FAILURE
%5 = select i1 %2, i32 %3, i32 %4
ret i32 %5
}
/* Variables and functions */
int BooyerMoor(char *, char *);
int /*<<< orphan*/ CalculatedLast(char *);
int /*<<< orphan*/ printf(char *, int);
void main() {
  char *text = "dcabcdabc";
  char *pattern = "abcdabc";
  CalculatedLast(pattern);
  printf("%d\n", BooyerMoor(text, pattern));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xeb8(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <CalculatedLast@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <BooyerMoor@plt>
mov    %eax,%esi
lea    0xe9d(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xeca(%rip),%rbx
mov    %rbx,%rdi
call   1050 <CalculatedLast@plt>
lea    0xeb9(%rip),%rdi
mov    %rbx,%rsi
call   1030 <BooyerMoor@plt>
lea    0xeb4(%rip),%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"dcabcdabc\00"
@.str.1 = [8 x i8] c"abcdabc\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define void @main() {
%1 = tail call i32 @CalculatedLast(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @BooyerMoor(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ barrier();
void rcu_all_qs(void) { barrier(); }


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

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

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

LLVM IR (-O2):
define void @rcu_all_qs() {
%1 = tail call i32 (...) @barrier()
ret void
}
/* Variables and functions */
size_t strlen(const char *src) {
  size_t i = 0;
  while (*src++)
    i++;
  return i;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1139 <strlen+0x39>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @strlen(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
store i64 0, i64* %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 i64, i64* %3
%11 = add i64 %10, 1
store i64 %11, i64* %3
br label %4
12: ; preds = %4
%13 = load i64, i64* %3
ret i64 %13
}

LLVM IR (-O2):
define i64 @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 i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add i64 %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 i64 [ 0, %1 ], [ %8, %4 ]
ret i64 %12
}
void free_Similarity_mat(int **matrix, int dim1) {
  int i;
  for (i = dim1 - 1; i >= 0; i--)
    free(matrix[i]);
  free(matrix);
}


x86 assembly (clang, -O0):
<free_Similarity_mat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1151 <free_Similarity_mat+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1128 <free_Similarity_mat+0x18>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_Similarity_mat>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
test   %esi,%esi
jle    1146 <free_Similarity_mat+0x36>
mov    %esi,%ebx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    -0x2(%rbx),%eax
mov    (%r14,%rax,8),%rdi
call   1030 <free@plt>
add    $0xffffffffffffffff,%rbx
cmp    $0x1,%rbx
ja     1130 <free_Similarity_mat+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_Similarity_mat(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* %4
%7 = sub nsw i32 %6, 1
store i32 %7, i32* %5
br label %8
8: ; preds = %18, %2
%9 = load i32, i32* %5
%10 = icmp sge i32 %9, 0
br i1 %10, label %11, label %21
11: ; preds = %8
%12 = load i32**, i32*** %3
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32*, i32** %12, i64 %14
%16 = load i32*, i32** %15
%17 = bitcast i32* %16 to i8*
br label %18
18: ; preds = %11
%19 = load i32, i32* %5
%20 = add nsw i32 %19, -1
store i32 %20, i32* %5
br label %8
21: ; preds = %8
%22 = load i32**, i32*** %3
%23 = bitcast i32** %22 to i8*
ret void
}

LLVM IR (-O2):
define void @free_Similarity_mat(i32** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %5, %4 ], [ %8, %6 ]
%8 = add nsw i64 %7, -1
%9 = and i64 %8, 4294967295
%10 = getelementptr inbounds i32*, i32** %0, i64 %9
%11 = bitcast i32** %10 to i8**
%12 = load i8*, i8** %11
tail call void @free(i8* %12)
%13 = icmp ugt i64 %7, 1
br i1 %13, label %6, label %14
14: ; preds = %6, %2
%15 = bitcast i32** %0 to i8*
tail call void @free(i8* %15)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ IN_Init();
int /*<<< orphan*/ IN_Shutdown();
void Sys_In_Restart_f(void) {
  IN_Shutdown();
  IN_Init();
}


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

x86 assembly (clang, -O2):
<Sys_In_Restart_f>:
push   %rax
xor    %eax,%eax
call   1030 <IN_Shutdown@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <IN_Init@plt>

LLVM IR (-O0):
define void @Sys_In_Restart_f() {
%1 = call i32 (...) @IN_Shutdown()
%2 = call i32 (...) @IN_Init()
ret void
}

LLVM IR (-O2):
define void @Sys_In_Restart_f() {
%1 = tail call i32 (...) @IN_Shutdown()
%2 = tail call i32 (...) @IN_Init()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ iconv_t;

/* Variables and functions */
size_t locale_str_buflen(char const *);
char *string_do_convert_length(char const *, int /*<<< orphan*/, size_t);
char *string_do_convert(const char *in, iconv_t ic) {
  size_t in_sz = locale_str_buflen(in);
  return string_do_convert_length(in, ic, in_sz);
}


x86 assembly (clang, -O0):
<string_do_convert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <locale_str_buflen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1040 <string_do_convert_length@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_do_convert>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <locale_str_buflen@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %rax,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <string_do_convert_length@plt>

LLVM IR (-O0):
define i8* @string_do_convert(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i64
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = call i64 @locale_str_buflen(i8* %6)
store i64 %7, i64* %5
%8 = load i8*, i8** %3
%9 = load i32, i32* %4
%10 = load i64, i64* %5
%11 = call i8* @string_do_convert_length(i8* %8, i32 %9, i64 %10)
ret i8* %11
}

LLVM IR (-O2):
define i8* @string_do_convert(i8* %0, i32 %1) {
%3 = tail call i64 @locale_str_buflen(i8* %0)
%4 = tail call i8* @string_do_convert_length(i8* %0, i32 %1, i64 %3)
ret i8* %4
}
int string_to_int(char *string) {
  int i, n;
  n = 0;
  for (i = 0; string[i] != '\0'; i++)
    n = (n * 10) + (string[i] - '0');
  return n;
}


x86 assembly (clang, -O0):
<string_to_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1151 <string_to_int+0x51>
imul   $0xa,-0x10(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <string_to_int+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_to_int>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <string_to_int+0x28>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
lea    (%rax,%rax,4),%eax
lea    (%rcx,%rax,2),%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <string_to_int+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @string_to_int(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %4
store i32 0, i32* %3
br label %5
5: ; preds = %24, %1
%6 = load i8*, i8** %2
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %27
13: ; preds = %5
%14 = load i32, i32* %4
%15 = mul nsw i32 %14, 10
%16 = load i8*, i8** %2
%17 = load i32, i32* %3
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = sub nsw i32 %21, 48
%23 = add nsw i32 %15, %22
store i32 %23, i32* %4
br label %24
24: ; preds = %13
%25 = load i32, i32* %3
%26 = add nsw i32 %25, 1
store i32 %26, i32* %3
br label %5
27: ; preds = %5
%28 = load i32, i32* %4
ret i32 %28
}

LLVM IR (-O2):
define i32 @string_to_int(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %12, %4 ], [ 0, %1 ]
%6 = phi i8 [ %14, %4 ], [ %2, %1 ]
%7 = phi i32 [ %11, %4 ], [ 0, %1 ]
%8 = sext i8 %6 to i32
%9 = mul nsw i32 %7, 10
%10 = add i32 %9, -48
%11 = add i32 %10, %8
%12 = add nuw nsw i64 %5, 1
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %4, %1
%17 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %17
}
int ghw_read_eoh(struct ghw_handler *h) { return 0; }


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

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

LLVM IR (-O0):
%struct.ghw_handler = type opaque
define i32 @ghw_read_eoh(%struct.ghw_handler* %0) {
%2 = alloca %struct.ghw_handler*
store %struct.ghw_handler* %0, %struct.ghw_handler** %2
ret i32 0
}

LLVM IR (-O2):
%struct.ghw_handler = type opaque
define i32 @ghw_read_eoh(%struct.ghw_handler* nocapture readnone %0) {
ret i32 0
}
void ptrace_sandbox_permit_accept(struct pt_sandbox *p_sandbox) {
  (void)p_sandbox;
}


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

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

LLVM IR (-O0):
%struct.pt_sandbox = type opaque
define void @ptrace_sandbox_permit_accept(%struct.pt_sandbox* %0) {
%2 = alloca %struct.pt_sandbox*
store %struct.pt_sandbox* %0, %struct.pt_sandbox** %2
%3 = load %struct.pt_sandbox*, %struct.pt_sandbox** %2
ret void
}

LLVM IR (-O2):
%struct.pt_sandbox = type opaque
define void @ptrace_sandbox_permit_accept(%struct.pt_sandbox* nocapture %0) {
ret void
}
/* Variables and functions */
char *get_field_string(int /*<<< orphan*/, int, char *, char *);
int /*<<< orphan*/ get_text_from_identifier(int);
char *get_field_string_from_identifier(int identifier, int no_of_fields,
                                       char *fieldname, char *value) {
  return get_field_string(get_text_from_identifier(identifier), no_of_fields,
                          fieldname, value);
}


x86 assembly (clang, -O0):
<get_field_string_from_identifier>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <get_text_from_identifier@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1030 <get_field_string@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_field_string_from_identifier>:
push   %rbp
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %rdx,%rbx
mov    %esi,%ebp
call   1040 <get_text_from_identifier@plt>
mov    %eax,%edi
mov    %ebp,%esi
mov    %rbx,%rdx
mov    %r14,%rcx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <get_field_string@plt>

LLVM IR (-O0):
define i8* @get_field_string_from_identifier(i32 %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i32, i32* %5
%10 = call i32 @get_text_from_identifier(i32 %9)
%11 = load i32, i32* %6
%12 = load i8*, i8** %7
%13 = load i8*, i8** %8
%14 = call i8* @get_field_string(i32 %10, i32 %11, i8* %12, i8* %13)
ret i8* %14
}

LLVM IR (-O2):
define i8* @get_field_string_from_identifier(i32 %0, i32 %1, i8* %2, i8* %3) {
%5 = tail call i32 @get_text_from_identifier(i32 %0)
%6 = tail call i8* @get_field_string(i32 %5, i32 %1, i8* %2, i8* %3)
ret i8* %6
}
void ShutdownGamespy(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ __clearerr(int /*<<< orphan*/ *);
void clearerr(FILE *stream) { __clearerr(stream); }


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

x86 assembly (clang, -O2):
<clearerr>:
jmp    1030 <__clearerr@plt>

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

LLVM IR (-O2):
define void @clearerr(i32* %0) {
%2 = tail call i32 @__clearerr(i32* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void volatile_store_u8(uint8_t *dest, uint8_t val) {
  *((volatile uint8_t *)dest) = val;
}


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

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

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

LLVM IR (-O2):
define void @volatile_store_u8(i32* %0, i32 %1) {
store volatile i32 %1, i32* %0
ret void
}
unsigned char rotl(unsigned char value, unsigned short int shift) {
  return (value << shift) | (value >> 8 - shift);
}


x86 assembly (clang, -O0):
<rotl>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
movzbl -0x1(%rbp),%eax
movzwl -0x4(%rbp),%ecx
shl    %cl,%eax
movzbl -0x1(%rbp),%edx
movzwl -0x4(%rbp),%esi
mov    $0x8,%ecx
sub    %esi,%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotl>:
mov    %esi,%ecx
mov    %edi,%eax
rol    %cl,%al
ret

LLVM IR (-O0):
define zeroext i8 @rotl(i8 zeroext %0, i16 zeroext %1) {
%3 = alloca i8
%4 = alloca i16
store i8 %0, i8* %3
store i16 %1, i16* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i16, i16* %4
%8 = zext i16 %7 to i32
%9 = shl i32 %6, %8
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = load i16, i16* %4
%13 = zext i16 %12 to i32
%14 = sub nsw i32 8, %13
%15 = ashr i32 %11, %14
%16 = or i32 %9, %15
%17 = trunc i32 %16 to i8
ret i8 %17
}

LLVM IR (-O2):
define zeroext i8 @rotl(i8 zeroext %0, i16 zeroext %1) {
%3 = trunc i16 %1 to i8
%4 = tail call i8 @llvm.fshl.i8(i8 %0, i8 %0, i8 %3)
ret i8 %4
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int input;
};
typedef TYPE_1__ XWMHints;

/* Variables and functions */
void set_XWMHints_input(void *_p, int _v) { ((XWMHints *)_p)->input = (int)_v; }


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

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

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

LLVM IR (-O2):
define void @set_XWMHints_input(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset32(void *, int, int);
void DSPInit(void) {
  memset32((void *)0x00002480, 0xdeadbeef, 0x40);
  memset32((void *)((0x00002480 + 0x40)), 0, 0x40);
}


x86 assembly (clang, -O0):
<DSPInit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2480,%edi
mov    $0xdeadbeef,%esi
mov    $0x40,%edx
call   1030 <memset32@plt>
mov    $0x24c0,%edi
xor    %esi,%esi
mov    $0x40,%edx
call   1030 <memset32@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DSPInit>:
push   %rax
mov    $0x2480,%edi
mov    $0xdeadbeef,%esi
mov    $0x40,%edx
call   1030 <memset32@plt>
mov    $0x24c0,%edi
xor    %esi,%esi
mov    $0x40,%edx
pop    %rax
jmp    1030 <memset32@plt>

LLVM IR (-O0):
define void @DSPInit() {
%1 = call i32 @memset32(i8* inttoptr (i64 9344 to i8*), i32 -559038737, i32 64)
%2 = call i32 @memset32(i8* inttoptr (i64 9408 to i8*), i32 0, i32 64)
ret void
}

LLVM IR (-O2):
define void @DSPInit() {
%1 = tail call i32 @memset32(i8* inttoptr (i64 9344 to i8*), i32 -559038737, i32 64)
%2 = tail call i32 @memset32(i8* inttoptr (i64 9408 to i8*), i32 0, i32 64)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float volatile);
float sqrtf(float volatile);
int main() {
  volatile float x, y;
  x = 4.0f;
  y = sqrtf(x);
  printf("%e\n", y);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  0xed0(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <sqrtf@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x40800000,0x4(%rsp)
40
movss  0x4(%rsp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     113d <main+0x1d>
sqrtss %xmm0,%xmm0
jmp    1142 <main+0x22>
call   1040 <sqrtf@plt>
movss  %xmm0,(%rsp)
movss  (%rsp),%xmm0
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%e\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = bitcast float* %1 to i8*
%4 = bitcast float* %2 to i8*
store volatile float 4.000000e+00, float* %1
%5 = load volatile float, float* %1
%6 = tail call float @sqrtf(float %5)
store volatile float %6, float* %2
%7 = load volatile float, float* %2
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float %7)
ret i32 0
}
void pgxpPsxNULL() {}


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

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

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

LLVM IR (-O2):
define void @pgxpPsxNULL() {
ret void
}
int f(int a) { return a == 10 ? 73 : 72; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x48,%eax
mov    $0x49,%ecx
cmp    $0xa,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
xor    %eax,%eax
cmp    $0xa,%edi
sete   %al
or     $0x48,%eax
ret

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 10
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 73, i32 72
ret i32 %6
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = icmp eq i32 %0, 10
%3 = select i1 %2, i32 73, i32 72
ret i32 %3
}
/* Type definitions */
struct passwd {
  int pw_uid;
};

/* Variables and functions */
struct passwd *getpwnam(char *);
unsigned get_system_uid() {
  struct passwd *ppwd = getpwnam("system");
  if (NULL == ppwd)
    return 1000;
  return ppwd->pw_uid;
}


x86 assembly (clang, -O0):
<get_system_uid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <getpwnam@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    1140 <get_system_uid+0x30>
movl   $0x3e8,-0x4(%rbp)
jmp    1149 <get_system_uid+0x39>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_system_uid>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <getpwnam@plt>
test   %rax,%rax
je     1126 <get_system_uid+0x16>
mov    (%rax),%eax
pop    %rcx
ret
mov    $0x3e8,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.passwd = type { i32 }
@.str = [7 x i8] c"system\00"
define i32 @get_system_uid() {
%1 = tail call %struct.passwd* @getpwnam(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq %struct.passwd* %1, null
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = getelementptr inbounds %struct.passwd, %struct.passwd* %1, i64 0, i32 0
%5 = load i32, i32* %4
br label %6
6: ; preds = %0, %3
%7 = phi i32 [ %5, %3 ], [ 1000, %0 ]
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ WStoSPI(int /*<<< orphan*/ *, int /*<<< orphan*/);
void WSBtoSPI(uint8_t *pi8SPIData, uint8_t ui8Color) {
  WStoSPI(pi8SPIData + (8 * 2), ui8Color);
}


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

x86 assembly (clang, -O2):
<WSBtoSPI>:
add    $0x40,%rdi
jmp    1030 <WStoSPI@plt>

LLVM IR (-O0):
define void @WSBtoSPI(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 = getelementptr inbounds i32, i32* %5, i64 16
%7 = load i32, i32* %4
%8 = call i32 @WStoSPI(i32* %6, i32 %7)
ret void
}

LLVM IR (-O2):
define void @WSBtoSPI(i32* %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 16
%4 = tail call i32 @WStoSPI(i32* %3, i32 %1)
ret void
}