xunge/DecIR huggingface dataset:
int fast_atoi(const char *str) {
  int val = 0;
  while (*str && *str >= '0' && *str <= '9') {
    val = val * 10 + (*str++ - '0');
  }
  return val;
}


x86 assembly (clang, -O0):
<fast_atoi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xd(%rbp)
je     1149 <fast_atoi+0x49>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0xd(%rbp)
jl     1149 <fast_atoi+0x49>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1159 <fast_atoi+0x59>
jmp    117c <fast_atoi+0x7c>
imul   $0xa,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <fast_atoi+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fast_atoi>:
mov    (%rdi),%cl
lea    -0x30(%rcx),%edx
xor    %eax,%eax
cmp    $0x9,%dl
ja     113b <fast_atoi+0x3b>
add    $0x1,%rdi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl %cl,%ecx
lea    (%rax,%rax,4),%eax
lea    (%rcx,%rax,2),%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
lea    -0x30(%rcx),%edx
add    $0x1,%rdi
cmp    $0xa,%dl
jb     1120 <fast_atoi+0x20>
ret

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

LLVM IR (-O2):
define i32 @fast_atoi(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = add i8 %2, -48
%4 = icmp ult i8 %3, 10
br i1 %4, label %5, label %17
5: ; preds = %1, %5
%6 = phi i8 [ %14, %5 ], [ %2, %1 ]
%7 = phi i32 [ %13, %5 ], [ 0, %1 ]
%8 = phi i8* [ %11, %5 ], [ %0, %1 ]
%9 = zext i8 %6 to i32
%10 = mul nsw i32 %7, 10
%11 = getelementptr inbounds i8, i8* %8, i64 1
%12 = add i32 %10, -48
%13 = add i32 %12, %9
%14 = load i8, i8* %11
%15 = add i8 %14, -48
%16 = icmp ult i8 %15, 10
br i1 %16, label %5, label %17
17: ; preds = %5, %1
%18 = phi i32 [ 0, %1 ], [ %13, %5 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void PrintList(int *list) {
  int i;
  for (i = 1; i <= list[0]; i++)
    printf("%d ", list[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<PrintList>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
cmp    (%rcx),%eax
jg     1159 <PrintList+0x49>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <PrintList+0x13>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintList>:
push   %r15
push   %r14
push   %rbx
cmpl   $0x0,(%rdi)
jle    115b <PrintList+0x3b>
mov    %rdi,%r15
lea    0xecc(%rip),%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    0x4(%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movslq (%r15),%rax
add    $0x1,%rbx
cmp    %rax,%rbx
jl     1140 <PrintList+0x20>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @PrintList(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp slt i32 %2, 1
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 1, %1 ]
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = add nuw nsw i64 %5, 1
%10 = load i32, i32* %0
%11 = sext i32 %10 to i64
%12 = icmp slt i64 %5, %11
br i1 %12, label %4, label %13
13: ; preds = %4, %1
%14 = tail call i32 @putchar(i32 10)
ret void
}
int shift_times(int x) {
  int i, k;
  for (i = 1, k = 0; i < x; i *= 2, ++k)
    ;
  if (i == x) {
    return k;
  } else {
    return -1;
  }
}


x86 assembly (clang, -O0):
<shift_times>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    113d <shift_times+0x3d>
jmp    1126 <shift_times+0x26>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1115 <shift_times+0x15>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1154 <shift_times+0x54>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115b <shift_times+0x5b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<shift_times>:
cmp    $0x2,%edi
jl     111b <shift_times+0x1b>
mov    $0x1,%eax
xor    %ecx,%ecx
nopl   0x0(%rax)
add    %eax,%eax
add    $0x1,%ecx
cmp    %edi,%eax
jl     1110 <shift_times+0x10>
jmp    1122 <shift_times+0x22>
xor    %ecx,%ecx
mov    $0x1,%eax
cmp    %edi,%eax
mov    $0xffffffff,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @shift_times(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ 1, %1 ]
%6 = shl nsw i32 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp slt i32 %6, %0
br i1 %8, label %3, label %9
9: ; preds = %3, %1
%10 = phi i32 [ 1, %1 ], [ %6, %3 ]
%11 = phi i32 [ 0, %1 ], [ %7, %3 ]
%12 = icmp eq i32 %10, %0
%13 = select i1 %12, i32 %11, i32 -1
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void _simple_list_free_fn(void *data) { free(data); }


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

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

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

LLVM IR (-O2):
define void @_simple_list_free_fn(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ synclink_cleanup();
void synclink_exit(void) {
  {
    synclink_cleanup();
    return;
  }
}


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

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

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

LLVM IR (-O2):
define void @synclink_exit() {
%1 = tail call i32 (...) @synclink_cleanup()
ret void
}
int loop(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @loop() {
ret i32 0
}
short sum(int a, int b) { return a + b; }


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define signext i16 @sum(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 = add nsw i32 %5, %6
%8 = trunc i32 %7 to i16
ret i16 %8
}

LLVM IR (-O2):
define signext i16 @sum(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = trunc i32 %3 to i16
ret i16 %4
}
double deriv(double x) { return -1 * x; }


x86 assembly (clang, -O0):
<deriv>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<deriv>:
xorps  0xef9(%rip),%xmm0
ret

LLVM IR (-O0):
define double @deriv(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double -1.000000e+00, %3
ret double %4
}

LLVM IR (-O2):
define double @deriv(double %0) {
%2 = fneg double %0
ret double %2
}
void f() {
label:
  __attribute__((unused)) goto label;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <f+0x9>
jmp    1109 <f+0x9>

x86 assembly (clang, -O2):
<f>:
jmp    1100 <f>

LLVM IR (-O0):
define void @f() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define void @f() {
br label %1
1: ; preds = %1, %0
br label %1
}
int *b(int *a) { return a; }


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

x86 assembly (clang, -O2):
<b>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i32* @b(i32* readnone returned %0) {
ret i32* %0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "Usage: %s binaryfile\n", "graycode");
  fprintf(stderr, "An image file \"binaryfile.gc\" will be created\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
lea    0xeeb(%rip),%rdx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
lea    0xeee(%rip),%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xee7(%rip),%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"Usage: %s binaryfile\0A\00"
@.str.1 = [9 x i8] c"graycode\00"
@.str.2 = [47 x i8] c"An image file \22binaryfile.gc\22 will be created\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 (i32, i8*, ...) @fprintf(i32 %1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"Usage: %s binaryfile\0A\00"
@.str.1 = [9 x i8] c"graycode\00"
@.str.2 = [47 x i8] c"An image file \22binaryfile.gc\22 will be created\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 (i32, i8*, ...) @fprintf(i32 %1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0))
ret void
}
void dead_test2(int *data) {
  int j = data[0] + data[1];
  int k = j + data[2];
  int m = k + data[3];
  int n = m + data[4];
  j = data[2];
  data[j] = 2;
}


x86 assembly (clang, -O0):
<dead_test2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
add    0x4(%rcx),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
add    0x8(%rcx),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%rcx
add    0xc(%rcx),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x8(%rbp),%rcx
add    0x10(%rcx),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0x2,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<dead_test2>:
movslq 0x8(%rdi),%rax
movl   $0x2,(%rdi,%rax,4)
ret

LLVM IR (-O0):
define void @dead_test2(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %2
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 0
%9 = load i32, i32* %8
%10 = load i32*, i32** %2
%11 = getelementptr inbounds i32, i32* %10, i64 1
%12 = load i32, i32* %11
%13 = add nsw i32 %9, %12
store i32 %13, i32* %3
%14 = load i32, i32* %3
%15 = load i32*, i32** %2
%16 = getelementptr inbounds i32, i32* %15, i64 2
%17 = load i32, i32* %16
%18 = add nsw i32 %14, %17
store i32 %18, i32* %4
%19 = load i32, i32* %4
%20 = load i32*, i32** %2
%21 = getelementptr inbounds i32, i32* %20, i64 3
%22 = load i32, i32* %21
%23 = add nsw i32 %19, %22
store i32 %23, i32* %5
%24 = load i32, i32* %5
%25 = load i32*, i32** %2
%26 = getelementptr inbounds i32, i32* %25, i64 4
%27 = load i32, i32* %26
%28 = add nsw i32 %24, %27
store i32 %28, i32* %6
%29 = load i32*, i32** %2
%30 = getelementptr inbounds i32, i32* %29, i64 2
%31 = load i32, i32* %30
store i32 %31, i32* %3
%32 = load i32*, i32** %2
%33 = load i32, i32* %3
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i32, i32* %32, i64 %34
store i32 2, i32* %35
ret void
}

LLVM IR (-O2):
define void @dead_test2(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
store i32 2, i32* %5
ret void
}
int f2(float x, float y) { return x != y; }


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
setne  %al
setp   %cl
or     %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
cmpneqss %xmm1,%xmm0
movd   %xmm0,%eax
and    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @f2(float %0, float %1) {
%3 = fcmp une float %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
int add_ints(int x, int y) { return x + y; }


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

x86 assembly (clang, -O2):
<add_ints>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @add_ints(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @add_ints(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
void sound_init() {}


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

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

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

LLVM IR (-O2):
define void @sound_init() {
ret void
}
/* Variables and functions */
double log2(double);
double __wrap_log2(double x) { return log2(x); }


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

x86 assembly (clang, -O2):
<__wrap_log2>:
jmp    1030 <log2@plt>

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

LLVM IR (-O2):
define double @__wrap_log2(double %0) {
%2 = tail call double @log2(double %0)
ret double %2
}
void probe_video_rom(int roms) {}


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

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

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

LLVM IR (-O2):
define void @probe_video_rom(i32 %0) {
ret void
}
void g_key_file_has_group() {}


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

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

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

LLVM IR (-O2):
define void @g_key_file_has_group() {
ret void
}
int utflength(char c) {
  int i;
  for (i = 0; (c >> 7) & 1; ++i) {
    c <<= 1;
  }
  return i ? i : 1;
}


x86 assembly (clang, -O0):
<utflength>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
sar    $0x7,%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     113c <utflength+0x3c>
movsbl -0x1(%rbp),%eax
shl    $0x1,%eax
mov    %al,-0x1(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1111 <utflength+0x11>
cmpl   $0x0,-0x8(%rbp)
je     1151 <utflength+0x51>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    115e <utflength+0x5e>
mov    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    115e <utflength+0x5e>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<utflength>:
mov    $0x1,%eax
test   %dil,%dil
jns    111b <utflength+0x1b>
xor    %eax,%eax
nopl   0x0(%rax)
add    %dil,%dil
add    $0x1,%eax
test   %dil,%dil
js     1110 <utflength+0x10>
ret

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

LLVM IR (-O2):
define i32 @utflength(i8 signext %0) {
%2 = icmp sgt i8 %0, -1
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i8 [ %6, %3 ], [ %0, %1 ]
%6 = shl i8 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp sgt i8 %6, -1
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 1, %1 ], [ %7, %3 ]
ret i32 %10
}
int generate_report_CSV() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @generate_report_CSV() {
ret i32 0
}
float PowerForHalfRadius(float halfRadius, float powerFraction) {
  return ((halfRadius * halfRadius) + 1.f) * (1.f / (1.f - powerFraction));
}


x86 assembly (clang, -O0):
<PowerForHalfRadius>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  0xedc(%rip),%xmm1
addss  %xmm1,%xmm0
movss  0xed0(%rip),%xmm2
subss  -0x8(%rbp),%xmm2
movss  0xec3(%rip),%xmm1
divss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<PowerForHalfRadius>:
mulss  %xmm0,%xmm0
movss  0xef4(%rip),%xmm2
addss  %xmm2,%xmm0
movaps %xmm2,%xmm3
subss  %xmm1,%xmm3
divss  %xmm3,%xmm2
mulss  %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @PowerForHalfRadius(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* %3
%7 = call float @llvm.fmuladd.f32(float %5, float %6, float 1.000000e+00)
%8 = load float, float* %4
%9 = fsub float 1.000000e+00, %8
%10 = fdiv float 1.000000e+00, %9
%11 = fmul float %7, %10
ret float %11
}

LLVM IR (-O2):
define float @PowerForHalfRadius(float %0, float %1) {
%3 = tail call float @llvm.fmuladd.f32(float %0, float %0, float 1.000000e+00)
%4 = fsub float 1.000000e+00, %1
%5 = fdiv float 1.000000e+00, %4
%6 = fmul float %3, %5
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ memcmp(void const *, void const *, size_t);
bool cutils_cdar_DynamicArray_void_ptr_compare(const void *item1,
                                               const void *item2,
                                               size_t item_size) {
  return !memcmp(item1, item2, item_size);
}


x86 assembly (clang, -O0):
<cutils_cdar_DynamicArray_void_ptr_compare>:
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
call   1030 <memcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @cutils_cdar_DynamicArray_void_ptr_compare(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @memcmp(i8* %7, i8* %8, i64 %9)
%11 = icmp ne i32 %10, 0
%12 = xor i1 %11, true
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @cutils_cdar_DynamicArray_void_ptr_compare(i8* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @bcmp(i8* %0, i8* %1, i64 %2)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
int getSize(int x) {
  int size = 0;
  for (; x; x >>= 1, size++)
    continue;
  size = size + (size % 8 ? (8 - size % 8) : 0);
  return size;
}


x86 assembly (clang, -O0):
<getSize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1134 <getSize+0x34>
jmp    111d <getSize+0x1d>
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <getSize+0xe>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1168 <getSize+0x68>
mov    -0x8(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    $0x8,%eax
sub    %edx,%eax
mov    %eax,-0x10(%rbp)
jmp    1172 <getSize+0x72>
xor    %eax,%eax
mov    %eax,-0x10(%rbp)
jmp    1172 <getSize+0x72>
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getSize>:
xor    %ecx,%ecx
test   %edi,%edi
je     111c <getSize+0x1c>
mov    %edi,%eax
nopl   0x0(%rax,%rax,1)
sar    %eax
add    $0x1,%ecx
cmp    $0x1,%edi
mov    %eax,%edi
ja     1110 <getSize+0x10>
mov    %ecx,%edx
and    $0x7,%edx
mov    $0x8,%eax
sub    %edx,%eax
test   %edx,%edx
cmove  %edx,%eax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @getSize(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = ashr i32 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i32 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
%11 = and i32 %10, 7
%12 = icmp eq i32 %11, 0
%13 = sub nuw nsw i32 8, %11
%14 = select i1 %12, i32 0, i32 %13
%15 = add nuw nsw i32 %14, %10
ret i32 %15
}
/* Type definitions */
typedef int /*<<< orphan*/ x;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t __be32_to_cpu(uint32_t x) {
  int i;
  uint32_t ret;
  char *a = (char *)&x;
  char *b = (char *)&ret;
  for (i = 0; i < sizeof(x); i++) {
    b[i] = a[sizeof(x) - i - 1];
  }
  return ret;
}


x86 assembly (clang, -O0):
<__be32_to_cpu>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x8(%rbp)
movslq -0x8(%rbp),%rax
cmp    $0x4,%rax
jae    115c <__be32_to_cpu+0x5c>
mov    -0x18(%rbp),%rax
movslq -0x8(%rbp),%rdx
mov    $0x4,%ecx
sub    %rdx,%rcx
sub    $0x1,%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x20(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    111e <__be32_to_cpu+0x1e>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @__be32_to_cpu(i32 %0) {
%2 = call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
void resizeReplicationBacklog(void) {
  _serverPanic("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/"
               "heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c",
               115, "Function '%s' is disabled.", __func__);
}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @EVP_sha384() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *strtok(char *, char *);
void tokenize(char *raw) {
  char *tok = strtok(raw, "\"");
  while (tok != NULL) {
    printf("str: %s\n", tok);
    tok = strtok(NULL, "\"");
  }
}


x86 assembly (clang, -O0):
<tokenize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1174 <tokenize+0x54>
mov    -0x10(%rbp),%rsi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
lea    0xe9a(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,-0x10(%rbp)
jmp    1140 <tokenize+0x20>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tokenize>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rsi
call   1040 <strtok@plt>
test   %rax,%rax
je     116a <tokenize+0x4a>
lea    0xec6(%rip),%r14
lea    0xebd(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1040 <strtok@plt>
test   %rax,%rax
jne    1150 <tokenize+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"\22\00"
@.str.1 = [9 x i8] c"str: %s\0A\00"
define void @tokenize(i8* %0) {
%2 = tail call i8* @strtok(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i8* %2, null
br i1 %3, label %9, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %7, %4 ], [ %2, %1 ]
%6 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %4
9: ; preds = %4, %1
ret void
}
/* Variables and functions */
int foo1();
int main() { return foo1() + 1; }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <foo1@plt>
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @foo1()
%3 = add nsw i32 %2, 1
ret i32 %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo1()
%2 = add nsw i32 %1, 1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void c_test2() { printf("c_test2\n"); }


x86 assembly (clang, -O0):
<c_test2>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_test2>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"c_test2\0A\00"
define void @c_test2() {
%1 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [8 x i8] c"c_test2\00"
define void @c_test2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isspace(unsigned char);
__attribute__((nonnull(1))) const char *m_strnextsp(const char *s) {
  while (*s && !isspace((unsigned char)*s))
    s++;
  return s;
}


x86 assembly (clang, -O0):
<m_strnextsp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1148 <m_strnextsp+0x38>
mov    -0x8(%rbp),%rax
movzbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1158 <m_strnextsp+0x48>
jmp    1169 <m_strnextsp+0x59>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <m_strnextsp+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m_strnextsp>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1138 <m_strnextsp+0x28>
nopw   0x0(%rax,%rax,1)
movzbl %al,%edi
call   1030 <isspace@plt>
test   %eax,%eax
jne    1138 <m_strnextsp+0x28>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <m_strnextsp+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @m_strnextsp(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %16, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = call i32 @isspace(i8 zeroext %10)
%12 = icmp ne i32 %11, 0
%13 = xor i1 %12, true
br label %14
14: ; preds = %8, %3
%15 = phi i1 [ false, %3 ], [ %13, %8 ]
br i1 %15, label %16, label %19
16: ; preds = %14
%17 = load i8*, i8** %2
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %2
br label %3
19: ; preds = %14
%20 = load i8*, i8** %2
ret i8* %20
}

LLVM IR (-O2):
define i8* @m_strnextsp(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %9
%5 = phi i8 [ %11, %9 ], [ %2, %1 ]
%6 = phi i8* [ %10, %9 ], [ %0, %1 ]
%7 = tail call i32 @isspace(i8 zeroext %5)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %9, %1
%14 = phi i8* [ %0, %1 ], [ %10, %9 ], [ %6, %4 ]
ret i8* %14
}
/* Type definitions */
typedef int /*<<< orphan*/ cpumask;
typedef int /*<<< orphan*/ cpu_set_t;

/* Variables and functions */
int /*<<< orphan*/ CPU_SET(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ CPU_ZERO(int /*<<< orphan*/ *);
int /*<<< orphan*/ sched_setaffinity(int /*<<< orphan*/, int,
                                     int /*<<< orphan*/ *);
int main() {
  cpu_set_t cpumask;
  CPU_ZERO(&cpumask);
  CPU_SET(0, &cpumask);
  sched_setaffinity(0, sizeof(cpumask), &cpumask);
  while (1) {
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <CPU_ZERO@plt>
xor    %edi,%edi
lea    -0x8(%rbp),%rsi
call   1050 <CPU_SET@plt>
xor    %edi,%edi
mov    $0x4,%esi
lea    -0x8(%rbp),%rdx
call   1030 <sched_setaffinity@plt>
jmp    1163 <main+0x33>

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <CPU_ZERO@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1050 <CPU_SET@plt>
xor    %edi,%edi
mov    $0x4,%esi
mov    %rbx,%rdx
call   1030 <sched_setaffinity@plt>
nopl   0x0(%rax,%rax,1)
jmp    1160 <main+0x30>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @CPU_ZERO(i32* %2)
%4 = call i32 @CPU_SET(i32 0, i32* %2)
%5 = call i32 @sched_setaffinity(i32 0, i32 4, i32* %2)
br label %6
6: ; preds = %0, %6
br label %6
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @CPU_ZERO(i32* %1)
%4 = call i32 @CPU_SET(i32 0, i32* %1)
%5 = call i32 @sched_setaffinity(i32 0, i32 4, i32* %1)
br label %6
6: ; preds = %6, %0
br label %6
}
/* Variables and functions */
int /*<<< orphan*/ BTCrackStep3(unsigned char *, unsigned char *, int,
                                unsigned char *);
void GetMasterKey(unsigned char in_key[16], unsigned char in_rand[16],
                  unsigned char *out_k) {
  BTCrackStep3(in_key, in_rand, 16, out_k);
}


x86 assembly (clang, -O0):
<GetMasterKey>:
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),%rcx
mov    $0x10,%edx
call   1030 <BTCrackStep3@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetMasterKey>:
mov    %rdx,%rcx
mov    $0x10,%edx
jmp    1030 <BTCrackStep3@plt>

LLVM IR (-O0):
define void @GetMasterKey(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 @BTCrackStep3(i8* %7, i8* %8, i32 16, i8* %9)
ret void
}

LLVM IR (-O2):
define void @GetMasterKey(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @BTCrackStep3(i8* %0, i8* %1, i32 16, i8* %2)
ret void
}
int isprime(int p) {
  int d;
  d = 2;
  while (d < p) {
    if (p % d == 0)
      return 0;
    d = d + 1;
  }
  return 1;
}


x86 assembly (clang, -O0):
<isprime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1144 <isprime+0x44>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1136 <isprime+0x36>
movl   $0x0,-0x4(%rbp)
jmp    114b <isprime+0x4b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <isprime+0xe>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprime>:
mov    $0x1,%ecx
cmp    $0x3,%edi
jl     1120 <isprime+0x20>
mov    $0x2,%esi
nop
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1123 <isprime+0x23>
add    $0x1,%esi
cmp    %esi,%edi
jne    1110 <isprime+0x10>
mov    %ecx,%eax
ret
xor    %ecx,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @isprime(i32 %0) {
%2 = icmp sgt i32 %0, 2
br i1 %2, label %5, label %10
3: ; preds = %5
%4 = icmp eq i32 %9, %0
br i1 %4, label %10, label %5
5: ; preds = %1, %3
%6 = phi i32 [ %9, %3 ], [ 2, %1 ]
%7 = srem i32 %0, %6
%8 = icmp eq i32 %7, 0
%9 = add nuw nsw i32 %6, 1
br i1 %8, label %10, label %3
10: ; preds = %5, %3, %1
%11 = phi i32 [ 1, %1 ], [ 1, %3 ], [ 0, %5 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ sync_bool_option(char *);
void get_server_options() {
  sync_bool_option("Shuffle");
  sync_bool_option("Repeat");
  sync_bool_option("AutoNext");
}


x86 assembly (clang, -O0):
<get_server_options>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <sync_bool_option@plt>
lea    0xee1(%rip),%rdi
call   1030 <sync_bool_option@plt>
lea    0xedc(%rip),%rdi
call   1030 <sync_bool_option@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_server_options>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <sync_bool_option@plt>
lea    0xee4(%rip),%rdi
call   1030 <sync_bool_option@plt>
lea    0xedf(%rip),%rdi
pop    %rax
jmp    1030 <sync_bool_option@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"Shuffle\00"
@.str.1 = [7 x i8] c"Repeat\00"
@.str.2 = [9 x i8] c"AutoNext\00"
define void @get_server_options() {
%1 = call i32 @sync_bool_option(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @sync_bool_option(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @sync_bool_option(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"Shuffle\00"
@.str.1 = [7 x i8] c"Repeat\00"
@.str.2 = [9 x i8] c"AutoNext\00"
define void @get_server_options() {
%1 = tail call i32 @sync_bool_option(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @sync_bool_option(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @sync_bool_option(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ sha256_final(int /*<<< orphan*/ *);
int /*<<< orphan*/ sha256_init();
int /*<<< orphan*/ sha256_padding(int /*<<< orphan*/ const *, unsigned int);
int /*<<< orphan*/ sha256_update(int /*<<< orphan*/ const *, unsigned int);
void sha256(const uint8_t *input, unsigned int count, uint8_t *state) {
  sha256_init();
  sha256_update(input, count);
  sha256_padding(input + (count / (512 / 8)) * (512 / 8), count);
  sha256_final(state);
}


x86 assembly (clang, -O0):
<sha256>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1030 <sha256_init@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <sha256_update@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%eax
shr    $0x6,%eax
shl    $0x6,%eax
mov    %eax,%eax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0xc(%rbp),%esi
call   1050 <sha256_padding@plt>
mov    -0x18(%rbp),%rdi
call   1060 <sha256_final@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sha256>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <sha256_init@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1040 <sha256_update@plt>
mov    %ebp,%eax
and    $0xffffffc0,%eax
lea    (%rbx,%rax,4),%rdi
mov    %ebp,%esi
call   1050 <sha256_padding@plt>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1060 <sha256_final@plt>

LLVM IR (-O0):
define void @sha256(i32* %0, i32 %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32*
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = call i32 (...) @sha256_init()
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = call i32 @sha256_update(i32* %8, i32 %9)
%11 = load i32*, i32** %4
%12 = load i32, i32* %5
%13 = udiv i32 %12, 64
%14 = mul i32 %13, 64
%15 = zext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %11, i64 %15
%17 = load i32, i32* %5
%18 = call i32 @sha256_padding(i32* %16, i32 %17)
%19 = load i32*, i32** %6
%20 = call i32 @sha256_final(i32* %19)
ret void
}

LLVM IR (-O2):
define void @sha256(i32* %0, i32 %1, i32* %2) {
%4 = tail call i32 (...) @sha256_init()
%5 = tail call i32 @sha256_update(i32* %0, i32 %1)
%6 = and i32 %1, -64
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = tail call i32 @sha256_padding(i32* %8, i32 %1)
%10 = tail call i32 @sha256_final(i32* %2)
ret void
}