xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned int bit_revert(unsigned int v) {
  size_t i;
  unsigned int n = 0;
  for (i = 0; i < sizeof(unsigned int) * 8; i++) {
    const unsigned int lsb = v & 1;
    v >>= 1;
    n <<= 1;
    n |= lsb;
  }
  return n;
}


x86 assembly (clang, -O0):
<bit_revert>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x20,-0x10(%rbp)
jae    1156 <bit_revert+0x56>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1116 <bit_revert+0x16>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_revert>:
xor    %eax,%eax
mov    $0x20,%r8d
nopl   0x0(%rax,%rax,1)
mov    %edi,%edx
and    $0x2,%edx
mov    %edi,%esi
shr    $0x2,%esi
mov    %edi,%ecx
and    $0x1,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rax,8),%eax
or     %edx,%eax
and    $0x1,%esi
or     %eax,%esi
mov    %edi,%eax
shr    $0x3,%eax
and    $0x1,%eax
shr    $0x4,%edi
lea    (%rax,%rsi,2),%eax
add    $0xfffffffffffffffc,%r8
jne    1110 <bit_revert+0x10>
ret

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

LLVM IR (-O2):
define i32 @bit_revert(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %17, %2 ]
%4 = phi i32 [ 0, %1 ], [ %19, %2 ]
%5 = phi i64 [ 0, %1 ], [ %20, %2 ]
%6 = and i32 %3, 2
%7 = lshr i32 %3, 2
%8 = shl i32 %4, 3
%9 = shl i32 %3, 2
%10 = and i32 %9, 4
%11 = or i32 %8, %10
%12 = or i32 %6, %11
%13 = and i32 %7, 1
%14 = lshr i32 %3, 3
%15 = or i32 %13, %12
%16 = and i32 %14, 1
%17 = lshr i32 %3, 4
%18 = shl i32 %15, 1
%19 = or i32 %16, %18
%20 = add nuw nsw i64 %5, 4
%21 = icmp eq i64 %20, 32
br i1 %21, label %22, label %2
22: ; preds = %2
ret i32 %19
}
void printnum(int pos, int num, char color, int base) {
  asm volatile("movl $0xB, %%eax; int $0x80"
               :
               : "b"(pos), "c"(num), "d"(color), "S"(base));
}


x86 assembly (clang, -O0):
<printnum>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %dl,%al
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0xc(%rbp),%ebx
mov    -0x10(%rbp),%ecx
mov    -0x11(%rbp),%dl
mov    -0x18(%rbp),%esi
mov    $0xb,%eax
int    $0x80
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<printnum>:
push   %rbx
mov    %ecx,%eax
mov    %esi,%ecx
mov    %edi,%ebx
mov    %eax,%esi
mov    $0xb,%eax
int    $0x80
pop    %rbx
ret

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

LLVM IR (-O2):
define void @printnum(i32 %0, i32 %1, i8 signext %2, i32 %3) {
tail call void asm sideeffect "movl $$0xB, %eax; int $$0x80", "{bx},{cx},{dx},{si},~{dirflag},~{fpsr},~{flags}"(i32 %0, i32 %1, i8 %2, i32 %3)
ret void
}
int __test() {
  int sum = 0;
  int x = 0;
loop:
  sum += x;
  ++x;
  if (x < 10) {
    goto loop;
  }
  goto here;
here:
  return sum;
}


x86 assembly (clang, -O0):
<__test>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1133 <__test+0x33>
jmp    1112 <__test+0x12>
jmp    1138 <__test+0x38>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @__test() {
ret i32 45
}
/* Type definitions */
typedef double clock_t;

