xunge/DecIR huggingface dataset:
int get_index(int cnt, int ring_size, int diff) {
  int ret = 0, modified_diff;
  if ((diff > ring_size) || (diff * (-1) > ring_size))
    modified_diff = diff % ring_size;
  else
    modified_diff = diff;
  ret = (ring_size + cnt + modified_diff) % ring_size;
  return ret;
}


x86 assembly (clang, -O0):
<get_index>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     112d <get_index+0x2d>
imul   $0xffffffff,-0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    113c <get_index+0x3c>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0x14(%rbp)
jmp    1142 <get_index+0x42>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
add    -0x14(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_index>:
cmp    %esi,%edx
jg     110c <get_index+0xc>
mov    %edx,%eax
neg    %eax
cmp    %esi,%eax
jle    1111 <get_index+0x11>
mov    %edx,%eax
cltd
idiv   %esi
add    %esi,%edi
add    %edx,%edi
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @get_index(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 0, i32* %7
%9 = load i32, i32* %6
%10 = load i32, i32* %5
%11 = icmp sgt i32 %9, %10
br i1 %11, label %17, label %12
12: ; preds = %3
%13 = load i32, i32* %6
%14 = mul nsw i32 %13, -1
%15 = load i32, i32* %5
%16 = icmp sgt i32 %14, %15
br i1 %16, label %17, label %21
17: ; preds = %12, %3
%18 = load i32, i32* %6
%19 = load i32, i32* %5
%20 = srem i32 %18, %19
store i32 %20, i32* %8
br label %23
21: ; preds = %12
%22 = load i32, i32* %6
store i32 %22, i32* %8
br label %23
23: ; preds = %21, %17
%24 = load i32, i32* %5
%25 = load i32, i32* %4
%26 = add nsw i32 %24, %25
%27 = load i32, i32* %8
%28 = add nsw i32 %26, %27
%29 = load i32, i32* %5
%30 = srem i32 %28, %29
store i32 %30, i32* %7
%31 = load i32, i32* %7
ret i32 %31
}

LLVM IR (-O2):
define i32 @get_index(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, %1
%5 = sub nsw i32 0, %2
%6 = icmp sgt i32 %5, %1
%7 = select i1 %4, i1 true, i1 %6
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = srem i32 %2, %1
br label %10
10: ; preds = %3, %8
%11 = phi i32 [ %9, %8 ], [ %2, %3 ]
%12 = add nsw i32 %1, %0
%13 = add nsw i32 %12, %11
%14 = srem i32 %13, %1
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ alexandria_visit();
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("You are standing outside the Great Library of Alexandria.\n");
  printf("You decide to go inside.\n\n");
  alexandria_visit();
}


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

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

LLVM IR (-O0):
@.str = [59 x i8] c"You are standing outside the Great Library of Alexandria.\0A\00"
@.str.1 = [27 x i8] c"You decide to go inside.\0A\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 (...) @alexandria_visit()
ret i32 0
}

LLVM IR (-O2):
@str = [58 x i8] c"You are standing outside the Great Library of Alexandria.\00"
@str.2 = [26 x i8] c"You decide to go inside.\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.2, i64 0, i64 0))
%5 = tail call i32 (...) @alexandria_visit()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void quit(int x) { exit(x); }


x86 assembly (clang, -O0):
<quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<quit>:
push   %rax
call   1030 <exit@plt>

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

LLVM IR (-O2):
define void @quit(i32 %0) {
%2 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ outb(short, char);
void putchar(char ch) { outb(((short int)(0x3F8 + 0)), ch); }


x86 assembly (clang, -O0):
<putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x3f8,%edi
movsbl -0x1(%rbp),%esi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchar>:
mov    %edi,%esi
mov    $0x3f8,%edi
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @putchar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @outb(i16 signext 1016, i8 signext %3)
ret void
}

