xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
void *doIO(void *threadid) {
  FILE *file = (FILE *)threadid;
  fwrite("TEST", 4, 1, file);
  pthread_exit(NULL);
}


x86 assembly (clang, -O0):
<doIO>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
lea    0xec1(%rip),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1040 <fwrite@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doIO>:
push   %rax
mov    %rdi,%rcx
lea    0xed5(%rip),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1040 <fwrite@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"TEST\00"
define i8* @doIO(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
store i32* %6, i32** %4
%7 = load i32*, i32** %4
%8 = call i32 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4, i32 1, i32* %7)
%9 = call i32 @pthread_exit(i32* null)
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [5 x i8] c"TEST\00"
define noalias i8* @doIO(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4, i32 1, i32* %2)
%4 = tail call i32 @pthread_exit(i32* null)
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ link_error();
void test3(int param1, int param2) {
  int local;
  if (param1)
    local = 3;
  if (param2)
    if (local != 3)
      link_error();
}


x86 assembly (clang, -O0):
<test3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112f <test3+0x1f>
movl   $0x3,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     114f <test3+0x3f>
cmpl   $0x3,-0xc(%rbp)
je     114a <test3+0x3a>
mov    $0x0,%al
call   1030 <link_error@plt>
jmp    114f <test3+0x3f>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test3(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 3, i32* %5
br label %9
9: ; preds = %8, %2
%10 = load i32, i32* %4
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %18
12: ; preds = %9
%13 = load i32, i32* %5
%14 = icmp ne i32 %13, 3
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = call i32 (...) @link_error()
br label %17
17: ; preds = %15, %12
br label %18
18: ; preds = %17, %9
ret void
}

