xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void cog_free(void *ptr) { free(ptr); }


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

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

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

LLVM IR (-O2):
define void @cog_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
double floor(double);
double frac(double x) { return (x - floor(x)); }


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

x86 assembly (clang, -O2):
<frac>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <floor@plt>
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @frac(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = call double @llvm.floor.f64(double %4)
%6 = fsub double %3, %5
ret double %6
}

LLVM IR (-O2):
define double @frac(double %0) {
%2 = tail call double @llvm.floor.f64(double %0)
%3 = fsub double %0, %2
ret double %3
}
int xmlUCSIsBasicLatin(int code) {
  return (((code >= 0x0000) && (code <= 0x007F)));
}


x86 assembly (clang, -O0):
<xmlUCSIsBasicLatin>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <xmlUCSIsBasicLatin+0x20>
cmpl   $0x7f,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlUCSIsBasicLatin>:
xor    %eax,%eax
cmp    $0x80,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @xmlUCSIsBasicLatin(i32 %0) {
%2 = icmp ult i32 %0, 128
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ LDX_();
int /*<<< orphan*/ c64_memAbsoluteAddr();
void LDX_abs(void) {
  c64_memAbsoluteAddr();
  LDX_();
}


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

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

LLVM IR (-O0):
define void @LDX_abs() {
%1 = call i32 (...) @c64_memAbsoluteAddr()
%2 = call i32 (...) @LDX_()
ret void
}

LLVM IR (-O2):
define void @LDX_abs() {
%1 = tail call i32 (...) @c64_memAbsoluteAddr()
%2 = tail call i32 (...) @LDX_()
ret void
}
void foo3(void) {}


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

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

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

LLVM IR (-O2):
define void @foo3() {
ret void
}
void omap_iommu_debugfs_init(void) {}


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

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

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

LLVM IR (-O2):
define void @omap_iommu_debugfs_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ NRerror(char *);
scalar_t__ malloc(size_t);
int *ivector(long nl, long nh) {
  int *v;
  v = (int *)malloc((size_t)((nh - nl + 1 + 1) * sizeof(int)));
  if (!v)
    NRerror("allocation failure in ivector()");
  return v - nl + 1;
}


x86 assembly (clang, -O0):
<ivector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
sub    -0x8(%rbp),%rdi
add    $0x1,%rdi
add    $0x1,%rdi
shl    $0x2,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1164 <ivector+0x44>
lea    0xea1(%rip),%rdi
call   1030 <NRerror@plt>
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
sub    -0x8(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
add    $0x4,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ivector>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
sub    %rdi,%rsi
lea    0x8(,%rsi,4),%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114b <ivector+0x2b>
lea    0xeba(%rip),%rdi
call   1030 <NRerror@plt>
shl    $0x2,%r14
sub    %r14,%rbx
add    $0x4,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [32 x i8] c"allocation failure in ivector()\00"
define i32* @ivector(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = sub nsw i64 %6, %7
%9 = add nsw i64 %8, 1
%10 = add nsw i64 %9, 1
%11 = mul i64 %10, 4
%12 = call i64 @malloc(i64 %11)
%13 = inttoptr i64 %12 to i32*
store i32* %13, i32** %5
%14 = load i32*, i32** %5
%15 = icmp ne i32* %14, null
br i1 %15, label %18, label %16
16: ; preds = %2
%17 = call i32 @NRerror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %16, %2
%19 = load i32*, i32** %5
%20 = load i64, i64* %3
%21 = sub i64 0, %20
%22 = getelementptr inbounds i32, i32* %19, i64 %21
%23 = getelementptr inbounds i32, i32* %22, i64 1
ret i32* %23
}

LLVM IR (-O2):
@.str = [32 x i8] c"allocation failure in ivector()\00"
define i32* @ivector(i64 %0, i64 %1) {
%3 = sub nsw i64 %1, %0
%4 = shl i64 %3, 2
%5 = add i64 %4, 8
%6 = tail call i64 @malloc(i64 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @NRerror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = inttoptr i64 %6 to i32*
%12 = sub i64 0, %0
%13 = getelementptr inbounds i32, i32* %11, i64 %12
%14 = getelementptr inbounds i32, i32* %13, i64 1
ret i32* %14
}
/* Variables and functions */
int /*<<< orphan*/ initTouch();
int /*<<< orphan*/ initUART();
int main(void) {
  initUART();
  initTouch();
  while (1) {
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <initUART@plt>
mov    $0x0,%al
call   1040 <initTouch@plt>
jmp    113d <main+0x1d>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <initUART@plt>
xor    %eax,%eax
call   1040 <initTouch@plt>
nop
jmp    1130 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @initUART()
%3 = call i32 (...) @initTouch()
br label %4
4: ; preds = %0, %4
br label %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @initUART()
%2 = tail call i32 (...) @initTouch()
br label %3
3: ; preds = %0, %3
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double, double, double);
double sin(double);
void hw2(double r1, double r2) {
  double s;
  s = sin(r1 + r2);
  printf("Hello, World! sin(%g+%g)=%g\n", r1, r2, s);
}


x86 assembly (clang, -O0):
<hw2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hw2>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
addsd  %xmm1,%xmm0
call   1040 <sin@plt>
movapd %xmm0,%xmm2
lea    0xebc(%rip),%rdi
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
add    $0x18,%rsp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"Hello, World! sin(%g+%g)=%g\0A\00"
define void @hw2(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = load double, double* %4
%8 = fadd double %6, %7
%9 = call double @sin(double %8)
store double %9, double* %5
%10 = load double, double* %3
%11 = load double, double* %4
%12 = load double, double* %5
%13 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), double %10, double %11, double %12)
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"Hello, World! sin(%g+%g)=%g\0A\00"
define void @hw2(double %0, double %1) {
%3 = fadd double %0, %1
%4 = tail call double @sin(double %3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), double %0, double %1, double %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ linewidth(short);
void linewidthf(float w) { linewidth((short)(w + 0.5)); }


x86 assembly (clang, -O0):
<linewidthf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed2(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
movswl %ax,%edi
call   1030 <linewidth@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<linewidthf>:
cvtss2sd %xmm0,%xmm0
addsd  0xee4(%rip),%xmm0
cvttsd2si %xmm0,%eax
movswl %ax,%edi
jmp    1030 <linewidth@plt>

LLVM IR (-O0):
define void @linewidthf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fadd double %4, 5.000000e-01
%6 = fptosi double %5 to i16
%7 = call i32 @linewidth(i16 signext %6)
ret void
}

LLVM IR (-O2):
define void @linewidthf(float %0) {
%2 = fpext float %0 to double
%3 = fadd double %2, 5.000000e-01
%4 = fptosi double %3 to i16
%5 = tail call i32 @linewidth(i16 signext %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, float const *, int);
uint32_t float_to_bits(const float f) {
  uint32_t bits = 0;
  memcpy(&bits, &f, sizeof(float));
  return bits;
}


x86 assembly (clang, -O0):
<float_to_bits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<float_to_bits>:
push   %rax
movss  %xmm0,0x4(%rsp)
movl   $0x0,(%rsp)
mov    %rsp,%rdi
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @float_to_bits(float %0) {
%2 = alloca float
%3 = alloca i32
store float %0, float* %2
store i32 0, i32* %3
%4 = call i32 @memcpy(i32* %3, float* %2, i32 4)
%5 = load i32, i32* %3
ret i32 %5
}

LLVM IR (-O2):
define i32 @float_to_bits(float %0) {
%2 = alloca float
%3 = alloca i32
store float %0, float* %2
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = call i32 @memcpy(i32* %3, float* %2, i32 4)
%6 = load i32, i32* %3
ret i32 %6
}
void _start() {
  int result = main(0, 0x0);
  __asm__ volatile("movl $0, %%eax\r\n"
                   "int $0x80\r\n"
                   :
                   : "c"(result));
  while (1) {
  }
}


x86 assembly (clang, -O0):
<_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %esi,%esi
mov    %esi,%edi
mov    $0x0,%al
call   1030 <main@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x0,%eax
int    $0x80
jmp    1130 <_start+0x20>

x86 assembly (clang, -O2):
<_start>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
xor    %eax,%eax
call   1030 <main@plt>
mov    %eax,%ecx
mov    $0x0,%eax
int    $0x80
cs nopw 0x0(%rax,%rax,1)
nop
jmp    1130 <_start+0x20>

LLVM IR (-O0):
define void @_start() {
%1 = alloca i32
%2 = call i32 (i32, i32, ...) bitcast (i32 (...)* @main to i32 (i32, i32, ...)*)(i32 0, i32 0)
store i32 %2, i32* %1
%3 = load i32, i32* %1
br label %4
4: ; preds = %0, %4
br label %4
}

LLVM IR (-O2):
define void @_start() {
%1 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @main to i32 (i32, i32, ...)*)(i32 0, i32 0)
tail call void asm sideeffect "movl $$0, %eax\0D\0Aint $$0x80\0D\0A", "{cx},~{dirflag},~{fpsr},~{flags}"(i32 %1)
br label %2
2: ; preds = %2, %0
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, size_t);
int copyout(const void *src, void *dst, size_t nbytes) {
  memcpy(dst, src, nbytes);
  return 0;
}


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

x86 assembly (clang, -O2):
<copyout>:
push   %rax
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
call   1030 <memcpy@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @copyout(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** %5
%8 = load i8*, i8** %4
%9 = load i64, i64* %6
%10 = call i32 @memcpy(i8* %7, i8* %8, i64 %9)
ret i32 0
}

LLVM IR (-O2):
define i32 @copyout(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @memcpy(i8* %1, i8* %0, i64 %2)
ret i32 0
}
double fmax(double a, double b) {
  if (a > b) {
    return (a);
  } else {
    return (b);
  }
}


x86 assembly (clang, -O0):
<fmax>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    112d <fmax+0x2d>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1137 <fmax+0x37>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmax>:
maxsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @fmax(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = load double, double* %5
%8 = fcmp ogt double %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load double, double* %4
store double %10, double* %3
br label %13
11: ; preds = %2
%12 = load double, double* %5
store double %12, double* %3
br label %13
13: ; preds = %11, %9
%14 = load double, double* %3
ret double %14
}

LLVM IR (-O2):
define double @fmax(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
void INI_Bool_TYPE() { ; }


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

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

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

LLVM IR (-O2):
define void @INI_Bool_TYPE() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  printf("%2$d, %1$d", 100, 200);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x64,%esi
mov    $0xc8,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [11 x i8] c"%2$d, %1$d\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 100, i32 200)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"%2$d, %1$d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 100, i32 200)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ TRUE;
int /*<<< orphan*/ open_copyinfo(int /*<<< orphan*/, char const *,
                                 unsigned long long);
void open_sendinfo(const char *name, unsigned long long size) {
  open_copyinfo(TRUE, name, size);
}


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

x86 assembly (clang, -O2):
<open_sendinfo>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2ecb(%rip),%rax
mov    (%rax),%edi
jmp    1030 <open_copyinfo@plt>

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

LLVM IR (-O2):
@TRUE = global i32 0
define void @open_sendinfo(i8* %0, i64 %1) {
%3 = load i32, i32* @TRUE
%4 = tail call i32 @open_copyinfo(i32 %3, i8* %0, i64 %1)
ret void
}
int test_imm_50int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x50 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_50int64_highword_mem>:
testb  $0x50,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_50int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 343597383680
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0xc1() {
  Assert_real((isprint(193) == 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_isprint.c",
              970, ("isprint should be 0 for 0xc1"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xc1\00"
define void @t_isprint_0xc1() {
%1 = tail call i64 @isprint(i32 193)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 970, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
double ceil(x)
double x;
{
  double y;
  y = floor(x);
  if (y < x)
    y += 1.0;
  return (y);
}


x86 assembly (clang, -O0):
<ceil>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <floor@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1152 <ceil+0x42>
movsd  0xeb8(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceil>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <floor@plt>
movsd  0xedd(%rip),%xmm2
addsd  %xmm0,%xmm2
movapd %xmm0,%xmm1
cmpltsd (%rsp),%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @ceil(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @llvm.floor.f64(double %4)
store double %5, double* %3
%6 = load double, double* %3
%7 = load double, double* %2
%8 = fcmp olt double %6, %7
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load double, double* %3
%11 = fadd double %10, 1.000000e+00
store double %11, double* %3
br label %12
12: ; preds = %9, %1
%13 = load double, double* %3
ret double %13
}

LLVM IR (-O2):
define double @ceil(double %0) {
%2 = tail call double @llvm.floor.f64(double %0)
%3 = fcmp olt double %2, %0
%4 = fadd double %2, 1.000000e+00
%5 = select i1 %3, double %4, double %2
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ OK;
int check_arg_count(int, int /*<<< orphan*/);
int /*<<< orphan*/ qiflush();
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_return(int /*<<< orphan*/);
void cmd_qiflush(int nargs, char **args) {
  if (check_arg_count(nargs, 0) == 1)
    return;
  qiflush();
  report_count(1);
  report_return(OK);
}


x86 assembly (clang, -O0):
<cmd_qiflush>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1040 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1167 <cmd_qiflush+0x27>
jmp    1186 <cmd_qiflush+0x46>
mov    $0x0,%al
call   1060 <qiflush@plt>
mov    $0x1,%edi
call   1050 <report_count@plt>
mov    0x2e61(%rip),%rax
mov    (%rax),%edi
call   1030 <report_return@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_qiflush>:
push   %rax
xor    %esi,%esi
call   1040 <check_arg_count@plt>
cmp    $0x1,%eax
jne    114f <cmd_qiflush+0xf>
pop    %rax
ret
xor    %eax,%eax
call   1060 <qiflush@plt>
mov    $0x1,%edi
call   1050 <report_count@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1030 <report_return@plt>

LLVM IR (-O0):
@OK = global i32 0
define void @cmd_qiflush(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = call i32 @check_arg_count(i32 %5, i32 0)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
br label %14
9: ; preds = %2
%10 = call i32 (...) @qiflush()
%11 = call i32 @report_count(i32 1)
%12 = load i32, i32* @OK
%13 = call i32 @report_return(i32 %12)
br label %14
14: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
@OK = global i32 0
define void @cmd_qiflush(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 0)
%4 = icmp eq i32 %3, 1
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = tail call i32 (...) @qiflush()
%7 = tail call i32 @report_count(i32 1)
%8 = load i32, i32* @OK
%9 = tail call i32 @report_return(i32 %8)
br label %10
10: ; preds = %2, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(
      stderr,
      "ea_receiver - A lightweight Elster EnergyAxis receiver\n"
      "Usage: ea_receiver [options] FILE\n"
      "\n"
      "  FILE        Unsigned 8-bit IQ file to process (or \"-\" for stdin)\n"
      "  -c N        Number of 400kHz channels to receive (1-255, default 6)\n"
      "\n");
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [229 x i8] c"ea_receiver - A lightweight Elster EnergyAxis receiver\0AUsage: ea_receiver [options] FILE\0A\0A FILE Unsigned 8-bit IQ file to process (or \22-\22 for stdin)\0A -c N Number of 400kHz channels to receive (1-255, default 6)\0A\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([229 x i8], [229 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [229 x i8] c"ea_receiver - A lightweight Elster EnergyAxis receiver\0AUsage: ea_receiver [options] FILE\0A\0A FILE Unsigned 8-bit IQ file to process (or \22-\22 for stdin)\0A -c N Number of 400kHz channels to receive (1-255, default 6)\0A\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([229 x i8], [229 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(unsigned short);
__attribute__((no, noclone)) unsigned short f3(unsigned short x,
                                               unsigned short y) {
  unsigned short r = x + y;
  if (y < r)
    foo(r);
  return r;
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movzwl -0x2(%rbp),%eax
movzwl -0x4(%rbp),%ecx
add    %ecx,%eax
mov    %ax,-0x6(%rbp)
movzwl -0x4(%rbp),%eax
movzwl -0x6(%rbp),%ecx
cmp    %ecx,%eax
jge    114d <f3+0x3d>
movzwl -0x6(%rbp),%edi
call   1030 <foo@plt>
movzwl -0x6(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
push   %rbx
mov    %edi,%ebx
add    %esi,%ebx
cmp    %si,%bx
jbe    1122 <f3+0x12>
movzwl %bx,%edi
call   1030 <foo@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define zeroext i16 @f3(i16 zeroext %0, i16 zeroext %1) {
%3 = add i16 %1, %0
%4 = icmp ugt i16 %3, %1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @foo(i16 zeroext %3)
br label %7
7: ; preds = %5, %2
ret i16 %3
}
/* Variables and functions */
int bitcount(int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("Bitcount -> %d", bitcount(7));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x7,%edi
call   1040 <bitcount@plt>
mov    %eax,%esi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"Bitcount -> %d\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @bitcount(i32 7)
%3 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Bitcount -> %d\00"
define i32 @main() {
%1 = tail call i32 @bitcount(i32 7)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
struct scheduler {
  int dummy;
};

/* Variables and functions */
int sched_restore(struct scheduler *);
int sched_fifo_leave(struct scheduler *sched_to_be_restored) {
  return sched_restore(sched_to_be_restored);
}


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

x86 assembly (clang, -O2):
<sched_fifo_leave>:
jmp    1030 <sched_restore@plt>

LLVM IR (-O0):
%struct.scheduler = type { i32 }
define i32 @sched_fifo_leave(%struct.scheduler* %0) {
%2 = alloca %struct.scheduler*
store %struct.scheduler* %0, %struct.scheduler** %2
%3 = load %struct.scheduler*, %struct.scheduler** %2
%4 = call i32 @sched_restore(%struct.scheduler* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.scheduler = type { i32 }
define i32 @sched_fifo_leave(%struct.scheduler* %0) {
%2 = tail call i32 @sched_restore(%struct.scheduler* %0)
ret i32 %2
}
void _M2_ASCII_finish(__attribute__((unused)) int argc,
                      __attribute__((unused)) char *argv[]) {}


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

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

LLVM IR (-O0):
define void @_M2_ASCII_finish(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
ret void
}

LLVM IR (-O2):
define void @_M2_ASCII_finish(i32 %0, i8** nocapture %1) {
ret void
}
void delay(unsigned int delta) {
  unsigned int t = 0;
  while (t < delta) {
    t++;
  }
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    1128 <delay+0x28>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <delay+0xe>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @delay(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %8, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp ult i32 %5, %6
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = load i32, i32* %3
%10 = add i32 %9, 1
store i32 %10, i32* %3
br label %4
11: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @delay(i32 %0) {
ret void
}
/* Variables and functions */
int getpid();
int lib_f(int mask) { return getpid() % mask; }


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

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

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

LLVM IR (-O2):
define i32 @lib_f(i32 %0) {
%2 = tail call i32 (...) @getpid()
%3 = srem i32 %2, %0
ret i32 %3
}
int ioctl_medium_changed(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ioctl_medium_changed() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ inet_csum_slice(int /*<<< orphan*/,
                                   int /*<<< orphan*/ const *,
                                   int /*<<< orphan*/, int /*<<< orphan*/);
uint16_t inet_csum(uint16_t sum, const uint8_t *buf, uint16_t len) {
  return inet_csum_slice(sum, buf, len, 0);
}


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

x86 assembly (clang, -O2):
<inet_csum>:
xor    %ecx,%ecx
jmp    1030 <inet_csum_slice@plt>

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

LLVM IR (-O2):
define i32 @inet_csum(i32 %0, i32* %1, i32 %2) {
%4 = tail call i32 @inet_csum_slice(i32 %0, i32* %1, i32 %2, i32 0)
ret i32 %4
}
double GetUSP(int *Ptr, int Scale) {
  unsigned Oct;
  double x;
  Oct = 077777 & *Ptr;
  x = Oct * (1.0 / 0100000) * Scale;
  return (x);
}


x86 assembly (clang, -O0):
<GetUSP>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0x7fff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cvtsi2sd %rax,%xmm0
movsd  0xed7(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetUSP>:
mov    $0x7fff,%eax
and    (%rdi),%eax
cvtsi2sd %eax,%xmm1
mulsd  0xeed(%rip),%xmm1
cvtsi2sd %esi,%xmm0
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @GetUSP(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca double
store i32* %0, i32** %3
store i32 %1, i32* %4
%7 = load i32*, i32** %3
%8 = load i32, i32* %7
%9 = and i32 32767, %8
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = uitofp i32 %10 to double
%12 = fmul double %11, 0x3F00000000000000
%13 = load i32, i32* %4
%14 = sitofp i32 %13 to double
%15 = fmul double %12, %14
store double %15, double* %6
%16 = load double, double* %6
ret double %16
}

LLVM IR (-O2):
define double @GetUSP(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = and i32 %3, 32767
%5 = uitofp i32 %4 to double
%6 = fmul double %5, 0x3F00000000000000
%7 = sitofp i32 %1 to double
%8 = fmul double %6, %7
ret double %8
}
void initDebug() {}


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

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

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

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

/* Variables and functions */
__attribute__((weak)) void __exit(int32_t exit_code) { return; }


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

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

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

LLVM IR (-O2):
define weak void @__exit(i32 %0) {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int length;
};
typedef TYPE_1__ XHostAddress;

/* Variables and functions */
void set_XHostAddress_length(void *_p, int _v) {
  ((XHostAddress *)_p)->length = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XHostAddress_length>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XHostAddress_length(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XHostAddress_length(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
__attribute__((const)) int is_single_char_word(char c) {
  return c == '{' || c == '}' || c == '[' || c == ']';
}


x86 assembly (clang, -O0):
<is_single_char_word>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7b,%ecx
mov    %al,-0x2(%rbp)
je     114d <is_single_char_word+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7d,%ecx
mov    %al,-0x2(%rbp)
je     114d <is_single_char_word+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x5b,%ecx
mov    %al,-0x2(%rbp)
je     114d <is_single_char_word+0x4d>
movsbl -0x1(%rbp),%eax
cmp    $0x5d,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_single_char_word>:
lea    -0x5b(%rdi),%ecx
cmp    $0x22,%cl
ja     1121 <is_single_char_word+0x21>
mov    $0x1,%eax
movzbl %cl,%ecx
movabs $0x500000001,%rdx
bt     %rcx,%rdx
jae    1121 <is_single_char_word+0x21>
ret
xor    %eax,%eax
cmp    $0x5d,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @is_single_char_word(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, 123
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, 125
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, 91
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, 93
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 @is_single_char_word(i8 signext %0) {
switch i8 %0, label %2 [
i8 125, label %5
i8 123, label %5
i8 91, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 93
%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
}
main(argc, argv) int argc;
char **argv;
{
  ScanArgs(argc, argv);
  InitializeFD();
  InitializeX11();
  InitializePEX();
  SetUpStdin();
  SetUpConnectionSocket(GetScopePort());
  SetSignalHandling();
  MainLoop();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1090 <ScanArgs@plt>
mov    $0x0,%al
call   1050 <InitializeFD@plt>
mov    $0x0,%al
call   10b0 <InitializeX11@plt>
mov    $0x0,%al
call   1080 <InitializePEX@plt>
mov    $0x0,%al
call   1040 <SetUpStdin@plt>
mov    $0x0,%al
call   1030 <GetScopePort@plt>
mov    %eax,%edi
mov    $0x0,%al
call   10a0 <SetUpConnectionSocket@plt>
mov    $0x0,%al
call   1070 <SetSignalHandling@plt>
mov    $0x0,%al
call   1060 <MainLoop@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1090 <ScanArgs@plt>
xor    %eax,%eax
call   1050 <InitializeFD@plt>
xor    %eax,%eax
call   10b0 <InitializeX11@plt>
xor    %eax,%eax
call   1080 <InitializePEX@plt>
xor    %eax,%eax
call   1040 <SetUpStdin@plt>
xor    %eax,%eax
call   1030 <GetScopePort@plt>
mov    %eax,%edi
xor    %eax,%eax
call   10a0 <SetUpConnectionSocket@plt>
xor    %eax,%eax
call   1070 <SetSignalHandling@plt>
xor    %eax,%eax
call   1060 <MainLoop@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = load i8**, i8*** %4
%7 = call i32 (i32, i8**, ...) bitcast (i32 (...)* @ScanArgs to i32 (i32, i8**, ...)*)(i32 %5, i8** %6)
%8 = call i32 (...) @InitializeFD()
%9 = call i32 (...) @InitializeX11()
%10 = call i32 (...) @InitializePEX()
%11 = call i32 (...) @SetUpStdin()
%12 = call i32 (...) @GetScopePort()
%13 = call i32 (i32, ...) bitcast (i32 (...)* @SetUpConnectionSocket to i32 (i32, ...)*)(i32 %12)
%14 = call i32 (...) @SetSignalHandling()
%15 = call i32 (...) @MainLoop()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 (i32, i8**, ...) bitcast (i32 (...)* @ScanArgs to i32 (i32, i8**, ...)*)(i32 %0, i8** %1)
%4 = tail call i32 (...) @InitializeFD()
%5 = tail call i32 (...) @InitializeX11()
%6 = tail call i32 (...) @InitializePEX()
%7 = tail call i32 (...) @SetUpStdin()
%8 = tail call i32 (...) @GetScopePort()
%9 = tail call i32 (i32, ...) bitcast (i32 (...)* @SetUpConnectionSocket to i32 (i32, ...)*)(i32 %8)
%10 = tail call i32 (...) @SetSignalHandling()
%11 = tail call i32 (...) @MainLoop()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void saveTerm() { printf("\e[?47h"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"\1B[?47h\00"
define void @saveTerm() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"\1B[?47h\00"
define void @saveTerm() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_session_is_active(const char *session) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_session_is_active>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    0x2ecf(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_session_is_active>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_session_is_active(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_session_is_active(i8* nocapture readnone %0) {
%2 = load i32, i32* @EINVAL
%3 = sub nsw i32 0, %2
ret i32 %3
}
/* Variables and functions */
int fib(int);
int main() {
  int a = 4;
  return fib(a);
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @fib(i32 4)
ret i32 %1
}
void null_set_volume(int value) {}


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

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

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

LLVM IR (-O2):
define void @null_set_volume(i32 %0) {
ret void
}
/* Variables and functions */
int rand();
int getRand(int min, int max) {
  int result;
  do {
    result = rand();
  } while (min >= result || result >= max);
  return result;
}


x86 assembly (clang, -O0):
<getRand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%al
cmp    -0xc(%rbp),%ecx
mov    %al,-0xd(%rbp)
jge    1145 <getRand+0x35>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
setge  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    111e <getRand+0xe>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getRand>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand@plt>
cmp    %ebp,%eax
jle    1120 <getRand+0x10>
cmp    %ebx,%eax
jge    1120 <getRand+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @getRand(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
br label %6
6: ; preds = %16, %2
%7 = call i32 (...) @rand()
store i32 %7, i32* %5
br label %8
8: ; preds = %6
%9 = load i32, i32* %3
%10 = load i32, i32* %5
%11 = icmp sge i32 %9, %10
br i1 %11, label %16, label %12
12: ; preds = %8
%13 = load i32, i32* %5
%14 = load i32, i32* %4
%15 = icmp sge i32 %13, %14
br label %16
16: ; preds = %12, %8
%17 = phi i1 [ true, %8 ], [ %15, %12 ]
br i1 %17, label %6, label %18
18: ; preds = %16
%19 = load i32, i32* %5
ret i32 %19
}

LLVM IR (-O2):
define i32 @getRand(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 (...) @rand()
%5 = icmp sle i32 %4, %0
%6 = icmp sge i32 %4, %1
%7 = or i1 %5, %6
br i1 %7, label %3, label %8
8: ; preds = %3
ret i32 %4
}
void foo137() {}


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

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

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

LLVM IR (-O2):
define void @foo137() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sscanf(char *, char *, char *);
char *get_meta_variation(char *variation, char *meta) {
  sscanf(meta, "%*s%s", variation);
  return variation;
}


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

x86 assembly (clang, -O2):
<get_meta_variation>:
push   %rbx
mov    %rsi,%rax
mov    %rdi,%rbx
lea    0xee2(%rip),%rsi
mov    %rax,%rdi
mov    %rbx,%rdx
call   1030 <sscanf@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%*s%s\00"
define i8* @get_meta_variation(i8* returned %0, i8* nocapture %1) {
%3 = tail call i32 @sscanf(i8* %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ mfread();
int midifile() {
  mfread();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @midifile() {
%1 = call i32 (...) @mfread()
ret i32 0
}

LLVM IR (-O2):
define i32 @midifile() {
%1 = tail call i32 (...) @mfread()
ret i32 0
}