xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ gen(char *);
void cgdata(void) { gen(".data"); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c".data\00"
define void @cgdata() {
%1 = tail call i32 @gen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double exp(double);
double pow(double, int);
double qOxi(double Oxi) {
  double q9, A = 100.8, B = -106, C = -3745;
  if (Oxi == 140) {
    return 47;
  } else {
    double q9 = A * exp(pow(Oxi + B, 2) / C);
    return q9;
  }
}


x86 assembly (clang, -O0):
<qOxi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  0xee3(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xece(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xeb9(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xe9f(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1183 <qOxi+0x63>
jp     1183 <qOxi+0x63>
movsd  0xea7(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11c6 <qOxi+0xa6>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x10(%rbp),%xmm0
addsd  -0x28(%rbp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
divsd  -0x30(%rbp),%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qOxi>:
push   %rax
ucomisd 0xedf(%rip),%xmm0
jne    1137 <qOxi+0x17>
jp     1137 <qOxi+0x17>
movsd  0xecb(%rip),%xmm0
pop    %rax
ret
addsd  0xed1(%rip),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
divsd  0xec7(%rip),%xmm0
call   1030 <exp@plt>
mulsd  0xec2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @qOxi(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %3
store double 1.008000e+02, double* %5
store double -1.060000e+02, double* %6
store double -3.745000e+03, double* %7
%9 = load double, double* %3
%10 = fcmp oeq double %9, 1.400000e+02
br i1 %10, label %11, label %12
11: ; preds = %1
store double 4.700000e+01, double* %2
br label %23
12: ; preds = %1
%13 = load double, double* %5
%14 = load double, double* %3
%15 = load double, double* %6
%16 = fadd double %14, %15
%17 = call double @pow(double %16, i32 2)
%18 = load double, double* %7
%19 = fdiv double %17, %18
%20 = call double @exp(double %19)
%21 = fmul double %13, %20
store double %21, double* %8
%22 = load double, double* %8
store double %22, double* %2
br label %23
23: ; preds = %12, %11
%24 = load double, double* %2
ret double %24
}

LLVM IR (-O2):
define double @qOxi(double %0) {
%2 = fcmp oeq double %0, 1.400000e+02
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = fadd double %0, -1.060000e+02
%5 = tail call double @pow(double %4, i32 2)
%6 = fdiv double %5, -3.745000e+03
%7 = tail call double @exp(double %6)
%8 = fmul double %7, 1.008000e+02
br label %9
9: ; preds = %1, %3
%10 = phi double [ %8, %3 ], [ 4.700000e+01, %1 ]
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void FSE_freeCTable(void *CTable) { free(CTable); }


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

LLVM IR (-O0):
define void @FSE_freeCTable(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 @FSE_freeCTable(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
long LSEEK(fd, offset, whence)
long *fd, *offset, *whence;
{
  long lseek();
  return (lseek(*fd, *offset, *whence));
}


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

x86 assembly (clang, -O2):
<LSEEK>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
mov    (%rdx),%rdx
xor    %eax,%eax
jmp    1030 <lseek@plt>

LLVM IR (-O0):
define i64 @LSEEK(i64* %0, i64* %1, i64* %2) {
%4 = alloca i64*
%5 = alloca i64*
%6 = alloca i64*
store i64* %0, i64** %4
store i64* %1, i64** %5
store i64* %2, i64** %6
%7 = load i64*, i64** %4
%8 = load i64, i64* %7
%9 = load i64*, i64** %5
%10 = load i64, i64* %9
%11 = load i64*, i64** %6
%12 = load i64, i64* %11
%13 = call i64 (i64, i64, i64, ...) bitcast (i64 (...)* @lseek to i64 (i64, i64, i64, ...)*)(i64 %8, i64 %10, i64 %12)
ret i64 %13
}

LLVM IR (-O2):
define i64 @LSEEK(i64* nocapture %0, i64* nocapture %1, i64* nocapture %2) {
%4 = load i64, i64* %0
%5 = load i64, i64* %1
%6 = load i64, i64* %2
%7 = tail call i64 (i64, i64, i64, ...) bitcast (i64 (...)* @lseek to i64 (i64, i64, i64, ...)*)(i64 %4, i64 %5, i64 %6)
ret i64 %7
}
/* Variables and functions */
scalar_t__ log(float);
float lfactorial(int x) {
  float lfac = 0;
  for (int i = 2; i <= x; i++) {
    lfac += log((float)i);
  }
  return lfac;
}


x86 assembly (clang, -O0):
<lfactorial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     115d <lfactorial+0x4d>
cvtsi2ssl -0xc(%rbp),%xmm0
call   1030 <log@plt>
cvtsi2ss %rax,%xmm0
addss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112a <lfactorial+0x1a>
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lfactorial>:
push   %r14
push   %rbx
push   %rax
xorps  %xmm0,%xmm0
cmp    $0x2,%edi
jl     1173 <lfactorial+0x63>
mov    %edi,%r14d
neg    %r14d
xorps  %xmm0,%xmm0
mov    $0x2,%ebx
nopw   0x0(%rax,%rax,1)
movss  %xmm0,0x4(%rsp)
xorps  %xmm0,%xmm0
cvtsi2ss %ebx,%xmm0
call   1030 <log@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
movss  0x4(%rsp),%xmm1
addss  %xmm0,%xmm1
movss  %xmm1,0x4(%rsp)
movss  0x4(%rsp),%xmm0
lea    (%r14,%rbx,1),%eax
add    $0x1,%eax
mov    %ebx,%ecx
add    $0x1,%ecx
mov    %ecx,%ebx
cmp    $0x1,%eax
jne    1130 <lfactorial+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define float @lfactorial(i32 %0) {
%2 = alloca i32
%3 = alloca float
%4 = alloca i32
store i32 %0, i32* %2
store float 0.000000e+00, float* %3
store i32 2, i32* %4
br label %5
5: ; preds = %16, %1
%6 = load i32, i32* %4
%7 = load i32, i32* %2
%8 = icmp sle i32 %6, %7
br i1 %8, label %9, label %19
9: ; preds = %5
%10 = load i32, i32* %4
%11 = sitofp i32 %10 to float
%12 = call i64 @log(float %11)
%13 = sitofp i64 %12 to float
%14 = load float, float* %3
%15 = fadd float %14, %13
store float %15, float* %3
br label %16
16: ; preds = %9
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 1
store i32 %18, i32* %4
br label %5
19: ; preds = %5
%20 = load float, float* %3
ret float %20
}

LLVM IR (-O2):
define float @lfactorial(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %3, label %5
3: ; preds = %5, %1
%4 = phi float [ 0.000000e+00, %1 ], [ %11, %5 ]
ret float %4
5: ; preds = %1, %5
%6 = phi i32 [ %12, %5 ], [ 2, %1 ]
%7 = phi float [ %11, %5 ], [ 0.000000e+00, %1 ]
%8 = sitofp i32 %6 to float
%9 = tail call i64 @log(float %8)
%10 = sitofp i64 %9 to float
%11 = fadd float %7, %10
%12 = add nuw i32 %6, 1
%13 = icmp eq i32 %6, %0
br i1 %13, label %3, label %5
}
unsigned int getInt32(const unsigned char *a) {
  unsigned int x = (a[0] << 24) + (a[1] << 16) + (a[2] << 8) + a[3];
  return x;
}


x86 assembly (clang, -O0):
<getInt32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @getInt32(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl i32 %7, 24
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 16
%14 = add nsw i32 %8, %13
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 2
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = add nsw i32 %14, %19
%21 = load i8*, i8** %2
%22 = getelementptr inbounds i8, i8* %21, i64 3
%23 = load i8, i8* %22
%24 = zext i8 %23 to i32
%25 = add nsw i32 %20, %24
store i32 %25, i32* %3
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @getInt32(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ stderr;
int _chroot_error(char const *message, int ret) {
  fputs("chroot"
        ": ",
        stderr);
  perror(message);
  return ret;
}


x86 assembly (clang, -O0):
<_chroot_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
lea    0xec1(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_chroot_error>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
lea    0xec8(%rip),%rdi
call   1030 <fputs@plt>
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"chroot: \00"
@stderr = global i32 0
define i32 @_chroot_error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = call i32 @fputs(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %3
%8 = call i32 @perror(i8* %7)
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
@.str = [9 x i8] c"chroot: \00"
@stderr = global i32 0
define i32 @_chroot_error(i8* nocapture %0, i32 returned %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputs(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @perror(i8* %0)
ret i32 %1
}
/* Variables and functions */
int open(char const *, int, int);
int ness_os_open(const char *path, int oflag, int mode) {
  int r;
  r = open(path, oflag, mode);
  return r;
}


x86 assembly (clang, -O0):
<ness_os_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%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 <open@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ness_os_open>:
jmp    1030 <open@plt>

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

LLVM IR (-O2):
define i32 @ness_os_open(i8* nocapture %0, i32 %1, i32 %2) {
%4 = tail call i32 @open(i8* %0, i32 %1, i32 %2)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ TtlWrite(int, int /*<<< orphan*/ *, int /*<<< orphan*/);
uint32_t TtlSetGlobalLock(void) {
  uint32_t x;
  do {
  } while (0);
  return TtlWrite(0x00000000, (uint8_t *)&x, 0);
}


x86 assembly (clang, -O0):
<TtlSetGlobalLock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
jmp    111d <TtlSetGlobalLock+0xd>
xor    %edx,%edx
lea    -0x4(%rbp),%rsi
mov    %edx,%edi
call   1030 <TtlWrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TtlSetGlobalLock>:
push   %rax
lea    0x4(%rsp),%rsi
xor    %edi,%edi
xor    %edx,%edx
call   1030 <TtlWrite@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @TtlSetGlobalLock() {
%1 = alloca i32
br label %2
2: ; preds = %0
br label %3
3: ; preds = %2
%4 = call i32 @TtlWrite(i32 0, i32* %1, i32 0)
ret i32 %4
}

LLVM IR (-O2):
define i32 @TtlSetGlobalLock() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @TtlWrite(i32 0, i32* %1, i32 0)
ret i32 %3
}
int test_imm_CEuint16_reg(unsigned short val) {
  return ((val) & (-0xCE << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_CEuint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffff32,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_CEuint16_reg>:
test   $0xff32,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_CEuint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -206
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ bar();
void foo2(void) { bar(); }


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

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

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

LLVM IR (-O2):
define void @foo2() {
%1 = tail call i32 (...) @bar()
ret void
}
long cread(long *xp) { return (xp ? *xp : 0); }


x86 assembly (clang, -O0):
<cread>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1123 <cread+0x23>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
jmp    112e <cread+0x2e>
xor    %eax,%eax
mov    %rax,-0x10(%rbp)
jmp    112e <cread+0x2e>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cread>:
test   %rdi,%rdi
je     1109 <cread+0x9>
mov    (%rdi),%rax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @cread(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = icmp ne i64* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i64*, i64** %2
%7 = load i64, i64* %6
br label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %5
%10 = phi i64 [ %7, %5 ], [ 0, %8 ]
ret i64 %10
}

LLVM IR (-O2):
define i64 @cread(i64* %0) {
%2 = icmp eq i64* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = load i64, i64* %0
br label %5
5: ; preds = %1, %3
%6 = phi i64 [ %4, %3 ], [ 0, %1 ]
ret i64 %6
}
void RTFileQuerySize(void) {}


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

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

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

LLVM IR (-O2):
define void @RTFileQuerySize() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gang();
int /*<<< orphan*/ seq();
int /*<<< orphan*/ worker();
void vector(void) {
  gang();
  worker();
  vector();
  seq();
}


x86 assembly (clang, -O0):
<vector>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <gang@plt>
mov    $0x0,%al
call   1040 <worker@plt>
call   1060 <vector@plt>
mov    $0x0,%al
call   1050 <seq@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<vector>:
push   %rax
xor    %eax,%eax
call   1030 <gang@plt>
xor    %eax,%eax
call   1040 <worker@plt>
call   1060 <vector@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <seq@plt>

LLVM IR (-O0):
define void @vector() {
%1 = call i32 (...) @gang()
%2 = call i32 (...) @worker()
%3 = call i32 (...) @seq()
ret void
}

LLVM IR (-O2):
define void @vector() {
%1 = tail call i32 (...) @gang()
%2 = tail call i32 (...) @worker()
tail call void @vector()
%3 = tail call i32 (...) @seq()
ret void
}
/* Type definitions */
union bpf_attr {
  int map_fd;
  void *value;
  void *key;
};
typedef int /*<<< orphan*/ attr;

/* Variables and functions */
int /*<<< orphan*/ BPF_MAP_LOOKUP_ELEM;
int /*<<< orphan*/ bzero(union bpf_attr *, int);
void *ptr_to_u64(void *);
int sys_bpf(int /*<<< orphan*/, union bpf_attr *, int);
int bpf_map_lookup_elem(int fd, void *key, void *value) {
  union bpf_attr attr;
  bzero(&attr, sizeof(attr));
  attr.map_fd = fd;
  attr.key = ptr_to_u64(key);
  attr.value = ptr_to_u64(value);
  return sys_bpf(BPF_MAP_LOOKUP_ELEM, &attr, sizeof(attr));
}


x86 assembly (clang, -O0):
<bpf_map_lookup_elem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x8,%esi
call   1050 <bzero@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <ptr_to_u64@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <ptr_to_u64@plt>
mov    %rax,-0x20(%rbp)
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
lea    -0x20(%rbp),%rsi
mov    $0x8,%edx
call   1030 <sys_bpf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bpf_map_lookup_elem>:
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
mov    %rsi,%rdi
call   1040 <ptr_to_u64@plt>
mov    %rbx,%rdi
call   1040 <ptr_to_u64@plt>
mov    %rax,0x8(%rsp)
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
mov    $0x8,%edx
call   1030 <sys_bpf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%union.bpf_attr = type { i8* }
@BPF_MAP_LOOKUP_ELEM = global i32 0
define i32 @bpf_map_lookup_elem(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca %union.bpf_attr
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = call i32 @bzero(%union.bpf_attr* %7, i32 8)
%9 = load i32, i32* %4
%10 = bitcast %union.bpf_attr* %7 to i32*
store i32 %9, i32* %10
%11 = load i8*, i8** %5
%12 = call i8* @ptr_to_u64(i8* %11)
%13 = bitcast %union.bpf_attr* %7 to i8**
store i8* %12, i8** %13
%14 = load i8*, i8** %6
%15 = call i8* @ptr_to_u64(i8* %14)
%16 = bitcast %union.bpf_attr* %7 to i8**
store i8* %15, i8** %16
%17 = load i32, i32* @BPF_MAP_LOOKUP_ELEM
%18 = call i32 @sys_bpf(i32 %17, %union.bpf_attr* %7, i32 8)
ret i32 %18
}

LLVM IR (-O2):
%union.bpf_attr = type { i8* }
@BPF_MAP_LOOKUP_ELEM = global i32 0
define i32 @bpf_map_lookup_elem(i32 %0, i8* %1, i8* %2) {
%4 = alloca %union.bpf_attr
%5 = bitcast %union.bpf_attr* %4 to i8*
%6 = tail call i8* @ptr_to_u64(i8* %1)
%7 = getelementptr inbounds %union.bpf_attr, %union.bpf_attr* %4, i64 0, i32 0
%8 = tail call i8* @ptr_to_u64(i8* %2)
store i8* %8, i8** %7
%9 = load i32, i32* @BPF_MAP_LOOKUP_ELEM
%10 = call i32 @sys_bpf(i32 %9, %union.bpf_attr* %4, i32 8)
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int *copy_int(int);
int /*<<< orphan*/ free(int *);
void copy_int_test(void) {
  int *i_ptr = copy_int(10);
  assert(*i_ptr == 10);
  free(i_ptr);
}


x86 assembly (clang, -O0):
<copy_int_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xa,%edi
call   1050 <copy_int@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0xa,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_int_test>:
push   %rbx
mov    $0xa,%edi
call   1050 <copy_int@plt>
mov    %rax,%rbx
xor    %edi,%edi
cmpl   $0xa,(%rax)
sete   %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @copy_int_test() {
%1 = alloca i32*
%2 = call i32* @copy_int(i32 10)
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 10
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load i32*, i32** %1
%9 = call i32 @free(i32* %8)
ret void
}

LLVM IR (-O2):
define void @copy_int_test() {
%1 = tail call i32* @copy_int(i32 10)
%2 = load i32, i32* %1
%3 = icmp eq i32 %2, 10
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 @free(i32* %1)
ret void
}
void test41_Blink2_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @test41_Blink2_targetInit__I() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGPIPE;
int /*<<< orphan*/ raise(int /*<<< orphan*/);
void testFour(void) { raise(SIGPIPE); }


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

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

LLVM IR (-O0):
@SIGPIPE = global i32 0
define void @testFour() {
%1 = load i32, i32* @SIGPIPE
%2 = call i32 @raise(i32 %1)
ret void
}

LLVM IR (-O2):
@SIGPIPE = global i32 0
define void @testFour() {
%1 = load i32, i32* @SIGPIPE
%2 = tail call i32 @raise(i32 %1)
ret void
}
void NV21ToRGB24Row_Any_NEON() {}


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

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

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

LLVM IR (-O2):
define void @NV21ToRGB24Row_Any_NEON() {
ret void
}
/* Variables and functions */
size_t strnlen(__const char *__string, size_t __maxlen) {
  size_t len;
  for (len = 0; len < __maxlen && __string[len]; len++)
    ;
  return len;
}


x86 assembly (clang, -O0):
<strnlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
xor    %eax,%eax
cmp    -0x10(%rbp),%rcx
mov    %al,-0x19(%rbp)
jae    113c <strnlen+0x3c>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    114c <strnlen+0x4c>
jmp    1162 <strnlen+0x62>
jmp    1151 <strnlen+0x51>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <strnlen+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnlen>:
xor    %eax,%eax
test   %rsi,%rsi
je     1122 <strnlen+0x22>
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,(%rdi,%rax,1)
je     1122 <strnlen+0x22>
add    $0x1,%rax
cmp    %rax,%rsi
jne    1110 <strnlen+0x10>
mov    %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @strnlen(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %9
%5 = phi i64 [ %10, %9 ], [ 0, %2 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %4
%10 = add nuw i64 %5, 1
%11 = icmp eq i64 %10, %1
br i1 %11, label %12, label %4
12: ; preds = %4, %9, %2
%13 = phi i64 [ 0, %2 ], [ %1, %9 ], [ %5, %4 ]
ret i64 %13
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0xe3() {
  Assert_real((isodigit(227) == 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_isodigit.c",
              1140, ("isodigit should be 0 for 0xe3"));
}


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

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

LLVM IR (-O0):
@.str = [169 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_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xe3\00"
define void @t_isodigit_0xe3() {
%1 = call i64 @isodigit(i32 227)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1140, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xe3\00"
define void @t_isodigit_0xe3() {
%1 = tail call i64 @isodigit(i32 227)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1140, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
double calkaD(double, double, double);
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, double *, double *, double *);
int main() {
  double a = 0;
  double b = 4;
  double delta = 0.2;
  scanf("%lf %lf %lf", &a, &b, &delta);
  printf("%f\n", calkaD(a, b, delta));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xec0(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xeab(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
lea    0xeaf(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdx
lea    -0x18(%rbp),%rcx
call   1050 <scanf@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1040 <calkaD@plt>
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
movabs $0x4010000000000000,%rax
mov    %rax,0x8(%rsp)
movabs $0x3fc999999999999a,%rax
99 c9 3f
mov    %rax,(%rsp)
lea    0xe9f(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
mov    %rsp,%rcx
call   1050 <scanf@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  (%rsp),%xmm2
call   1040 <calkaD@plt>
lea    0xe7c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"%lf %lf %lf\00"
@.str.1 = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
store double 0.000000e+00, double* %1
store double 4.000000e+00, double* %2
store double 2.000000e-01, double* %3
%4 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double* %1, double* %2, double* %3)
%5 = load double, double* %1
%6 = load double, double* %2
%7 = load double, double* %3
%8 = call double @calkaD(double %5, double %6, double %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"%lf %lf %lf\00"
@.str.1 = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = bitcast double* %1 to i8*
store double 0.000000e+00, double* %1
%5 = bitcast double* %2 to i8*
store double 4.000000e+00, double* %2
%6 = bitcast double* %3 to i8*
store double 2.000000e-01, double* %3
%7 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double* %1, double* %2, double* %3)
%8 = load double, double* %1
%9 = load double, double* %2
%10 = load double, double* %3
%11 = call double @calkaD(double %8, double %9, double %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %11)
ret i32 0
}
/* Variables and functions */
char *__strncpy(char *, char const *, size_t);
char *strncpy(char *dest, const char *src, size_t n) {
  return __strncpy(dest, src, n);
}


x86 assembly (clang, -O0):
<strncpy>:
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 <__strncpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncpy>:
jmp    1030 <__strncpy@plt>

LLVM IR (-O0):
define i8* @strncpy(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* @__strncpy(i8* %7, i8* %8, i64 %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @strncpy(i8* %0, i8* %1, i64 %2) {
%4 = tail call i8* @__strncpy(i8* %0, i8* %1, i64 %2)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void die(const char const *msg) {
  fprintf(stderr, "%s\n", msg);
  exit(EXIT_FAILURE);
}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @glutDestroyWindow(i32 %0) {
ret void
}
perror_with_exit(string) char *string;
{
  perror(string);
  exit(1);
}


x86 assembly (clang, -O0):
<perror_with_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<perror_with_exit>:
push   %rax
xor    %eax,%eax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @perror_with_exit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @perror to i32 (i8*, ...)*)(i8* %3)
unreachable
}

LLVM IR (-O2):
define i32 @perror_with_exit(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @perror to i32 (i8*, ...)*)(i8* %0)
tail call void @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void stars() {
  int i;
  for (i = 0; i < 5; i++) {
    printf("*");
  }
}


x86 assembly (clang, -O0):
<stars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jge    1143 <stars+0x33>
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <stars+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stars>:
push   %rax
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"*\00"
define void @stars() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %7, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 5
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
br label %2
10: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @stars() {
%1 = tail call i32 @putchar(i32 42)
%2 = tail call i32 @putchar(i32 42)
%3 = tail call i32 @putchar(i32 42)
%4 = tail call i32 @putchar(i32 42)
%5 = tail call i32 @putchar(i32 42)
ret void
}
short quantize(const short data, const unsigned short qt) {
  return (data * qt - (data >> 15) + ((1 << (10 - 1)) - 1)) >> 10;
}


x86 assembly (clang, -O0):
<quantize>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movswl -0x2(%rbp),%eax
movzwl -0x4(%rbp),%ecx
imul   %ecx,%eax
movswl -0x2(%rbp),%ecx
sar    $0xf,%ecx
sub    %ecx,%eax
add    $0x1ff,%eax
sar    $0xa,%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<quantize>:
imul   %edi,%esi
sar    $0xf,%edi
sub    %edi,%esi
lea    0x1ff(%rsi),%eax
shr    $0xa,%eax
ret

LLVM IR (-O0):
define signext i16 @quantize(i16 signext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = sext i16 %5 to i32
%7 = load i16, i16* %4
%8 = zext i16 %7 to i32
%9 = mul nsw i32 %6, %8
%10 = load i16, i16* %3
%11 = sext i16 %10 to i32
%12 = ashr i32 %11, 15
%13 = sub nsw i32 %9, %12
%14 = add nsw i32 %13, 511
%15 = ashr i32 %14, 10
%16 = trunc i32 %15 to i16
ret i16 %16
}

LLVM IR (-O2):
define signext i16 @quantize(i16 signext %0, i16 zeroext %1) {
%3 = sext i16 %0 to i32
%4 = zext i16 %1 to i32
%5 = mul nsw i32 %4, %3
%6 = ashr i32 %3, 15
%7 = sub nsw i32 511, %6
%8 = add nsw i32 %7, %5
%9 = lshr i32 %8, 10
%10 = trunc i32 %9 to i16
ret i16 %10
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void PrintUsage(const char *own_path) {
  fprintf(stderr, "Usage: %s [file.icns]\n", own_path);
}


x86 assembly (clang, -O0):
<PrintUsage>:
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):
<PrintUsage>:
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 = [23 x i8] c"Usage: %s [file.icns]\0A\00"
define void @PrintUsage(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 ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"Usage: %s [file.icns]\0A\00"
define void @PrintUsage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int testfunc(char **, char *, char *);
int main(void) {
  char *ret;
  if (testfunc(&ret, "%s.", "Text") != 5)
    return 1;
  if (strcmp(ret, "Text."))
    return 2;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x10(%rbp),%rdi
lea    0xec6(%rip),%rsi
lea    0xec3(%rip),%rdx
call   1030 <testfunc@plt>
cmp    $0x5,%eax
je     115b <main+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1188 <main+0x68>
mov    -0x10(%rbp),%rdi
lea    0xea3(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     1181 <main+0x61>
movl   $0x2,-0x4(%rbp)
jmp    1188 <main+0x68>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rsi
lea    0xed5(%rip),%rdx
mov    %rsp,%rdi
call   1030 <testfunc@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0x5,%ecx
jne    1160 <main+0x40>
mov    (%rsp),%rdi
lea    0xebb(%rip),%rsi
call   1040 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s.\00"
@.str.1 = [5 x i8] c"Text\00"
@.str.2 = [6 x i8] c"Text.\00"
define i32 @main() {
%1 = alloca i8*
%2 = bitcast i8** %1 to i8*
%3 = call i32 @testfunc(i8** %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%4 = icmp eq i32 %3, 5
br i1 %4, label %5, label %10
5: ; preds = %0
%6 = load i8*, i8** %1
%7 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
%9 = select i1 %8, i32 0, i32 2
br label %10
10: ; preds = %5, %0
%11 = phi i32 [ 1, %0 ], [ %9, %5 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ fb_init();
int /*<<< orphan*/ heap_init();
int /*<<< orphan*/ heap_reinitp();
int /*<<< orphan*/ pages_init();
void kmain(void) {
  heap_init();
  pages_init();
  heap_reinitp();
  fb_init();
}


x86 assembly (clang, -O0):
<kmain>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <heap_init@plt>
mov    $0x0,%al
call   1030 <pages_init@plt>
mov    $0x0,%al
call   1050 <heap_reinitp@plt>
mov    $0x0,%al
call   1040 <fb_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<kmain>:
push   %rax
xor    %eax,%eax
call   1060 <heap_init@plt>
xor    %eax,%eax
call   1030 <pages_init@plt>
xor    %eax,%eax
call   1050 <heap_reinitp@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <fb_init@plt>

LLVM IR (-O0):
define void @kmain() {
%1 = call i32 (...) @heap_init()
%2 = call i32 (...) @pages_init()
%3 = call i32 (...) @heap_reinitp()
%4 = call i32 (...) @fb_init()
ret void
}

LLVM IR (-O2):
define void @kmain() {
%1 = tail call i32 (...) @heap_init()
%2 = tail call i32 (...) @pages_init()
%3 = tail call i32 (...) @heap_reinitp()
%4 = tail call i32 (...) @fb_init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ new_int(int);
int pop_int();
int /*<<< orphan*/ push(int /*<<< orphan*/);
void builtin_rem() {
  int b = pop_int();
  int a = pop_int();
  push(new_int(a % b));
}


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

x86 assembly (clang, -O2):
<builtin_rem>:
push   %rbx
xor    %eax,%eax
call   1030 <pop_int@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <pop_int@plt>
cltd
idiv   %ebx
mov    %edx,%edi
call   1040 <new_int@plt>
mov    %eax,%edi
pop    %rbx
jmp    1050 <push@plt>

LLVM IR (-O0):
define void @builtin_rem() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @pop_int()
store i32 %3, i32* %1
%4 = call i32 (...) @pop_int()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = load i32, i32* %1
%7 = srem i32 %5, %6
%8 = call i32 @new_int(i32 %7)
%9 = call i32 @push(i32 %8)
ret void
}

LLVM IR (-O2):
define void @builtin_rem() {
%1 = tail call i32 (...) @pop_int()
%2 = tail call i32 (...) @pop_int()
%3 = srem i32 %2, %1
%4 = tail call i32 @new_int(i32 %3)
%5 = tail call i32 @push(i32 %4)
ret void
}
int HISTO_COMPARE(const void *l, const void *r) {
  int x, y;
  x = *((int *)l);
  y = *((int *)r);
  return (x - y);
}


x86 assembly (clang, -O0):
<HISTO_COMPARE>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
sub    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<HISTO_COMPARE>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @HISTO_COMPARE(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
store i32 %9, i32* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = sub nsw i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @HISTO_COMPARE(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ printf(char *, char const *, int, char const *,
                          char const *);
void paravm_assert(const char *file, int line, const char *func,
                   const char *msg) {
  printf("Assertion failed at %s:%i!%s: %s\n", file, line, func, msg);
  abort();
}


x86 assembly (clang, -O0):
<paravm_assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<paravm_assert>:
push   %rax
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xecd(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"Assertion failed at %s:%i!%s: %s\0A\00"
define void @paravm_assert(i8* %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = load i8*, i8** %7
%12 = load i8*, i8** %8
%13 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %9, i32 %10, i8* %11, i8* %12)
%14 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@.str = [34 x i8] c"Assertion failed at %s:%i!%s: %s\0A\00"
define void @paravm_assert(i8* %0, i32 %1, i8* %2, i8* %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i8* %2, i8* %3)
%6 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ StartGame();
int main(int argc, char *argv[]) {
  StartGame();
  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 <StartGame@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <StartGame@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**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @StartGame()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @StartGame()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ findandjump(int, char *);
int /*<<< orphan*/ stdputstr(char *);
void xlcleanup(void) {
  stdputstr("[ back to previous break level ]\n");
  findandjump(0x0010, "not in a break loop");
}


x86 assembly (clang, -O0):
<xlcleanup>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <stdputstr@plt>
mov    $0x10,%edi
lea    0xee6(%rip),%rsi
call   1040 <findandjump@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<xlcleanup>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <stdputstr@plt>
lea    0xeee(%rip),%rsi
mov    $0x10,%edi
pop    %rax
jmp    1040 <findandjump@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"[ back to previous break level ]\0A\00"
@.str.1 = [20 x i8] c"not in a break loop\00"
define void @xlcleanup() {
%1 = call i32 @stdputstr(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @findandjump(i32 16, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"[ back to previous break level ]\0A\00"
@.str.1 = [20 x i8] c"not in a break loop\00"
define void @xlcleanup() {
%1 = tail call i32 @stdputstr(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @findandjump(i32 16, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int peekSensor() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @peekSensor() {
ret i32 0
}