xunge/DecIR huggingface dataset:
/* Variables and functions */
double cos(int);
double sin(int);
double p_vi(double redchan, double nirchan) {
  double result;
  if ((nirchan + redchan) == 0.0) {
    result = -1.0;
  } else {
    result = (sin(1) * nirchan) / (cos(1) * redchan);
  }
  return result;
}


x86 assembly (clang, -O0):
<p_vi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
addsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1161 <p_vi+0x41>
jp     1161 <p_vi+0x41>
movsd  0xea9(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1195 <p_vi+0x75>
mov    $0x1,%edi
call   1030 <sin@plt>
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    $0x1,%edi
call   1040 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p_vi>:
sub    $0x18,%rsp
movapd %xmm0,%xmm2
addsd  %xmm1,%xmm2
xorpd  %xmm3,%xmm3
ucomisd %xmm3,%xmm2
jne    1145 <p_vi+0x25>
jp     1145 <p_vi+0x25>
movsd  0xec0(%rip),%xmm0
add    $0x18,%rsp
ret
mov    $0x1,%edi
movsd  %xmm0,0x10(%rsp)
movsd  %xmm1,0x8(%rsp)
call   1030 <sin@plt>
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    $0x1,%edi
call   1040 <cos@plt>
mulsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @p_vi(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* %4
%7 = load double, double* %3
%8 = fadd double %6, %7
%9 = fcmp oeq double %8, 0.000000e+00
br i1 %9, label %10, label %11
10: ; preds = %2
store double -1.000000e+00, double* %5
br label %19
11: ; preds = %2
%12 = call double @sin(i32 1)
%13 = load double, double* %4
%14 = fmul double %12, %13
%15 = call double @cos(i32 1)
%16 = load double, double* %3
%17 = fmul double %15, %16
%18 = fdiv double %14, %17
store double %18, double* %5
br label %19
19: ; preds = %11, %10
%20 = load double, double* %5
ret double %20
}

LLVM IR (-O2):
define double @p_vi(double %0, double %1) {
%3 = fadd double %0, %1
%4 = fcmp oeq double %3, 0.000000e+00
br i1 %4, label %11, label %5
5: ; preds = %2
%6 = tail call double @sin(i32 1)
%7 = fmul double %6, %1
%8 = tail call double @cos(i32 1)
%9 = fmul double %8, %0
%10 = fdiv double %7, %9
br label %11
11: ; preds = %2, %5
%12 = phi double [ %10, %5 ], [ -1.000000e+00, %2 ]
ret double %12
}
/* Variables and functions */
int ARCONTROLLER_TESTBENCH_DeviceControllerAutoTest();
int main(int argc, char *argv[]) {
  return ARCONTROLLER_TESTBENCH_DeviceControllerAutoTest();
}


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 <ARCONTROLLER_TESTBENCH_DeviceControllerAutoTest@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @ARCONTROLLER_TESTBENCH_DeviceControllerAutoTest()
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void greeting() { printf("Enter the radius of the circle > "); }


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"Enter the radius of the circle > \00"
define void @greeting() {
%1 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"Enter the radius of the circle > \00"
define void @greeting() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret void
}
void change(int *p, int *q) {
  int tmp;
  tmp = *p;
  *p = *q;
  *q = tmp;
}


x86 assembly (clang, -O0):
<change>:
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),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @change(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
int f() {
  int a;
  int *p = &a;
  *p = 1;
  a = 2;
  return a;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @f() {
ret i32 2
}
int *c_ivector(nl, nh)
long nh, nl;
{
  int *v;
  v = (int *)calloc(nh - nl + 1 + 1, sizeof(int));
  return v - nl + 1;
}


x86 assembly (clang, -O0):
<c_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
mov    $0x4,%esi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
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):
<c_ivector>:
push   %rbx
mov    %rdi,%rbx
sub    %rdi,%rsi
lea    0x2(%rsi),%rdi
mov    $0x4,%esi
call   1030 <calloc@plt>
shl    $0x2,%rbx
neg    %rbx
add    %rbx,%rax
add    $0x4,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i32* @c_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 = call i8* @calloc(i64 %10, i64 4)
%12 = bitcast i8* %11 to i32*
store i32* %12, i32** %5
%13 = load i32*, i32** %5
%14 = load i64, i64* %3
%15 = sub i64 0, %14
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = getelementptr inbounds i32, i32* %16, i64 1
ret i32* %17
}