LLVM IR (-O2):
define void @test3(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int *do_an_allocation();
int /*<<< orphan*/ free_an_allocation(int *);
int main(int argc, char *argv[]) {
  int *ptr = do_an_allocation();
  free_an_allocation(ptr);
  int a = *ptr;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <do_an_allocation@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free_an_allocation@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <do_an_allocation@plt>
mov    %rax,%rdi
call   1030 <free_an_allocation@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32* (...) @do_an_allocation()
store i32* %8, i32** %6
%9 = load i32*, i32** %6
%10 = call i32 @free_an_allocation(i32* %9)
%11 = load i32*, i32** %6
%12 = load i32, i32* %11
store i32 %12, i32* %7
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32* (...) @do_an_allocation()
%4 = tail call i32 @free_an_allocation(i32* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ realloc(void *, long);
void az(void *q, long r) { realloc(q, r); }


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

x86 assembly (clang, -O2):
<az>:
jmp    1030 <realloc@plt>

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

LLVM IR (-O2):
define void @az(i8* %0, i64 %1) {
%3 = tail call i32 @realloc(i8* %0, i64 %1)
ret void
}
void ffree_vector(v, nl, nh) float *v;
int nl, nh;
{ free((char *)(v + nl)); }


x86 assembly (clang, -O0):
<ffree_vector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffree_vector>:
movslq %esi,%rax
lea    (%rdi,%rax,4),%rdi
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @ffree_vector(float* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds float, float* %0, i64 %4
%6 = bitcast float* %5 to i8*
tail call void @free(i8* %6)
ret void
}
/* Type definitions */
typedef unsigned char volatile uint32_t;

/* Variables and functions */
uint32_t ADI8RegRead(uint32_t ui32Base, uint32_t ui32Reg) {
  ;
  ;
  return ((*((volatile unsigned char *)(ui32Base + ui32Reg))));
}


x86 assembly (clang, -O0):
<ADI8RegRead>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    -0x1(%rbp),%al
movzbl %al,%eax
mov    -0x2(%rbp),%cl
movzbl %cl,%ecx
add    %ecx,%eax
cltq
mov    (%rax),%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADI8RegRead>:
mov    %dil,-0x1(%rsp)
mov    %sil,-0x2(%rsp)
movzbl -0x1(%rsp),%eax
movzbl -0x2(%rsp),%ecx
mov    (%rcx,%rax,1),%al
ret

LLVM IR (-O0):
define zeroext i8 @ADI8RegRead(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store volatile i8 %0, i8* %3
store volatile i8 %1, i8* %4
%5 = load volatile i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load volatile i8, i8* %4
%8 = zext i8 %7 to i32
%9 = add nsw i32 %6, %8
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i8*
%12 = load volatile i8, i8* %11
ret i8 %12
}

LLVM IR (-O2):
define zeroext i8 @ADI8RegRead(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store volatile i8 %0, i8* %3
store volatile i8 %1, i8* %4
%5 = load volatile i8, i8* %3
%6 = zext i8 %5 to i64
%7 = load volatile i8, i8* %4
%8 = zext i8 %7 to i64
%9 = add nuw nsw i64 %8, %6
%10 = inttoptr i64 %9 to i8*
%11 = load volatile i8, i8* %10
ret i8 %11
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *prog) {
  fprintf(stderr,
          "usage:\t%s<options>\n"
          "\t\t-u\tInput variant or individual uncompressed binary file name\n"
          "\t\t-n\tNumber of fields to OR\n"
          "\t\t-f\tCSV field IDs\n",
          prog);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [130 x i8] c"usage:\09%s<options>\0A\09\09-u\09Input variant or individual uncompressed binary file name\0A\09\09-n\09Number of fields to OR\0A\09\09-f\09CSV field IDs\0A\00"
define void @usage(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 ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [130 x i8] c"usage:\09%s<options>\0A\09\09-u\09Input variant or individual uncompressed binary file name\0A\09\09-n\09Number of fields to OR\0A\09\09-f\09CSV field IDs\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int dcmpun(double a, double b) { return __builtin_isunordered(a, b); }


x86 assembly (clang, -O0):
<dcmpun>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
setp   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dcmpun>:
xor    %eax,%eax
ucomisd %xmm1,%xmm0
setp   %al
ret

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

LLVM IR (-O2):
define i32 @dcmpun(double %0, double %1) {
%3 = fcmp uno double %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
char check_char(char x) { return x; }


x86 assembly (clang, -O0):
<check_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define signext i8 @check_char(i8 returned signext %0) {
ret i8 %0
}
void av_stristr() {}


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

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

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

LLVM IR (-O2):
define void @av_stristr() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ im_a_minion_01();
void testFuncMultiLineStatement(void) { im_a_minion_01(); }


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

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

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

LLVM IR (-O2):
define void @testFuncMultiLineStatement() {
%1 = tail call i32 (...) @im_a_minion_01()
ret void
}
void __ipipe_idle(void) {}


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

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

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

LLVM IR (-O2):
define void @__ipipe_idle() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
void main() {
  int i;
  for (i = 0; i < 1000000; i += 2)
    ;
  __VERIFIER_assert(i == 1000000);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0xf4240,-0x4(%rbp)
jge    113f <main+0x2f>
jmp    1131 <main+0x21>
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <main+0xf>
cmpl   $0xf4240,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__VERIFIER_assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%edi
jmp    1030 <__VERIFIER_assert@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %6, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 1000000
br i1 %4, label %5, label %9
5: ; preds = %2
br label %6
6: ; preds = %5
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 2
store i32 %8, i32* %1
br label %2
9: ; preds = %2
%10 = load i32, i32* %1
%11 = icmp eq i32 %10, 1000000
%12 = zext i1 %11 to i32
%13 = call i32 @__VERIFIER_assert(i32 %12)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @__VERIFIER_assert(i32 1)
ret void
}
int test_imm_F5uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0xF5 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_F5uint64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x20,%rdx
and    $0xf5,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_F5uint64_highword_reg>:
movabs $0xf500000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_F5uint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = and i64 %4, 245
%6 = icmp ne i64 %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_F5uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 1052266987520
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
unsigned char *inv_int32_to_little8(long x, unsigned char *little8) {
  little8[3] = (unsigned char)((x >> 24) & 0xff);
  little8[2] = (unsigned char)((x >> 16) & 0xff);
  little8[1] = (unsigned char)((x >> 8) & 0xff);
  little8[0] = (unsigned char)(x & 0xff);
  return little8;
}


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

x86 assembly (clang, -O2):
<inv_int32_to_little8>:
mov    %rsi,%rax
mov    %edi,(%rsi)
ret

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

LLVM IR (-O2):
define i8* @inv_int32_to_little8(i64 %0, i8* returned writeonly %1) {
%3 = lshr i64 %0, 24
%4 = trunc i64 %3 to i8
%5 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %4, i8* %5
%6 = lshr i64 %0, 16
%7 = trunc i64 %6 to i8
%8 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %7, i8* %8
%9 = lshr i64 %0, 8
%10 = trunc i64 %9 to i8
%11 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %10, i8* %11
%12 = trunc i64 %0 to i8
store i8 %12, i8* %1
ret i8* %1
}
/* Variables and functions */
int test_print_results();
int main(int argc, char **argv) {
  (void)argc;
  (void)argv;
  extern void Vector(void);
  Vector();
  ;
  extern void List(void);
  List();
  ;
  extern void Buffer(void);
  Buffer();
  ;
  extern void String(void);
  String();
  ;
  extern void RBT(void);
  RBT();
  ;
  extern void Exn(void);
  Exn();
  ;
  extern void Set(void);
  Set();
  ;
  extern void Map(void);
  Map();
  ;
  return test_print_results();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
call   1070 <Vector@plt>
call   10a0 <List@plt>
call   1030 <Buffer@plt>
call   1040 <String@plt>
call   1080 <RBT@plt>
call   1090 <Exn@plt>
call   10b0 <Set@plt>
call   1060 <Map@plt>
mov    $0x0,%al
call   1050 <test_print_results@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1070 <Vector@plt>
call   10a0 <List@plt>
call   1030 <Buffer@plt>
call   1040 <String@plt>
call   1080 <RBT@plt>
call   1090 <Exn@plt>
call   10b0 <Set@plt>
call   1060 <Map@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <test_print_results@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 (...) @test_print_results()
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
tail call void @Vector()
tail call void @List()
tail call void @Buffer()
tail call void @String()
tail call void @RBT()
tail call void @Exn()
tail call void @Set()
tail call void @Map()
%3 = tail call i32 (...) @test_print_results()
ret i32 %3
}
void av_buffer_pool_get() {}


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

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

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

LLVM IR (-O2):
define void @av_buffer_pool_get() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Reserved78_DriverIRQHandler();
__attribute__((weak)) void Reserved78_IRQHandler(void) {
  Reserved78_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @Reserved78_IRQHandler() {
%1 = call i32 (...) @Reserved78_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @Reserved78_IRQHandler() {
%1 = tail call i32 (...) @Reserved78_DriverIRQHandler()
ret void
}
void stripext(char *in, char *out) {
  while (*in && *in != '.')
    *out++ = *in++;
  *out = 0;
}


x86 assembly (clang, -O0):
<stripext>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1131 <stripext+0x31>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1141 <stripext+0x41>
jmp    1168 <stripext+0x68>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
jmp    110c <stripext+0xc>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<stripext>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rax,1),%ecx
test   %cl,%cl
je     1126 <stripext+0x26>
cmp    $0x2e,%cl
je     1126 <stripext+0x26>
mov    %cl,(%rsi,%rax,1)
add    $0x1,%rax
jmp    1110 <stripext+0x10>
movb   $0x0,(%rsi,%rax,1)
ret

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

LLVM IR (-O2):
define void @stripext(i8* nocapture %0, i8* nocapture writeonly %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i8* [ %0, %2 ], [ %8, %7 ]
%5 = phi i8* [ %1, %2 ], [ %9, %7 ]
%6 = load i8, i8* %4
switch i8 %6, label %7 [
i8 0, label %10
i8 46, label %10
]
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %4, i64 1
%9 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %6, i8* %5
br label %3
10: ; preds = %3, %3
store i8 0, i8* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x86() {
  Assert_real((iscntrl(134) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_iscntrl.c",
              675, ("iscntrl should be 0 for 0x86"));
}


x86 assembly (clang, -O0):
<t_iscntrl_0x86>:
push   %rbp
mov    %rsp,%rbp
mov    $0x86,%edi
call   1030 <iscntrl@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x2a3,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_iscntrl_0x86>:
push   %rax
mov    $0x86,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2a3,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0x86\00"
define void @t_iscntrl_0x86() {
%1 = call i64 @iscntrl(i32 134)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 675, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0x86\00"
define void @t_iscntrl_0x86() {
%1 = tail call i64 @iscntrl(i32 134)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 675, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int genRand();
int nrand(int end) { return genRand() % end; }


x86 assembly (clang, -O0):
<nrand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <genRand@plt>
cltd
idivl  -0x4(%rbp)
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrand>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <genRand@plt>
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @nrand(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @genRand()
%4 = load i32, i32* %2
%5 = srem i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @nrand(i32 %0) {
%2 = tail call i32 (...) @genRand()
%3 = srem i32 %2, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ wczytaj_liczbe_calkowita(int *);
int main() {
  int n, suma = 0;
  int i;
  wczytaj_liczbe_calkowita(&n);
  for (i = 1; i <= n; i++) {
    suma += i;
  }
  printf("Suma: %d\n", suma);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <wczytaj_liczbe_calkowita@plt>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1169 <main+0x49>
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1146 <main+0x26>
mov    -0xc(%rbp),%esi
lea    0xe8d(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <wczytaj_liczbe_calkowita@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
jle    1148 <main+0x28>
lea    -0x1(%rax),%ecx
lea    -0x2(%rax),%edx
imul   %rcx,%rdx
shr    %rdx
lea    (%rdx,%rax,2),%esi
add    $0xffffffff,%esi
jmp    114a <main+0x2a>
xor    %esi,%esi
lea    0xeaf(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"Suma: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @wczytaj_liczbe_calkowita(i32* %1)
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 1
br i1 %5, label %17, label %6
6: ; preds = %0
%7 = shl nuw i32 %4, 1
%8 = add nsw i32 %4, -1
%9 = zext i32 %8 to i33
%10 = add nsw i32 %4, -2
%11 = zext i32 %10 to i33
%12 = mul i33 %9, %11
%13 = lshr i33 %12, 1
%14 = trunc i33 %13 to i32
%15 = add i32 %7, %14
%16 = add i32 %15, -1
br label %17
17: ; preds = %6, %0
%18 = phi i32 [ 0, %0 ], [ %16, %6 ]
%19 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %18)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ INTERNAL_init_viewport_history(int);
int /*<<< orphan*/ INTERNAL_kill_viewport_history(int);
void INTERNAL_reset_viewport_history(int win_id) {
  INTERNAL_kill_viewport_history(win_id);
  INTERNAL_init_viewport_history(win_id);
}


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

x86 assembly (clang, -O2):
<INTERNAL_reset_viewport_history>:
push   %rbx
mov    %edi,%ebx
call   1040 <INTERNAL_kill_viewport_history@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <INTERNAL_init_viewport_history@plt>

LLVM IR (-O0):
define void @INTERNAL_reset_viewport_history(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @INTERNAL_kill_viewport_history(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @INTERNAL_init_viewport_history(i32 %5)
ret void
}

LLVM IR (-O2):
define void @INTERNAL_reset_viewport_history(i32 %0) {
%2 = tail call i32 @INTERNAL_kill_viewport_history(i32 %0)
%3 = tail call i32 @INTERNAL_init_viewport_history(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *safe_malloc(size_t size) {
  void *ptr = malloc(size);
  if (!ptr) {
    fprintf(stderr, "Can't allocate memory!\n");
    exit(EXIT_FAILURE);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<safe_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1177 <safe_malloc+0x47>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_malloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <safe_malloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Can't allocate memory!\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @safe_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %13, label %8
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Can't allocate memory!\0A\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @safe_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int /*<<< orphan*/ basic_test(int);
int /*<<< orphan*/ close(int);
int open(char *, int /*<<< orphan*/);
void open_logical(void) {
  int fd;
  fd = open("/dev/ssr", O_RDWR);
  basic_test(fd >= 0);
  close(fd);
}


x86 assembly (clang, -O0):
<open_logical>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
lea    0xeb8(%rip),%rdi
call   1050 <open@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <basic_test@plt>
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_logical>:
push   %rbx
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xebf(%rip),%rdi
call   1050 <open@plt>
mov    %eax,%ebx
mov    %eax,%edi
not    %edi
shr    $0x1f,%edi
call   1030 <basic_test@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <close@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"/dev/ssr\00"
@O_RDWR = global i32 0
define void @open_logical() {
%1 = alloca i32
%2 = load i32, i32* @O_RDWR
%3 = call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %2)
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp sge i32 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @basic_test(i32 %6)
%8 = load i32, i32* %1
%9 = call i32 @close(i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"/dev/ssr\00"
@O_RDWR = global i32 0
define void @open_logical() {
%1 = load i32, i32* @O_RDWR
%2 = tail call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = xor i32 %2, -1
%4 = lshr i32 %3, 31
%5 = tail call i32 @basic_test(i32 %4)
%6 = tail call i32 @close(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int abs(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int bin_diff(int min_bin, int max_bin) {
  int diff = abs(max_bin - min_bin);
  if (diff > 1) {
    printf("\nCoordinate overlaps 3 or more bins: raise bin_size_ratio.\n");
    exit(EXIT_FAILURE);
  }
  return diff;
}


x86 assembly (clang, -O0):
<bin_diff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
sub    -0x4(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jle    1170 <bin_diff+0x40>
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e77(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bin_diff>:
sub    %edi,%esi
mov    %esi,%eax
neg    %eax
cmovs  %esi,%eax
cmp    $0x2,%eax
jae    112f <bin_diff+0xf>
ret
push   %rax
lea    0xec9(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [60 x i8] c"\0ACoordinate overlaps 3 or more bins: raise bin_size_ratio.\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @bin_diff(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = call i32 @abs(i32 %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = icmp sgt i32 %10, 1
br i1 %11, label %12, label %16
12: ; preds = %2
%13 = call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
%14 = load i32, i32* @EXIT_FAILURE
%15 = call i32 @exit(i32 %14)
unreachable
16: ; preds = %2
%17 = load i32, i32* %5
ret i32 %17
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@str = [59 x i8] c"\0ACoordinate overlaps 3 or more bins: raise bin_size_ratio.\00"
define i32 @bin_diff(i32 %0, i32 %1) {
%3 = sub nsw i32 %1, %0
%4 = tail call i32 @llvm.abs.i32(i32 %3, i1 true)
%5 = icmp ugt i32 %4, 1
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %2
ret i32 %4
}
void task_enter() { ("task_enter"); }


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"task_enter\00"
define void @task_enter() {
ret void
}

LLVM IR (-O2):
define void @task_enter() {
ret void
}
/* Type definitions */
struct _reent {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ BT_kFree(void *);
void _free_r(struct _reent *r, void *ptr) {
  ;
  BT_kFree(ptr);
}


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

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

LLVM IR (-O0):
%struct._reent = type { i32 }
define void @_free_r(%struct._reent* %0, i8* %1) {
%3 = alloca %struct._reent*
%4 = alloca i8*
store %struct._reent* %0, %struct._reent** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @BT_kFree(i8* %5)
ret void
}

LLVM IR (-O2):
%struct._reent = type { i32 }
define void @_free_r(%struct._reent* nocapture readnone %0, i8* %1) {
%3 = tail call i32 @BT_kFree(i8* %1)
ret void
}
/* Type definitions */
struct pollfd {
  int dummy;
};

/* Variables and functions */
int poll(struct pollfd *, unsigned int, int);
__attribute__((visibility("default"))) int
httplib_poll(struct pollfd *pfd, unsigned int n, int milliseconds) {
  return poll(pfd, n, milliseconds);
}


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

x86 assembly (clang, -O2):
<httplib_poll>:
jmp    1030 <poll@plt>

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

LLVM IR (-O2):
%struct.pollfd = type { i32 }
define i32 @httplib_poll(%struct.pollfd* %0, i32 %1, i32 %2) {
%4 = tail call i32 @poll(%struct.pollfd* %0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
void ComparatorIntEnable(unsigned long ulBase, unsigned long ulComp) {
  DEBUG_ASSERT(ulBase == 0x4003C000);
  DEBUG_ASSERT(ulComp < 3);
  (*((volatile unsigned long *)(ulBase + 0x00000008))) |= 1 << ulComp;
}


x86 assembly (clang, -O0):
<ComparatorIntEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x4003c000,-0x8(%rbp)
40
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
cmpq   $0x3,-0x10(%rbp)
setb   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
movslq %eax,%rdx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rcx
or     %rdx,%rcx
mov    %rcx,0x8(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ComparatorIntEnable>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %edi,%edi
cmp    $0x4003c000,%r14
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
xor    %edi,%edi
cmp    $0x3,%rbx
setb   %dil
call   1030 <DEBUG_ASSERT@plt>
mov    $0x1,%eax
mov    %ebx,%ecx
shl    %cl,%eax
cltq
or     %rax,0x8(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @ComparatorIntEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = icmp eq i64 %5, 1073987584
%7 = zext i1 %6 to i32
%8 = call i32 @DEBUG_ASSERT(i32 %7)
%9 = load i64, i64* %4
%10 = icmp ult i64 %9, 3
%11 = zext i1 %10 to i32
%12 = call i32 @DEBUG_ASSERT(i32 %11)
%13 = load i64, i64* %4
%14 = trunc i64 %13 to i32
%15 = shl i32 1, %14
%16 = sext i32 %15 to i64
%17 = load i64, i64* %3
%18 = add i64 %17, 8
%19 = inttoptr i64 %18 to i64*
%20 = load volatile i64, i64* %19
%21 = or i64 %20, %16
store volatile i64 %21, i64* %19
ret void
}

LLVM IR (-O2):
define void @ComparatorIntEnable(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 1073987584
%4 = zext i1 %3 to i32
%5 = tail call i32 @DEBUG_ASSERT(i32 %4)
%6 = icmp ult i64 %1, 3
%7 = zext i1 %6 to i32
%8 = tail call i32 @DEBUG_ASSERT(i32 %7)
%9 = trunc i64 %1 to i32
%10 = shl nuw i32 1, %9
%11 = sext i32 %10 to i64
%12 = add i64 %0, 8
%13 = inttoptr i64 %12 to i64*
%14 = load volatile i64, i64* %13
%15 = or i64 %14, %11
store volatile i64 %15, i64* %13
ret void
}
void f(int y) {}


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

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

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

LLVM IR (-O2):
define void @f(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _SC_NPROCESSORS_CONF;
int sysconf(int /*<<< orphan*/);
int elg_pform_num_cpus() { return sysconf(_SC_NPROCESSORS_CONF); }


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

x86 assembly (clang, -O2):
<elg_pform_num_cpus>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <sysconf@plt>

LLVM IR (-O0):
@_SC_NPROCESSORS_CONF = global i32 0
define i32 @elg_pform_num_cpus() {
%1 = load i32, i32* @_SC_NPROCESSORS_CONF
%2 = call i32 @sysconf(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@_SC_NPROCESSORS_CONF = global i32 0
define i32 @elg_pform_num_cpus() {
%1 = load i32, i32* @_SC_NPROCESSORS_CONF
%2 = tail call i32 @sysconf(i32 %1)
ret i32 %2
}
int do_155() { return 155; }


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

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

LLVM IR (-O0):
define i32 @do_155() {
ret i32 155
}

LLVM IR (-O2):
define i32 @do_155() {
ret i32 155
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, int);
int set_nonblocking(int sck) {
  int flags;
  flags = fcntl(sck, F_GETFL, 0);
  flags |= O_NONBLOCK;
  if (fcntl(sck, F_SETFL, flags))
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<set_nonblocking>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    %eax,-0xc(%rbp)
mov    0x2eb0(%rip),%rax
mov    (%rax),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2e8e(%rip),%rax
mov    (%rax),%esi
mov    -0xc(%rbp),%edx
call   1030 <fcntl@plt>
cmp    $0x0,%eax
je     1169 <set_nonblocking+0x59>
movl   $0xffffffff,-0x4(%rbp)
jmp    1170 <set_nonblocking+0x60>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_nonblocking>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    0x2ebe(%rip),%rcx
or     (%rcx),%eax
mov    0x2ea5(%rip),%rcx
mov    (%rcx),%esi
mov    %ebx,%edi
mov    %eax,%edx
call   1030 <fcntl@plt>
neg    %eax
sbb    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@F_GETFL = global i32 0
@O_NONBLOCK = global i32 0
@F_SETFL = global i32 0
define i32 @set_nonblocking(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* @F_GETFL
%7 = call i32 @fcntl(i32 %5, i32 %6, i32 0)
store i32 %7, i32* %4
%8 = load i32, i32* @O_NONBLOCK
%9 = load i32, i32* %4
%10 = or i32 %9, %8
store i32 %10, i32* %4
%11 = load i32, i32* %3
%12 = load i32, i32* @F_SETFL
%13 = load i32, i32* %4
%14 = call i32 @fcntl(i32 %11, i32 %12, i32 %13)
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %1
store i32 -1, i32* %2
br label %18
17: ; preds = %1
store i32 0, i32* %2
br label %18
18: ; preds = %17, %16
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@O_NONBLOCK = global i32 0
@F_SETFL = global i32 0
define i32 @set_nonblocking(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i32 @fcntl(i32 %0, i32 %2, i32 0)
%4 = load i32, i32* @O_NONBLOCK
%5 = or i32 %4, %3
%6 = load i32, i32* @F_SETFL
%7 = tail call i32 @fcntl(i32 %0, i32 %6, i32 %5)
%8 = icmp ne i32 %7, 0
%9 = sext i1 %8 to i32
ret i32 %9
}
const char *mg_version(void) { return ("2.8"); }


x86 assembly (clang, -O0):
<mg_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mg_version>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"2.8\00"
define i8* @mg_version() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [4 x i8] c"2.8\00"
define i8* @mg_version() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
char get_mapped_char_from_num(int);
int get_mapped_num_from_char(char);
char decode_character(char input_letter, char key_letter) {
  int letter_mapped = get_mapped_num_from_char(input_letter);
  int key_mapped = get_mapped_num_from_char(key_letter);
  int subbed = (letter_mapped - key_mapped);
  if (subbed < 0) {
    subbed += 27;
  }
  return get_mapped_char_from_num(subbed);
}


x86 assembly (clang, -O0):
<decode_character>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%edi
call   1040 <get_mapped_num_from_char@plt>
mov    %eax,-0x8(%rbp)
movsbl -0x2(%rbp),%edi
call   1040 <get_mapped_num_from_char@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    1168 <decode_character+0x48>
mov    -0x10(%rbp),%eax
add    $0x1b,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <get_mapped_char_from_num@plt>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_character>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
call   1040 <get_mapped_num_from_char@plt>
mov    %eax,%ebx
mov    %ebp,%edi
call   1040 <get_mapped_num_from_char@plt>
sub    %eax,%ebx
lea    0x1b(%rbx),%edi
test   %ebx,%ebx
cmovns %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <get_mapped_char_from_num@plt>

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

LLVM IR (-O2):
define signext i8 @decode_character(i8 signext %0, i8 signext %1) {
%3 = tail call i32 @get_mapped_num_from_char(i8 signext %0)
%4 = tail call i32 @get_mapped_num_from_char(i8 signext %1)
%5 = sub nsw i32 %3, %4
%6 = icmp slt i32 %5, 0
%7 = add nsw i32 %5, 27
%8 = select i1 %6, i32 %7, i32 %5
%9 = tail call signext i8 @get_mapped_char_from_num(i32 %8)
ret i8 %9
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void butterhpf_note_free(void *data) { free(data); }


x86 assembly (clang, -O0):
<butterhpf_note_free>:
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):
<butterhpf_note_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @butterhpf_note_free(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 @butterhpf_note_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, char);
int main() {
  char a = 'a';
  char b = 'b';
  {
    char c;
    c = a;
    a = b;
    b = c;
  };
  printf("a is now %c and b is now %c\n", a, b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x61,-0x5(%rbp)
movb   $0x62,-0x6(%rbp)
mov    -0x5(%rbp),%al
mov    %al,-0x7(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x7(%rbp),%al
mov    %al,-0x6(%rbp)
mov    -0x5(%rbp),%al
lea    0xebd(%rip),%rdi
movsbl %al,%esi
movsbl -0x6(%rbp),%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [29 x i8] c"a is now %c and b is now %c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
store i32 0, i32* %1
store i8 97, i8* %2
store i8 98, i8* %3
%5 = load i8, i8* %2
store i8 %5, i8* %4
%6 = load i8, i8* %3
store i8 %6, i8* %2
%7 = load i8, i8* %4
store i8 %7, i8* %3
%8 = load i8, i8* %2
%9 = load i8, i8* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8 signext %8, i8 signext %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"a is now %c and b is now %c\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8 signext 98, i8 signext 97)
ret i32 0
}