xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ countingSort(int *, int);
int main() {
  int test1[] = {2, 6, 4, 3, 2, 3, 4, 6, 3, 4, 3, 5, 2, 6};
  int size1 = 14;
  countingSort(test1, size1);
  int test2[] = {5, 6, 7, 8, 5};
  int size2 = 5;
  countingSort(test2, size2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xec6(%rip),%rsi
mov    $0x38,%edx
call   1030 <memcpy@plt>
movl   $0xe,-0x44(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x44(%rbp),%esi
call   1040 <countingSort@plt>
mov    0xee2(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0xedf(%rip),%rax
mov    %rax,-0x58(%rbp)
mov    0xedd(%rip),%eax
mov    %eax,-0x50(%rbp)
movl   $0x5,-0x64(%rbp)
lea    -0x60(%rbp),%rdi
mov    -0x64(%rbp),%esi
call   1040 <countingSort@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x58,%rsp
mov    0xf15(%rip),%rax
mov    %rax,0x50(%rsp)
movaps 0xef9(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xedd(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xec1(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
lea    0x20(%rsp),%rdi
mov    $0xe,%esi
call   1030 <countingSort@plt>
mov    0xef7(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xedc(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x5,%esi
call   1030 <countingSort@plt>
xor    %eax,%eax
add    $0x58,%rsp
ret

LLVM IR (-O0):
@__const.main.test1 = [14 x i32] [i32 2, i32 6, i32 4, i32 3, i32 2, i32 3, i32 4, i32 6, i32 3, i32 4, i32 3, i32 5, i32 2, i32 6]
@__const.main.test2 = [5 x i32] [i32 5, i32 6, i32 7, i32 8, i32 5]
define i32 @main() {
%1 = alloca i32
%2 = alloca [14 x i32]
%3 = alloca i32
%4 = alloca [5 x i32]
%5 = alloca i32
store i32 0, i32* %1
%6 = bitcast [14 x i32]* %2 to i8*
store i32 14, i32* %3
%7 = getelementptr inbounds [14 x i32], [14 x i32]* %2, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call i32 @countingSort(i32* %7, i32 %8)
%10 = bitcast [5 x i32]* %4 to i8*
store i32 5, i32* %5
%11 = getelementptr inbounds [5 x i32], [5 x i32]* %4, i64 0, i64 0
%12 = load i32, i32* %5
%13 = call i32 @countingSort(i32* %11, i32 %12)
ret i32 0
}

LLVM IR (-O2):
@__const.main.test1 = [14 x i32] [i32 2, i32 6, i32 4, i32 3, i32 2, i32 3, i32 4, i32 6, i32 3, i32 4, i32 3, i32 5, i32 2, i32 6]
@__const.main.test2 = [5 x i32] [i32 5, i32 6, i32 7, i32 8, i32 5]
define i32 @main() {
%1 = alloca [14 x i32]
%2 = alloca [5 x i32]
%3 = bitcast [14 x i32]* %1 to i8*
%4 = getelementptr inbounds [14 x i32], [14 x i32]* %1, i64 0, i64 0
%5 = call i32 @countingSort(i32* %4, i32 14)
%6 = bitcast [5 x i32]* %2 to i8*
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%8 = call i32 @countingSort(i32* %7, i32 5)
ret i32 0
}
int p_b(int b, int p) { return (b > p); }


x86 assembly (clang, -O0):
<p_b>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<p_b>:
xor    %eax,%eax
cmp    %esi,%edi
setg   %al
ret

LLVM IR (-O0):
define i32 @p_b(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 = icmp sgt i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @p_b(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ EUID_ROOT();
int /*<<< orphan*/ delete_run_files(int /*<<< orphan*/);
int /*<<< orphan*/ getpid();
void clear_atexit(void) {
  EUID_ROOT();
  delete_run_files(getpid());
}


x86 assembly (clang, -O0):
<clear_atexit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <EUID_ROOT@plt>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%edi
call   1040 <delete_run_files@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_atexit>:
push   %rax
xor    %eax,%eax
call   1050 <EUID_ROOT@plt>
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <delete_run_files@plt>

LLVM IR (-O0):
define void @clear_atexit() {
%1 = call i32 (...) @EUID_ROOT()
%2 = call i32 (...) @getpid()
%3 = call i32 @delete_run_files(i32 %2)
ret void
}

LLVM IR (-O2):
define void @clear_atexit() {
%1 = tail call i32 (...) @EUID_ROOT()
%2 = tail call i32 (...) @getpid()
%3 = tail call i32 @delete_run_files(i32 %2)
ret void
}
/* Variables and functions */
char tolower(char);
void strntolower(char *s, int n) {
  int i;
  for (i = 0; i < n; i++) {
    s[i] = tolower(s[i]);
  }
}


x86 assembly (clang, -O0):
<strntolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115e <strntolower+0x4e>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <tolower@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <strntolower+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strntolower>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1147 <strntolower+0x37>
mov    %rdi,%r15
mov    %esi,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%edi
call   1030 <tolower@plt>
mov    %al,(%r15,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1130 <strntolower+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @strntolower(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %21, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %24
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i8, i8* %14
%16 = call signext i8 @tolower(i8 signext %15)
%17 = load i8*, i8** %3
%18 = load i32, i32* %5
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %17, i64 %19
store i8 %16, i8* %20
br label %21
21: ; preds = %10
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 1
store i32 %23, i32* %5
br label %6
24: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @strntolower(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call signext i8 @tolower(i8 signext %9)
store i8 %10, i8* %8
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
int test_imm_23int8_reg(signed char val) {
  return ((val) & (-0x23 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_23int8_reg>:
test   $0xdd,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_23int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, -35
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_23int8_reg(i8 signext %0) {
%2 = and i8 %0, -35
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int ordering_lt(void) { return (-1); }


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

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

LLVM IR (-O0):
define i32 @ordering_lt() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @ordering_lt() {
ret i32 -1
}
/* Variables and functions */
int spawnve(int, char const *, char const **, char const **);
int execve(const char *path, const char **argv, const char **envp) {
  return spawnve(3, path, argv, envp);
}


x86 assembly (clang, -O0):
<execve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x3,%edi
call   1030 <spawnve@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execve>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x3,%edi
jmp    1030 <spawnve@plt>

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

LLVM IR (-O2):
define i32 @execve(i8* %0, i8** %1, i8** %2) {
%4 = tail call i32 @spawnve(i32 3, i8* %0, i8** %1, i8** %2)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ newprivkey;

/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
int /*<<< orphan*/ explicit_bzero(char *, int);
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ strcpy(char *, char *);
void explicit_bzero3_out_ofbound() {
  char *privkey = (char *)malloc(7);
  const char newprivkey[10] = "mysafekey";
  strcpy(privkey, "random");
  explicit_bzero(privkey, sizeof(newprivkey));
  clang_analyzer_eval(privkey[0] == '\0');
  free(privkey);
}


x86 assembly (clang, -O0):
<explicit_bzero3_out_ofbound>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x7,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    0xe93(%rip),%rax
mov    %rax,-0x12(%rbp)
mov    0xe90(%rip),%ax
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe83(%rip),%rsi
call   1040 <strcpy@plt>
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1060 <explicit_bzero@plt>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1070 <clang_analyzer_eval@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<explicit_bzero3_out_ofbound>:
push   %rbx
mov    $0x7,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
lea    0xe9b(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1060 <explicit_bzero@plt>
xor    %edi,%edi
cmpb   $0x0,(%rbx)
sete   %dil
call   1070 <clang_analyzer_eval@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@__const.explicit_bzero3_out_ofbound.newprivkey = [10 x i8] c"mysafekey\00"
@.str = [7 x i8] c"random\00"
define void @explicit_bzero3_out_ofbound() {
%1 = alloca i8*
%2 = alloca [10 x i8]
%3 = call i64 @malloc(i32 7)
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %1
%5 = bitcast [10 x i8]* %2 to i8*
%6 = load i8*, i8** %1
%7 = call i32 @strcpy(i8* %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%8 = load i8*, i8** %1
%9 = call i32 @explicit_bzero(i8* %8, i32 10)
%10 = load i8*, i8** %1
%11 = getelementptr inbounds i8, i8* %10, i64 0
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 0
%15 = zext i1 %14 to i32
%16 = call i32 @clang_analyzer_eval(i32 %15)
%17 = load i8*, i8** %1
%18 = call i32 @free(i8* %17)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"random\00"
define void @explicit_bzero3_out_ofbound() {
%1 = tail call i64 @malloc(i32 7)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @explicit_bzero(i8* %2, i32 10)
%5 = load i8, i8* %2
%6 = icmp eq i8 %5, 0
%7 = zext i1 %6 to i32
%8 = tail call i32 @clang_analyzer_eval(i32 %7)
%9 = tail call i32 @free(i8* %2)
ret void
}
void eulerStep(double (*f)(double, double), double t0, double y0, double h,
               int i, double *t, double *y) {
  *t = t0 + h * i;
  *y = y0 + h * (*f)(t0, y0);
}


x86 assembly (clang, -O0):
<eulerStep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
mov    %esi,-0x24(%rbp)
mov    %rdx,-0x30(%rbp)
mov    %rcx,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
cvtsi2sdl -0x24(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x8(%rbp),%rax
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   *%rax
movsd  -0x48(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x40(%rbp),%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x38(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eulerStep>:
push   %rbx
sub    $0x10,%rsp
cvtsi2sd %esi,%xmm3
mov    %rcx,%rbx
movsd  %xmm2,0x8(%rsp)
movsd  %xmm1,(%rsp)
mulsd  %xmm2,%xmm3
addsd  %xmm0,%xmm3
movsd  %xmm3,(%rdx)
call   *%rdi
mulsd  0x8(%rsp),%xmm0
addsd  (%rsp),%xmm0
movsd  %xmm0,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @eulerStep(double (double, double)* %0, double %1, double %2, double %3, i32 %4, double* %5, double* %6) {
%8 = alloca double (double, double)*
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca i32
%13 = alloca double*
%14 = alloca double*
store double (double, double)* %0, double (double, double)** %8
store double %1, double* %9
store double %2, double* %10
store double %3, double* %11
store i32 %4, i32* %12
store double* %5, double** %13
store double* %6, double** %14
%15 = load double, double* %9
%16 = load double, double* %11
%17 = load i32, i32* %12
%18 = sitofp i32 %17 to double
%19 = call double @llvm.fmuladd.f64(double %16, double %18, double %15)
%20 = load double*, double** %13
store double %19, double* %20
%21 = load double, double* %10
%22 = load double, double* %11
%23 = load double (double, double)*, double (double, double)** %8
%24 = load double, double* %9
%25 = load double, double* %10
%26 = call double %23(double %24, double %25)
%27 = call double @llvm.fmuladd.f64(double %22, double %26, double %21)
%28 = load double*, double** %14
store double %27, double* %28
ret void
}

LLVM IR (-O2):
define void @eulerStep(double (double, double)* nocapture %0, double %1, double %2, double %3, i32 %4, double* nocapture writeonly %5, double* nocapture writeonly %6) {
%8 = sitofp i32 %4 to double
%9 = tail call double @llvm.fmuladd.f64(double %3, double %8, double %1)
store double %9, double* %5
%10 = tail call double %0(double %1, double %2)
%11 = tail call double @llvm.fmuladd.f64(double %3, double %10, double %2)
store double %11, double* %6
ret void
}
void Cyc_Core_rufree_nop(struct _RegionHandle *r, unsigned char *ptr) {}


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

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

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

LLVM IR (-O2):
%struct._RegionHandle = type opaque
define void @Cyc_Core_rufree_nop(%struct._RegionHandle* nocapture %0, i8* nocapture %1) {
ret void
}
void myfunc(char *msg) {}


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

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

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

LLVM IR (-O2):
define void @myfunc(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_error();
void error(void) {
  {
  ERROR:
    __VERIFIER_error();
    return;
  }
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <error+0x9>
mov    $0x0,%al
call   1030 <__VERIFIER_error@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @error() {
br label %1
1: ; preds = %0
%2 = call i32 (...) @__VERIFIER_error()
ret void
}

LLVM IR (-O2):
define void @error() {
%1 = tail call i32 (...) @__VERIFIER_error()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ system(char *);
int rp_app_exit(void) {
  fprintf(stderr, "Stopping MCPHA server.\n");
  system("/opt/redpitaya/www/apps/mcpha/stop.sh");
  return 0;
}


x86 assembly (clang, -O0):
<rp_app_exit>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
lea    0xed8(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rp_app_exit>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
lea    0xedb(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Stopping MCPHA server.\0A\00"
@.str.1 = [38 x i8] c"/opt/redpitaya/www/apps/mcpha/stop.sh\00"
define i32 @rp_app_exit() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @system(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Stopping MCPHA server.\0A\00"
@.str.1 = [38 x i8] c"/opt/redpitaya/www/apps/mcpha/stop.sh\00"
define i32 @rp_app_exit() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @system(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int const uint16_t;

/* Variables and functions */
uint16_t adts_get_fullness(const uint8_t *p_adts) {
  return ((p_adts[5] & 0x1f) << 6) | (p_adts[6] >> 2);
}


x86 assembly (clang, -O0):
<adts_get_fullness>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%eax
and    $0x1f,%eax
shl    $0x6,%eax
mov    -0x8(%rbp),%rcx
mov    0x18(%rcx),%ecx
sar    $0x2,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adts_get_fullness>:
mov    0x14(%rdi),%ecx
mov    0x18(%rdi),%eax
and    $0x1f,%ecx
shl    $0x6,%ecx
sar    $0x2,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @adts_get_fullness(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 5
%5 = load i32, i32* %4
%6 = and i32 %5, 31
%7 = shl i32 %6, 6
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 6
%10 = load i32, i32* %9
%11 = ashr i32 %10, 2
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @adts_get_fullness(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 5
%3 = load i32, i32* %2
%4 = shl i32 %3, 6
%5 = and i32 %4, 1984
%6 = getelementptr inbounds i32, i32* %0, i64 6
%7 = load i32, i32* %6
%8 = ashr i32 %7, 2
%9 = or i32 %5, %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ SwtAdd(double, double, double);
void SumAdd(double x, double y) { SwtAdd(x, y, (double)1.0); }


x86 assembly (clang, -O0):
<SumAdd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xecc(%rip),%xmm2
call   1030 <SwtAdd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SumAdd>:
movsd  0xee8(%rip),%xmm2
jmp    1030 <SwtAdd@plt>

LLVM IR (-O0):
define void @SumAdd(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call i32 @SwtAdd(double %5, double %6, double 1.000000e+00)
ret void
}

LLVM IR (-O2):
define void @SumAdd(double %0, double %1) {
%3 = tail call i32 @SwtAdd(double %0, double %1, double 1.000000e+00)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_store_pd(double *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, double, double);
void print128(__m128d val) {
  double a[2];
  _mm_store_pd(&a[0], val);
  printf("%f %f\n", a[0], a[1]);
}


x86 assembly (clang, -O0):
<print128>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1030 <_mm_store_pd@plt>
movsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print128>:
sub    $0x18,%rsp
mov    %edi,%esi
mov    %rsp,%rdi
call   1030 <_mm_store_pd@plt>
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
lea    0xec0(%rip),%rdi
call   1040 <printf@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%f %f\0A\00"
define void @print128(i32 %0) {
%2 = alloca [2 x double]
%3 = bitcast [2 x double]* %2 to i8*
%4 = getelementptr inbounds [2 x double], [2 x double]* %2, i64 0, i64 0
%5 = call i32 @_mm_store_pd(double* %4, i32 %0)
%6 = load double, double* %4
%7 = getelementptr inbounds [2 x double], [2 x double]* %2, i64 0, i64 1
%8 = load double, double* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %6, double %8)
ret void
}
unsigned int round_two_power(unsigned int n) {
  n = n - 1;
  n = n | (n >> 1);
  n = n | (n >> 2);
  n = n | (n >> 4);
  n = n | (n >> 8);
  n = n | (n >> 16);
  n = n + 1;
  return n;
}


x86 assembly (clang, -O0):
<round_two_power>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x1,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x2,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x4,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x10,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_two_power>:
lea    -0x1(%rdi),%eax
mov    %eax,%ecx
shr    %ecx
or     %eax,%ecx
mov    %ecx,%eax
shr    $0x2,%eax
or     %ecx,%eax
mov    %eax,%ecx
shr    $0x4,%ecx
or     %eax,%ecx
mov    %ecx,%edx
shr    $0x8,%edx
or     %ecx,%edx
mov    %edx,%eax
shr    $0x10,%eax
or     %edx,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @round_two_power(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub i32 %3, 1
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = load i32, i32* %2
%7 = lshr i32 %6, 1
%8 = or i32 %5, %7
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = load i32, i32* %2
%11 = lshr i32 %10, 2
%12 = or i32 %9, %11
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = load i32, i32* %2
%15 = lshr i32 %14, 4
%16 = or i32 %13, %15
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = load i32, i32* %2
%19 = lshr i32 %18, 8
%20 = or i32 %17, %19
store i32 %20, i32* %2
%21 = load i32, i32* %2
%22 = load i32, i32* %2
%23 = lshr i32 %22, 16
%24 = or i32 %21, %23
store i32 %24, i32* %2
%25 = load i32, i32* %2
%26 = add i32 %25, 1
store i32 %26, i32* %2
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @round_two_power(i32 %0) {
%2 = add i32 %0, -1
%3 = lshr i32 %2, 1
%4 = or i32 %3, %2
%5 = lshr i32 %4, 2
%6 = or i32 %5, %4
%7 = lshr i32 %6, 4
%8 = or i32 %7, %6
%9 = lshr i32 %8, 8
%10 = or i32 %9, %8
%11 = lshr i32 %10, 16
%12 = or i32 %11, %10
%13 = add i32 %12, 1
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() {
  char name[40];
  printf("Enter your name:\n");
}


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"Enter your name:\0A\00"
define i32 @main() {
%1 = alloca [40 x i8]
%2 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [17 x i8] c"Enter your name:\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int f_ge_rm2(float a1, float *a2) { return !(((a1) >= (*a2))); }


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

x86 assembly (clang, -O2):
<f_ge_rm2>:
xor    %eax,%eax
ucomiss (%rdi),%xmm0
setb   %al
ret

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

LLVM IR (-O2):
define i32 @f_ge_rm2(float %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = fcmp ugt float %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ hoc_pushx(int);
int /*<<< orphan*/ hoc_ret();
hoc_Plt() {
  hoc_ret();
  hoc_pushx(0.);
}


x86 assembly (clang, -O0):
<hoc_Plt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <hoc_ret@plt>
xor    %edi,%edi
call   1040 <hoc_pushx@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hoc_Plt>:
push   %rax
xor    %eax,%eax
call   1030 <hoc_ret@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <hoc_pushx@plt>

LLVM IR (-O0):
define i32 @hoc_Plt() {
%1 = alloca i32
%2 = call i32 (...) @hoc_ret()
%3 = call i32 @hoc_pushx(i32 0)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @hoc_Plt() {
%1 = tail call i32 (...) @hoc_ret()
%2 = tail call i32 @hoc_pushx(i32 0)
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ GLint;
typedef int /*<<< orphan*/ GLenum;

/* Variables and functions */
int /*<<< orphan*/ __glGetPixelMap_size(int /*<<< orphan*/);
GLint __glGetPixelMapusv_size(GLenum map) { return __glGetPixelMap_size(map); }


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

x86 assembly (clang, -O2):
<__glGetPixelMapusv_size>:
jmp    1030 <__glGetPixelMap_size@plt>

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

LLVM IR (-O2):
define i32 @__glGetPixelMapusv_size(i32 %0) {
%2 = tail call i32 @__glGetPixelMap_size(i32 %0)
ret i32 %2
}
/* Type definitions */
struct sockaddr {
  int dummy;
};

/* Variables and functions */
int errno;
int recvfrom(int, char *, int, int, struct sockaddr *, unsigned int *);
int os_recvfrom(int s, char *buf, int len, int flags, struct sockaddr *from,
                unsigned int *fromlen) {
  int retval;
  retval = recvfrom(s, buf, len, flags, from, fromlen);
  if (retval == -1)
    retval = -errno;
  return retval;
}


x86 assembly (clang, -O0):
<os_recvfrom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
call   1030 <recvfrom@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0xffffffff,-0x2c(%rbp)
jne    1162 <os_recvfrom+0x52>
xor    %eax,%eax
mov    0x2e83(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_recvfrom>:
push   %rax
call   1030 <recvfrom@plt>
mov    0x2ec3(%rip),%rcx
xor    %edx,%edx
sub    (%rcx),%edx
cmp    $0xffffffff,%eax
cmove  %edx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
@errno = global i32 0
define i32 @os_recvfrom(i32 %0, i8* %1, i32 %2, i32 %3, %struct.sockaddr* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca %struct.sockaddr*
%12 = alloca i32*
%13 = alloca i32
store i32 %0, i32* %7
store i8* %1, i8** %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store %struct.sockaddr* %4, %struct.sockaddr** %11
store i32* %5, i32** %12
%14 = load i32, i32* %7
%15 = load i8*, i8** %8
%16 = load i32, i32* %9
%17 = load i32, i32* %10
%18 = load %struct.sockaddr*, %struct.sockaddr** %11
%19 = load i32*, i32** %12
%20 = call i32 @recvfrom(i32 %14, i8* %15, i32 %16, i32 %17, %struct.sockaddr* %18, i32* %19)
store i32 %20, i32* %13
%21 = load i32, i32* %13
%22 = icmp eq i32 %21, -1
br i1 %22, label %23, label %26
23: ; preds = %6
%24 = load i32, i32* @errno
%25 = sub nsw i32 0, %24
store i32 %25, i32* %13
br label %26
26: ; preds = %23, %6
%27 = load i32, i32* %13
ret i32 %27
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
@errno = global i32 0
define i32 @os_recvfrom(i32 %0, i8* %1, i32 %2, i32 %3, %struct.sockaddr* %4, i32* %5) {
%7 = tail call i32 @recvfrom(i32 %0, i8* %1, i32 %2, i32 %3, %struct.sockaddr* %4, i32* %5)
%8 = icmp eq i32 %7, -1
%9 = load i32, i32* @errno
%10 = sub nsw i32 0, %9
%11 = select i1 %8, i32 %10, i32 %7
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ test(double);
int main() {
  test(12.0);
  test(12.345);
  test(12.345555555555);
  test(12.3450);
  test(12.34555555555555555555);
  test(1.2345e+54);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xef9(%rip),%xmm0
call   1030 <test@plt>
movsd  0xedc(%rip),%xmm0
call   1030 <test@plt>
movsd  0xed7(%rip),%xmm0
call   1030 <test@plt>
movsd  0xec2(%rip),%xmm0
call   1030 <test@plt>
movsd  0xead(%rip),%xmm0
call   1030 <test@plt>
movsd  0xe98(%rip),%xmm0
call   1030 <test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xee7(%rip),%xmm0
call   1030 <test@plt>
movsd  0xee2(%rip),%xmm0
call   1030 <test@plt>
movsd  0xedd(%rip),%xmm0
call   1030 <test@plt>
movsd  0xec8(%rip),%xmm0
call   1030 <test@plt>
movsd  0xecb(%rip),%xmm0
call   1030 <test@plt>
movsd  0xec6(%rip),%xmm0
call   1030 <test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @test(double 1.200000e+01)
%3 = call i32 @test(double 1.234500e+01)
%4 = call i32 @test(double 0x4028B0ECA8641EA3)
%5 = call i32 @test(double 1.234500e+01)
%6 = call i32 @test(double 0x4028B0ECA8641FDC)
%7 = call i32 @test(double 1.234500e+54)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test(double 1.200000e+01)
%2 = tail call i32 @test(double 1.234500e+01)
%3 = tail call i32 @test(double 0x4028B0ECA8641EA3)
%4 = tail call i32 @test(double 1.234500e+01)
%5 = tail call i32 @test(double 0x4028B0ECA8641FDC)
%6 = tail call i32 @test(double 1.234500e+54)
ret i32 0
}
void mod_udpd_is_GPL_compatible() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ kill(int /*<<< orphan*/, int);
void restart_adb(pid_t pid) { kill(pid, 9); }


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

x86 assembly (clang, -O2):
<restart_adb>:
mov    $0x9,%esi
jmp    1030 <kill@plt>

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

LLVM IR (-O2):
define void @restart_adb(i32 %0) {
%2 = tail call i32 @kill(i32 %0, i32 9)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
__attribute__((always_)) void uvisor_write32(uint32_t volatile *addr,
                                             uint32_t val) {
  *(addr) = val;
}


x86 assembly (clang, -O0):
<uvisor_write32>:
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):
<uvisor_write32>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @uvisor_write32(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 @uvisor_write32(i32* %0, i32 %1) {
store volatile i32 %1, i32* %0
ret void
}
int square(int squareOf) { return squareOf * squareOf; }


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

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

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

LLVM IR (-O2):
define i32 @square(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int __uportsys_getsockopt(int, int, int, void *, int /*<<< orphan*/ *,
                          int /*<<< orphan*/ *);
int /*<<< orphan*/ errno;
int getsockopt(int sd, int level, int opt_name, void *opt_value,
               socklen_t *opt_len) {
  return __uportsys_getsockopt(sd, level, opt_name, opt_value, opt_len, &errno);
}


x86 assembly (clang, -O0):
<getsockopt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    0x2e9f(%rip),%r9
call   1030 <__uportsys_getsockopt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getsockopt>:
mov    0x2ec9(%rip),%r9
jmp    1030 <__uportsys_getsockopt@plt>

LLVM IR (-O0):
@errno = global i32 0
define i32 @getsockopt(i32 %0, i32 %1, i32 %2, i8* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32*
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i32* %4, i32** %10
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i8*, i8** %9
%15 = load i32*, i32** %10
%16 = call i32 @__uportsys_getsockopt(i32 %11, i32 %12, i32 %13, i8* %14, i32* %15, i32* @errno)
ret i32 %16
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @getsockopt(i32 %0, i32 %1, i32 %2, i8* %3, i32* %4) {
%6 = tail call i32 @__uportsys_getsockopt(i32 %0, i32 %1, i32 %2, i8* %3, i32* %4, i32* @errno)
ret i32 %6
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ nios_pkt_8x8_pack(int *, int, int, int, int);
void nios_pkt_8x8_resp_pack(uint8_t *buf, uint8_t target, bool write,
                            uint8_t addr, uint8_t data, bool success) {
  nios_pkt_8x8_pack(buf, target, write, addr, data);
  if (success) {
    buf[2] |= (1 << 1);
  }
}


x86 assembly (clang, -O0):
<nios_pkt_8x8_resp_pack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
call   1030 <nios_pkt_8x8_pack@plt>
cmpl   $0x0,-0x1c(%rbp)
je     115a <nios_pkt_8x8_resp_pack+0x4a>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%ecx
or     $0x2,%ecx
mov    %ecx,0x8(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nios_pkt_8x8_resp_pack>:
push   %rbp
push   %rbx
push   %rax
mov    %r9d,%ebp
mov    %rdi,%rbx
call   1030 <nios_pkt_8x8_pack@plt>
test   %ebp,%ebp
je     1126 <nios_pkt_8x8_resp_pack+0x16>
orb    $0x2,0x8(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @nios_pkt_8x8_resp_pack(i32* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32* %0, i32** %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i32*, i32** %7
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = load i32, i32* %10
%17 = load i32, i32* %11
%18 = call i32 @nios_pkt_8x8_pack(i32* %13, i32 %14, i32 %15, i32 %16, i32 %17)
%19 = load i32, i32* %12
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %26
21: ; preds = %6
%22 = load i32*, i32** %7
%23 = getelementptr inbounds i32, i32* %22, i64 2
%24 = load i32, i32* %23
%25 = or i32 %24, 2
store i32 %25, i32* %23
br label %26
26: ; preds = %21, %6
ret void
}

LLVM IR (-O2):
define void @nios_pkt_8x8_resp_pack(i32* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = tail call i32 @nios_pkt_8x8_pack(i32* %0, i32 %1, i32 %2, i32 %3, i32 %4)
%8 = icmp eq i32 %5, 0
br i1 %8, label %13, label %9
9: ; preds = %6
%10 = getelementptr inbounds i32, i32* %0, i64 2
%11 = load i32, i32* %10
%12 = or i32 %11, 2
store i32 %12, i32* %10
br label %13
13: ; preds = %9, %6
ret void
}
/* Type definitions */
struct dentry {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __fist_print_generic_dentry(char const *, char const *,
                                               struct dentry const *, int);
void fist_print_generic_dentry3(const char *str, const char *str2,
                                const struct dentry *dentry) {
  __fist_print_generic_dentry(str, str2, dentry, 1);
}


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

x86 assembly (clang, -O2):
<fist_print_generic_dentry3>:
mov    $0x1,%ecx
jmp    1030 <__fist_print_generic_dentry@plt>

LLVM IR (-O0):
%struct.dentry = type { i32 }
define void @fist_print_generic_dentry3(i8* %0, i8* %1, %struct.dentry* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca %struct.dentry*
store i8* %0, i8** %4
store i8* %1, i8** %5
store %struct.dentry* %2, %struct.dentry** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load %struct.dentry*, %struct.dentry** %6
%10 = call i32 @__fist_print_generic_dentry(i8* %7, i8* %8, %struct.dentry* %9, i32 1)
ret void
}

LLVM IR (-O2):
%struct.dentry = type { i32 }
define void @fist_print_generic_dentry3(i8* %0, i8* %1, %struct.dentry* %2) {
%4 = tail call i32 @__fist_print_generic_dentry(i8* %0, i8* %1, %struct.dentry* %2, i32 1)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef scalar_t__ int8_t;

/* Variables and functions */
int /*<<< orphan*/ __wleu08(int *, int);
int i2c_transact(int, int, int *, int, int /*<<< orphan*/);
int i2c_write_leint08(int fd, int chip_addr, int reg, int8_t value) {
  uint8_t data[1 + sizeof(uint8_t)];
  data[0] = reg;
  __wleu08(&data[1], (uint8_t)value);
  return i2c_transact(fd, chip_addr, data, 1 + sizeof(uint8_t), 0);
}


x86 assembly (clang, -O0):
<i2c_write_leint08>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x30(%rbp)
lea    -0x30(%rbp),%rdi
add    $0x4,%rdi
mov    -0x18(%rbp),%rax
mov    %eax,%esi
call   1030 <__wleu08@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    -0x30(%rbp),%rdx
mov    $0x5,%ecx
xor    %r8d,%r8d
call   1040 <i2c_transact@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_write_leint08>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    %esi,%ebx
mov    %edi,%ebp
mov    %edx,(%rsp)
lea    0x4(%rsp),%rdi
mov    %ecx,%esi
call   1030 <__wleu08@plt>
mov    %rsp,%rdx
mov    %ebp,%edi
mov    %ebx,%esi
mov    $0x5,%ecx
xor    %r8d,%r8d
call   1040 <i2c_transact@plt>
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @i2c_write_leint08(i32 %0, i32 %1, i32 %2, i64 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i64
%9 = alloca [5 x i32]
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i64 %3, i64* %8
%10 = load i32, i32* %7
%11 = getelementptr inbounds [5 x i32], [5 x i32]* %9, i64 0, i64 0
store i32 %10, i32* %11
%12 = getelementptr inbounds [5 x i32], [5 x i32]* %9, i64 0, i64 1
%13 = load i64, i64* %8
%14 = trunc i64 %13 to i32
%15 = call i32 @__wleu08(i32* %12, i32 %14)
%16 = load i32, i32* %5
%17 = load i32, i32* %6
%18 = getelementptr inbounds [5 x i32], [5 x i32]* %9, i64 0, i64 0
%19 = call i32 @i2c_transact(i32 %16, i32 %17, i32* %18, i32 5, i32 0)
ret i32 %19
}

LLVM IR (-O2):
define i32 @i2c_write_leint08(i32 %0, i32 %1, i32 %2, i64 %3) {
%5 = alloca [5 x i32]
%6 = bitcast [5 x i32]* %5 to i8*
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %5, i64 0, i64 0
store i32 %2, i32* %7
%8 = getelementptr inbounds [5 x i32], [5 x i32]* %5, i64 0, i64 1
%9 = trunc i64 %3 to i32
%10 = call i32 @__wleu08(i32* %8, i32 %9)
%11 = call i32 @i2c_transact(i32 %0, i32 %1, i32* %7, i32 5, i32 0)
ret i32 %11
}
int test_imm_AFint16_mem(short *val) {
  return ((*val) & (0xAF << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_AFint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0xaf,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_AFint16_mem>:
testb  $0xaf,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_AFint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, 175
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_AFint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 175
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void set_temp_dir(struct d_tree *t, const char *path) {}


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

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

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

LLVM IR (-O2):
%struct.d_tree = type opaque
define void @set_temp_dir(%struct.d_tree* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *);
int ask_query() {
  char query[10];
  gets(query);
  printf("Your query has been recorded. We'll reply back to you\n");
}


x86 assembly (clang, -O0):
<ask_query>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0xe(%rbp),%rdi
call   1040 <gets@plt>
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ask_query>:
sub    $0x18,%rsp
lea    0xe(%rsp),%rdi
call   1040 <gets@plt>
lea    0xecb(%rip),%rdi
call   1030 <puts@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [55 x i8] c"Your query has been recorded. We'll reply back to you\0A\00"
define i32 @ask_query() {
%1 = alloca i32
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%4 = call i32 @gets(i8* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
@str = [54 x i8] c"Your query has been recorded. We'll reply back to you\00"
define i32 @ask_query() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @gets(i8* %2)
%4 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char const *const, int);
void cornerturn_1thread(unsigned char *outputBuffer,
                        const unsigned char *const *threadBuffers,
                        int outputDataSize) {
  memcpy(outputBuffer, threadBuffers[0], outputDataSize);
}


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

x86 assembly (clang, -O2):
<cornerturn_1thread>:
mov    (%rsi),%rsi
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @cornerturn_1thread(i8* %0, i8** nocapture %1, i32 %2) {
%4 = load i8*, i8** %1
%5 = tail call i32 @memcpy(i8* %0, i8* %4, i32 %2)
ret void
}