LLVM IR (-O2):
define noalias i32* @c_ivector(i64 %0, i64 %1) {
%3 = sub i64 0, %0
%4 = sub i64 2, %0
%5 = add i64 %4, %1
%6 = tail call i8* @calloc(i64 %5, i64 4)
%7 = bitcast i8* %6 to i32*
%8 = getelementptr inbounds i32, i32* %7, i64 %3
%9 = getelementptr inbounds i32, i32* %8, i64 1
ret i32* %9
}
/* Variables and functions */
char getchar();
char *readLine(char *buffer) {
  char *ch = buffer;
  while ((*ch = getchar()) != '\n')
    ch++;
  *ch = 0;
  return buffer;
}


x86 assembly (clang, -O0):
<readLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    -0x10(%rbp),%rcx
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0xa,%eax
je     114e <readLine+0x3e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <readLine+0x14>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readLine>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    %rdi,%rbx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
mov    %al,(%rbx)
add    $0x1,%rbx
cmp    $0xa,%al
jne    1120 <readLine+0x10>
movb   $0x0,-0x1(%rbx)
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @readLine(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %10, %1
%6 = call signext i8 (...) @getchar()
%7 = load i8*, i8** %3
store i8 %6, i8* %7
%8 = sext i8 %6 to i32
%9 = icmp ne i32 %8, 10
br i1 %9, label %10, label %13
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %3
br label %5
13: ; preds = %5
%14 = load i8*, i8** %3
store i8 0, i8* %14
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
define i8* @readLine(i8* returned writeonly %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = tail call signext i8 (...) @getchar()
store i8 %4, i8* %3
%5 = icmp eq i8 %4, 10
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
store i8 0, i8* %3
ret i8* %0
}
/* Variables and functions */
int float_to_int(float);
scalar_t__ pNaNf(float);
int issNaNf(float val) {
  return ((0x7fc00000 & float_to_int(val)) == 0x7f800000) && 0 < pNaNf(val);
}


x86 assembly (clang, -O0):
<issNaNf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <float_to_int@plt>
mov    %eax,%ecx
and    $0x7fc00000,%ecx
xor    %eax,%eax
cmp    $0x7f800000,%ecx
mov    %al,-0x5(%rbp)
jne    1168 <issNaNf+0x48>
movss  -0x4(%rbp),%xmm0
call   1030 <pNaNf@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
setl   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<issNaNf>:
push   %rax
movss  %xmm0,0x4(%rsp)
call   1040 <float_to_int@plt>
mov    %eax,%ecx
and    $0x7fc00000,%ecx
xor    %eax,%eax
cmp    $0x7f800000,%ecx
jne    1154 <issNaNf+0x34>
movss  0x4(%rsp),%xmm0
call   1030 <pNaNf@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setg   %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @issNaNf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i32 @float_to_int(float %3)
%5 = and i32 2143289344, %4
%6 = icmp eq i32 %5, 2139095040
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load float, float* %2
%9 = call i64 @pNaNf(float %8)
%10 = icmp slt i64 0, %9
br label %11
11: ; preds = %7, %1
%12 = phi i1 [ false, %1 ], [ %10, %7 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @issNaNf(float %0) {
%2 = tail call i32 @float_to_int(float %0)
%3 = and i32 %2, 2143289344
%4 = icmp eq i32 %3, 2139095040
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = tail call i64 @pNaNf(float %0)
%7 = icmp sgt i64 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %1
%10 = phi i32 [ 0, %1 ], [ %8, %5 ]
ret i32 %10
}
/* Variables and functions */
int fun();
int /*<<< orphan*/ printf(char *, int);
int main() {
  int r = fun();
  printf("fun() returns %d\n", r);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"fun() returns %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @fun()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"fun() returns %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @fun()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
unsigned int cpuid_eax(unsigned int op) {
  unsigned int eax;
  __asm__("cpuid" : "=a"(eax) : "0"(op) : "bx", "cx", "dx");
  return eax;
}


x86 assembly (clang, -O0):
<cpuid_eax>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cpuid
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid_eax>:
push   %rbx
mov    %edi,%eax
cpuid
pop    %rbx
ret

LLVM IR (-O0):
define i32 @cpuid_eax(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 asm "cpuid", "={ax},0,~{bx},~{cx},~{dx},~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @cpuid_eax(i32 %0) {
%2 = tail call i32 asm "cpuid", "={ax},0,~{bx},~{cx},~{dx},~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0xdb() {
  Assert_real((isalnum(219) == 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_isalnum.c",
              1100, ("isalnum should be 0 for 0xdb"));
}


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

x86 assembly (clang, -O2):
<t_isalnum_0xdb>:
push   %rax
mov    $0xdb,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x44c,%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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xdb\00"
define void @t_isalnum_0xdb() {
%1 = call i64 @isalnum(i32 219)
%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 1100, 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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xdb\00"
define void @t_isalnum_0xdb() {
%1 = tail call i64 @isalnum(i32 219)
%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 1100, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int a(void) {
  int i = 0, g = 0;
  while (i++ < 100000) {
    g += i;
  }
  return g;
}


x86 assembly (clang, -O0):
<a>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x186a0,%eax
jge    1136 <a+0x36>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <a+0x12>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @a() {
ret i32 705082704
}
/* Variables and functions */
int /*<<< orphan*/ reverse(char *);
void s_uitoa(unsigned int n, char *s) {
  int i;
  i = 0;
  do {
    s[i++] = n % 10 + '0';
  } while ((n /= 10) > 0);
  s[i] = '\0';
  reverse(s);
}


x86 assembly (clang, -O0):
<s_uitoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
add    $0x30,%edx
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x14(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
ja     1126 <s_uitoa+0x16>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%rdi
call   1030 <reverse@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_uitoa>:
mov    %rsi,%r9
xor    %eax,%eax
mov    $0xcccccccd,%r8d
nopl   0x0(%rax,%rax,1)
mov    %edi,%edx
imul   %r8,%rdx
shr    $0x23,%rdx
lea    (%rdx,%rdx,1),%ecx
lea    (%rcx,%rcx,4),%ecx
mov    %edi,%esi
sub    %ecx,%esi
or     $0x30,%sil
mov    %sil,(%r9,%rax,1)
add    $0x1,%rax
cmp    $0x9,%edi
mov    %edx,%edi
ja     1120 <s_uitoa+0x10>
mov    %eax,%eax
movb   $0x0,(%r9,%rax,1)
mov    %r9,%rdi
jmp    1030 <reverse@plt>

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

LLVM IR (-O2):
define void @s_uitoa(i32 %0, i8* %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %9, %3 ], [ 0, %2 ]
%5 = phi i32 [ %11, %3 ], [ %0, %2 ]
%6 = urem i32 %5, 10
%7 = trunc i32 %6 to i8
%8 = or i8 %7, 48
%9 = add nuw i64 %4, 1
%10 = getelementptr inbounds i8, i8* %1, i64 %4
store i8 %8, i8* %10
%11 = udiv i32 %5, 10
%12 = icmp ult i32 %5, 10
br i1 %12, label %13, label %3
13: ; preds = %3
%14 = and i64 %9, 4294967295
%15 = getelementptr inbounds i8, i8* %1, i64 %14
store i8 0, i8* %15
%16 = tail call i32 @reverse(i8* %1)
ret void
}
int testfunc_00(int a, int b, int c, int d) {
  return (a != b || a != d) ? b : c;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1128 <testfunc_00+0x28>
mov    -0x4(%rbp),%eax
cmp    -0x10(%rbp),%eax
je     1133 <testfunc_00+0x33>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1139 <testfunc_00+0x39>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    %edx,%eax
xor    %edi,%ecx
xor    %esi,%edi
or     %edi,%ecx
cmovne %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @testfunc_00(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %0, %1
%6 = icmp eq i32 %0, %3
%7 = and i1 %5, %6
%8 = select i1 %7, i32 %2, i32 %1
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ update_stat();
void update_cpu_usage() { update_stat(); }


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

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

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

LLVM IR (-O2):
define void @update_cpu_usage() {
%1 = tail call i32 (...) @update_stat()
ret void
}
void MMR3HeapFree(void) {}


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

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

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

LLVM IR (-O2):
define void @MMR3HeapFree() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ luaL_check_string(int);
int /*<<< orphan*/ pushresult(int);
scalar_t__ remove(int /*<<< orphan*/);
void io_remove(void) { pushresult(remove(luaL_check_string(1)) == 0); }


x86 assembly (clang, -O0):
<io_remove>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1050 <luaL_check_string@plt>
mov    %eax,%edi
call   1030 <remove@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <pushresult@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_remove>:
push   %rax
mov    $0x1,%edi
call   1050 <luaL_check_string@plt>
mov    %eax,%edi
call   1030 <remove@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
pop    %rax
jmp    1040 <pushresult@plt>

LLVM IR (-O0):
define void @io_remove() {
%1 = call i32 @luaL_check_string(i32 1)
%2 = call i64 @remove(i32 %1)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
%5 = call i32 @pushresult(i32 %4)
ret void
}

LLVM IR (-O2):
define void @io_remove() {
%1 = tail call i32 @luaL_check_string(i32 1)
%2 = tail call i64 @remove(i32 %1)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @pushresult(i32 %4)
ret void
}
/* Variables and functions */
int getnextline(char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stripline(char *);
int main() {
  char ret[32000];
  while (getnextline(ret) != -1) {
    stripline(ret);
    printf("%s\n", ret);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x7d10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x7d10(%rbp),%rdi
call   1040 <getnextline@plt>
cmp    $0xffffffff,%eax
je     117b <main+0x4b>
lea    -0x7d10(%rbp),%rdi
call   1050 <stripline@plt>
lea    -0x7d10(%rbp),%rsi
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
jmp    1142 <main+0x12>
xor    %eax,%eax
add    $0x7d10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x7d08,%rsp
mov    %rsp,%rdi
call   1040 <getnextline@plt>
cmp    $0xffffffff,%eax
je     1180 <main+0x50>
mov    %rsp,%rbx
lea    0xeaf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1050 <stripline@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <getnextline@plt>
cmp    $0xffffffff,%eax
jne    1160 <main+0x30>
xor    %eax,%eax
add    $0x7d08,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [32000 x i8]
%2 = getelementptr inbounds [32000 x i8], [32000 x i8]* %1, i64 0, i64 0
%3 = call i32 @getnextline(i8* %2)
%4 = icmp eq i32 %3, -1
br i1 %4, label %10, label %5
5: ; preds = %0, %5
%6 = call i32 @stripline(i8* %2)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%8 = call i32 @getnextline(i8* %2)
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %5
10: ; preds = %5, %0
ret i32 0
}
/* Type definitions */
struct page {
  int dummy;
};

/* Variables and functions */
scalar_t__ dune_page2pa(struct page *);
struct page *dune_page_alloc();
void *alloc_page(void) {
  struct page *pg = dune_page_alloc();
  if (!pg)
    return NULL;
  return (void *)dune_page2pa(pg);
}


x86 assembly (clang, -O0):
<alloc_page>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <dune_page_alloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114b <alloc_page+0x2b>
movq   $0x0,-0x8(%rbp)
jmp    1158 <alloc_page+0x38>
mov    -0x10(%rbp),%rdi
call   1040 <dune_page2pa@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_page>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <dune_page_alloc@plt>
test   %rax,%rax
je     113a <alloc_page+0x1a>
mov    %rax,%rdi
call   1040 <dune_page2pa@plt>
mov    %rax,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.page = type { i32 }
define i8* @alloc_page() {
%1 = alloca i8*
%2 = alloca %struct.page*
%3 = call %struct.page* (...) @dune_page_alloc()
store %struct.page* %3, %struct.page** %2
%4 = load %struct.page*, %struct.page** %2
%5 = icmp ne %struct.page* %4, null
br i1 %5, label %7, label %6
6: ; preds = %0
store i8* null, i8** %1
br label %11
7: ; preds = %0
%8 = load %struct.page*, %struct.page** %2
%9 = call i64 @dune_page2pa(%struct.page* %8)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %1
br label %11
11: ; preds = %7, %6
%12 = load i8*, i8** %1
ret i8* %12
}

LLVM IR (-O2):
%struct.page = type { i32 }
define i8* @alloc_page() {
%1 = tail call %struct.page* (...) @dune_page_alloc()
%2 = icmp eq %struct.page* %1, null
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i64 @dune_page2pa(%struct.page* %1)
%5 = inttoptr i64 %4 to i8*
br label %6
6: ; preds = %0, %3
%7 = phi i8* [ %5, %3 ], [ null, %0 ]
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void C1Mod2Function1() { printf("Expected message: C1Mod2Function1.\n"); }


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

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

LLVM IR (-O0):
@.str = [36 x i8] c"Expected message: C1Mod2Function1.\0A\00"
define void @C1Mod2Function1() {
%1 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [35 x i8] c"Expected message: C1Mod2Function1.\00"
define void @C1Mod2Function1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret void
}
void gzio_C(void) {}


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

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

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

LLVM IR (-O2):
define void @gzio_C() {
ret void
}
void vga_reset(void *s) {}


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

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

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

LLVM IR (-O2):
define void @vga_reset(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, short);
int main(void) {
  short a = 1000 * 1000;
  printf("%d\n", a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movw   $0x4240,-0x6(%rbp)
lea    0xed4(%rip),%rdi
movswl -0x6(%rbp),%esi
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    $0x4240,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i16
store i32 0, i32* %1
store i16 16960, i16* %2
%3 = load i16, i16* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i16 signext %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i16 signext 16960)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ file_short;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fread(char *, int, int, int /*<<< orphan*/ *);
int read_ushort(FILE *file, unsigned short *shortp) {
  unsigned char file_short[2];
  if (fread((char *)file_short, (int)sizeof(file_short), 1, file) != 1)
    return 0;
  *shortp = file_short[0] * 256 + file_short[1];
  return 1;
}


x86 assembly (clang, -O0):
<read_ushort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
lea    -0x1a(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
cmp    $0x1,%eax
je     114c <read_ushort+0x3c>
movl   $0x0,-0x4(%rbp)
jmp    116a <read_ushort+0x5a>
movzbl -0x1a(%rbp),%eax
shl    $0x8,%eax
movzbl -0x19(%rbp),%ecx
add    %ecx,%eax
mov    %ax,%cx
mov    -0x18(%rbp),%rax
mov    %cx,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_ushort>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %rdi,%rcx
lea    0xe(%rsp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
jne    1149 <read_ushort+0x39>
movzwl 0xe(%rsp),%eax
rol    $0x8,%ax
mov    %ax,(%rbx)
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @read_ushort(i32* nocapture %0, i16* nocapture writeonly %1) {
%3 = alloca [2 x i8]
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%5 = call i32 @fread(i8* %4, i32 2, i32 1, i32* %0)
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %15
7: ; preds = %2
%8 = load i8, i8* %4
%9 = zext i8 %8 to i16
%10 = shl nuw i16 %9, 8
%11 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i16
%14 = or i16 %10, %13
store i16 %14, i16* %1
br label %15
15: ; preds = %2, %7
%16 = phi i32 [ 1, %7 ], [ 0, %2 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char *, unsigned int);
unsigned framecpy(unsigned char *addr, unsigned char *data, unsigned len) {
  memcpy(addr, data, len);
  return len;
}


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

x86 assembly (clang, -O2):
<framecpy>:
push   %rbx
mov    %edx,%ebx
call   1030 <memcpy@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @framecpy(i8* %0, i8* %1, i32 returned %2) {
%4 = tail call i32 @memcpy(i8* %0, i8* %1, i32 %2)
ret i32 %2
}
int main() {
  int x;
  x = 3;
  x = !x;
  x = !x;
  x = ~x;
  x = -x;
  if (x != 2)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     115b <main+0x5b>
movl   $0x1,-0x4(%rbp)
jmp    1162 <main+0x62>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 3, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = xor i32 %11, -1
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = sub nsw i32 0, %13
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = icmp ne i32 %15, 2
br i1 %16, label %17, label %18
17: ; preds = %0
store i32 1, i32* %1
br label %19
18: ; preds = %0
store i32 0, i32* %1
br label %19
19: ; preds = %18, %17
%20 = load i32, i32* %1
ret i32 %20
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void d2i_DIST_POINT_NAME(void) {}


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

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

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

LLVM IR (-O2):
define void @d2i_DIST_POINT_NAME() {
ret void
}
/* Variables and functions */
scalar_t__ network_init();
int subsys_network_initialize(void) {
  if (network_init() < 0)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<subsys_network_initialize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <network_init@plt>
cmp    $0x0,%rax
jge    1135 <subsys_network_initialize+0x25>
movl   $0xffffffff,-0x4(%rbp)
jmp    113c <subsys_network_initialize+0x2c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<subsys_network_initialize>:
push   %rax
xor    %eax,%eax
call   1030 <network_init@plt>
sar    $0x3f,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @subsys_network_initialize() {
%1 = alloca i32
%2 = call i64 (...) @network_init()
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 -1, i32* %1
br label %6
5: ; preds = %0
store i32 0, i32* %1
br label %6
6: ; preds = %5, %4
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @subsys_network_initialize() {
%1 = tail call i64 (...) @network_init()
%2 = ashr i64 %1, 63
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i, sum = 0;
  for (i = 1; i <= 20; i++) {
    sum = sum + i;
  }
  printf("Suma liczb naturalnych od 1 do 20 to %d\n", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x14,-0x8(%rbp)
jg     114e <main+0x3e>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
mov    -0xc(%rbp),%esi
lea    0xea8(%rip),%rdi
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    $0xd2,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [41 x i8] c"Suma liczb naturalnych od 1 do 20 to %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 210)
ret i32 0
}
void rotr(int *a, int *b, int *c) {
  int dnum = *c;
  *c = *b;
  *b = *a;
  *a = dnum;
}


x86 assembly (clang, -O0):
<rotr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotr>:
mov    (%rdx),%eax
mov    (%rsi),%ecx
mov    %ecx,(%rdx)
mov    (%rdi),%ecx
mov    %ecx,(%rsi)
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @rotr(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%8 = load i32*, i32** %6
%9 = load i32, i32* %8
store i32 %9, i32* %7
%10 = load i32*, i32** %5
%11 = load i32, i32* %10
%12 = load i32*, i32** %6
store i32 %11, i32* %12
%13 = load i32*, i32** %4
%14 = load i32, i32* %13
%15 = load i32*, i32** %5
store i32 %14, i32* %15
%16 = load i32, i32* %7
%17 = load i32*, i32** %4
store i32 %16, i32* %17
ret void
}

LLVM IR (-O2):
define void @rotr(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %2
%5 = load i32, i32* %1
store i32 %5, i32* %2
%6 = load i32, i32* %0
store i32 %6, i32* %1
store i32 %4, i32* %0
ret void
}
/* Variables and functions */
char *strtok(char *, char *);
char *getinput(char *input) {
  char *next;
  next = strtok(input, "=");
  next = strtok(NULL, "=");
  return next;
}


x86 assembly (clang, -O0):
<getinput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strtok@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xec5(%rip),%rsi
call   1030 <strtok@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getinput>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rsi
call   1030 <strtok@plt>
xor    %edi,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strtok@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"=\00"
define i8* @getinput(i8* %0) {
%2 = tail call i8* @strtok(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}
void ff_hevc_put_hevc_bi_w_qpel_h24_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_qpel_h24_8_sse4() {
ret void
}
/* Variables and functions */
char *dupe_str(char const *);
int safe_strlen(char const *);
char *equalize_date_string(const char *s) {
  char *ret = dupe_str(s);
  if (safe_strlen(s) > 16) {
    ret[4] = 0x20;
    ret[7] = 0x20;
    ret[10] = 0x20;
    ret[13] = 0x20;
    ret[16] = 0x20;
  }
  return ret;
}


x86 assembly (clang, -O0):
<equalize_date_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <dupe_str@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <safe_strlen@plt>
cmp    $0x10,%eax
jle    1173 <equalize_date_string+0x53>
mov    -0x10(%rbp),%rax
movb   $0x20,0x4(%rax)
mov    -0x10(%rbp),%rax
movb   $0x20,0x7(%rax)
mov    -0x10(%rbp),%rax
movb   $0x20,0xa(%rax)
mov    -0x10(%rbp),%rax
movb   $0x20,0xd(%rax)
mov    -0x10(%rbp),%rax
movb   $0x20,0x10(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<equalize_date_string>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <dupe_str@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1040 <safe_strlen@plt>
cmp    $0x11,%eax
jl     1150 <equalize_date_string+0x30>
movb   $0x20,0x4(%rbx)
movb   $0x20,0x7(%rbx)
movb   $0x20,0xa(%rbx)
movb   $0x20,0xd(%rbx)
movb   $0x20,0x10(%rbx)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @equalize_date_string(i8* %0) {
%2 = tail call i8* @dupe_str(i8* %0)
%3 = tail call i32 @safe_strlen(i8* %0)
%4 = icmp sgt i32 %3, 16
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = getelementptr inbounds i8, i8* %2, i64 4
store i8 32, i8* %6
%7 = getelementptr inbounds i8, i8* %2, i64 7
store i8 32, i8* %7
%8 = getelementptr inbounds i8, i8* %2, i64 10
store i8 32, i8* %8
%9 = getelementptr inbounds i8, i8* %2, i64 13
store i8 32, i8* %9
%10 = getelementptr inbounds i8, i8* %2, i64 16
store i8 32, i8* %10
br label %11
11: ; preds = %5, %1
ret i8* %2
}
/* Type definitions */
struct value {
  int dummy;
};
struct key {
  int dummy;
};
struct hashtable {
  int dummy;
};

/* Variables and functions */
scalar_t__ hashtable_remove(struct hashtable *, struct key *);
struct value *remove_some(struct hashtable *h, struct key *k) {
  return (struct value *)(hashtable_remove(h, k));
}


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

x86 assembly (clang, -O2):
<remove_some>:
jmp    1030 <hashtable_remove@plt>

LLVM IR (-O0):
%struct.value = type { i32 }
%struct.hashtable = type { i32 }
%struct.key = type { i32 }
define %struct.value* @remove_some(%struct.hashtable* %0, %struct.key* %1) {
%3 = alloca %struct.hashtable*
%4 = alloca %struct.key*
store %struct.hashtable* %0, %struct.hashtable** %3
store %struct.key* %1, %struct.key** %4
%5 = load %struct.hashtable*, %struct.hashtable** %3
%6 = load %struct.key*, %struct.key** %4
%7 = call i64 @hashtable_remove(%struct.hashtable* %5, %struct.key* %6)
%8 = inttoptr i64 %7 to %struct.value*
ret %struct.value* %8
}

LLVM IR (-O2):
%struct.value = type { i32 }
%struct.hashtable = type { i32 }
%struct.key = type { i32 }
define %struct.value* @remove_some(%struct.hashtable* %0, %struct.key* %1) {
%3 = tail call i64 @hashtable_remove(%struct.hashtable* %0, %struct.key* %1)
%4 = inttoptr i64 %3 to %struct.value*
ret %struct.value* %4
}
/* Variables and functions */
int /*<<< orphan*/ atoi(char *);
int /*<<< orphan*/ exit(int);
int press(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  if (argc == 1 + 1) {
    return -press(atoi(argv[1]));
  } else {
    printf("USAGE : press count\n");
    exit(9);
  }
}


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)
cmpl   $0x2,-0x8(%rbp)
jne    1180 <main+0x40>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,%edi
call   1030 <press@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret
lea    0xe79(%rip),%rdi
call   1040 <printf@plt>
mov    $0x9,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    115a <main+0x1a>
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
mov    %eax,%edi
call   1040 <press@plt>
neg    %eax
pop    %rcx
ret
lea    0xe9f(%rip),%rdi
call   1030 <puts@plt>
mov    $0x9,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"USAGE : press count\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 2
br i1 %7, label %8, label %15
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @atoi(i8* %11)
%13 = call i32 @press(i32 %12)
%14 = sub nsw i32 0, %13
ret i32 %14
15: ; preds = %2
%16 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%17 = call i32 @exit(i32 9)
unreachable
}

LLVM IR (-O2):
@str = [20 x i8] c"USAGE : press count\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
%8 = tail call i32 @press(i32 %7)
%9 = sub nsw i32 0, %8
ret i32 %9
10: ; preds = %2
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%12 = tail call i32 @exit(i32 9)
unreachable
}