xunge/DecIR huggingface dataset:
/* Variables and functions */
int partition(int *, int, int);
void quick_sort(int a[], int left, int right) {
  int q = 0;
  if (left >= right) {
    return;
  }
  q = partition(a, left, right);
  quick_sort(a, left, (q - 1));
  quick_sort(a, (q + 1), right);
  return;
}


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)
movl   $0x0,-0x14(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     114a <quick_sort+0x2a>
jmp    1180 <quick_sort+0x60>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quick_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quick_sort@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

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

/* Variables and functions */
int offset(int /*<<< orphan*/, int, int, int);
int play_attack_defend2_n(int, int /*<<< orphan*/, int, int, int, int);
int autohelperowl_vital_apat34(struct pattern *patt, int transformation,
                               int move, int color, int action) {
  int A;
  (void)patt;
  (void)color;
  (void)action;
  A = offset(0, 2, move, transformation);
  return play_attack_defend2_n(color, 0, 1, move, A, move);
}


x86 assembly (clang, -O0):
<autohelperowl_vital_apat34>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
xor    %edi,%edi
mov    $0x2,%esi
call   1040 <offset@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
mov    -0x10(%rbp),%r9d
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <play_attack_defend2_n@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<autohelperowl_vital_apat34>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebx
mov    %edx,%ebp
mov    %esi,%ecx
xor    %edi,%edi
mov    $0x2,%esi
call   1040 <offset@plt>
mov    %ebx,%edi
xor    %esi,%esi
mov    $0x1,%edx
mov    %ebp,%ecx
mov    %eax,%r8d
mov    %ebp,%r9d
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <play_attack_defend2_n@plt>

LLVM IR (-O0):
%struct.pattern = type { i32 }
define i32 @autohelperowl_vital_apat34(%struct.pattern* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca %struct.pattern*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store %struct.pattern* %0, %struct.pattern** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%12 = load %struct.pattern*, %struct.pattern** %6
%13 = load i32, i32* %9
%14 = load i32, i32* %10
%15 = load i32, i32* %8
%16 = load i32, i32* %7
%17 = call i32 @offset(i32 0, i32 2, i32 %15, i32 %16)
store i32 %17, i32* %11
%18 = load i32, i32* %9
%19 = load i32, i32* %8
%20 = load i32, i32* %11
%21 = load i32, i32* %8
%22 = call i32 @play_attack_defend2_n(i32 %18, i32 0, i32 1, i32 %19, i32 %20, i32 %21)
ret i32 %22
}

LLVM IR (-O2):
%struct.pattern = type { i32 }
define i32 @autohelperowl_vital_apat34(%struct.pattern* nocapture readnone %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @offset(i32 0, i32 2, i32 %2, i32 %1)
%7 = tail call i32 @play_attack_defend2_n(i32 %3, i32 0, i32 1, i32 %2, i32 %6, i32 %2)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ munmap(unsigned char *, size_t);
void close_pair(unsigned char *text, unsigned char *create, size_t size,
                int tweak) {
  munmap(text, size);
  munmap(create, size + tweak);
}


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

x86 assembly (clang, -O2):
<close_pair>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%ebp
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdx,%rsi
call   1030 <munmap@plt>
movslq %ebp,%rsi
add    %rbx,%rsi
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <munmap@plt>

LLVM IR (-O0):
define void @close_pair(i8* %0, i8* %1, i64 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %7
%11 = call i32 @munmap(i8* %9, i64 %10)
%12 = load i8*, i8** %6
%13 = load i64, i64* %7
%14 = load i32, i32* %8
%15 = sext i32 %14 to i64
%16 = add i64 %13, %15
%17 = call i32 @munmap(i8* %12, i64 %16)
ret void
}

LLVM IR (-O2):
define void @close_pair(i8* %0, i8* %1, i64 %2, i32 %3) {
%5 = tail call i32 @munmap(i8* %0, i64 %2)
%6 = sext i32 %3 to i64
%7 = add i64 %6, %2
%8 = tail call i32 @munmap(i8* %1, i64 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ swiftSort(int *, int /*<<< orphan*/, int);
int majorityElement0(int *nums, int size) {
  swiftSort(nums, 0, size - 1);
  return nums[size / 2];
}


x86 assembly (clang, -O0):
<majorityElement0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1030 <swiftSort@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<majorityElement0>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
lea    -0x1(%rbx),%edx
xor    %esi,%esi
call   1030 <swiftSort@plt>
mov    %ebx,%eax
shr    $0x1f,%eax
add    %ebx,%eax
sar    %eax
cltq
mov    (%r14,%rax,4),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @majorityElement0(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 = sub nsw i32 %6, 1
%8 = call i32 @swiftSort(i32* %5, i32 0, i32 %7)
%9 = load i32*, i32** %3
%10 = load i32, i32* %4
%11 = sdiv i32 %10, 2
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %9, i64 %12
%14 = load i32, i32* %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @majorityElement0(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call i32 @swiftSort(i32* %0, i32 0, i32 %3)
%5 = sdiv i32 %1, 2
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = load i32, i32* %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void fn_HALT(void) { exit(EXIT_SUCCESS); }


x86 assembly (clang, -O0):
<fn_HALT>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<fn_HALT>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define void @fn_HALT() {
%1 = load i32, i32* @EXIT_SUCCESS
%2 = call i32 @exit(i32 %1)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define void @fn_HALT() {
%1 = load i32, i32* @EXIT_SUCCESS
%2 = tail call i32 @exit(i32 %1)
unreachable
}
/* Variables and functions */
bool someMatch(int *t1, int *t2, int *t3) {
  if (t1 == t2)
    return true;
  if (t1 == t3)
    return true;
  if (t2 == t3)
    return true;
  return false;
}


x86 assembly (clang, -O0):
<someMatch>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    112a <someMatch+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1165 <someMatch+0x65>
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jne    1144 <someMatch+0x44>
movl   $0x1,-0x4(%rbp)
jmp    1165 <someMatch+0x65>
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
jne    115e <someMatch+0x5e>
movl   $0x1,-0x4(%rbp)
jmp    1165 <someMatch+0x65>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<someMatch>:
cmp    %rsi,%rdi
sete   %al
cmp    %rdx,%rdi
sete   %cl
or     %al,%cl
cmp    %rdx,%rsi
sete   %al
or     %cl,%al
movzbl %al,%eax
ret

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

LLVM IR (-O2):
define i32 @someMatch(i32* readnone %0, i32* readnone %1, i32* readnone %2) {
%4 = icmp eq i32* %0, %1
%5 = icmp eq i32* %0, %2
%6 = or i1 %4, %5
%7 = icmp eq i32* %1, %2
%8 = or i1 %7, %6
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ deleteFile(char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
void deleteFiles(int i) {
  char filepath[80];
  sprintf(filepath, "input_%d.txt", i);
  deleteFile(filepath);
  char filepathOut[80];
  sprintf(filepathOut, "output_%d.txt", i);
  deleteFile(filepathOut);
}


x86 assembly (clang, -O0):
<deleteFiles>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xec4(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x60(%rbp),%rdi
call   1030 <deleteFile@plt>
lea    -0xb0(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xeb2(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0xb0(%rbp),%rdi
call   1030 <deleteFile@plt>
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deleteFiles>:
push   %r14
push   %rbx
sub    $0xa8,%rsp
mov    %edi,%ebx
lea    0xecd(%rip),%rsi
lea    0x50(%rsp),%r14
mov    %r14,%rdi
mov    %ebx,%edx
call   1040 <sprintf@plt>
mov    %r14,%rdi
call   1030 <deleteFile@plt>
lea    0xebc(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
mov    %ebx,%edx
call   1040 <sprintf@plt>
mov    %r14,%rdi
call   1030 <deleteFile@plt>
add    $0xa8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [13 x i8] c"input_%d.txt\00"
@.str.1 = [14 x i8] c"output_%d.txt\00"
define void @deleteFiles(i32 %0) {
%2 = alloca i32
%3 = alloca [80 x i8]
%4 = alloca [80 x i8]
store i32 %0, i32* %2
%5 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%6 = load i32, i32* %2
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%9 = call i32 @deleteFile(i8* %8)
%10 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%11 = load i32, i32* %2
%12 = call i32 @sprintf(i8* %10, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%14 = call i32 @deleteFile(i8* %13)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"input_%d.txt\00"
@.str.1 = [14 x i8] c"output_%d.txt\00"
define void @deleteFiles(i32 %0) {
%2 = alloca [80 x i8]
%3 = alloca [80 x i8]
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %0)
%6 = call i32 @deleteFile(i8* %4)
%7 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%8 = call i32 @sprintf(i8* %7, i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %0)
%9 = call i32 @deleteFile(i8* %7)
ret void
}
void termop_scrollregion(struct ansiseq *s) {
  tnc_log_log(
      6, 4, -1,
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/vt100.c",
      439, __func__, "unhandled");
  ansiseq_dump(s);
}


x86 assembly (clang, -O0):
<termop_scrollregion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x6,%edi
mov    $0x4,%esi
mov    $0xffffffff,%edx
lea    0xebe(%rip),%rcx
mov    $0x1b7,%r8d
lea    0xf37(%rip),%r9
lea    0xf44(%rip),%rax
mov    %rax,(%rsp)
mov    $0x0,%al
call   1030 <tnc_log_log@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <ansiseq_dump@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<termop_scrollregion>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xf6b(%rip),%rax
mov    %rax,(%rsp)
lea    0xec6(%rip),%rcx
lea    0xf45(%rip),%r9
mov    $0x6,%edi
mov    $0x4,%esi
mov    $0xffffffff,%edx
mov    $0x1b7,%r8d
xor    %eax,%eax
call   1030 <tnc_log_log@plt>
mov    %rbx,%rdi
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <ansiseq_dump@plt>

LLVM IR (-O0):
%struct.ansiseq = type opaque
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/vt100.c\00"
@__func__.termop_scrollregion = [20 x i8] c"termop_scrollregion\00"
@.str.1 = [10 x i8] c"unhandled\00"
define void @termop_scrollregion(%struct.ansiseq* %0) {
%2 = alloca %struct.ansiseq*
store %struct.ansiseq* %0, %struct.ansiseq** %2
%3 = call i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @tnc_log_log to i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...)*)(i32 6, i32 4, i32 -1, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 439, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @__func__.termop_scrollregion, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%4 = load %struct.ansiseq*, %struct.ansiseq** %2
%5 = call i32 (%struct.ansiseq*, ...) bitcast (i32 (...)* @ansiseq_dump to i32 (%struct.ansiseq*, ...)*)(%struct.ansiseq* %4)
ret void
}

LLVM IR (-O2):
%struct.ansiseq = type opaque
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/vt100.c\00"
@__func__.termop_scrollregion = [20 x i8] c"termop_scrollregion\00"
@.str.1 = [10 x i8] c"unhandled\00"
define void @termop_scrollregion(%struct.ansiseq* %0) {
%2 = tail call i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @tnc_log_log to i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...)*)(i32 6, i32 4, i32 -1, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 439, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @__func__.termop_scrollregion, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (%struct.ansiseq*, ...) bitcast (i32 (...)* @ansiseq_dump to i32 (%struct.ansiseq*, ...)*)(%struct.ansiseq* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PseudoRandomUsingAtomic_nextInt();
void *thr1(void *arg) {
  PseudoRandomUsingAtomic_nextInt();
  return 0;
}


x86 assembly (clang, -O0):
<thr1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <PseudoRandomUsingAtomic_nextInt@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thr1>:
push   %rax
xor    %eax,%eax
call   1030 <PseudoRandomUsingAtomic_nextInt@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @thr1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @PseudoRandomUsingAtomic_nextInt()
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @thr1(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @PseudoRandomUsingAtomic_nextInt()
ret i8* null
}
/* Variables and functions */
scalar_t__ mock(char *);
char *cf_s_libexecdir(char *s) { return (char *)mock(s); }


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

x86 assembly (clang, -O2):
<cf_s_libexecdir>:
jmp    1030 <mock@plt>

LLVM IR (-O0):
define i8* @cf_s_libexecdir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @mock(i8* %3)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
define i8* @cf_s_libexecdir(i8* %0) {
%2 = tail call i64 @mock(i8* %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ BRMerkleBlockFree(void *);
void _setApplyFreeBlock(void *info, void *block) { BRMerkleBlockFree(block); }


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

x86 assembly (clang, -O2):
<_setApplyFreeBlock>:
mov    %rsi,%rdi
jmp    1030 <BRMerkleBlockFree@plt>

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

LLVM IR (-O2):
define void @_setApplyFreeBlock(i8* nocapture readnone %0, i8* %1) {
%3 = tail call i32 @BRMerkleBlockFree(i8* %1)
ret void
}
void BN_mask_bits(void) {}


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

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

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

LLVM IR (-O2):
define void @BN_mask_bits() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void print_help(void) {
  printf("Usage: white_ppm [-t|-b|-h] input output\n");
  exit(1);
}


x86 assembly (clang, -O0):
<print_help>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_help>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"Usage: white_ppm [-t|-b|-h] input output\0A\00"
define void @print_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [41 x i8] c"Usage: white_ppm [-t|-b|-h] input output\00"
define void @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
int do_037() { return 37; }


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

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

LLVM IR (-O0):
define i32 @do_037() {
ret i32 37
}

LLVM IR (-O2):
define i32 @do_037() {
ret i32 37
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void die(const char *str) {
  fprintf(stderr, "%s\n", str);
  exit(1);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @die(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
double forceToBounds(const double x, const double lower, const double upper) {
  if (x < lower) {
    return (lower);
  } else if (x > upper) {
    return (upper);
  }
  return (x);
}


x86 assembly (clang, -O0):
<forceToBounds>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1136 <forceToBounds+0x36>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1164 <forceToBounds+0x64>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    1155 <forceToBounds+0x55>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1164 <forceToBounds+0x64>
jmp    115a <forceToBounds+0x5a>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<forceToBounds>:
minsd  %xmm0,%xmm2
cmpltsd %xmm1,%xmm0
movapd %xmm0,%xmm3
andnpd %xmm2,%xmm3
andpd  %xmm1,%xmm0
orpd   %xmm3,%xmm0
ret

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

LLVM IR (-O2):
define double @forceToBounds(double %0, double %1, double %2) {
%4 = fcmp olt double %0, %1
%5 = fcmp ogt double %0, %2
%6 = select i1 %5, double %2, double %0
%7 = select i1 %4, double %1, double %6
ret double %7
}
/* Variables and functions */
void *malloc(size_t);
void *emalloc(size_t sz) { return malloc(sz); }


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

x86 assembly (clang, -O2):
<emalloc>:
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @emalloc(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i8* @malloc(i64 %3)
ret i8* %4
}

LLVM IR (-O2):
define noalias i8* @emalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct timespec {
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC_RAW;
scalar_t__ clock_gettime(int /*<<< orphan*/, struct timespec *);
int /*<<< orphan*/ die(char *, int /*<<< orphan*/);
int /*<<< orphan*/ errno;
time_t clock_seconds() {
  struct timespec t;
  if (clock_gettime(CLOCK_MONOTONIC_RAW, &t) != 0) {
    die("Unable to call clock_gettime", errno);
  }
  return t.tv_sec;
}


x86 assembly (clang, -O0):
<clock_seconds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <clock_gettime@plt>
cmp    $0x0,%rax
je     1159 <clock_seconds+0x39>
mov    0x2e8d(%rip),%rax
mov    (%rax),%esi
lea    0xeac(%rip),%rdi
call   1040 <die@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clock_seconds>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <clock_gettime@plt>
test   %rax,%rax
je     114c <clock_seconds+0x2c>
mov    0x2e9a(%rip),%rax
mov    (%rax),%esi
lea    0xeb9(%rip),%rdi
call   1040 <die@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC_RAW = global i32 0
@.str = [29 x i8] c"Unable to call clock_gettime\00"
@errno = global i32 0
define i32 @clock_seconds() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_MONOTONIC_RAW
%3 = call i64 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = load i32, i32* @errno
%7 = call i32 @die(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %8
8: ; preds = %5, %0
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%10 = load i32, i32* %9
ret i32 %10
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC_RAW = global i32 0
@.str = [29 x i8] c"Unable to call clock_gettime\00"
@errno = global i32 0
define i32 @clock_seconds() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_MONOTONIC_RAW
%4 = call i64 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %0
%7 = load i32, i32* @errno
%8 = call i32 @die(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %6, %0
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%11 = load i32, i32* %10
ret i32 %11
}
/* Type definitions */
struct kfs_file_info {
  int dummy;
};

/* Variables and functions */
int cmp_file_info(struct kfs_file_info const *, struct kfs_file_info const *);
int qsort_cmp_file_info(const void *x, const void *y) {
  return cmp_file_info(*(const struct kfs_file_info **)x,
                       *(const struct kfs_file_info **)y);
}


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

x86 assembly (clang, -O2):
<qsort_cmp_file_info>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <cmp_file_info@plt>

LLVM IR (-O0):
%struct.kfs_file_info = type { i32 }
define i32 @qsort_cmp_file_info(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 = bitcast i8* %5 to %struct.kfs_file_info**
%7 = load %struct.kfs_file_info*, %struct.kfs_file_info** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to %struct.kfs_file_info**
%10 = load %struct.kfs_file_info*, %struct.kfs_file_info** %9
%11 = call i32 @cmp_file_info(%struct.kfs_file_info* %7, %struct.kfs_file_info* %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.kfs_file_info = type { i32 }
define i32 @qsort_cmp_file_info(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to %struct.kfs_file_info**
%4 = load %struct.kfs_file_info*, %struct.kfs_file_info** %3
%5 = bitcast i8* %1 to %struct.kfs_file_info**
%6 = load %struct.kfs_file_info*, %struct.kfs_file_info** %5
%7 = tail call i32 @cmp_file_info(%struct.kfs_file_info* %4, %struct.kfs_file_info* %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void x264_free(void *p) {
  if (p) {
    free(*(((void **)p) - 1));
  }
}


x86 assembly (clang, -O0):
<x264_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1134 <x264_free+0x24>
mov    -0x8(%rbp),%rax
mov    -0x8(%rax),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x264_free>:
test   %rdi,%rdi
je     111e <x264_free+0xe>
mov    -0x8(%rdi),%rdi
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @x264_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = bitcast i8* %6 to i8**
%8 = getelementptr inbounds i8*, i8** %7, i64 -1
%9 = load i8*, i8** %8
%10 = call i32 @free(i8* %9)
br label %11
11: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @x264_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = getelementptr inbounds i8, i8* %0, i64 -8
%5 = bitcast i8* %4 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @free(i8* %6)
br label %8
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ n32016_reset_addr(int);
int /*<<< orphan*/ tube_log_performance_counters();
int /*<<< orphan*/ tube_reset_performance_counters();
int /*<<< orphan*/ tube_wait_for_rst_release();
void copro_32016_reset() {
  tube_log_performance_counters();
  n32016_reset_addr(0xF00000);
  tube_wait_for_rst_release();
  tube_reset_performance_counters();
}


x86 assembly (clang, -O0):
<copro_32016_reset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <tube_log_performance_counters@plt>
mov    $0xf00000,%edi
call   1050 <n32016_reset_addr@plt>
mov    $0x0,%al
call   1060 <tube_wait_for_rst_release@plt>
mov    $0x0,%al
call   1040 <tube_reset_performance_counters@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<copro_32016_reset>:
push   %rax
xor    %eax,%eax
call   1030 <tube_log_performance_counters@plt>
mov    $0xf00000,%edi
call   1050 <n32016_reset_addr@plt>
xor    %eax,%eax
call   1060 <tube_wait_for_rst_release@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <tube_reset_performance_counters@plt>

LLVM IR (-O0):
define void @copro_32016_reset() {
%1 = call i32 (...) @tube_log_performance_counters()
%2 = call i32 @n32016_reset_addr(i32 15728640)
%3 = call i32 (...) @tube_wait_for_rst_release()
%4 = call i32 (...) @tube_reset_performance_counters()
ret void
}

LLVM IR (-O2):
define void @copro_32016_reset() {
%1 = tail call i32 (...) @tube_log_performance_counters()
%2 = tail call i32 @n32016_reset_addr(i32 15728640)
%3 = tail call i32 (...) @tube_wait_for_rst_release()
%4 = tail call i32 (...) @tube_reset_performance_counters()
ret void
}
/* Variables and functions */
int _f(int, int /*<<< orphan*/, double const, double const *);
double _I_11(const double omega, const double vertices_omegas[4]) {
  return _f(1, 0, omega, vertices_omegas) / 3;
}


x86 assembly (clang, -O0):
<_I_11>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rdx
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <_f@plt>
mov    $0x3,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_I_11>:
push   %rax
mov    %rdi,%rdx
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <_f@plt>
cltq
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @_I_11(double %0, double* %1) {
%3 = alloca double
%4 = alloca double*
store double %0, double* %3
store double* %1, double** %4
%5 = load double, double* %3
%6 = load double*, double** %4
%7 = call i32 @_f(i32 1, i32 0, double %5, double* %6)
%8 = sdiv i32 %7, 3
%9 = sitofp i32 %8 to double
ret double %9
}

LLVM IR (-O2):
define double @_I_11(double %0, double* %1) {
%3 = tail call i32 @_f(i32 1, i32 0, double %0, double* %1)
%4 = sdiv i32 %3, 3
%5 = sitofp i32 %4 to double
ret double %5
}
void u_util_init(struct Jelly *jelly) {}


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

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

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

LLVM IR (-O2):
%struct.Jelly = type opaque
define void @u_util_init(%struct.Jelly* nocapture %0) {
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int inb(int);
int /*<<< orphan*/ outb(int, int);
void nosound() {
  uint8_t tmp = inb(0x61) & 0xFC;
  outb(0x61, tmp);
}


x86 assembly (clang, -O0):
<nosound>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x61,%edi
call   1040 <inb@plt>
and    $0xfc,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x61,%edi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nosound>:
push   %rax
mov    $0x61,%edi
call   1040 <inb@plt>
and    $0xfc,%eax
mov    $0x61,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @nosound() {
%1 = alloca i32
%2 = call i32 @inb(i32 97)
%3 = and i32 %2, 252
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = call i32 @outb(i32 97, i32 %4)
ret void
}

LLVM IR (-O2):
define void @nosound() {
%1 = tail call i32 @inb(i32 97)
%2 = and i32 %1, 252
%3 = tail call i32 @outb(i32 97, i32 %2)
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int dobldobl_deflate(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(249, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<dobldobl_deflate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0xf9,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dobldobl_deflate>:
mov    $0xf9,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @dobldobl_deflate() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 249, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @dobldobl_deflate() {
%1 = tail call i32 @_ada_use_c2phc(i32 249, i32* undef, i32* undef, double* undef)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ SSL_library_init();
int /*<<< orphan*/ SSL_load_error_strings();
void ssl_init() {
  SSL_library_init();
  SSL_load_error_strings();
}


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

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

LLVM IR (-O0):
define void @ssl_init() {
%1 = call i32 (...) @SSL_library_init()
%2 = call i32 (...) @SSL_load_error_strings()
ret void
}

LLVM IR (-O2):
define void @ssl_init() {
%1 = tail call i32 (...) @SSL_library_init()
%2 = tail call i32 (...) @SSL_load_error_strings()
ret void
}
int mp_isprint(char c) { return (unsigned char)c >= 32; }


x86 assembly (clang, -O0):
<mp_isprint>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x20,%eax
setge  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_isprint>:
xor    %eax,%eax
cmp    $0x20,%dil
setae  %al
ret

LLVM IR (-O0):
define i32 @mp_isprint(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp sge i32 %4, 32
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @mp_isprint(i8 signext %0) {
%2 = icmp ugt i8 %0, 31
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() {
  printf("hello");
  printf("world");
  printf("\n");
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
lea    0xed2(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
@.str.1 = [6 x i8] c"world\00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
@.str.1 = [6 x i8] c"world\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @putchar(i32 10)
ret i32 0
}
void specialKeyPressed(int key, int x, int y) {
  (void)key;
  (void)x;
  (void)y;
}


x86 assembly (clang, -O0):
<specialKeyPressed>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @specialKeyPressed(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 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
ret void
}

LLVM IR (-O2):
define void @specialKeyPressed(i32 %0, i32 %1, i32 %2) {
ret void
}
void foo720() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ calloc(int /*<<< orphan*/, int);
int64_t L_halloc(int64_t size) { return (int64_t)calloc(size, 1); }


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

x86 assembly (clang, -O2):
<L_halloc>:
mov    $0x1,%esi
jmp    1030 <calloc@plt>

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

LLVM IR (-O2):
define i32 @L_halloc(i32 %0) {
%2 = tail call i32 @calloc(i32 %0, i32 1)
ret i32 %2
}
void snapscani_mutex_unlock(int *sem_id) {}


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

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

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

LLVM IR (-O2):
define void @snapscani_mutex_unlock(i32* nocapture %0) {
ret void
}
/* Type definitions */
typedef char uint32_t;

/* Variables and functions */
char ntohl(char);
uint32_t _bt_uint32_t(char *buf, int offset) {
  return ntohl(ntohl((uint32_t)(buf[offset] << 24) | (buf[offset + 1] << 16) |
                     (buf[offset + 2] << 8) | buf[offset + 3]));
}


x86 assembly (clang, -O0):
<_bt_uint32_t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
shl    $0x18,%eax
movsbl %al,%eax
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%edx
add    $0x1,%edx
movslq %edx,%rdx
movsbl (%rcx,%rdx,1),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%edx
add    $0x2,%edx
movslq %edx,%rdx
movsbl (%rcx,%rdx,1),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%edx
add    $0x3,%edx
movslq %edx,%rdx
movsbl (%rcx,%rdx,1),%ecx
or     %ecx,%eax
movsbl %al,%edi
call   1030 <ntohl@plt>
movsbl %al,%edi
call   1030 <ntohl@plt>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_bt_uint32_t>:
push   %rax
movslq %esi,%rax
movsbl 0x3(%rax,%rdi,1),%edi
call   1030 <ntohl@plt>
movsbl %al,%edi
pop    %rax
jmp    1030 <ntohl@plt>

LLVM IR (-O0):
define signext i8 @_bt_uint32_t(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = shl i32 %10, 24
%12 = trunc i32 %11 to i8
%13 = sext i8 %12 to i32
%14 = load i8*, i8** %3
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 1
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %14, i64 %17
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = shl i32 %20, 16
%22 = or i32 %13, %21
%23 = load i8*, i8** %3
%24 = load i32, i32* %4
%25 = add nsw i32 %24, 2
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i8, i8* %23, i64 %26
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = shl i32 %29, 8
%31 = or i32 %22, %30
%32 = load i8*, i8** %3
%33 = load i32, i32* %4
%34 = add nsw i32 %33, 3
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds i8, i8* %32, i64 %35
%37 = load i8, i8* %36
%38 = sext i8 %37 to i32
%39 = or i32 %31, %38
%40 = trunc i32 %39 to i8
%41 = call signext i8 @ntohl(i8 signext %40)
%42 = call signext i8 @ntohl(i8 signext %41)
ret i8 %42
}

LLVM IR (-O2):
define signext i8 @_bt_uint32_t(i8* nocapture %0, i32 %1) {
%3 = add nsw i32 %1, 3
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = tail call signext i8 @ntohl(i8 signext %6)
%8 = tail call signext i8 @ntohl(i8 signext %7)
ret i8 %8
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
void errorOpType(void) { error("Unexpected operand type\n"); }


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

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

LLVM IR (-O0):
@.str = [25 x i8] c"Unexpected operand type\0A\00"
define void @errorOpType() {
%1 = call i32 @error(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"Unexpected operand type\0A\00"
define void @errorOpType() {
%1 = tail call i32 @error(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret void
}
int test_imm_E7uint8_reg(unsigned char val) {
  return ((val) & (0xE7 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_E7uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -25
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void p1(int s) { char b[s]; }


x86 assembly (clang, -O0):
<p1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @p1(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = call i8* @llvm.stacksave()
store i8* %7, i8** %3
%8 = alloca i8, i64 %6
store i64 %6, i64* %4
%9 = load i8*, i8** %3
ret void
}

LLVM IR (-O2):
define void @p1(i32 %0) {
ret void
}
/* Variables and functions */
int tunemu_open(char *);
int tun_open(char *dev) { return tunemu_open(dev); }


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

x86 assembly (clang, -O2):
<tun_open>:
jmp    1030 <tunemu_open@plt>

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

LLVM IR (-O2):
define i32 @tun_open(i8* %0) {
%2 = tail call i32 @tunemu_open(i8* %0)
ret i32 %2
}