xunge/DecIR huggingface dataset:
void reshape(context_in, major_in, context_out, major_out, first_proc,
             nprow_new, npcol_new) int *context_in,
    *context_out, *first_proc, *major_in, *major_out, *nprow_new, *npcol_new;
{
  Creshape(*context_in, *major_in, context_out, *major_out, *first_proc,
           *nprow_new, *npcol_new);
}


x86 assembly (clang, -O0):
<reshape>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
mov    -0x28(%rbp),%rax
mov    (%rax),%r8d
mov    -0x30(%rbp),%rax
mov    (%rax),%r9d
mov    0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,(%rsp)
mov    $0x0,%al
call   1030 <Creshape@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reshape>:
push   %rax
mov    0x10(%rsp),%rax
mov    (%rdi),%edi
mov    (%rsi),%esi
mov    (%rcx),%ecx
mov    (%r8),%r8d
mov    (%r9),%r9d
mov    (%rax),%eax
mov    %eax,(%rsp)
xor    %eax,%eax
call   1030 <Creshape@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @reshape(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6) {
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i32*
%14 = alloca i32*
store i32* %0, i32** %8
store i32* %1, i32** %9
store i32* %2, i32** %10
store i32* %3, i32** %11
store i32* %4, i32** %12
store i32* %5, i32** %13
store i32* %6, i32** %14
%15 = load i32*, i32** %8
%16 = load i32, i32* %15
%17 = load i32*, i32** %9
%18 = load i32, i32* %17
%19 = load i32*, i32** %10
%20 = load i32*, i32** %11
%21 = load i32, i32* %20
%22 = load i32*, i32** %12
%23 = load i32, i32* %22
%24 = load i32*, i32** %13
%25 = load i32, i32* %24
%26 = load i32*, i32** %14
%27 = load i32, i32* %26
%28 = call i32 (i32, i32, i32*, i32, i32, i32, i32, ...) bitcast (i32 (...)* @Creshape to i32 (i32, i32, i32*, i32, i32, i32, i32, ...)*)(i32 %16, i32 %18, i32* %19, i32 %21, i32 %23, i32 %25, i32 %27)
ret void
}

LLVM IR (-O2):
define void @reshape(i32* nocapture %0, i32* nocapture %1, i32* %2, i32* nocapture %3, i32* nocapture %4, i32* nocapture %5, i32* nocapture %6) {
%8 = load i32, i32* %0
%9 = load i32, i32* %1
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = tail call i32 (i32, i32, i32*, i32, i32, i32, i32, ...) bitcast (i32 (...)* @Creshape to i32 (i32, i32, i32*, i32, i32, i32, i32, ...)*)(i32 %8, i32 %9, i32* %2, i32 %10, i32 %11, i32 %12, i32 %13)
ret void
}
int lum(int r, int g, int b) {
  return (19662 * r + 38666 * g + 7208 * b) >> 16;
}


x86 assembly (clang, -O0):
<lum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
imul   $0x4cce,-0x4(%rbp),%eax
imul   $0x970a,-0x8(%rbp),%ecx
add    %ecx,%eax
imul   $0x1c28,-0xc(%rbp),%ecx
add    %ecx,%eax
sar    $0x10,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lum>:
imul   $0x4cce,%edi,%eax
imul   $0x970a,%esi,%ecx
add    %eax,%ecx
imul   $0x1c28,%edx,%eax
add    %ecx,%eax
sar    $0x10,%eax
ret

LLVM IR (-O0):
define i32 @lum(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 = mul nsw i32 19662, %7
%9 = load i32, i32* %5
%10 = mul nsw i32 38666, %9
%11 = add nsw i32 %8, %10
%12 = load i32, i32* %6
%13 = mul nsw i32 7208, %12
%14 = add nsw i32 %11, %13
%15 = ashr i32 %14, 16
ret i32 %15
}