/* Variables and functions */
double CLOCKS_PER_SEC;
double clock();
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ ugly_number();
int main() {
  clock_t startm, stopm;
  startm = clock();
  ugly_number();
  stopm = clock();
  printf("%6.3f seconds used by the processor.\n",
         ((double)stopm - startm) / CLOCKS_PER_SEC);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1050 <ugly_number@plt>
mov    $0x0,%al
call   1030 <clock@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
mov    0x2e79(%rip),%rax
divsd  (%rax),%xmm0
lea    0xe86(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <clock@plt>
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1050 <ugly_number@plt>
xor    %eax,%eax
call   1030 <clock@plt>
subsd  (%rsp),%xmm0
mov    0x2e91(%rip),%rax
divsd  (%rax),%xmm0
lea    0xe9e(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"%6.3f seconds used by the processor.\0A\00"
@CLOCKS_PER_SEC = global double 0.000000e+00
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
%4 = call double (...) @clock()
store double %4, double* %2
%5 = call i32 (...) @ugly_number()
%6 = call double (...) @clock()
store double %6, double* %3
%7 = load double, double* %3
%8 = load double, double* %2
%9 = fsub double %7, %8
%10 = load double, double* @CLOCKS_PER_SEC
%11 = fdiv double %9, %10
%12 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), double %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [38 x i8] c"%6.3f seconds used by the processor.\0A\00"
@CLOCKS_PER_SEC = global double 0.000000e+00
define i32 @main() {
%1 = tail call double (...) @clock()
%2 = tail call i32 (...) @ugly_number()
%3 = tail call double (...) @clock()
%4 = fsub double %3, %1
%5 = load double, double* @CLOCKS_PER_SEC
%6 = fdiv double %4, %5
%7 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), double %6)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int main() {
  float d, f = 3.1415;
  uint32_t a = 7, b = 3, c, r;
  c = a / b;
  r = a % b;
  d = f * 2.1;
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movss  0xef5(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movl   $0x7,-0x10(%rbp)
movl   $0x3,-0x14(%rbp)
mov    -0x10(%rbp),%eax
cltd
idivl  -0x14(%rbp)
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
cltd
idivl  -0x14(%rbp)
mov    %edx,-0x1c(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeb5(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
store float 0x400921CAC0000000, float* %3
store i32 7, i32* %4
store i32 3, i32* %5
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = sdiv i32 %8, %9
store i32 %10, i32* %6
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = srem i32 %11, %12
store i32 %13, i32* %7
%14 = load float, float* %3
%15 = fpext float %14 to double
%16 = fmul double %15, 2.100000e+00
%17 = fptrunc double %16 to float
store float %17, float* %2
ret i32 0
}

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

/* Variables and functions */
uint8_t reversebytes(uint8_t b) {
  b = (b & 0xF0) >> 4 | (b & 0x0F) << 4;
  b = (b & 0xCC) >> 2 | (b & 0x33) << 2;
  b = (b & 0xAA) >> 1 | (b & 0x55) << 1;
  return b;
}


x86 assembly (clang, -O0):
<reversebytes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf0,%eax
sar    $0x4,%eax
mov    -0x4(%rbp),%ecx
and    $0xf,%ecx
shl    $0x4,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xcc,%eax
sar    $0x2,%eax
mov    -0x4(%rbp),%ecx
and    $0x33,%ecx
shl    $0x2,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xaa,%eax
sar    $0x1,%eax
mov    -0x4(%rbp),%ecx
and    $0x55,%ecx
shl    $0x1,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reversebytes>:
rol    $0x4,%dil
mov    %edi,%eax
and    $0x33,%al
shl    $0x2,%al
shr    $0x2,%dil
and    $0x33,%dil
or     %al,%dil
mov    %edi,%eax
and    $0x55,%al
add    %al,%al
shr    %dil
and    $0x55,%dil
or     %al,%dil
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @reversebytes(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 240
%5 = ashr i32 %4, 4
%6 = load i32, i32* %2
%7 = and i32 %6, 15
%8 = shl i32 %7, 4
%9 = or i32 %5, %8
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = and i32 %10, 204
%12 = ashr i32 %11, 2
%13 = load i32, i32* %2
%14 = and i32 %13, 51
%15 = shl i32 %14, 2
%16 = or i32 %12, %15
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = and i32 %17, 170
%19 = ashr i32 %18, 1
%20 = load i32, i32* %2
%21 = and i32 %20, 85
%22 = shl i32 %21, 1
%23 = or i32 %19, %22
store i32 %23, i32* %2
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
define i32 @reversebytes(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = tail call i8 @llvm.bitreverse.i8(i8 %2)
%4 = zext i8 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free_func(void *);
void free_via_ptr(void *x) { free_func(x); }


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

x86 assembly (clang, -O2):
<free_via_ptr>:
jmp    1030 <free_func@plt>

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

LLVM IR (-O2):
define void @free_via_ptr(i8* %0) {
%2 = tail call i32 @free_func(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("2004"
         "-"
         "2018"
         " "
         "Frontier Kernel Project");
  return 0;
}


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

LLVM IR (-O0):
@.str = [34 x i8] c"2004-2018 Frontier Kernel Project\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"2004-2018 Frontier Kernel Project\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *realloc(void *, size_t);
void *safe_realloc(void *ptr, size_t size) {
  void *mem = realloc(ptr, size);
  if (mem == NULL && size != 0)
    abort();
  return mem;
}


x86 assembly (clang, -O0):
<safe_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    115e <safe_realloc+0x3e>
cmpq   $0x0,-0x10(%rbp)
je     115e <safe_realloc+0x3e>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_realloc>:
push   %rbx
mov    %rsi,%rbx
call   1040 <realloc@plt>
test   %rbx,%rbx
je     1133 <safe_realloc+0x13>
test   %rax,%rax
je     1135 <safe_realloc+0x15>
pop    %rbx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @safe_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i64, i64* %4
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = call i32 (...) @abort()
unreachable
16: ; preds = %11, %2
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
define noalias i8* @safe_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
%5 = icmp ne i64 %1, 0
%6 = and i1 %5, %4
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 (...) @abort()
unreachable
9: ; preds = %2
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ ungetc(int, int /*<<< orphan*/ *);
void uninitvar_ungetc(void) {
  int c;
  FILE *stream;
  (void)ungetc(c, stream);
}


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

x86 assembly (clang, -O2):
<uninitvar_ungetc>:
jmp    1030 <ungetc@plt>

LLVM IR (-O0):
define void @uninitvar_ungetc() {
%1 = alloca i32
%2 = alloca i32*
%3 = load i32, i32* %1
%4 = load i32*, i32** %2
%5 = call i32 @ungetc(i32 %3, i32* %4)
ret void
}

LLVM IR (-O2):
define void @uninitvar_ungetc() {
%1 = tail call i32 @ungetc(i32 undef, i32* undef)
ret void
}
/* Variables and functions */
int calculateTrucks(int, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int loadSize = 0;
  int numCrate = 0;
  int trucks = 0;
  scanf("%d%d", &numCrate, &loadSize);
  trucks = calculateTrucks(loadSize, numCrate);
  printf("%d", trucks);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xeac(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0x4(%rbp),%rdx
call   1050 <scanf@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <calculateTrucks@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe89(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
movl   $0x0,(%rsp)
lea    0xeb9(%rip),%rdi
mov    %rsp,%rsi
lea    0x4(%rsp),%rdx
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1030 <calculateTrucks@plt>
lea    0xe9b(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %1)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @calculateTrucks(i32 %6, i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
int sqrt_my(int num) {
  int i = 0;
  while (1) {
    if (i * i == num)
      return i;
    if (i * i < num)
      i++;
    else
      return --i;
  }
}


x86 assembly (clang, -O0):
<sqrt_my>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1129 <sqrt_my+0x29>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115d <sqrt_my+0x5d>
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1147 <sqrt_my+0x47>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1158 <sqrt_my+0x58>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    %eax,-0x4(%rbp)
jmp    115d <sqrt_my+0x5d>
jmp    110e <sqrt_my+0xe>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqrt_my>:
test   %edi,%edi
je     1125 <sqrt_my+0x25>
xor    %ecx,%ecx
mov    $0xffffffff,%eax
nopl   0x0(%rax,%rax,1)
cmp    %edi,%ecx
jge    1124 <sqrt_my+0x24>
lea    0x2(%rax),%ecx
imul   %ecx,%ecx
add    $0x1,%eax
cmp    %edi,%ecx
jne    1110 <sqrt_my+0x10>
add    $0x1,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @sqrt_my(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %1, %25
%6 = load i32, i32* %4
%7 = load i32, i32* %4
%8 = mul nsw i32 %6, %7
%9 = load i32, i32* %3
%10 = icmp eq i32 %8, %9
br i1 %10, label %11, label %13
11: ; preds = %5
%12 = load i32, i32* %4
store i32 %12, i32* %2
br label %26
13: ; preds = %5
%14 = load i32, i32* %4
%15 = load i32, i32* %4
%16 = mul nsw i32 %14, %15
%17 = load i32, i32* %3
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %22
19: ; preds = %13
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 1
store i32 %21, i32* %4
br label %25
22: ; preds = %13
%23 = load i32, i32* %4
%24 = add nsw i32 %23, -1
store i32 %24, i32* %4
store i32 %24, i32* %2
br label %26
25: ; preds = %19
br label %5
26: ; preds = %22, %11
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @sqrt_my(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %13, label %3
3: ; preds = %1, %7
%4 = phi i32 [ %9, %7 ], [ 0, %1 ]
%5 = phi i32 [ %8, %7 ], [ 0, %1 ]
%6 = icmp slt i32 %4, %0
br i1 %6, label %7, label %11
7: ; preds = %3
%8 = add nuw nsw i32 %5, 1
%9 = mul nsw i32 %8, %8
%10 = icmp eq i32 %9, %0
br i1 %10, label %13, label %3
11: ; preds = %3
%12 = add nsw i32 %5, -1
br label %13
13: ; preds = %7, %1, %11
%14 = phi i32 [ %12, %11 ], [ 0, %1 ], [ %8, %7 ]
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
FILE *AbreRhoVsTEn(char *contenedor) {
  FILE *aA;
  char archivo[200];
  sprintf(archivo, "%s/RhoVsT", contenedor);
  aA = fopen(archivo, "w");
  fputs("# t   rho   tipo (tipo 0 es la total)\n", aA);
  return aA;
}


x86 assembly (clang, -O0):
<AbreRhoVsTEn>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xe0(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xeaf(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0xe0(%rbp),%rdi
lea    0xea6(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe94(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x10(%rbp),%rax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AbreRhoVsTEn>:
push   %rbx
sub    $0xd0,%rsp
mov    %rdi,%rdx
lea    0xebe(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
lea    0xeb6(%rip),%rsi
mov    %rbx,%rdi
call   1030 <fopen@plt>
mov    %rax,%rbx
lea    0xea6(%rip),%rdi
mov    $0x26,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1050 <fwrite@plt>
mov    %rbx,%rax
add    $0xd0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"%s/RhoVsT\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [39 x i8] c"# t rho tipo (tipo 0 es la total)\0A\00"
define i32* @AbreRhoVsTEn(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca [200 x i8]
store i8* %0, i8** %2
%5 = getelementptr inbounds [200 x i8], [200 x i8]* %4, i64 0, i64 0
%6 = load i8*, i8** %2
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = getelementptr inbounds [200 x i8], [200 x i8]* %4, i64 0, i64 0
%9 = call i32* @fopen(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %9, i32** %3
%10 = load i32*, i32** %3
%11 = call i32 @fputs(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i32* %10)
%12 = load i32*, i32** %3
ret i32* %12
}

LLVM IR (-O2):
@.str = [10 x i8] c"%s/RhoVsT\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [39 x i8] c"# t rho tipo (tipo 0 es la total)\0A\00"
define noalias i32* @AbreRhoVsTEn(i8* %0) {
%2 = alloca [200 x i8]
%3 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32* @fopen(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i64 @fwrite(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i64 38, i64 1, i32* %5)
ret i32* %5
}
int main() {
  void *p;
  p = &p;
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = bitcast i8** %2 to i8*
store i8* %3, i8** %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ die_out_of_memory();
void *malloc(size_t);
void *xmalloc(size_t size) {
  void *p = malloc(size);
  if (!p)
    die_out_of_memory();
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114b <xmalloc+0x2b>
mov    $0x0,%al
call   1040 <die_out_of_memory@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <xmalloc+0x15>
xor    %eax,%eax
call   1040 <die_out_of_memory@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @die_out_of_memory()
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ mkdir(char *, int);
int main() {
  mkdir("/home/ajit/c_code/aji", 0x777);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"/home/ajit/c_code/aji\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @mkdir(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 1911)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"/home/ajit/c_code/aji\00"
define i32 @main() {
%1 = tail call i32 @mkdir(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 1911)
ret i32 0
}
/* Variables and functions */
char *all_tests();
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ tests_statistics();
int main(int argc, char **argv) {
  char *result = all_tests();
  if (result != 0) {
    printf("%s\n", result);
  }
  tests_statistics();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <all_tests@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     116c <main+0x3c>
mov    -0x18(%rbp),%rsi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <tests_statistics@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <all_tests@plt>
test   %rax,%rax
je     114c <main+0x1c>
lea    0xebc(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <tests_statistics@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* (...) @all_tests()
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
br label %7
7: ; preds = %5, %2
%8 = tail call i32 (...) @tests_statistics()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ read_flora_classes();
int /*<<< orphan*/ read_flora_species();
void load_flora(void) {
  read_flora_classes();
  read_flora_species();
  return;
}


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

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

LLVM IR (-O0):
define void @load_flora() {
%1 = call i32 (...) @read_flora_classes()
%2 = call i32 (...) @read_flora_species()
ret void
}

LLVM IR (-O2):
define void @load_flora() {
%1 = tail call i32 (...) @read_flora_classes()
%2 = tail call i32 (...) @read_flora_species()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int scanf(char *, int *);
int /*<<< orphan*/ table(int);
int main(void) {
  int n;
  printf("n = ");
  if (scanf("%d", &n) != 1) {
    printf("Invalid input!\n");
    return 1;
  }
  table(n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
cmp    $0x1,%eax
je     117c <main+0x4c>
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    118b <main+0x5b>
mov    -0x8(%rbp),%edi
call   1040 <table@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb1(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
cmp    $0x1,%eax
jne    1170 <main+0x30>
mov    0x4(%rsp),%edi
call   1050 <table@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xe91(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"n = \00"
@.str.1 = [3 x i8] c"%d\00"
@str = [15 x i8] c"Invalid input!\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = icmp eq i32 %4, 1
br i1 %5, label %8, label %6
6: ; preds = %0
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
br label %11
8: ; preds = %0
%9 = load i32, i32* %1
%10 = call i32 @table(i32 %9)
br label %11
11: ; preds = %8, %6
%12 = phi i32 [ 1, %6 ], [ 0, %8 ]
ret i32 %12
}
void f3(int i) { ; }


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

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

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

LLVM IR (-O2):
define void @f3(i32 %0) {
ret void
}
float tetragono(float x) {
  float p;
  p = x * 4;
  return p;
}


x86 assembly (clang, -O0):
<tetragono>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<tetragono>:
mulss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @tetragono(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fmul float %4, 4.000000e+00
store float %5, float* %3
%6 = load float, float* %3
ret float %6
}

LLVM IR (-O2):
define float @tetragono(float %0) {
%2 = fmul float %0, 4.000000e+00
ret float %2
}
int COMMAND_CAN_ACR(void) { return -1; }


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

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

LLVM IR (-O0):
define i32 @COMMAND_CAN_ACR() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @COMMAND_CAN_ACR() {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ mem_free(void *);
void del_pages(void *p) { mem_free(p); }


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

x86 assembly (clang, -O2):
<del_pages>:
jmp    1030 <mem_free@plt>

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

LLVM IR (-O2):
define void @del_pages(i8* %0) {
%2 = tail call i32 @mem_free(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int16_t;

/* Variables and functions */
int /*<<< orphan*/ __put_unaligned_be16(int /*<<< orphan*/, void *);
void put_unaligned_be16(u_int16_t val, void *p) {
  __put_unaligned_be16(val, p);
}


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

x86 assembly (clang, -O2):
<put_unaligned_be16>:
jmp    1030 <__put_unaligned_be16@plt>

LLVM IR (-O0):
define void @put_unaligned_be16(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 @__put_unaligned_be16(i32 %5, i8* %6)
ret void
}

LLVM IR (-O2):
define void @put_unaligned_be16(i32 %0, i8* %1) {
%3 = tail call i32 @__put_unaligned_be16(i32 %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void child() {
  for (int i = 4; i <= 6; i++) {
    printf("C %2d\n", i);
  }
}


x86 assembly (clang, -O0):
<child>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x4,-0x4(%rbp)
cmpl   $0x6,-0x4(%rbp)
jg     1146 <child+0x36>
mov    -0x4(%rbp),%esi
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <child+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<child>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
pop    %rbx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"C %2d\0A\00"
define void @child() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 5)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
ret void
}
/* Type definitions */
struct cache {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct cache *);
void free_cache(struct cache *ce) { free(ce); }


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

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

LLVM IR (-O2):
%struct.cache = type { i32 }
define void @free_cache(%struct.cache* nocapture %0) {
%2 = tail call i32 @free(%struct.cache* %0)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int abs_diff(int, int);
uint32_t __hsail_sad_u16x2(uint32_t a, uint32_t b, uint32_t add) {
  return abs_diff((a >> 16) & 0xffff, (b >> 16) & 0xffff) +
         abs_diff((a >> 0) & 0xffff, (b >> 0) & 0xffff) + add;
}


x86 assembly (clang, -O0):
<__hsail_sad_u16x2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
sar    $0x10,%edi
and    $0xffff,%edi
mov    -0x8(%rbp),%esi
sar    $0x10,%esi
and    $0xffff,%esi
call   1030 <abs_diff@plt>
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
sar    $0x0,%edi
and    $0xffff,%edi
mov    -0x8(%rbp),%esi
sar    $0x0,%esi
and    $0xffff,%esi
call   1030 <abs_diff@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
add    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__hsail_sad_u16x2>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%r15d
mov    %edi,%ebx
shr    $0x10,%edi
shr    $0x10,%esi
call   1030 <abs_diff@plt>
mov    %eax,%ebp
movzwl %bx,%edi
movzwl %r15w,%esi
call   1030 <abs_diff@plt>
add    %r14d,%ebp
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @__hsail_sad_u16x2(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 = ashr i32 %7, 16
%9 = and i32 %8, 65535
%10 = load i32, i32* %5
%11 = ashr i32 %10, 16
%12 = and i32 %11, 65535
%13 = call i32 @abs_diff(i32 %9, i32 %12)
%14 = load i32, i32* %4
%15 = ashr i32 %14, 0
%16 = and i32 %15, 65535
%17 = load i32, i32* %5
%18 = ashr i32 %17, 0
%19 = and i32 %18, 65535
%20 = call i32 @abs_diff(i32 %16, i32 %19)
%21 = add nsw i32 %13, %20
%22 = load i32, i32* %6
%23 = add nsw i32 %21, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @__hsail_sad_u16x2(i32 %0, i32 %1, i32 %2) {
%4 = lshr i32 %0, 16
%5 = lshr i32 %1, 16
%6 = tail call i32 @abs_diff(i32 %4, i32 %5)
%7 = and i32 %0, 65535
%8 = and i32 %1, 65535
%9 = tail call i32 @abs_diff(i32 %7, i32 %8)
%10 = add i32 %6, %2
%11 = add i32 %10, %9
ret i32 %11
}
int Kit_TruthWordNum(int nVars) { return nVars <= 5 ? 1 : (1 << (nVars - 5)); }


x86 assembly (clang, -O0):
<Kit_TruthWordNum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jg     111e <Kit_TruthWordNum+0x1e>
mov    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112e <Kit_TruthWordNum+0x2e>
mov    -0x4(%rbp),%ecx
sub    $0x5,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Kit_TruthWordNum>:
lea    -0x5(%rdi),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    $0x1,%ecx
cmp    $0x6,%edi
cmovl  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @Kit_TruthWordNum(i32 %0) {
%2 = icmp slt i32 %0, 6
%3 = add nsw i32 %0, -5
%4 = shl nuw i32 1, %3
%5 = select i1 %2, i32 1, i32 %4
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
double difftime(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void pause(void) {
  time_t then;
  time(&then);
  while (difftime(time(NULL), then) < 0.1)
    ;
}


x86 assembly (clang, -O0):
<pause>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1040 <time@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
mov    -0x4(%rbp),%esi
call   1030 <difftime@plt>
movaps %xmm0,%xmm1
movsd  0xeb1(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    115e <pause+0x3e>
jmp    1131 <pause+0x11>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pause>:
push   %rax
lea    0x4(%rsp),%rdi
call   1040 <time@plt>
nopl   0x0(%rax,%rax,1)
xor    %edi,%edi
call   1040 <time@plt>
mov    0x4(%rsp),%esi
mov    %eax,%edi
call   1030 <difftime@plt>
movsd  0xeb6(%rip),%xmm1
ucomisd %xmm0,%xmm1
ja     1130 <pause+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @pause() {
%1 = alloca i32
%2 = call i32 @time(i32* %1)
br label %3
3: ; preds = %8, %0
%4 = call i32 @time(i32* null)
%5 = load i32, i32* %1
%6 = call double @difftime(i32 %4, i32 %5)
%7 = fcmp olt double %6, 1.000000e-01
br i1 %7, label %8, label %9
8: ; preds = %3
br label %3
9: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @pause() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @time(i32* %1)
br label %4
4: ; preds = %4, %0
%5 = call i32 @time(i32* null)
%6 = load i32, i32* %1
%7 = call double @difftime(i32 %5, i32 %6)
%8 = fcmp olt double %7, 1.000000e-01
br i1 %8, label %4, label %9
9: ; preds = %4
ret void
}
double randl(x)
double x;
{
  double exp();
  return exp(x * ran());
}


x86 assembly (clang, -O0):
<randl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1040 <ran@plt>
movsd  -0x10(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randl>:
push   %rax
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1040 <ran@plt>
cvtsi2sd %eax,%xmm1
movsd  (%rsp),%xmm0
mulsd  %xmm1,%xmm0
pop    %rax
jmp    1030 <exp@plt>

LLVM IR (-O0):
define double @randl(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 (...) @ran()
%5 = sitofp i32 %4 to double
%6 = fmul double %3, %5
%7 = call double @exp(double %6)
ret double %7
}

LLVM IR (-O2):
define double @randl(double %0) {
%2 = tail call i32 (...) @ran()
%3 = sitofp i32 %2 to double
%4 = fmul double %3, %0
%5 = tail call double @exp(double %4)
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int f1();
int main() {
  if (f1() != 8)
    _exit(-1);
  _exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <f1@plt>
cmp    $0x8,%eax
je     1149 <main+0x29>
mov    $0xffffffff,%edi
call   1030 <_exit@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <f1@plt>
cmp    $0x8,%eax
jne    1134 <main+0x14>
xor    %edi,%edi
call   1030 <_exit@plt>
mov    $0xffffffff,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @f1()
%3 = icmp ne i32 %2, 8
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @_exit(i32 -1)
unreachable
6: ; preds = %0
%7 = call i32 @_exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f1()
%2 = icmp eq i32 %1, 8
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @_exit(i32 -1)
unreachable
5: ; preds = %0
%6 = tail call i32 @_exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ fsync(int);
int flush_file_(int *fd) {
  fsync(*fd);
  return 0;
}


x86 assembly (clang, -O0):
<flush_file_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <fsync@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @flush_file_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @fsync(i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void building(void) { printf("Not yed developed\n"); }


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

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

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

LLVM IR (-O2):
@str = [18 x i8] c"Not yed developed\00"
define void @building() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int x;
typedef int uint64_t;

/* Variables and functions */
uint64_t htonll(uint64_t x) {
  return (
      (((x)&0xff00000000000000LL) >> 56) | (((x)&0x00ff000000000000LL) >> 40) |
      (((x)&0x0000ff0000000000LL) >> 24) | (((x)&0x000000ff00000000LL) >> 8) |
      (((x)&0x00000000ff000000LL) << 8) | (((x)&0x0000000000ff0000LL) << 24) |
      (((x)&0x000000000000ff00LL) << 40) | (((x)&0x00000000000000ffLL) << 56));
}


x86 assembly (clang, -O0):
<htonll>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
movabs $0xff00000000000000,%rcx
and    %rcx,%rax
shr    $0x38,%rax
movslq -0x4(%rbp),%rcx
movabs $0xff000000000000,%rdx
and    %rdx,%rcx
sar    $0x28,%rcx
or     %rcx,%rax
movslq -0x4(%rbp),%rcx
movabs $0xff0000000000,%rdx
and    %rdx,%rcx
sar    $0x18,%rcx
or     %rcx,%rax
movslq -0x4(%rbp),%rcx
movabs $0xff00000000,%rdx
and    %rdx,%rcx
sar    $0x8,%rcx
or     %rcx,%rax
movslq -0x4(%rbp),%rcx
movabs $0xff000000,%rdx
and    %rdx,%rcx
shl    $0x8,%rcx
or     %rcx,%rax
movslq -0x4(%rbp),%rcx
and    $0xff0000,%rcx
shl    $0x18,%rcx
or     %rcx,%rax
movslq -0x4(%rbp),%rcx
and    $0xff00,%rcx
shl    $0x28,%rcx
or     %rcx,%rax
movslq -0x4(%rbp),%rcx
and    $0xff,%rcx
shl    $0x38,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<htonll>:
movslq %edi,%rax
bswap  %rax
ret

LLVM IR (-O0):
define i32 @htonll(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = and i64 %4, -72057594037927936
%6 = lshr i64 %5, 56
%7 = load i32, i32* %2
%8 = sext i32 %7 to i64
%9 = and i64 %8, 71776119061217280
%10 = ashr i64 %9, 40
%11 = or i64 %6, %10
%12 = load i32, i32* %2
%13 = sext i32 %12 to i64
%14 = and i64 %13, 280375465082880
%15 = ashr i64 %14, 24
%16 = or i64 %11, %15
%17 = load i32, i32* %2
%18 = sext i32 %17 to i64
%19 = and i64 %18, 1095216660480
%20 = ashr i64 %19, 8
%21 = or i64 %16, %20
%22 = load i32, i32* %2
%23 = sext i32 %22 to i64
%24 = and i64 %23, 4278190080
%25 = shl i64 %24, 8
%26 = or i64 %21, %25
%27 = load i32, i32* %2
%28 = sext i32 %27 to i64
%29 = and i64 %28, 16711680
%30 = shl i64 %29, 24
%31 = or i64 %26, %30
%32 = load i32, i32* %2
%33 = sext i32 %32 to i64
%34 = and i64 %33, 65280
%35 = shl i64 %34, 40
%36 = or i64 %31, %35
%37 = load i32, i32* %2
%38 = sext i32 %37 to i64
%39 = and i64 %38, 255
%40 = shl i64 %39, 56
%41 = or i64 %36, %40
%42 = trunc i64 %41 to i32
ret i32 %42
}

LLVM IR (-O2):
define i32 @htonll(i32 %0) {
%2 = sext i32 %0 to i64
%3 = tail call i64 @llvm.bswap.i64(i64 %2)
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
double __math_check_uflow(double);
double check_uflow(double x) { return 0 ? __math_check_uflow(x) : x; }


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

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

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

LLVM IR (-O2):
define double @check_uflow(double returned %0) {
ret double %0
}