xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int cubic_scale_denom(uint32_t src_dim, uint32_t out_dim) {
  uint32_t scale_factor;
  scale_factor = src_dim / out_dim;
  if (scale_factor >= 8 * 4) {
    return 8;
  } else if (scale_factor >= 4 * 4) {
    return 4;
  } else if (scale_factor >= 2 * 4) {
    return 2;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<cubic_scale_denom>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x10(%rbp)
cmpl   $0x20,-0x10(%rbp)
jl     112a <cubic_scale_denom+0x2a>
movl   $0x8,-0x4(%rbp)
jmp    115d <cubic_scale_denom+0x5d>
cmpl   $0x10,-0x10(%rbp)
jl     1140 <cubic_scale_denom+0x40>
movl   $0x4,-0x4(%rbp)
jmp    115d <cubic_scale_denom+0x5d>
cmpl   $0x8,-0x10(%rbp)
jl     1156 <cubic_scale_denom+0x56>
movl   $0x2,-0x4(%rbp)
jmp    115d <cubic_scale_denom+0x5d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cubic_scale_denom>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %eax,%ecx
mov    $0x8,%eax
cmp    $0x1f,%ecx
jg     1126 <cubic_scale_denom+0x26>
mov    $0x4,%eax
cmp    $0xf,%ecx
jg     1126 <cubic_scale_denom+0x26>
xor    %eax,%eax
cmp    $0x8,%ecx
setge  %al
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @cubic_scale_denom(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
%4 = icmp sgt i32 %3, 31
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = icmp sgt i32 %3, 15
br i1 %6, label %10, label %7
7: ; preds = %5
%8 = icmp sgt i32 %3, 7
%9 = select i1 %8, i32 2, i32 1
br label %10
10: ; preds = %7, %5, %2
%11 = phi i32 [ 8, %2 ], [ 4, %5 ], [ %9, %7 ]
ret i32 %11
}
int onlyATGC(char c) { return c == 'A' || c == 'T' || c == 'G' || c == 'C'; }


x86 assembly (clang, -O0):
<onlyATGC>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x41,%ecx
mov    %al,-0x2(%rbp)
je     114d <onlyATGC+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x54,%ecx
mov    %al,-0x2(%rbp)
je     114d <onlyATGC+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x47,%ecx
mov    %al,-0x2(%rbp)
je     114d <onlyATGC+0x4d>
movsbl -0x1(%rbp),%eax
cmp    $0x43,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<onlyATGC>:
lea    -0x41(%rdi),%ecx
cmp    $0x13,%cl
ja     111c <onlyATGC+0x1c>
mov    $0x1,%eax
movzbl %cl,%ecx
mov    $0x80041,%edx
bt     %rcx,%rdx
jae    111c <onlyATGC+0x1c>
ret
xor    %eax,%eax
cmp    $0x43,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @onlyATGC(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 65
br i1 %5, label %18, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 84
br i1 %9, label %18, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 71
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 67
br label %18
18: ; preds = %14, %10, %6, %1
%19 = phi i1 [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %17, %14 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @onlyATGC(i8 signext %0) {
switch i8 %0, label %2 [
i8 84, label %5
i8 71, label %5
i8 65, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 67
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
unsigned long RTCFlagStatusGet(void) {
  return ((*((volatile unsigned long *)(0x40002800 + 0x00000004))) & (0x2F));
}


x86 assembly (clang, -O0):
<RTCFlagStatusGet>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40002804,%eax
mov    (%rax),%rax
and    $0x2f,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RTCFlagStatusGet>:
mov    0x40002804,%rax
40
and    $0x2f,%eax
ret

LLVM IR (-O0):
define i64 @RTCFlagStatusGet() {
%1 = load volatile i64, i64* inttoptr (i64 1073752068 to i64*)
%2 = and i64 %1, 47
ret i64 %2
}

LLVM IR (-O2):
define i64 @RTCFlagStatusGet() {
%1 = load volatile i64, i64* inttoptr (i64 1073752068 to i64*)
%2 = and i64 %1, 47
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ diskInit();
void cmdDiskPlayFile(char *path) {
  if (!diskInit()) {
    return;
  }
}


x86 assembly (clang, -O0):
<cmdDiskPlayFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <diskInit@plt>
cmp    $0x0,%eax
jne    1131 <cmdDiskPlayFile+0x21>
jmp    1131 <cmdDiskPlayFile+0x21>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @cmdDiskPlayFile(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @diskInit()
%4 = icmp ne i32 %3, 0
br i1 %4, label %6, label %5
5: ; preds = %1
br label %6
6: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @cmdDiskPlayFile(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @diskInit()
ret void
}
void send2gpu() {}


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

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

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

LLVM IR (-O2):
define void @send2gpu() {
ret void
}
int main() {
  int age = 24;
  char name = "Miles Lilly";
  printf("%s is %d  years old\n", "Miles Lilly", 24);
  printf("%s is %d years old\n", name, age);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x18,-0x8(%rbp)
lea    0xed3(%rip),%rax
mov    %al,-0x9(%rbp)
lea    0xed5(%rip),%rdi
lea    0xec2(%rip),%rsi
mov    $0x18,%edx
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0x9(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xef4(%rip),%rdi
lea    0xee1(%rip),%rbx
mov    %rbx,%rsi
mov    $0x18,%edx
xor    %eax,%eax
call   1030 <printf@plt>
movsbl %bl,%esi
lea    0xee9(%rip),%rdi
mov    $0x18,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Miles Lilly\00"
@.str.1 = [21 x i8] c"%s is %d years old\0A\00"
@.str.2 = [20 x i8] c"%s is %d years old\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
store i32 0, i32* %1
store i32 24, i32* %2
store i8 ptrtoint ([12 x i8]* @.str to i8), i8* %3
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 24)
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = load i32, i32* %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %6, i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Miles Lilly\00"
@.str.1 = [21 x i8] c"%s is %d years old\0A\00"
@.str.2 = [20 x i8] c"%s is %d years old\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 24)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 sext (i8 ptrtoint ([12 x i8]* @.str to i8) to i32), i32 24)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ scalbln(double, long);
int /*<<< orphan*/ scalblnf(float, long);
int /*<<< orphan*/ scalblnl(long double, long);
void uninitvar_scalbln(void) {
  float f;
  long int i1;
  (void)scalblnf(f, i1);
  double d;
  long int i2;
  (void)scalbln(d, i2);
  long double ld;
  long int i3;
  (void)scalblnl(ld, i3);
}


x86 assembly (clang, -O0):
<uninitvar_scalbln>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movss  -0x4(%rbp),%xmm0
mov    -0x10(%rbp),%rdi
call   1040 <scalblnf@plt>
movsd  -0x18(%rbp),%xmm0
mov    -0x20(%rbp),%rdi
call   1030 <scalbln@plt>
fldt   -0x30(%rbp)
mov    -0x38(%rbp),%rdi
mov    %rsp,%rax
fstpt  (%rax)
call   1050 <scalblnl@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_scalbln>:
sub    $0x18,%rsp
call   1040 <scalblnf@plt>
call   1030 <scalbln@plt>
call   1050 <scalblnl@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @uninitvar_scalbln() {
%1 = alloca float
%2 = alloca i64
%3 = alloca double
%4 = alloca i64
%5 = alloca x86_fp80
%6 = alloca i64
%7 = load float, float* %1
%8 = load i64, i64* %2
%9 = call i32 @scalblnf(float %7, i64 %8)
%10 = load double, double* %3
%11 = load i64, i64* %4
%12 = call i32 @scalbln(double %10, i64 %11)
%13 = load x86_fp80, x86_fp80* %5
%14 = load i64, i64* %6
%15 = call i32 @scalblnl(x86_fp80 %13, i64 %14)
ret void
}

LLVM IR (-O2):
define void @uninitvar_scalbln() {
%1 = tail call i32 @scalblnf(float undef, i64 undef)
%2 = tail call i32 @scalbln(double undef, i64 undef)
%3 = tail call i32 @scalblnl(x86_fp80 undef, i64 undef)
ret void
}
int cpuid_vendor(char *vnd) {
  union {
    struct {
      unsigned b, d, c;
    };
    char v[12];
  } v;
  unsigned eax;
  asm("cpuid" : "=a"(eax), "=b"(v.b), "=c"(v.c), "=d"(v.d) : "0"(0));
  return !strncmp(v.v, vnd, 12);
}


x86 assembly (clang, -O0):
<cpuid_vendor>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x28,%rsp
mov    %rdi,-0x10(%rbp)
xor    %eax,%eax
cpuid
mov    %eax,-0x24(%rbp)
mov    %ebx,-0x20(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0xc,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x28,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid_vendor>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rsi
xor    %eax,%eax
cpuid
mov    %ebx,(%rsp)
mov    %ecx,0x8(%rsp)
mov    %edx,0x4(%rsp)
mov    %rsp,%rdi
mov    $0xc,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%union.anon = type { %struct.anon }
%struct.anon = type { i32, i32, i32 }
define i32 @cpuid_vendor(i8* %0) {
%2 = alloca i8*
%3 = alloca %union.anon
%4 = alloca i32
store i8* %0, i8** %2
%5 = bitcast %union.anon* %3 to %struct.anon*
%6 = getelementptr inbounds %struct.anon, %struct.anon* %5, i32 0, i32 0
%7 = bitcast %union.anon* %3 to %struct.anon*
%8 = getelementptr inbounds %struct.anon, %struct.anon* %7, i32 0, i32 2
%9 = bitcast %union.anon* %3 to %struct.anon*
%10 = getelementptr inbounds %struct.anon, %struct.anon* %9, i32 0, i32 1
%11 = call { i32, i32, i32, i32 } asm "cpuid", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 0)
%12 = extractvalue { i32, i32, i32, i32 } %11, 0
%13 = extractvalue { i32, i32, i32, i32 } %11, 1
%14 = extractvalue { i32, i32, i32, i32 } %11, 2
%15 = extractvalue { i32, i32, i32, i32 } %11, 3
store i32 %12, i32* %4
store i32 %13, i32* %6
store i32 %14, i32* %8
store i32 %15, i32* %10
%16 = bitcast %union.anon* %3 to [12 x i8]*
%17 = getelementptr inbounds [12 x i8], [12 x i8]* %16, i64 0, i64 0
%18 = load i8*, i8** %2
%19 = call i32 @strncmp(i8* %17, i8* %18, i64 12)
%20 = icmp ne i32 %19, 0
%21 = xor i1 %20, true
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
%union.anon = type { %struct.anon }
%struct.anon = type { i32, i32, i32 }
define i32 @cpuid_vendor(i8* nocapture %0) {
%2 = alloca %union.anon
%3 = bitcast %union.anon* %2 to i8*
%4 = getelementptr inbounds %union.anon, %union.anon* %2, i64 0, i32 0, i32 0
%5 = getelementptr inbounds %union.anon, %union.anon* %2, i64 0, i32 0, i32 2
%6 = getelementptr inbounds %union.anon, %union.anon* %2, i64 0, i32 0, i32 1
%7 = tail call { i32, i32, i32, i32 } asm "cpuid", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 0)
%8 = extractvalue { i32, i32, i32, i32 } %7, 1
%9 = extractvalue { i32, i32, i32, i32 } %7, 2
%10 = extractvalue { i32, i32, i32, i32 } %7, 3
store i32 %8, i32* %4
store i32 %9, i32* %5
store i32 %10, i32* %6
%11 = call i32 @strncmp(i8* %3, i8* dereferenceable(1) %0, i64 12)
%12 = icmp eq i32 %11, 0
%13 = zext i1 %12 to i32
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ FwInterrupt3();
void _mm_stream_si32(int *__A, int __B) {
  FwInterrupt3();
  __A, __B;
}


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

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

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

LLVM IR (-O2):
define void @_mm_stream_si32(i32* nocapture readnone %0, i32 %1) {
%3 = tail call i32 (...) @FwInterrupt3()
ret void
}
/* Variables and functions */
void *__memcpy2__(void *, void *, size_t);
void *_memcpy2(void *dest, void *src, size_t len) {
  return __memcpy2__(dest, src, len);
}


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

x86 assembly (clang, -O2):
<_memcpy2>:
jmp    1030 <__memcpy2__@plt>

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

LLVM IR (-O2):
define i8* @_memcpy2(i8* %0, i8* %1, i64 %2) {
%4 = tail call i8* @__memcpy2__(i8* %0, i8* %1, i64 %2)
ret i8* %4
}
int HelpItem156(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem156() {
ret i32 0
}
/* Variables and functions */
int send(int, void *, int, int /*<<< orphan*/);
int skwrite(int *sd, void *buf, int size) {
  ;
  return send(*sd, buf, size, 0);
}


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

x86 assembly (clang, -O2):
<skwrite>:
mov    (%rdi),%edi
xor    %ecx,%ecx
jmp    1030 <send@plt>

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

LLVM IR (-O2):
define i32 @skwrite(i32* nocapture %0, i8* %1, i32 %2) {
%4 = load i32, i32* %0
%5 = tail call i32 @send(i32 %4, i8* %1, i32 %2, i32 0)
ret i32 %5
}
/* Variables and functions */
scalar_t__ refc_dec(void *);
int /*<<< orphan*/ refc_free(void *);
int refc_dec_free(void *handle) {
  if (refc_dec(handle) == 0) {
    refc_free(handle);
  }
}


x86 assembly (clang, -O0):
<refc_dec_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <refc_dec@plt>
cmp    $0x0,%rax
jne    1148 <refc_dec_free+0x28>
mov    -0x10(%rbp),%rdi
call   1040 <refc_free@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<refc_dec_free>:
push   %rbx
mov    %rdi,%rbx
call   1030 <refc_dec@plt>
test   %rax,%rax
je     1130 <refc_dec_free+0x10>
pop    %rbx
ret
mov    %rbx,%rdi
call   1040 <refc_free@plt>
pop    %rbx
ret

LLVM IR (-O0):
define i32 @refc_dec_free(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @refc_dec(i8* %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i32 @refc_free(i8* %8)
br label %10
10: ; preds = %7, %1
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @refc_dec_free(i8* %0) {
%2 = tail call i64 @refc_dec(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @refc_free(i8* %0)
br label %6
6: ; preds = %4, %1
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ next(int *, int);
void permutation(int k, int *v, int size) {
  int i;
  for (i = 0; i < k; i++)
    next(v, size);
}


x86 assembly (clang, -O0):
<permutation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    114f <permutation+0x3f>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <next@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1129 <permutation+0x19>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<permutation>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
jle    1130 <permutation+0x20>
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rbx,%rdi
mov    %r14d,%esi
call   1030 <next@plt>
add    $0xffffffff,%ebp
jne    1120 <permutation+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @permutation(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
br label %8
8: ; preds = %16, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %4
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %19
12: ; preds = %8
%13 = load i32*, i32** %5
%14 = load i32, i32* %6
%15 = call i32 @next(i32* %13, i32 %14)
br label %16
16: ; preds = %12
%17 = load i32, i32* %7
%18 = add nsw i32 %17, 1
store i32 %18, i32* %7
br label %8
19: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @permutation(i32 %0, i32* %1, i32 %2) {
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %10
5: ; preds = %3, %5
%6 = phi i32 [ %8, %5 ], [ 0, %3 ]
%7 = tail call i32 @next(i32* %1, i32 %2)
%8 = add nuw nsw i32 %6, 1
%9 = icmp eq i32 %8, %0
br i1 %9, label %10, label %5
10: ; preds = %5, %3
ret void
}
unsigned int get_rr_interval_idle(struct rq *rq, struct task_struct *task) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.rq = type opaque
%struct.task_struct = type opaque
define i32 @get_rr_interval_idle(%struct.rq* %0, %struct.task_struct* %1) {
%3 = alloca %struct.rq*
%4 = alloca %struct.task_struct*
store %struct.rq* %0, %struct.rq** %3
store %struct.task_struct* %1, %struct.task_struct** %4
ret i32 0
}

LLVM IR (-O2):
%struct.rq = type opaque
%struct.task_struct = type opaque
define i32 @get_rr_interval_idle(%struct.rq* nocapture readnone %0, %struct.task_struct* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ sprintf(char *, char *, int);
char *intToString(int i) {
  char *chaine = malloc(2 * sizeof(char));
  sprintf(chaine, "%d", i);
  return chaine;
}


x86 assembly (clang, -O0):
<intToString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x2,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xeb9(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intToString>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0x2,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
lea    0xec7(%rip),%rsi
mov    %rax,%rdi
mov    %ebp,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i8* @intToString(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = call i8* @malloc(i32 2)
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = load i32, i32* %2
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i8*, i8** %3
ret i8* %8
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define noalias i8* @intToString(i32 %0) {
%2 = tail call dereferenceable_or_null(2) i8* @malloc(i32 2)
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %2, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* %2
}
char *strchr(const char *s, int c) {
  for (; *s != (char)c; ++s)
    if (*s == '\0')
      return 0;
  return (char *)s;
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x14(%rbp),%ecx
movsbl %cl,%ecx
cmp    %ecx,%eax
je     1153 <strchr+0x53>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    113d <strchr+0x3d>
movq   $0x0,-0x8(%rbp)
jmp    115b <strchr+0x5b>
jmp    1142 <strchr+0x42>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110b <strchr+0xb>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    %rdi,%rax
movsbl %sil,%ecx
movsbl (%rdi),%edx
cmp    %edx,%ecx
je     1120 <strchr+0x20>
xchg   %ax,%ax
test   %dl,%dl
je     1121 <strchr+0x21>
movsbl 0x1(%rax),%edx
add    $0x1,%rax
cmp    %edx,%ecx
jne    1110 <strchr+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = shl i32 %1, 24
%4 = ashr exact i32 %3, 24
%5 = load i8, i8* %0
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %4, %6
br i1 %7, label %17, label %8
8: ; preds = %2, %12
%9 = phi i8 [ %14, %12 ], [ %5, %2 ]
%10 = phi i8* [ %13, %12 ], [ %0, %2 ]
%11 = icmp eq i8 %9, 0
br i1 %11, label %17, label %12
12: ; preds = %8
%13 = getelementptr inbounds i8, i8* %10, i64 1
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %4, %15
br i1 %16, label %17, label %8
17: ; preds = %8, %12, %2
%18 = phi i8* [ %0, %2 ], [ %13, %12 ], [ null, %8 ]
ret i8* %18
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_43() {
  Assert_real((isqrt(43) == 6),
              "/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/stdlib/isqrt.c",
              220, ("Integer square root of 43 should be 6"));
}


x86 assembly (clang, -O0):
<t_sqrt_43>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2b,%edi
call   1030 <isqrt@plt>
cmp    $0x6,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0xdc,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_43>:
push   %rax
mov    $0x2b,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x6,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0xdc,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 43 should be 6\00"
define void @t_sqrt_43() {
%1 = call i32 @isqrt(i32 43)
%2 = icmp eq i32 %1, 6
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 220, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 43 should be 6\00"
define void @t_sqrt_43() {
%1 = tail call i32 @isqrt(i32 43)
%2 = icmp eq i32 %1, 6
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 220, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ g(char **);
void h(char **p) { g(p); }


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

x86 assembly (clang, -O2):
<h>:
jmp    1030 <g@plt>

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

LLVM IR (-O2):
define void @h(i8** %0) {
%2 = tail call i32 @g(i8** %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(unsigned int);
void aeron_micro_sleep(unsigned int microseconds) { usleep(microseconds); }


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

x86 assembly (clang, -O2):
<aeron_micro_sleep>:
jmp    1030 <usleep@plt>

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

LLVM IR (-O2):
define void @aeron_micro_sleep(i32 %0) {
%2 = tail call i32 @usleep(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
char *malloc(int const);
int /*<<< orphan*/ stderr;
int main(void) {
  const int G = 1024 * 1024 * 1024;
  for (int n = 0;; n++) {
    char *p = malloc(G * sizeof(char));
    if (p == NULL) {
      fprintf(stderr, "failed to allocate > %g TiBytes\n", n / 1000.0);
      return 1;
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x40000000,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x40000000,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    118b <main+0x6b>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  0xe94(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edx
lea    0xe8d(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret
jmp    1190 <main+0x70>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113d <main+0x1d>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"failed to allocate > %g TiBytes\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
store i32 0, i32* %1
store i32 1073741824, i32* %2
store i32 0, i32* %3
br label %5
5: ; preds = %17, %0
%6 = call i8* @malloc(i32 1073741824)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %16
9: ; preds = %5
%10 = load i32, i32* @stderr
%11 = load i32, i32* %3
%12 = sitofp i32 %11 to double
%13 = fdiv double %12, 1.000000e+03
%14 = fptosi double %13 to i32
%15 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %14)
ret i32 1
16: ; preds = %5
br label %17
17: ; preds = %16
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
br label %5
}

LLVM IR (-O2):
@stderr = global i32 0
define i32 @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
int Cyc_Absyn_hash_ptr(void *a) { return (int)((unsigned)a); }


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

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

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

LLVM IR (-O2):
define i32 @Cyc_Absyn_hash_ptr(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int wint_t;

/* Variables and functions */
int isblank(int);
int iswblank(wint_t c) { return c <= 255 ? isblank(c) : 0; }


x86 assembly (clang, -O0):
<iswblank>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xff,-0x4(%rbp)
jg     1138 <iswblank+0x28>
mov    -0x4(%rbp),%edi
call   1030 <isblank@plt>
mov    %eax,-0x8(%rbp)
jmp    1142 <iswblank+0x32>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    1142 <iswblank+0x32>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iswblank>:
cmp    $0xff,%edi
jg     111d <iswblank+0xd>
jmp    1030 <isblank@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @iswblank(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 %3, 255
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 @isblank(i32 %6)
br label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %5
%10 = phi i32 [ %7, %5 ], [ 0, %8 ]
ret i32 %10
}

LLVM IR (-O2):
define i32 @iswblank(i32 %0) {
%2 = icmp slt i32 %0, 256
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @isblank(i32 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 0, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ foo();
int main(int argc, char **argv) {
  for (;;) {
    foo();
  }
  return (0);
}


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)
mov    $0x0,%al
call   1030 <foo@plt>
jmp    1126 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <foo@plt>
jmp    1120 <main+0x10>

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
br label %6
6: ; preds = %6, %2
%7 = call i32 (...) @foo()
br label %6
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 (...) @foo()
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *, char *);
void internal_error(char *reason) {
  char *title = "500 Internal Error";
  (void)printf(
      "<HTML><HEAD><TITLE>%s</TITLE></HEAD>\n<BODY><H2>%s</H2>\nSomething "
      "unusual went wrong during a server-side-includes "
      "request:\n<BLOCKQUOTE>\n%s\n</BLOCKQUOTE>\n</BODY></HTML>\n",
      title, title, reason);
}


x86 assembly (clang, -O0):
<internal_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rcx
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<internal_error>:
mov    %rdi,%rcx
lea    0xef9(%rip),%rdi
lea    0xedf(%rip),%rdx
mov    %rdx,%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"500 Internal Error\00"
@.str.1 = [169 x i8] c"<HTML><HEAD><TITLE>%s</TITLE></HEAD>\0A<BODY><H2>%s</H2>\0ASomething unusual went wrong during a server-side-includes request:\0A<BLOCKQUOTE>\0A%s\0A</BLOCKQUOTE>\0A</BODY></HTML>\0A\00"
define void @internal_error(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load i8*, i8** %3
%5 = load i8*, i8** %3
%6 = load i8*, i8** %2
%7 = call i32 @printf(i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str.1, i64 0, i64 0), i8* %4, i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"500 Internal Error\00"
@.str.1 = [169 x i8] c"<HTML><HEAD><TITLE>%s</TITLE></HEAD>\0A<BODY><H2>%s</H2>\0ASomething unusual went wrong during a server-side-includes request:\0A<BLOCKQUOTE>\0A%s\0A</BLOCKQUOTE>\0A</BODY></HTML>\0A\00"
define void @internal_error(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ tux_firmware_init_descriptor();
int /*<<< orphan*/ tux_id_init_descriptor();
int /*<<< orphan*/ tux_sound_flash_init_descriptor();
__attribute__((visibility("hidden"))) void tux_descriptor_init(void) {
  tux_firmware_init_descriptor();
  tux_sound_flash_init_descriptor();
  tux_id_init_descriptor();
}


x86 assembly (clang, -O0):
<tux_descriptor_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <tux_firmware_init_descriptor@plt>
mov    $0x0,%al
call   1030 <tux_sound_flash_init_descriptor@plt>
mov    $0x0,%al
call   1050 <tux_id_init_descriptor@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tux_descriptor_init>:
push   %rax
xor    %eax,%eax
call   1040 <tux_firmware_init_descriptor@plt>
xor    %eax,%eax
call   1030 <tux_sound_flash_init_descriptor@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <tux_id_init_descriptor@plt>

LLVM IR (-O0):
define hidden void @tux_descriptor_init() {
%1 = call i32 (...) @tux_firmware_init_descriptor()
%2 = call i32 (...) @tux_sound_flash_init_descriptor()
%3 = call i32 (...) @tux_id_init_descriptor()
ret void
}

LLVM IR (-O2):
define hidden void @tux_descriptor_init() {
%1 = tail call i32 (...) @tux_firmware_init_descriptor()
%2 = tail call i32 (...) @tux_sound_flash_init_descriptor()
%3 = tail call i32 (...) @tux_id_init_descriptor()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ jmp_buf;

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ longjmp(int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, ...);
int setjmp(int /*<<< orphan*/);
int main(int argv, char **argc) {
  jmp_buf env;
  int i = 3;
  i = setjmp(env);
  printf("i = %d\n", i);
  if (i != 0) {
    exit(0);
  }
  longjmp(env, 2);
  printf("This Line Does Not Get Printed");
  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)
movl   $0x3,-0x18(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <setjmp@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xe8e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0x18(%rbp)
je     118a <main+0x4a>
xor    %edi,%edi
call   1060 <exit@plt>
mov    -0x14(%rbp),%edi
mov    $0x2,%esi
call   1050 <longjmp@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
call   1040 <setjmp@plt>
mov    %eax,%ebx
lea    0xeb1(%rip),%rdi
xor    %eax,%eax
mov    %ebx,%esi
call   1030 <printf@plt>
test   %ebx,%ebx
jne    1166 <main+0x26>
mov    $0x2,%esi
call   1050 <longjmp@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"i = %d\0A\00"
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
store i32 3, i32* %7
%8 = load i32, i32* %6
%9 = call i32 @setjmp(i32 %8)
store i32 %9, i32* %7
%10 = load i32, i32* %7
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = load i32, i32* %7
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %2
%15 = call i32 @exit(i32 0)
unreachable
16: ; preds = %2
%17 = load i32, i32* %6
%18 = call i32 @longjmp(i32 %17, i32 2)
unreachable
}

LLVM IR (-O2):
@.str = [8 x i8] c"i = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = call i32 @setjmp(i32 undef)
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = icmp eq i32 %3, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = call i32 @exit(i32 0)
unreachable
8: ; preds = %2
%9 = call i32 @longjmp(i32 undef, i32 2)
unreachable
}
int popC(char *stack, int top, char *x) {
  if (top == -1)
    return top;
  *x = stack[top];
  return --top;
}


x86 assembly (clang, -O0):
<popC>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    1124 <popC+0x24>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <popC+0x41>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<popC>:
cmp    $0xffffffff,%esi
je     1113 <popC+0x13>
mov    %esi,%eax
movslq %esi,%rcx
mov    (%rdi,%rcx,1),%cl
mov    %cl,(%rdx)
add    $0xffffffff,%eax
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @popC(i8* nocapture %0, i32 %1, i8* nocapture writeonly %2) {
%4 = icmp eq i32 %1, -1
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
store i8 %8, i8* %2
%9 = add nsw i32 %1, -1
br label %10
10: ; preds = %3, %5
%11 = phi i32 [ %9, %5 ], [ -1, %3 ]
ret i32 %11
}
/* Variables and functions */
int checker_read_long_double(int /*<<< orphan*/, char const *, int,
                             long double *);
int checker_read_in_long_double(const char *name, int eof_error_flag,
                                long double *p_val) {
  return checker_read_long_double(0, name, eof_error_flag, p_val);
}


x86 assembly (clang, -O0):
<checker_read_in_long_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
xor    %edi,%edi
call   1030 <checker_read_long_double@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checker_read_in_long_double>:
mov    %rdx,%rcx
mov    %esi,%edx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <checker_read_long_double@plt>

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

LLVM IR (-O2):
define i32 @checker_read_in_long_double(i8* %0, i32 %1, x86_fp80* %2) {
%4 = tail call i32 @checker_read_long_double(i32 0, i8* %0, i32 %1, x86_fp80* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ is_empty();
int /*<<< orphan*/ pop();
void destroy_stack(void) {
  while (!is_empty())
    pop();
}


x86 assembly (clang, -O0):
<destroy_stack>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <destroy_stack+0x9>
mov    $0x0,%al
call   1030 <is_empty@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1145 <destroy_stack+0x25>
jmp    1151 <destroy_stack+0x31>
mov    $0x0,%al
call   1040 <pop@plt>
jmp    1129 <destroy_stack+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<destroy_stack>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <is_empty@plt>
test   %eax,%eax
jne    1144 <destroy_stack+0x24>
xor    %eax,%eax
call   1040 <pop@plt>
jmp    1130 <destroy_stack+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @destroy_stack() {
br label %1
1: ; preds = %5, %0
%2 = call i32 (...) @is_empty()
%3 = icmp ne i32 %2, 0
%4 = xor i1 %3, true
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @pop()
br label %1
7: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @destroy_stack() {
%1 = tail call i32 (...) @is_empty()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0, %3
%4 = tail call i32 (...) @pop()
%5 = tail call i32 (...) @is_empty()
%6 = icmp eq i32 %5, 0
br i1 %6, label %3, label %7
7: ; preds = %3, %0
ret void
}
void wpa_supplicant_scan(void *eloop_ctx, void *timeout_ctx) {
  printf("%s - not implemented\n", __func__);
}


x86 assembly (clang, -O0):
<wpa_supplicant_scan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed9(%rip),%rdi
lea    0xee8(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wpa_supplicant_scan>:
lea    0xee9(%rip),%rdi
lea    0xef8(%rip),%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"%s - not implemented\0A\00"
@__func__.wpa_supplicant_scan = [20 x i8] c"wpa_supplicant_scan\00"
define void @wpa_supplicant_scan(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @__func__.wpa_supplicant_scan, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"%s - not implemented\0A\00"
@__func__.wpa_supplicant_scan = [20 x i8] c"wpa_supplicant_scan\00"
define void @wpa_supplicant_scan(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @__func__.wpa_supplicant_scan, i64 0, i64 0))
ret void
}
/* Variables and functions */
void append(int c, char *dst, size_t len, size_t *pos) {
  if (*pos < len)
    dst[*pos] = c;
  ++*pos;
}


x86 assembly (clang, -O0):
<append>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
cmp    -0x18(%rbp),%rax
jae    1137 <append+0x37>
mov    -0x4(%rbp),%eax
mov    %al,%dl
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    (%rcx),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<append>:
mov    (%rcx),%rax
cmp    %rdx,%rax
jae    110f <append+0xf>
mov    %dil,(%rsi,%rax,1)
mov    (%rcx),%rax
add    $0x1,%rax
mov    %rax,(%rcx)
ret

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

LLVM IR (-O2):
define void @append(i32 %0, i8* nocapture writeonly %1, i64 %2, i64* nocapture %3) {
%5 = load i64, i64* %3
%6 = icmp ult i64 %5, %2
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = trunc i32 %0 to i8
%9 = getelementptr inbounds i8, i8* %1, i64 %5
store i8 %8, i8* %9
%10 = load i64, i64* %3
br label %11
11: ; preds = %7, %4
%12 = phi i64 [ %10, %7 ], [ %5, %4 ]
%13 = add i64 %12, 1
store i64 %13, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_binary_search_tree();
int /*<<< orphan*/ test_linked_list();
int /*<<< orphan*/ test_map();
int /*<<< orphan*/ test_queue();
int /*<<< orphan*/ test_stack();
int main() {
  test_linked_list();
  test_map();
  test_binary_search_tree();
  test_stack();
  test_queue();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <test_linked_list@plt>
mov    $0x0,%al
call   1050 <test_map@plt>
mov    $0x0,%al
call   1070 <test_binary_search_tree@plt>
mov    $0x0,%al
call   1060 <test_stack@plt>
mov    $0x0,%al
call   1040 <test_queue@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_linked_list@plt>
xor    %eax,%eax
call   1050 <test_map@plt>
xor    %eax,%eax
call   1070 <test_binary_search_tree@plt>
xor    %eax,%eax
call   1060 <test_stack@plt>
xor    %eax,%eax
call   1040 <test_queue@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_linked_list()
%3 = call i32 (...) @test_map()
%4 = call i32 (...) @test_binary_search_tree()
%5 = call i32 (...) @test_stack()
%6 = call i32 (...) @test_queue()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_linked_list()
%2 = tail call i32 (...) @test_map()
%3 = tail call i32 (...) @test_binary_search_tree()
%4 = tail call i32 (...) @test_stack()
%5 = tail call i32 (...) @test_queue()
ret i32 0
}