LLVM IR (-O2):
define void @putchar(i8 signext %0) {
%2 = tail call i32 @outb(i16 signext 1016, i8 signext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int no = 1;
  int sum = 0;
  do {
    sum = sum + no;
    no = no + 1;
  } while (no <= 5);
  printf("1 到5合计是  %d . \n", sum);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jle    112d <main+0x1d>
mov    -0xc(%rbp),%esi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [24 x i8] c"1 \E5\88\B05\E5\90\88\E8\AE\A1\E6\98\AF %d . \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %10, %0
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = add nsw i32 %5, %6
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 1
store i32 %9, i32* %2
br label %10
10: ; preds = %4
%11 = load i32, i32* %2
%12 = icmp sle i32 %11, 5
br i1 %12, label %4, label %13
13: ; preds = %10
%14 = load i32, i32* %3
%15 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"1 \E5\88\B05\E5\90\88\E8\AE\A1\E6\98\AF %d . \0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 15)
ret i32 0
}
int setsid() {
  int fd;
  return -1;
}


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

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

LLVM IR (-O0):
define i32 @setsid() {
%1 = alloca i32
ret i32 -1
}

LLVM IR (-O2):
define i32 @setsid() {
ret i32 -1
}
void glmReverseVector2f(float v[2]) {
  v[0] = -v[0];
  v[1] = -v[1];
}


x86 assembly (clang, -O0):
<glmReverseVector2f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmReverseVector2f>:
movss  (%rdi),%xmm0
movss  0x4(%rdi),%xmm1
movaps 0xef0(%rip),%xmm2
xorps  %xmm2,%xmm0
movss  %xmm0,(%rdi)
xorps  %xmm2,%xmm1
movss  %xmm1,0x4(%rdi)
ret

LLVM IR (-O0):
define void @glmReverseVector2f(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 0
%5 = load float, float* %4
%6 = fneg float %5
%7 = load float*, float** %2
%8 = getelementptr inbounds float, float* %7, i64 0
store float %6, float* %8
%9 = load float*, float** %2
%10 = getelementptr inbounds float, float* %9, i64 1
%11 = load float, float* %10
%12 = fneg float %11
%13 = load float*, float** %2
%14 = getelementptr inbounds float, float* %13, i64 1
store float %12, float* %14
ret void
}

LLVM IR (-O2):
define void @glmReverseVector2f(float* nocapture %0) {
%2 = load float, float* %0
%3 = fneg float %2
store float %3, float* %0
%4 = getelementptr inbounds float, float* %0, i64 1
%5 = load float, float* %4
%6 = fneg float %5
store float %6, float* %4
ret void
}
int min_beregning(int a, int b, int type) {
  if (type == 2) {
    return a + b;
  } else if (type == 3) {
    return a * b;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<min_beregning>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x2,-0x10(%rbp)
jne    1125 <min_beregning+0x25>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1145 <min_beregning+0x45>
cmpl   $0x3,-0x10(%rbp)
jne    113e <min_beregning+0x3e>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1145 <min_beregning+0x45>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min_beregning>:
cmp    $0x3,%edx
je     1110 <min_beregning+0x10>
xor    %eax,%eax
cmp    $0x2,%edx
jne    1115 <min_beregning+0x15>
add    %edi,%esi
jmp    1113 <min_beregning+0x13>
imul   %edi,%esi
mov    %esi,%eax
ret

LLVM IR (-O0):
define i32 @min_beregning(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %7
%9 = icmp eq i32 %8, 2
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = add nsw i32 %11, %12
store i32 %13, i32* %4
br label %22
14: ; preds = %3
%15 = load i32, i32* %7
%16 = icmp eq i32 %15, 3
br i1 %16, label %17, label %21
17: ; preds = %14
%18 = load i32, i32* %5
%19 = load i32, i32* %6
%20 = mul nsw i32 %18, %19
store i32 %20, i32* %4
br label %22
21: ; preds = %14
store i32 0, i32* %4
br label %22
22: ; preds = %21, %17, %10
%23 = load i32, i32* %4
ret i32 %23
}

LLVM IR (-O2):
define i32 @min_beregning(i32 %0, i32 %1, i32 %2) {
switch i32 %2, label %8 [
i32 2, label %4
i32 3, label %6
]
4: ; preds = %3
%5 = add nsw i32 %1, %0
br label %8
6: ; preds = %3
%7 = mul nsw i32 %1, %0
br label %8
8: ; preds = %3, %6, %4
%9 = phi i32 [ %5, %4 ], [ %7, %6 ], [ 0, %3 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int is_prime(char *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ stdin;
int main() {
  char input[11];
  fgets(input, 11, stdin);
  printf("%d", is_prime(input));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xf(%rbp),%rdi
mov    0x2e9e(%rip),%rax
mov    (%rax),%edx
mov    $0xb,%esi
call   1040 <fgets@plt>
lea    -0xf(%rbp),%rdi
call   1050 <is_prime@plt>
mov    %eax,%esi
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    0x2eac(%rip),%rax
mov    (%rax),%edx
lea    0x5(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xb,%esi
call   1040 <fgets@plt>
mov    %rbx,%rdi
call   1050 <is_prime@plt>
lea    0xea1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@stdin = global i32 0
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [11 x i8]
%2 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i32 @fgets(i8* %2, i32 11, i32 %3)
%5 = call i32 @is_prime(i8* %2)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
void scribe_allow_uaccess(void) {}


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

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

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

LLVM IR (-O2):
define void @scribe_allow_uaccess() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ taskdelay(int);
void taskmain(int argc, char *argv[]) { taskdelay(1000); }


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

x86 assembly (clang, -O2):
<taskmain>:
mov    $0x3e8,%edi
jmp    1030 <taskdelay@plt>

LLVM IR (-O0):
define void @taskmain(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @taskdelay(i32 1000)
ret void
}

LLVM IR (-O2):
define void @taskmain(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @taskdelay(i32 1000)
ret void
}
/* Variables and functions */
int partion(int *, int, int);
int quick_sort(int data[], int p, int q) {
  if (p < q) {
    int r = partion(data, p, q);
    quick_sort(data, p, r - 1);
    quick_sort(data, r + 1, q);
  }
  return 0;
}


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 <partion@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>
xor    %eax,%eax
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 <partion@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>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @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 %26
11: ; preds = %3
%12 = load i32*, i32** %4
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = call i32 @partion(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 = call i32 @quick_sort(i32* %16, i32 %17, i32 %19)
%21 = load i32*, i32** %4
%22 = load i32, i32* %7
%23 = add nsw i32 %22, 1
%24 = load i32, i32* %6
%25 = call i32 @quick_sort(i32* %21, i32 %23, i32 %24)
br label %26
26: ; preds = %11, %3
ret i32 0
}

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


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

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

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

LLVM IR (-O2):
define void @foo12() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ roadmap_screen_rotate(int);
void roadmap_start_rotate(void) { roadmap_screen_rotate(10); }


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

x86 assembly (clang, -O2):
<roadmap_start_rotate>:
mov    $0xa,%edi
jmp    1030 <roadmap_screen_rotate@plt>

LLVM IR (-O0):
define void @roadmap_start_rotate() {
%1 = call i32 @roadmap_screen_rotate(i32 10)
ret void
}

LLVM IR (-O2):
define void @roadmap_start_rotate() {
%1 = tail call i32 @roadmap_screen_rotate(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ console_log(char *);
scalar_t__ fork();
int /*<<< orphan*/ regdump();
int /*<<< orphan*/ wait(void *);
int /*<<< orphan*/ yield();
int main() {
  console_log("Hello world from init!\n");
  if (fork()) {
    wait(((void *)0));
    return 123;
  } else {
    regdump();
    yield();
    regdump();
    return 456;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
call   1040 <console_log@plt>
mov    $0x0,%al
call   1060 <fork@plt>
cmp    $0x0,%rax
je     1191 <main+0x41>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <wait@plt>
movl   $0x7b,-0x4(%rbp)
jmp    11ad <main+0x5d>
mov    $0x0,%al
call   1070 <regdump@plt>
mov    $0x0,%al
call   1030 <yield@plt>
mov    $0x0,%al
call   1070 <regdump@plt>
movl   $0x1c8,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xea8(%rip),%rdi
call   1040 <console_log@plt>
xor    %eax,%eax
call   1060 <fork@plt>
test   %rax,%rax
je     1177 <main+0x27>
xor    %edi,%edi
call   1050 <wait@plt>
mov    $0x7b,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1070 <regdump@plt>
xor    %eax,%eax
call   1030 <yield@plt>
xor    %eax,%eax
call   1070 <regdump@plt>
mov    $0x1c8,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Hello world from init!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @console_log(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i64 (...) @fork()
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @wait(i8* null)
store i32 123, i32* %1
br label %11
7: ; preds = %0
%8 = call i32 (...) @regdump()
%9 = call i32 (...) @yield()
%10 = call i32 (...) @regdump()
store i32 456, i32* %1
br label %11
11: ; preds = %7, %5
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@.str = [24 x i8] c"Hello world from init!\0A\00"
define i32 @main() {
%1 = tail call i32 @console_log(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = tail call i64 (...) @fork()
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 @wait(i8* null)
br label %10
6: ; preds = %0
%7 = tail call i32 (...) @regdump()
%8 = tail call i32 (...) @yield()
%9 = tail call i32 (...) @regdump()
br label %10
10: ; preds = %6, %4
%11 = phi i32 [ 123, %4 ], [ 456, %6 ]
ret i32 %11
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t is_esp_inuse(uint32_t bitmap) { return (bitmap & (0x1 << 8)); }


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

x86 assembly (clang, -O2):
<is_esp_inuse>:
mov    %edi,%eax
and    $0x100,%eax
ret

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

LLVM IR (-O2):
define i32 @is_esp_inuse(i32 %0) {
%2 = and i32 %0, 256
ret i32 %2
}
void runOpenCL(void *a) {}


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

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

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

LLVM IR (-O2):
define void @runOpenCL(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printbits(int /*<<< orphan*/);
int /*<<< orphan*/ setbits(int, int, int, int);
int main(void) {
  printbits(setbits(8, 2, 1, 2));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x8,%edi
mov    $0x2,%ecx
mov    $0x1,%edx
mov    %ecx,%esi
call   1040 <setbits@plt>
mov    %eax,%edi
call   1030 <printbits@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x8,%edi
mov    $0x2,%esi
mov    $0x1,%edx
mov    $0x2,%ecx
call   1040 <setbits@plt>
mov    %eax,%edi
call   1030 <printbits@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @setbits(i32 8, i32 2, i32 1, i32 2)
%3 = call i32 @printbits(i32 %2)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @setbits(i32 8, i32 2, i32 1, i32 2)
%2 = tail call i32 @printbits(i32 %1)
ret i32 0
}
/* Type definitions */
struct tms {
  int dummy;
};
typedef int clock_t;

/* Variables and functions */
clock_t _times(struct tms *buf __attribute__((unused))) { return -1; }


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

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

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

LLVM IR (-O2):
%struct.tms = type { i32 }
define i32 @_times(%struct.tms* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(int *, int *, long);
void dup_ivector(int *src, long nl, long nh, int *dst) {
  long len = nh - nl + 1;
  static long size = sizeof(int);
  memcpy(dst + nl, src + nl, len * size);
}


x86 assembly (clang, -O0):
<dup_ivector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
sub    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
mov    -0x28(%rbp),%rdx
imul   0x2ec6(%rip),%rdx
call   1030 <memcpy@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dup_ivector>:
sub    %rsi,%rdx
lea    (%rcx,%rsi,4),%rax
lea    (%rdi,%rsi,4),%rsi
lea    0x4(,%rdx,4),%rdx
mov    %rax,%rdi
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
@dup_ivector.size = internal global i64 4
define void @dup_ivector(i32* %0, i64 %1, i64 %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32*
%9 = alloca i64
store i32* %0, i32** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i32* %3, i32** %8
%10 = load i64, i64* %7
%11 = load i64, i64* %6
%12 = sub nsw i64 %10, %11
%13 = add nsw i64 %12, 1
store i64 %13, i64* %9
%14 = load i32*, i32** %8
%15 = load i64, i64* %6
%16 = getelementptr inbounds i32, i32* %14, i64 %15
%17 = load i32*, i32** %5
%18 = load i64, i64* %6
%19 = getelementptr inbounds i32, i32* %17, i64 %18
%20 = load i64, i64* %9
%21 = load i64, i64* @dup_ivector.size
%22 = mul nsw i64 %20, %21
%23 = call i32 @memcpy(i32* %16, i32* %19, i64 %22)
ret void
}

LLVM IR (-O2):
define void @dup_ivector(i32* %0, i64 %1, i64 %2, i32* %3) {
%5 = sub nsw i64 %2, %1
%6 = getelementptr inbounds i32, i32* %3, i64 %1
%7 = getelementptr inbounds i32, i32* %0, i64 %1
%8 = shl i64 %5, 2
%9 = add i64 %8, 4
%10 = tail call i32 @memcpy(i32* %6, i32* %7, i64 %9)
ret void
}
/* Variables and functions */
int get_token();
void cmd_add(void) {
  int token;
  token = get_token();
}


x86 assembly (clang, -O0):
<cmd_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <get_token@plt>
mov    %eax,-0x4(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @cmd_add() {
%1 = alloca i32
%2 = call i32 (...) @get_token()
store i32 %2, i32* %1
ret void
}

LLVM IR (-O2):
define void @cmd_add() {
%1 = tail call i32 (...) @get_token()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, int);
int /*<<< orphan*/ stderr;
int set_pin(int pin, int val) {
  fprintf(stderr, "set p%d -> %d\n", pin, val);
  return val;
}


x86 assembly (clang, -O0):
<set_pin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2ebb(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_pin>:
push   %rbx
mov    %esi,%ebx
mov    %edi,%edx
mov    0x2ec4(%rip),%rax
mov    (%rax),%edi
lea    0xedb(%rip),%rsi
mov    %ebx,%ecx
call   1030 <fprintf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"set p%d -> %d\0A\00"
define i32 @set_pin(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"set p%d -> %d\0A\00"
define i32 @set_pin(i32 %0, i32 returned %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret i32 %1
}
/* Variables and functions */
scalar_t__ RAND_MAX;
scalar_t__ random();
double drandom(void) { return ((double)random() / ((double)RAND_MAX + 1.)); }


x86 assembly (clang, -O0):
<drandom>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <random@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec1(%rip),%rax
cvtsi2sdq (%rax),%xmm1
movsd  0xecc(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<drandom>:
push   %rax
xor    %eax,%eax
call   1030 <random@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec4(%rip),%rax
cvtsi2sdq (%rax),%xmm1
addsd  0xecf(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define double @drandom() {
%1 = call i64 (...) @random()
%2 = sitofp i64 %1 to double
%3 = load i64, i64* @RAND_MAX
%4 = sitofp i64 %3 to double
%5 = fadd double %4, 1.000000e+00
%6 = fdiv double %2, %5
ret double %6
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define double @drandom() {
%1 = tail call i64 (...) @random()
%2 = sitofp i64 %1 to double
%3 = load i64, i64* @RAND_MAX
%4 = sitofp i64 %3 to double
%5 = fadd double %4, 1.000000e+00
%6 = fdiv double %2, %5
ret double %6
}
/* Variables and functions */
int japi_getimage(int);
int j_getimage(int arg0) { return (japi_getimage(arg0)); }


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

x86 assembly (clang, -O2):
<j_getimage>:
jmp    1030 <japi_getimage@plt>

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

LLVM IR (-O2):
define i32 @j_getimage(i32 %0) {
%2 = tail call i32 @japi_getimage(i32 %0)
ret i32 %2
}
void iwl_legacy_reset_traffic_log(struct iwl_priv *priv) {}


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

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

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

LLVM IR (-O2):
%struct.iwl_priv = type opaque
define void @iwl_legacy_reset_traffic_log(%struct.iwl_priv* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char *, int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/);
void _CLog_datePostfix(char *tmp, int size) {
  time_t t = time(0);
  strftime(tmp, size, "_%Y_%m_%d", localtime(&t));
}


x86 assembly (clang, -O0):
<_CLog_datePostfix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <localtime@plt>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    %eax,%ecx
lea    0xe90(%rip),%rdx
call   1050 <strftime@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_CLog_datePostfix>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <localtime@plt>
lea    0xeac(%rip),%rdx
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %eax,%ecx
call   1050 <strftime@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"_%Y_%m_%d\00"
define void @_CLog_datePostfix(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = call i32 @time(i32 0)
store i32 %6, i32* %5
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i32 @localtime(i32* %5)
%10 = call i32 @strftime(i8* %7, i32 %8, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"_%Y_%m_%d\00"
define void @_CLog_datePostfix(i8* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @time(i32 0)
store i32 %5, i32* %3
%6 = call i32 @localtime(i32* %3)
%7 = call i32 @strftime(i8* %0, i32 %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ nrerror(char *);
double *vector(long nl, long nh) {
  double *v;
  v = (double *)malloc((size_t)((nh - nl + 1 + 1) * sizeof(double)));
  if (!v)
    nrerror("allocation failure in vector()");
  return v - nl + 1;
}


x86 assembly (clang, -O0):
<vector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
sub    -0x8(%rbp),%rdi
add    $0x1,%rdi
add    $0x1,%rdi
shl    $0x3,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1164 <vector+0x44>
lea    0xea1(%rip),%rdi
call   1030 <nrerror@plt>
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
sub    -0x8(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
add    $0x8,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vector>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
sub    %rdi,%rsi
lea    0x10(,%rsi,8),%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114b <vector+0x2b>
lea    0xeba(%rip),%rdi
call   1030 <nrerror@plt>
shl    $0x3,%r14
sub    %r14,%rbx
add    $0x8,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [31 x i8] c"allocation failure in vector()\00"
define double* @vector(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca double*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = sub nsw i64 %6, %7
%9 = add nsw i64 %8, 1
%10 = add nsw i64 %9, 1
%11 = mul i64 %10, 8
%12 = call i64 @malloc(i64 %11)
%13 = inttoptr i64 %12 to double*
store double* %13, double** %5
%14 = load double*, double** %5
%15 = icmp ne double* %14, null
br i1 %15, label %18, label %16
16: ; preds = %2
%17 = call i32 @nrerror(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %16, %2
%19 = load double*, double** %5
%20 = load i64, i64* %3
%21 = sub i64 0, %20
%22 = getelementptr inbounds double, double* %19, i64 %21
%23 = getelementptr inbounds double, double* %22, i64 1
ret double* %23
}

LLVM IR (-O2):
@.str = [31 x i8] c"allocation failure in vector()\00"
define double* @vector(i64 %0, i64 %1) {
%3 = sub nsw i64 %1, %0
%4 = shl i64 %3, 3
%5 = add i64 %4, 16
%6 = tail call i64 @malloc(i64 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @nrerror(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = inttoptr i64 %6 to double*
%12 = sub i64 0, %0
%13 = getelementptr inbounds double, double* %11, i64 %12
%14 = getelementptr inbounds double, double* %13, i64 1
ret double* %14
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *calloc(size_t num, size_t size) {
  size_t n = num * size * sizeof(char);
  void *p = malloc(n);
  memset(p, 0, n);
  return p;
}


x86 assembly (clang, -O0):
<calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x10(%rbp),%rax
shl    $0x0,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
imul   %rsi,%rbx
mov    %rbx,%rdi
call   1040 <malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @calloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%7 = load i64, i64* %3
%8 = load i64, i64* %4
%9 = mul i64 %7, %8
%10 = mul i64 %9, 1
store i64 %10, i64* %5
%11 = load i64, i64* %5
%12 = call i8* @malloc(i64 %11)
store i8* %12, i8** %6
%13 = load i8*, i8** %6
%14 = load i64, i64* %5
%15 = call i32 @memset(i8* %13, i32 0, i64 %14)
%16 = load i8*, i8** %6
ret i8* %16
}

LLVM IR (-O2):
define i8* @calloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i32 @memset(i8* %4, i32 0, i64 %3)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void failure() { exit(0xf); }


x86 assembly (clang, -O0):
<failure>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<failure>:
push   %rax
mov    $0xf,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @failure() {
%1 = call i32 @exit(i32 15)
unreachable
}

LLVM IR (-O2):
define void @failure() {
%1 = tail call i32 @exit(i32 15)
unreachable
}
int d_blg_rc2(double a1) { return !(__builtin_islessgreater(a1, 100)); }


x86 assembly (clang, -O0):
<d_blg_rc2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
ucomisd %xmm1,%xmm0
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_blg_rc2>:
xor    %eax,%eax
ucomisd 0xef6(%rip),%xmm0
sete   %al
ret

LLVM IR (-O0):
define i32 @d_blg_rc2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp one double %3, 1.000000e+02
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @d_blg_rc2(double %0) {
%2 = fcmp ueq double %0, 1.000000e+02
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
scalar_t__ oscap_strcmp(char const *, char const *);
bool oscap_streq(const char *s1, const char *s2) {
  return oscap_strcmp(s1, s2) == 0;
}


x86 assembly (clang, -O0):
<oscap_streq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <oscap_strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @oscap_streq(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i64 @oscap_strcmp(i8* %5, i8* %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @oscap_streq(i8* %0, i8* %1) {
%3 = tail call i64 @oscap_strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
int x16_teardown() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @x16_teardown() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ res_lsw(unsigned int, unsigned int, int, unsigned int);
void LFV(unsigned vt, unsigned element, signed offset, unsigned base) {
  res_lsw(vt, element, offset, base);
  return;
}


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

x86 assembly (clang, -O2):
<LFV>:
jmp    1030 <res_lsw@plt>

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

LLVM IR (-O2):
define void @LFV(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @res_lsw(i32 %0, i32 %1, i32 %2, i32 %3)
ret void
}
/* Variables and functions */
long double sinh(long double);
long double imprecise_sinhl(long double v) { return sinh(v); }


x86 assembly (clang, -O0):
<imprecise_sinhl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <sinh@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imprecise_sinhl>:
jmp    1030 <sinh@plt>

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

LLVM IR (-O2):
define x86_fp80 @imprecise_sinhl(x86_fp80 %0) {
%2 = tail call x86_fp80 @sinh(x86_fp80 %0)
ret x86_fp80 %2
}
/* Variables and functions */
double atan2(int /*<<< orphan*/, double);
int /*<<< orphan*/ sqrt(int);
double acos(double x) { return atan2(sqrt(1 - x * x), x); }


x86 assembly (clang, -O0):
<acos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xea6(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1040 <sqrt@plt>
mov    %eax,%edi
movsd  -0x8(%rbp),%xmm0
call   1030 <atan2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acos>:
push   %rax
movsd  %xmm0,(%rsp)
movapd %xmm0,%xmm2
mulsd  %xmm0,%xmm2
movsd  0xeca(%rip),%xmm1
subsd  %xmm2,%xmm1
cvttsd2si %xmm1,%edi
call   1040 <sqrt@plt>
mov    %eax,%edi
movsd  (%rsp),%xmm0
pop    %rax
jmp    1030 <atan2@plt>

LLVM IR (-O0):
define double @acos(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fneg double %3
%6 = call double @llvm.fmuladd.f64(double %5, double %4, double 1.000000e+00)
%7 = fptosi double %6 to i32
%8 = call i32 @sqrt(i32 %7)
%9 = load double, double* %2
%10 = call double @atan2(i32 %8, double %9)
ret double %10
}

LLVM IR (-O2):
define double @acos(double %0) {
%2 = fneg double %0
%3 = tail call double @llvm.fmuladd.f64(double %2, double %0, double 1.000000e+00)
%4 = fptosi double %3 to i32
%5 = tail call i32 @sqrt(i32 %4)
%6 = tail call double @atan2(i32 %5, double %0)
ret double %6
}
int ade7854_probe_trigger(struct iio_dev *indio_dev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.iio_dev = type opaque
define i32 @ade7854_probe_trigger(%struct.iio_dev* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int toku_fs_set_cachesize(size_t cachesize) { return cachesize - cachesize; }


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

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

LLVM IR (-O0):
define i32 @toku_fs_set_cachesize(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load i64, i64* %2
%5 = sub i64 %3, %4
%6 = trunc i64 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @toku_fs_set_cachesize(i64 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ core8_print(char *, char const *, int /*<<< orphan*/);
void U_EMREXTTEXTOUTA_print(const char *contents) {
  core8_print("U_EMREXTTEXTOUTA", contents, 0);
}


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

x86 assembly (clang, -O2):
<U_EMREXTTEXTOUTA_print>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
xor    %edx,%edx
jmp    1030 <core8_print@plt>

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

LLVM IR (-O2):
@.str = [17 x i8] c"U_EMREXTTEXTOUTA\00"
define void @U_EMREXTTEXTOUTA_print(i8* %0) {
%2 = tail call i32 @core8_print(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0, i32 0)
ret void
}
void dump32(unsigned char *c, unsigned long i) {
  c[0] = (i >> 24) & 0xff;
  c[1] = (i >> 16) & 0xff;
  c[2] = (i >> 8) & 0xff;
  c[3] = i & 0xff;
}


x86 assembly (clang, -O0):
<dump32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x18,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
shr    $0x10,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%rax
shr    $0x8,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x10(%rbp),%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @dump32(i8* nocapture writeonly %0, i64 %1) {
%3 = lshr i64 %1, 24
%4 = trunc i64 %3 to i8
store i8 %4, i8* %0
%5 = lshr i64 %1, 16
%6 = trunc i64 %5 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %6, i8* %7
%8 = lshr i64 %1, 8
%9 = trunc i64 %8 to i8
%10 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %9, i8* %10
%11 = trunc i64 %1 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
ret void
}
unsigned int wp_str_hash(const void *v) {
  const signed char *p;
  unsigned int h = 5381;
  for (p = v; *p != '\0'; p++) {
    h = (h << 5) + h + *p;
  }
  return h;
}


x86 assembly (clang, -O0):
<wp_str_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1505,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114d <wp_str_hash+0x4d>
mov    -0x14(%rbp),%eax
shl    $0x5,%eax
add    -0x14(%rbp),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1117 <wp_str_hash+0x17>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wp_str_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1138 <wp_str_hash+0x38>
add    $0x1,%rdi
mov    $0x1505,%edx
mov    %edx,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %cl,%ecx
shl    $0x5,%eax
add    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
mov    %eax,%edx
test   %cl,%cl
jne    1120 <wp_str_hash+0x20>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i32 @wp_str_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 5381, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = mul i32 %6, 33
%10 = add i32 %9, %8
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 5381, %1 ], [ %10, %4 ]
ret i32 %15
}