LLVM IR (-O2):
define i32 @lum(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %0, 19662
%5 = mul nsw i32 %1, 38666
%6 = add nsw i32 %5, %4
%7 = mul nsw i32 %2, 7208
%8 = add nsw i32 %6, %7
%9 = ashr i32 %8, 16
ret i32 %9
}
double piapprox(int index, unsigned int n) {
  double approx;
  double nn = (double)n;
  double idx = (double)index;
  approx = 1.0 / (1.0 + (idx - 0.5) / nn * (idx - 0.5) / nn);
  return approx;
}


x86 assembly (clang, -O0):
<piapprox>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x18(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xeda(%rip),%xmm1
subsd  %xmm1,%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  0xec4(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  0xea7(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xe9b(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<piapprox>:
mov    %esi,%eax
cvtsi2sd %rax,%xmm0
cvtsi2sd %edi,%xmm1
addsd  0xeed(%rip),%xmm1
movapd %xmm1,%xmm2
divsd  %xmm0,%xmm2
mulsd  %xmm1,%xmm2
divsd  %xmm0,%xmm2
movsd  0xedd(%rip),%xmm0
addsd  %xmm0,%xmm2
divsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @piapprox(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
%6 = alloca double
%7 = alloca double
store i32 %0, i32* %3
store i32 %1, i32* %4
%8 = load i32, i32* %4
%9 = uitofp i32 %8 to double
store double %9, double* %6
%10 = load i32, i32* %3
%11 = sitofp i32 %10 to double
store double %11, double* %7
%12 = load double, double* %7
%13 = fsub double %12, 5.000000e-01
%14 = load double, double* %6
%15 = fdiv double %13, %14
%16 = load double, double* %7
%17 = fsub double %16, 5.000000e-01
%18 = fmul double %15, %17
%19 = load double, double* %6
%20 = fdiv double %18, %19
%21 = fadd double 1.000000e+00, %20
%22 = fdiv double 1.000000e+00, %21
store double %22, double* %5
%23 = load double, double* %5
ret double %23
}

LLVM IR (-O2):
define double @piapprox(i32 %0, i32 %1) {
%3 = uitofp i32 %1 to double
%4 = sitofp i32 %0 to double
%5 = fadd double %4, -5.000000e-01
%6 = fdiv double %5, %3
%7 = fmul double %5, %6
%8 = fdiv double %7, %3
%9 = fadd double %8, 1.000000e+00
%10 = fdiv double 1.000000e+00, %9
ret double %10
}
/* Type definitions */
typedef int /*<<< orphan*/ mqd_t;

/* Variables and functions */
int mq_close(int /*<<< orphan*/);
destroyCasilla(mqd_t cas) { return mq_close(cas); }


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

x86 assembly (clang, -O2):
<destroyCasilla>:
jmp    1030 <mq_close@plt>

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

LLVM IR (-O2):
define i32 @destroyCasilla(i32 %0) {
%2 = tail call i32 @mq_close(i32 %0)
ret i32 %2
}
void free_ressources() {}


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

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

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

LLVM IR (-O2):
define void @free_ressources() {
ret void
}
void mark_corruption(void *ptr, unsigned long size) {
  unsigned long i;
  for (i = 0; i < 2; i++)
    ((unsigned char *)ptr)[i] = 0x5a;
  for (i = 2 + size; i < (2 * 2) + size; i++)
    ((unsigned char *)ptr)[i] = 0xa5;
}


x86 assembly (clang, -O0):
<mark_corruption>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x2,-0x18(%rbp)
jae    113c <mark_corruption+0x3c>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x5a,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <mark_corruption+0x14>
mov    -0x10(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
add    $0x4,%rcx
cmp    %rcx,%rax
jae    117a <mark_corruption+0x7a>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0xa5,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1148 <mark_corruption+0x48>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mark_corruption>:
movw   $0x5a5a,(%rdi)
lea    0x2(%rsi),%rax
add    $0x4,%rsi
cmp    %rsi,%rax
jae    1118 <mark_corruption+0x18>
movw   $0xa5a5,(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @mark_corruption(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %6
6: ; preds = %13, %2
%7 = load i64, i64* %5
%8 = icmp ult i64 %7, 2
br i1 %8, label %9, label %16
9: ; preds = %6
%10 = load i8*, i8** %3
%11 = load i64, i64* %5
%12 = getelementptr inbounds i8, i8* %10, i64 %11
store i8 90, i8* %12
br label %13
13: ; preds = %9
%14 = load i64, i64* %5
%15 = add i64 %14, 1
store i64 %15, i64* %5
br label %6
16: ; preds = %6
%17 = load i64, i64* %4
%18 = add i64 2, %17
store i64 %18, i64* %5
br label %19
19: ; preds = %28, %16
%20 = load i64, i64* %5
%21 = load i64, i64* %4
%22 = add i64 4, %21
%23 = icmp ult i64 %20, %22
br i1 %23, label %24, label %31
24: ; preds = %19
%25 = load i8*, i8** %3
%26 = load i64, i64* %5
%27 = getelementptr inbounds i8, i8* %25, i64 %26
store i8 -91, i8* %27
br label %28
28: ; preds = %24
%29 = load i64, i64* %5
%30 = add i64 %29, 1
store i64 %30, i64* %5
br label %19
31: ; preds = %19
ret void
}

LLVM IR (-O2):
define void @mark_corruption(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i16*
store i16 23130, i16* %3
%4 = add i64 %1, 2
%5 = add i64 %1, 4
%6 = icmp ult i64 %4, %5
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = getelementptr i8, i8* %0, i64 %4
%9 = bitcast i8* %8 to i16*
store i16 -23131, i16* %9
br label %10
10: ; preds = %7, %2
ret void
}
int lg2(unsigned int v) { return 31 - __builtin_clz(v); }


x86 assembly (clang, -O0):
<lg2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
bsr    %eax,%ecx
xor    $0x1f,%ecx
mov    $0x1f,%eax
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lg2>:
bsr    %edi,%eax
ret

LLVM IR (-O0):
define i32 @lg2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @llvm.ctlz.i32(i32 %3, i1 true)
%5 = sub nsw i32 31, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @lg2(i32 %0) {
%2 = tail call i32 @llvm.ctlz.i32(i32 %0, i1 true)
%3 = xor i32 %2, 31
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sleep(int);
void traverse(const void *data) {
  printf("%d\n", *(int *)data);
  sleep(1);
}


x86 assembly (clang, -O0):
<traverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<traverse>:
push   %rax
mov    (%rdi),%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <sleep@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @traverse(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @sleep(i32 1)
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
scalar_t__ __stdfix_sat_ulr(int);
uint32_t __stdfix_smul_ulr(uint32_t x, uint32_t y) {
  return (__stdfix_sat_ulr(((uint64_t)x * (uint64_t)y) >> 32));
}


x86 assembly (clang, -O0):
<__stdfix_smul_ulr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%edi
mov    -0x10(%rbp),%rax
imul   %eax,%edi
mov    $0x20,%ecx
sar    %cl,%edi
call   1030 <__stdfix_sat_ulr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__stdfix_smul_ulr>:
jmp    1030 <__stdfix_sat_ulr@plt>

LLVM IR (-O0):
define i64 @__stdfix_smul_ulr(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = trunc i64 %5 to i32
%7 = load i64, i64* %4
%8 = trunc i64 %7 to i32
%9 = mul nsw i32 %6, %8
%10 = ashr i32 %9, 32
%11 = call i64 @__stdfix_sat_ulr(i32 %10)
ret i64 %11
}

LLVM IR (-O2):
define i64 @__stdfix_smul_ulr(i64 %0, i64 %1) {
%3 = tail call i64 @__stdfix_sat_ulr(i32 poison)
ret i64 %3
}
int test_imm_B3int64_midword_reg(long long val) {
  return ((val >> 16) & (0xB3 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_B3int64_midword_reg(i64 %0) {
%2 = and i64 %0, 11730944
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int random_int2(int /*<<< orphan*/, int);
int random_int(int n) { return random_int2(0, n); }


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

x86 assembly (clang, -O2):
<random_int>:
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <random_int2@plt>

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

LLVM IR (-O2):
define i32 @random_int(i32 %0) {
%2 = tail call i32 @random_int2(i32 0, i32 %0)
ret i32 %2
}
int strLen(const char *str) {
  for (const char *i = str;; i++)
    if (*i == 0)
      return i - str;
}


x86 assembly (clang, -O0):
<strLen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    112d <strLen+0x2d>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret
jmp    1132 <strLen+0x32>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strLen+0x10>

x86 assembly (clang, -O2):
<strLen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strLen+0x10>
ret

LLVM IR (-O0):
define i32 @strLen(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 = %18, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %17
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = load i8*, i8** %2
%13 = ptrtoint i8* %11 to i64
%14 = ptrtoint i8* %12 to i64
%15 = sub i64 %13, %14
%16 = trunc i64 %15 to i32
ret i32 %16
17: ; preds = %5
br label %18
18: ; preds = %17
%19 = load i8*, i8** %3
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %3
br label %5
}

LLVM IR (-O2):
define i32 @strLen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
void foo702() {}


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

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

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

LLVM IR (-O2):
define void @foo702() {
ret void
}
/* Variables and functions */
int read(int, char *, int);
char *read_nchar(int fd, char *s, int n) {
  int c = 0;
  int r;
  do {
    r = read(fd, s, n - c);
    c += r;
  } while (c < n);
  return s;
}


x86 assembly (clang, -O0):
<read_nchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
sub    -0x18(%rbp),%edx
call   1030 <read@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jl     1129 <read_nchar+0x19>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_nchar>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rsi,%r14
mov    %edi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edx
sub    %ebx,%edx
mov    %r15d,%edi
mov    %r14,%rsi
call   1030 <read@plt>
add    %eax,%ebx
cmp    %ebp,%ebx
jl     1130 <read_nchar+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @read_nchar(i32 %0, i8* returned %1, i32 %2) {
br label %4
4: ; preds = %4, %3
%5 = phi i32 [ 0, %3 ], [ %8, %4 ]
%6 = sub nsw i32 %2, %5
%7 = tail call i32 @read(i32 %0, i8* %1, i32 %6)
%8 = add nsw i32 %7, %5
%9 = icmp slt i32 %8, %2
br i1 %9, label %4, label %10
10: ; preds = %4
ret i8* %1
}
/* Type definitions */
struct BinNode {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(void *);
void freeBinNode(struct BinNode *node) {
  if (node)
    free((void *)node);
}


x86 assembly (clang, -O0):
<freeBinNode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <freeBinNode+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeBinNode>:
test   %rdi,%rdi
je     111a <freeBinNode+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
%struct.BinNode = type { i32 }
define void @freeBinNode(%struct.BinNode* %0) {
%2 = alloca %struct.BinNode*
store %struct.BinNode* %0, %struct.BinNode** %2
%3 = load %struct.BinNode*, %struct.BinNode** %2
%4 = icmp ne %struct.BinNode* %3, null
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load %struct.BinNode*, %struct.BinNode** %2
%7 = bitcast %struct.BinNode* %6 to i8*
%8 = call i32 @free(i8* %7)
br label %9
9: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
%struct.BinNode = type { i32 }
define void @freeBinNode(%struct.BinNode* %0) {
%2 = icmp eq %struct.BinNode* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = bitcast %struct.BinNode* %0 to i8*
%5 = tail call i32 @free(i8* %4)
br label %6
6: ; preds = %3, %1
ret void
}
void test_two(int x) {
#pragma omp for ordered
  for (int i = 0; i < x; i++)
    ;
}


x86 assembly (clang, -O0):
<test_two>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    112d <test_two+0x2d>
jmp    111f <test_two+0x1f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <test_two+0xe>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_two(i32 %0) {
ret void
}
double MMHGtoPSI(double MMHG) {
  double PSI = 0.0193368 * MMHG;
  return PSI;
}


x86 assembly (clang, -O0):
<MMHGtoPSI>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @MMHGtoPSI(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fmul double 1.933680e-02, %4
store double %5, double* %3
%6 = load double, double* %3
ret double %6
}

LLVM IR (-O2):
define double @MMHGtoPSI(double %0) {
%2 = fmul double %0, 1.933680e-02
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *malloc(int);
int /*<<< orphan*/ memset(int *, int /*<<< orphan*/, int);
int memset20_scalar() {
  int *x = malloc(sizeof(int));
  *x = 10;
  memset(x, 0, sizeof(int));
  int num = 1 / *x;
  free(x);
  return num;
}


x86 assembly (clang, -O0):
<memset20_scalar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0xa,(%rax)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    -0x8(%rbp),%rcx
mov    $0x1,%eax
cltd
idivl  (%rcx)
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memset20_scalar>:
push   %rbp
push   %rbx
push   %rax
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
movl   $0xa,(%rax)
xor    %ebp,%ebp
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    (%rbx),%eax
lea    0x1(%rax),%ecx
cmp    $0x3,%ecx
cmovb  %eax,%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @memset20_scalar() {
%1 = alloca i32*
%2 = alloca i32
%3 = call i32* @malloc(i32 4)
store i32* %3, i32** %1
%4 = load i32*, i32** %1
store i32 10, i32* %4
%5 = load i32*, i32** %1
%6 = call i32 @memset(i32* %5, i32 0, i32 4)
%7 = load i32*, i32** %1
%8 = load i32, i32* %7
%9 = sdiv i32 1, %8
store i32 %9, i32* %2
%10 = load i32*, i32** %1
%11 = call i32 @free(i32* %10)
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @memset20_scalar() {
%1 = tail call i32* @malloc(i32 4)
store i32 10, i32* %1
%2 = tail call i32 @memset(i32* %1, i32 0, i32 4)
%3 = load i32, i32* %1
%4 = add i32 %3, 1
%5 = icmp ult i32 %4, 3
%6 = select i1 %5, i32 %3, i32 0
%7 = tail call i32 @free(i32* %1)
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, double);
void param_fwritef(FILE *fp, char *var_name, double val) {
  fprintf(fp, "%s = %18.11e;\n", var_name, val);
}


x86 assembly (clang, -O0):
<param_fwritef>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
movsd  -0x18(%rbp),%xmm0
lea    0xec7(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<param_fwritef>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%s = %18.11e;\0A\00"
define void @param_fwritef(i32* %0, i8* %1, double %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca double
store i32* %0, i32** %4
store i8* %1, i8** %5
store double %2, double* %6
%7 = load i32*, i32** %4
%8 = load i8*, i8** %5
%9 = load double, double* %6
%10 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %8, double %9)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s = %18.11e;\0A\00"
define void @param_fwritef(i32* nocapture %0, i8* %1, double %2) {
%4 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %1, double %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char *);
int appendRomanNumerals(int arabic, int value, char *romanPart, char *output) {
  int result = arabic;
  while (result >= value) {
    strcat(output, romanPart);
    result -= value;
  }
  return result;
}


x86 assembly (clang, -O0):
<appendRomanNumerals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1155 <appendRomanNumerals+0x45>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcat@plt>
mov    -0x8(%rbp),%ecx
mov    -0x1c(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x1c(%rbp)
jmp    112c <appendRomanNumerals+0x1c>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<appendRomanNumerals>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
cmp    %esi,%edi
jl     1141 <appendRomanNumerals+0x31>
mov    %rcx,%r14
mov    %rdx,%r15
mov    %esi,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <strcat@plt>
sub    %ebp,%ebx
cmp    %ebp,%ebx
jge    1130 <appendRomanNumerals+0x20>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @appendRomanNumerals(i32 %0, i32 %1, i8* %2, i8* %3) {
%5 = icmp slt i32 %0, %1
br i1 %5, label %11, label %6
6: ; preds = %4, %6
%7 = phi i32 [ %9, %6 ], [ %0, %4 ]
%8 = tail call i32 @strcat(i8* %3, i8* %2)
%9 = sub nsw i32 %7, %1
%10 = icmp slt i32 %9, %1
br i1 %10, label %11, label %6
11: ; preds = %6, %4
%12 = phi i32 [ %0, %4 ], [ %9, %6 ]
ret i32 %12
}
void enso_classification(int year, char *classification, char *intensity) {}


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

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

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

LLVM IR (-O2):
define void @enso_classification(i32 %0, i8* nocapture %1, i8* nocapture %2) {
ret void
}
void RTThreadBlocking(void) {}


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

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

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

LLVM IR (-O2):
define void @RTThreadBlocking() {
ret void
}
/* Variables and functions */
void *calloc(unsigned long, int);
int /*<<< orphan*/ free(void *);
void f2(int i) {
  unsigned long j;
  void *ptr = calloc(j, i);
  free(ptr);
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1040 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
push   %rax
mov    %edi,%esi
call   1040 <calloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @f2(i32 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i8*
store i32 %0, i32* %2
%5 = load i64, i64* %3
%6 = load i32, i32* %2
%7 = call i8* @calloc(i64 %5, i32 %6)
store i8* %7, i8** %4
%8 = load i8*, i8** %4
%9 = call i32 @free(i8* %8)
ret void
}

LLVM IR (-O2):
define void @f2(i32 %0) {
%2 = tail call i8* @calloc(i64 undef, i32 %0)
%3 = tail call i32 @free(i8* %2)
ret void
}
/* Type definitions */
typedef int x;
typedef int uint64_t;

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


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

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

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

LLVM IR (-O2):
define i32 @ntohll(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 */
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int rnd(int min, int max) {
  srand(time(NULL));
  return min + rand() % max;
}


x86 assembly (clang, -O0):
<rnd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1050 <rand@plt>
cltd
idivl  -0x8(%rbp)
mov    -0xc(%rbp),%eax
add    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rnd>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @rnd(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @time(i32* null)
%6 = call i32 @srand(i32 %5)
%7 = load i32, i32* %3
%8 = call i32 (...) @rand()
%9 = load i32, i32* %4
%10 = srem i32 %8, %9
%11 = add nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @rnd(i32 %0, i32 %1) {
%3 = tail call i32 @time(i32* null)
%4 = tail call i32 @srand(i32 %3)
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, %1
%7 = add nsw i32 %6, %0
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ fn14();
int fn15(int);
int fn16(int x) {
  x = fn15(x);
  if (x < 0 || x >= 7)
    fn14();
}


x86 assembly (clang, -O0):
<fn16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <fn15@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     114a <fn16+0x2a>
cmpl   $0x7,-0x8(%rbp)
jl     1151 <fn16+0x31>
mov    $0x0,%al
call   1030 <fn14@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn16>:
push   %rax
call   1040 <fn15@plt>
cmp    $0x7,%eax
jb     1132 <fn16+0x12>
xor    %eax,%eax
call   1030 <fn14@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @fn16(i32 %0) {
%2 = tail call i32 @fn15(i32 %0)
%3 = icmp ugt i32 %2, 6
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @fn14()
br label %6
6: ; preds = %1, %4
ret i32 undef
}
void ft_striter(char *s, void (*f)(char *)) {
  if (!s || !f)
    return;
  while (*s) {
    f(s);
    s++;
  }
}


x86 assembly (clang, -O0):
<ft_striter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1126 <ft_striter+0x26>
cmpq   $0x0,-0x10(%rbp)
jne    112b <ft_striter+0x2b>
jmp    1158 <ft_striter+0x58>
jmp    1130 <ft_striter+0x30>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1158 <ft_striter+0x58>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdi
call   *%rax
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1130 <ft_striter+0x30>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_striter>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     1130 <ft_striter+0x30>
mov    %rsi,%r14
test   %rsi,%rsi
je     1130 <ft_striter+0x30>
mov    %rdi,%rbx
cmpb   $0x0,(%rdi)
je     1130 <ft_striter+0x30>
nopl   0x0(%rax)
mov    %rbx,%rdi
call   *%r14
cmpb   $0x0,0x1(%rbx)
lea    0x1(%rbx),%rbx
jne    1120 <ft_striter+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @ft_striter(i8* %0, void (i8*)* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne void (i8*)* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %14
6: ; preds = %2
%7 = load i8, i8* %0
%8 = icmp eq i8 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %6, %9
%10 = phi i8* [ %11, %9 ], [ %0, %6 ]
tail call void %1(i8* %10)
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %9
14: ; preds = %9, %6, %2
ret void
}
double pathcon_nm6_sign(double x) { return x < 0 ? -1 : x > 0 ? 1 : x; }


x86 assembly (clang, -O0):
<pathcon_nm6_sign>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1129 <pathcon_nm6_sign+0x29>
movsd  0xee9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1161 <pathcon_nm6_sign+0x61>
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    114d <pathcon_nm6_sign+0x4d>
movsd  0xebd(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1157 <pathcon_nm6_sign+0x57>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathcon_nm6_sign>:
xorpd  %xmm1,%xmm1
xorpd  %xmm2,%xmm2
cmpltsd %xmm0,%xmm2
movsd  0xeeb(%rip),%xmm3
andpd  %xmm2,%xmm3
andnpd %xmm0,%xmm2
orpd   %xmm3,%xmm2
cmpltsd %xmm1,%xmm0
movapd %xmm0,%xmm1
andnpd %xmm2,%xmm1
movsd  0xed2(%rip),%xmm2
andpd  %xmm2,%xmm0
orpd   %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @pathcon_nm6_sign(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %6
5: ; preds = %1
br label %14
6: ; preds = %1
%7 = load double, double* %2
%8 = fcmp ogt double %7, 0.000000e+00
br i1 %8, label %9, label %10
9: ; preds = %6
br label %12
10: ; preds = %6
%11 = load double, double* %2
br label %12
12: ; preds = %10, %9
%13 = phi double [ 1.000000e+00, %9 ], [ %11, %10 ]
br label %14
14: ; preds = %12, %5
%15 = phi double [ -1.000000e+00, %5 ], [ %13, %12 ]
ret double %15
}

LLVM IR (-O2):
define double @pathcon_nm6_sign(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fcmp ogt double %0, 0.000000e+00
%4 = select i1 %3, double 1.000000e+00, double %0
%5 = select i1 %2, double -1.000000e+00, double %4
ret double %5
}
/* Variables and functions */
int rand();
int randomint(int floor, int ceil) {
  int len = ceil - floor;
  return floor + rand() % len;
}


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

x86 assembly (clang, -O2):
<randomint>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
sub    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @randomint(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* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %3
%10 = call i32 (...) @rand()
%11 = load i32, i32* %5
%12 = srem i32 %10, %11
%13 = add nsw i32 %9, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @randomint(i32 %0, i32 %1) {
%3 = sub nsw i32 %1, %0
%4 = tail call i32 (...) @rand()
%5 = srem i32 %4, %3
%6 = add nsw i32 %5, %0
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void cc3_gpio_set_value(uint8_t pin, bool value) {}


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

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

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

LLVM IR (-O2):
define void @cc3_gpio_set_value(i32 %0, i32 %1) {
ret void
}
void ISRSPI_Interrupt(void) {}


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

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

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

LLVM IR (-O2):
define void @ISRSPI_Interrupt() {
ret void
}
/* Variables and functions */
int symlink(char *, char *);
int hyper_symlink(char *oldpath, char *newpath) {
  return symlink(oldpath, newpath);
}


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

x86 assembly (clang, -O2):
<hyper_symlink>:
jmp    1030 <symlink@plt>

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

LLVM IR (-O2):
define i32 @hyper_symlink(i8* %0, i8* %1) {
%3 = tail call i32 @symlink(i8* %0, i8* %1)
ret i32 %3
}
unsigned long long int
unsignedlonglongint_ignoring_longlong(unsigned long long int x, long long y) {
  return x;
}


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

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

LLVM IR (-O0):
define i64 @unsignedlonglongint_ignoring_longlong(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @unsignedlonglongint_ignoring_longlong(i64 returned %0, i64 %1) {
ret i64 %0
}
/* Variables and functions */
int f458(int *);
int f459(int *p) { return f458(p); }


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

x86 assembly (clang, -O2):
<f459>:
jmp    1030 <f458@plt>

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

LLVM IR (-O2):
define i32 @f459(i32* %0) {
%2 = tail call i32 @f458(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ __system_property_get(char const *, char *);
int /*<<< orphan*/ logd(char *, char const *, char *);
void props_log(const char *prop, char *prop_buf) {
  __system_property_get(prop, prop_buf);
  logd("props_log %32.32s: %s", prop, prop_buf);
}


x86 assembly (clang, -O0):
<props_log>:
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   1040 <__system_property_get@plt>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xeb4(%rip),%rdi
call   1030 <logd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<props_log>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <__system_property_get@plt>
lea    0xeca(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <logd@plt>

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

LLVM IR (-O2):
@.str = [22 x i8] c"props_log %32.32s: %s\00"
define void @props_log(i8* %0, i8* %1) {
%3 = tail call i32 @__system_property_get(i8* %0, i8* %1)
%4 = tail call i32 @logd(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
void XtSessionReturnToken() {}


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

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

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

LLVM IR (-O2):
define void @XtSessionReturnToken() {
ret void
}
int MsgReply(int rcvid, int status, const void *msg, int size) { return 0; }


x86 assembly (clang, -O0):
<MsgReply>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @MsgReply(i32 %0, i32 %1, i8* %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
ret i32 0
}

LLVM IR (-O2):
define i32 @MsgReply(i32 %0, i32 %1, i8* nocapture readnone %2, i32 %3) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usageError(char *argv0) {
  fprintf(stderr,
          "Usage: %s <stlfile> [--stopX] -l length [-p new-ngram-chance]\n");
}


x86 assembly (clang, -O0):
<usageError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
lea    0xed4(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [63 x i8] c"Usage: %s <stlfile> [--stopX] -l length [-p new-ngram-chance]\0A\00"
define void @usageError(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [63 x i8] c"Usage: %s <stlfile> [--stopX] -l length [-p new-ngram-chance]\0A\00"
define void @usageError(i8* nocapture readnone %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(void) {
  puts("");
  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 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @putchar(i32 10)
ret i32 0
}
void security_inode_post_mkdir(struct inode *dir, struct dentry *dentry,
                               int mode) {}


x86 assembly (clang, -O0):
<security_inode_post_mkdir>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.inode = type opaque
%struct.dentry = type opaque
define void @security_inode_post_mkdir(%struct.inode* %0, %struct.dentry* %1, i32 %2) {
%4 = alloca %struct.inode*
%5 = alloca %struct.dentry*
%6 = alloca i32
store %struct.inode* %0, %struct.inode** %4
store %struct.dentry* %1, %struct.dentry** %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
%struct.inode = type opaque
%struct.dentry = type opaque
define void @security_inode_post_mkdir(%struct.inode* nocapture %0, %struct.dentry* nocapture %1, i32 %2) {
ret void
}