xunge/DecIR huggingface dataset:
/* Variables and functions */
void *inv_malloc(unsigned int);
void *kmalloc(size_t size, unsigned int gfp_flags) {
  (void)gfp_flags;
  return inv_malloc((unsigned int)size);
}


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

x86 assembly (clang, -O2):
<kmalloc>:
jmp    1030 <inv_malloc@plt>

LLVM IR (-O0):
define i8* @kmalloc(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i64, i64* %3
%7 = trunc i64 %6 to i32
%8 = call i8* @inv_malloc(i32 %7)
ret i8* %8
}

LLVM IR (-O2):
define i8* @kmalloc(i64 %0, i32 %1) {
%3 = trunc i64 %0 to i32
%4 = tail call i8* @inv_malloc(i32 %3)
ret i8* %4
}
__attribute__((no, noclone)) unsigned __int128 t137_3add(signed __int128 y) {
  unsigned __int128 r;
  if (__builtin_add_overflow((unsigned __int128)(2), y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t137_3add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    %rcx,%r9
sar    $0x3f,%r9
add    $0x2,%rdx
adc    $0x0,%rcx
mov    %r9,%r8
adc    $0x0,%r8
adc    $0x0,%r9
mov    %r8d,%eax
and    $0x1,%eax
mov    %eax,%esi
mov    %rsi,%rax
neg    %rax
mov    %rax,%rdi
xor    %r9,%rdi
xor    %r8,%rax
or     %rdi,%rax
or     %rsi,%rax
setne  %al
mov    %rdx,-0x40(%rbp)
mov    %rcx,-0x38(%rbp)
test   $0x1,%al
jne    1187 <t137_3add+0x77>
jmp    118e <t137_3add+0x7e>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t137_3add>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
add    $0x2,%r14
mov    %rsi,%rbx
adc    $0x0,%rbx
mov    $0xfffffffffffffffd,%rax
cmp    %rdi,%rax
mov    $0xffffffffffffffff,%rax
sbb    %rsi,%rax
jl     113f <t137_3add+0x2f>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %r14,%rax
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t137_3add(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = bitcast i128* %4 to { i64, i64 }*
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 0
store i64 %0, i64* %8
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = load i128, i128* %4
store i128 %10, i128* %5
%11 = load i128, i128* %5
%12 = sext i128 %11 to i129
%13 = call { i129, i1 } @llvm.sadd.with.overflow.i129(i129 2, i129 %12)
%14 = extractvalue { i129, i1 } %13, 1
%15 = extractvalue { i129, i1 } %13, 0
%16 = trunc i129 %15 to i128
%17 = zext i128 %16 to i129
%18 = icmp ne i129 %15, %17
%19 = or i1 %14, %18
store i128 %16, i128* %6
br i1 %19, label %20, label %22
20: ; preds = %2
%21 = call i32 (...) @bar()
br label %22
22: ; preds = %20, %2
%23 = load i128, i128* %6
store i128 %23, i128* %3
%24 = bitcast i128* %3 to { i64, i64 }*
%25 = load { i64, i64 }, { i64, i64 }* %24
ret { i64, i64 } %25
}

LLVM IR (-O2):
define { i64, i64 } @t137_3add(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = zext i128 %6 to i129
%8 = add nuw i129 %7, 2
%9 = icmp slt i128 %6, -2
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = tail call i32 (...) @bar()
br label %12
12: ; preds = %10, %2
%13 = trunc i129 %8 to i64
%14 = lshr i129 %8, 64
%15 = trunc i129 %14 to i64
%16 = insertvalue { i64, i64 } poison, i64 %13, 0
%17 = insertvalue { i64, i64 } %16, i64 %15, 1
ret { i64, i64 } %17
}
void nseel_asm_abs_end(void) {}


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

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

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

LLVM IR (-O2):
define void @nseel_asm_abs_end() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ suma();
void main() {
  suma();
  return;
}


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

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

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @suma()
ret void
}
/* Variables and functions */
int are_equal(int *, int *, int);
int /*<<< orphan*/ calculate(int *, int *, int);
int test_ones() {
  int input[] = {1, 1, 1, 1, 1};
  int expected[] = {1, 1, 1, 1, 1};
  int output[5];
  calculate(input, output, 5);
  return are_equal(output, expected, 5);
}


x86 assembly (clang, -O0):
<test_ones>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecc(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xed2(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xecf(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xecd(%rip),%eax
mov    %eax,-0x30(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x60(%rbp),%rsi
mov    $0x5,%edx
call   1030 <calculate@plt>
lea    -0x60(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    $0x5,%edx
call   1040 <are_equal@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ones>:
push   %rbx
sub    $0x60,%rsp
mov    0xee5(%rip),%eax
mov    %eax,0x30(%rsp)
movaps 0xeca(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
mov    %eax,0x10(%rsp)
movaps %xmm0,(%rsp)
lea    0x20(%rsp),%rdi
lea    0x40(%rsp),%rbx
mov    %rbx,%rsi
mov    $0x5,%edx
call   1030 <calculate@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
mov    $0x5,%edx
call   1040 <are_equal@plt>
add    $0x60,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.test_ones.input = [5 x i32] [i32 1, i32 1, i32 1, i32 1, i32 1]
@__const.test_ones.expected = [5 x i32] [i32 1, i32 1, i32 1, i32 1, i32 1]
define i32 @test_ones() {
%1 = alloca [5 x i32]
%2 = alloca [5 x i32]
%3 = alloca [5 x i32]
%4 = bitcast [5 x i32]* %1 to i8*
%5 = bitcast [5 x i32]* %2 to i8*
%6 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%8 = call i32 @calculate(i32* %6, i32* %7, i32 5)
%9 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%10 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%11 = call i32 @are_equal(i32* %9, i32* %10, i32 5)
ret i32 %11
}

LLVM IR (-O2):
@__const.test_ones.expected = [5 x i32] [i32 1, i32 1, i32 1, i32 1, i32 1]
define i32 @test_ones() {
%1 = alloca [5 x i32]
%2 = alloca [5 x i32]
%3 = alloca [5 x i32]
%4 = bitcast [5 x i32]* %1 to i8*
%5 = bitcast [5 x i32]* %2 to i8*
%6 = bitcast [5 x i32]* %3 to i8*
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%8 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%9 = call i32 @calculate(i32* %7, i32* %8, i32 5)
%10 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%11 = call i32 @are_equal(i32* %8, i32* %10, i32 5)
ret i32 %11
}
char *T(x)
char *x;
{
  char *r = M(strlen(x) + 1);
  strcpy(r, x);
  return r;
}


x86 assembly (clang, -O0):
<T>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
mov    $0x0,%al
call   1050 <M@plt>
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<T>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
xor    %eax,%eax
call   1050 <M@plt>
movslq %eax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @T(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add i64 %5, 1
%7 = call i32 (i64, ...) bitcast (i32 (...)* @M to i32 (i64, ...)*)(i64 %6)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = load i8*, i8** %2
%12 = call i8* @strcpy(i8* %10, i8* %11)
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
define i8* @T(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i32 (i64, ...) bitcast (i32 (...)* @M to i32 (i64, ...)*)(i64 %3)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
%7 = tail call i8* @strcpy(i8* dereferenceable(1) %6, i8* dereferenceable(1) %0)
ret i8* %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ MC_put2_16(int, int /*<<< orphan*/ *,
                              int /*<<< orphan*/ const *, int, int,
                              int /*<<< orphan*/);
void MC_put_x_16_mmxext(uint8_t *dest, const uint8_t *ref, int stride,
                        int height) {
  MC_put2_16(height, dest, ref, stride, 1, 0);
}


x86 assembly (clang, -O0):
<MC_put_x_16_mmxext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x1,%r8d
xor    %r9d,%r9d
call   1030 <MC_put2_16@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MC_put_x_16_mmxext>:
mov    %edx,%eax
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %ecx,%edi
mov    %eax,%ecx
mov    $0x1,%r8d
xor    %r9d,%r9d
jmp    1030 <MC_put2_16@plt>

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

LLVM IR (-O2):
define void @MC_put_x_16_mmxext(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = tail call i32 @MC_put2_16(i32 %3, i32* %0, i32* %1, i32 %2, i32 1, i32 0)
ret void
}
const char *__malidrv_build_info(void) {
  return "malidrv:  CONFIG=sc8810 USING_OS_MEMORY=0 API_VERSION=17 REPO_URL= "
         "REVISION=-rr3p1 CHANGED_REVISION= CHANGE_DATE= CPU= USING_UMP=1 "
         "USING_MALI200=0 USING_MALI400=0 USING_MALI400_L2_CACHE=0 USING_GP2=0 "
         "KDIR= MALI_PLATFORM_FILE=platform/sc8810/mali_platform.c "
         "OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_PROFILING=1 "
         "USING_INTERNAL_PROFILING=0 USING_GPU_UTILIZATION=y";
}


x86 assembly (clang, -O0):
<__malidrv_build_info>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__malidrv_build_info>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [364 x i8] c"malidrv: CONFIG=sc8810 USING_OS_MEMORY=0 API_VERSION=17 REPO_URL= REVISION=-rr3p1 CHANGED_REVISION= CHANGE_DATE= CPU= USING_UMP=1 USING_MALI200=0 USING_MALI400=0 USING_MALI400_L2_CACHE=0 USING_GP2=0 KDIR= MALI_PLATFORM_FILE=platform/sc8810/mali_platform.c OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_PROFILING=1 USING_INTERNAL_PROFILING=0 USING_GPU_UTILIZATION=y\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([364 x i8], [364 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [364 x i8] c"malidrv: CONFIG=sc8810 USING_OS_MEMORY=0 API_VERSION=17 REPO_URL= REVISION=-rr3p1 CHANGED_REVISION= CHANGE_DATE= CPU= USING_UMP=1 USING_MALI200=0 USING_MALI400=0 USING_MALI400_L2_CACHE=0 USING_GP2=0 KDIR= MALI_PLATFORM_FILE=platform/sc8810/mali_platform.c OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_PROFILING=1 USING_INTERNAL_PROFILING=0 USING_GPU_UTILIZATION=y\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([364 x i8], [364 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
double M_PI;
double cos(double);
double _hamming(double x) {
  if (x < -1 || x > 1)
    return (0);
  return (0.54 - 0.46 * cos((M_PI * (1.0 + x))));
}


x86 assembly (clang, -O0):
<_hamming>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  0xedb(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
ja     1147 <_hamming+0x37>
movsd  -0x10(%rbp),%xmm0
movsd  0xecb(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1154 <_hamming+0x44>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1192 <_hamming+0x82>
mov    0x2e8d(%rip),%rax
movsd  (%rax),%xmm0
movsd  0xea1(%rip),%xmm1
addsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
call   1030 <cos@plt>
movsd  0xe93(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe8f(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_hamming>:
push   %rax
movsd  0xee7(%rip),%xmm1
ucomisd %xmm0,%xmm1
ja     1153 <_hamming+0x43>
ucomisd 0xee1(%rip),%xmm0
ja     1153 <_hamming+0x43>
mov    0x2eb8(%rip),%rax
addsd  0xed0(%rip),%xmm0
mulsd  (%rax),%xmm0
call   1030 <cos@plt>
mulsd  0xec7(%rip),%xmm0
addsd  0xec7(%rip),%xmm0
pop    %rax
ret
xorpd  %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @_hamming(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, -1.000000e+00
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load double, double* %3
%8 = fcmp ogt double %7, 1.000000e+00
br i1 %8, label %9, label %10
9: ; preds = %6, %1
store double 0.000000e+00, double* %2
br label %17
10: ; preds = %6
%11 = load double, double* @M_PI
%12 = load double, double* %3
%13 = fadd double 1.000000e+00, %12
%14 = fmul double %11, %13
%15 = call double @cos(double %14)
%16 = call double @llvm.fmuladd.f64(double -4.600000e-01, double %15, double 5.400000e-01)
store double %16, double* %2
br label %17
17: ; preds = %10, %9
%18 = load double, double* %2
ret double %18
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @_hamming(double %0) {
%2 = fcmp olt double %0, -1.000000e+00
%3 = fcmp ogt double %0, 1.000000e+00
%4 = or i1 %2, %3
br i1 %4, label %11, label %5
5: ; preds = %1
%6 = load double, double* @M_PI
%7 = fadd double %0, 1.000000e+00
%8 = fmul double %7, %6
%9 = tail call double @cos(double %8)
%10 = tail call double @llvm.fmuladd.f64(double %9, double -4.600000e-01, double 5.400000e-01)
br label %11
11: ; preds = %1, %5
%12 = phi double [ %10, %5 ], [ 0.000000e+00, %1 ]
ret double %12
}
/* Variables and functions */
int /*<<< orphan*/ Mzero(void *, size_t);
int /*<<< orphan*/ Sys_failure(char *);
int /*<<< orphan*/ assert(int);
void *malloc(size_t);
void *Malloc(size_t size) {
  void *retval;
  assert(size > 0);
  retval = malloc(size);
  if (retval == NULL)
    Sys_failure("malloc");
  Mzero(retval, size);
  return retval;
}


x86 assembly (clang, -O0):
<Malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
seta   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1182 <Malloc+0x42>
lea    0xe83(%rip),%rdi
call   1050 <Sys_failure@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1060 <Mzero@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Malloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %edi,%edi
test   %r14,%r14
setne  %dil
call   1030 <assert@plt>
mov    %r14,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1171 <Malloc+0x31>
lea    0xe94(%rip),%rdi
call   1050 <Sys_failure@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <Mzero@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [7 x i8] c"malloc\00"
define i8* @Malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = icmp ugt i64 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load i64, i64* %2
%9 = call i8* @malloc(i64 %8)
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %14
12: ; preds = %1
%13 = call i32 @Sys_failure(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %12, %1
%15 = load i8*, i8** %3
%16 = load i64, i64* %2
%17 = call i32 @Mzero(i8* %15, i64 %16)
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
@.str = [7 x i8] c"malloc\00"
define i8* @Malloc(i64 %0) {
%2 = icmp ne i64 %0, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i8* @malloc(i64 %0)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = tail call i32 @Sys_failure(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
%10 = tail call i32 @Mzero(i8* %5, i64 %0)
ret i8* %5
}
/* Variables and functions */
scalar_t__ RAND_MAX;
scalar_t__ rand();
double get_random(double min, double max) {
  return (max - min) * ((double)rand() / (double)RAND_MAX) + min;
}


x86 assembly (clang, -O0):
<get_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
movsd  -0x18(%rbp),%xmm0
cvtsi2sd %rax,%xmm2
mov    0x2e9f(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm2
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_random>:
sub    $0x18,%rsp
movsd  %xmm0,0x10(%rsp)
subsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
mov    0x2eae(%rip),%rax
xorps  %xmm1,%xmm1
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
mulsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define double @get_random(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double, double* %3
%7 = fsub double %5, %6
%8 = call i64 (...) @rand()
%9 = sitofp i64 %8 to double
%10 = load i64, i64* @RAND_MAX
%11 = sitofp i64 %10 to double
%12 = fdiv double %9, %11
%13 = load double, double* %3
%14 = call double @llvm.fmuladd.f64(double %7, double %12, double %13)
ret double %14
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define double @get_random(double %0, double %1) {
%3 = fsub double %1, %0
%4 = tail call i64 (...) @rand()
%5 = sitofp i64 %4 to double
%6 = load i64, i64* @RAND_MAX
%7 = sitofp i64 %6 to double
%8 = fdiv double %5, %7
%9 = tail call double @llvm.fmuladd.f64(double %3, double %8, double %0)
ret double %9
}
int my_strcmp(const char *s1, const char *s2) {
  while (*s1) {
    if (*s1 - *s2)
      break;
    ++s1;
    ++s2;
  }
  return *s1 - *s2;
}


x86 assembly (clang, -O0):
<my_strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1154 <my_strcmp+0x54>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
sub    %ecx,%eax
cmp    $0x0,%eax
je     1137 <my_strcmp+0x37>
jmp    1154 <my_strcmp+0x54>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <my_strcmp+0xc>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strcmp>:
mov    (%rdi),%al
test   %al,%al
je     1123 <my_strcmp+0x23>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
cmp    (%rsi),%al
jne    1125 <my_strcmp+0x25>
add    $0x1,%rsi
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <my_strcmp+0x10>
xor    %eax,%eax
movsbl %al,%eax
movsbl (%rsi),%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @my_strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %11
%6 = phi i8 [ %14, %11 ], [ %3, %2 ]
%7 = phi i8* [ %13, %11 ], [ %1, %2 ]
%8 = phi i8* [ %12, %11 ], [ %0, %2 ]
%9 = load i8, i8* %7
%10 = icmp eq i8 %6, %9
br i1 %10, label %11, label %16
11: ; preds = %5
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = load i8, i8* %12
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %11, %5, %2
%17 = phi i8* [ %1, %2 ], [ %7, %5 ], [ %13, %11 ]
%18 = phi i8 [ 0, %2 ], [ %6, %5 ], [ 0, %11 ]
%19 = sext i8 %18 to i32
%20 = load i8, i8* %17
%21 = sext i8 %20 to i32
%22 = sub nsw i32 %19, %21
ret i32 %22
}
/* Type definitions */
struct mbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mb_pool_free(struct mbuf *);
void mb_free(struct mbuf *m) { mb_pool_free(m); }


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

x86 assembly (clang, -O2):
<mb_free>:
jmp    1030 <mb_pool_free@plt>

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

LLVM IR (-O2):
%struct.mbuf = type { i32 }
define void @mb_free(%struct.mbuf* %0) {
%2 = tail call i32 @mb_pool_free(%struct.mbuf* %0)
ret void
}
/* Variables and functions */
int syscall(int, int, int, int, int);
int thread(int fn, int stack, int flag, int ptr) {
  return syscall(14, fn, stack, flag, ptr);
}


x86 assembly (clang, -O0):
<thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    $0xe,%edi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread>:
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
mov    $0xe,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @thread(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @syscall(i32 14, i32 %9, i32 %10, i32 %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @thread(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @syscall(i32 14, i32 %0, i32 %1, i32 %2, i32 %3)
ret i32 %5
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int _rand_next_xorshift32(unsigned int *);
int rand_r(unsigned *seed) {
  uint32_t x = _rand_next_xorshift32(seed);
  return (int)(x >> 1);
}


x86 assembly (clang, -O0):
<rand_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <_rand_next_xorshift32@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_r>:
push   %rax
call   1030 <_rand_next_xorshift32@plt>
sar    %eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @rand_r(i32* %0) {
%2 = tail call i32 @_rand_next_xorshift32(i32* %0)
%3 = ashr i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free_audioterminal();
int /*<<< orphan*/ free_class();
int /*<<< orphan*/ free_genericstrtable();
int /*<<< orphan*/ free_product();
int /*<<< orphan*/ free_protocol();
int /*<<< orphan*/ free_subclass();
int /*<<< orphan*/ free_vendor();
int /*<<< orphan*/ free_videoterminal();
int names_free(void) {
  free_vendor();
  free_product();
  free_class();
  free_subclass();
  free_protocol();
  free_audioterminal();
  free_videoterminal();
  free_genericstrtable();
  return 0;
}


x86 assembly (clang, -O0):
<names_free>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <free_vendor@plt>
mov    $0x0,%al
call   1050 <free_product@plt>
mov    $0x0,%al
call   10a0 <free_class@plt>
mov    $0x0,%al
call   1070 <free_subclass@plt>
mov    $0x0,%al
call   1030 <free_protocol@plt>
mov    $0x0,%al
call   1080 <free_audioterminal@plt>
mov    $0x0,%al
call   1090 <free_videoterminal@plt>
mov    $0x0,%al
call   1040 <free_genericstrtable@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<names_free>:
push   %rax
xor    %eax,%eax
call   1060 <free_vendor@plt>
xor    %eax,%eax
call   1050 <free_product@plt>
xor    %eax,%eax
call   10a0 <free_class@plt>
xor    %eax,%eax
call   1070 <free_subclass@plt>
xor    %eax,%eax
call   1030 <free_protocol@plt>
xor    %eax,%eax
call   1080 <free_audioterminal@plt>
xor    %eax,%eax
call   1090 <free_videoterminal@plt>
xor    %eax,%eax
call   1040 <free_genericstrtable@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @names_free() {
%1 = call i32 (...) @free_vendor()
%2 = call i32 (...) @free_product()
%3 = call i32 (...) @free_class()
%4 = call i32 (...) @free_subclass()
%5 = call i32 (...) @free_protocol()
%6 = call i32 (...) @free_audioterminal()
%7 = call i32 (...) @free_videoterminal()
%8 = call i32 (...) @free_genericstrtable()
ret i32 0
}

LLVM IR (-O2):
define i32 @names_free() {
%1 = tail call i32 (...) @free_vendor()
%2 = tail call i32 (...) @free_product()
%3 = tail call i32 (...) @free_class()
%4 = tail call i32 (...) @free_subclass()
%5 = tail call i32 (...) @free_protocol()
%6 = tail call i32 (...) @free_audioterminal()
%7 = tail call i32 (...) @free_videoterminal()
%8 = tail call i32 (...) @free_genericstrtable()
ret i32 0
}
char *logging_default_formatter(int level, const char *log_message) {
  return (char *)log_message;
}


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

x86 assembly (clang, -O2):
<logging_default_formatter>:
mov    %rsi,%rax
ret

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

LLVM IR (-O2):
define i8* @logging_default_formatter(i32 %0, i8* readnone returned %1) {
ret i8* %1
}
void tokenizer_error_print(void) { ; }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ asprintf(char **, char *, int /*<<< orphan*/);
char *fmt_16(uint16_t num) {
  char *fmt;
  asprintf(&fmt, "f16(%#04x)", num);
  return fmt;
}


x86 assembly (clang, -O0):
<fmt_16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    -0x10(%rbp),%rdi
lea    0xed7(%rip),%rsi
call   1030 <asprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmt_16>:
push   %rax
mov    %edi,%edx
lea    0xee6(%rip),%rsi
mov    %rsp,%rdi
call   1030 <asprintf@plt>
mov    (%rsp),%rax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"f16(%x)\00"
define i8* @fmt_16(i32 %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i32 @asprintf(i8** %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = load i8*, i8** %2
ret i8* %5
}
/* Type definitions */
struct terminal {
  int dummy;
};
struct parm_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cr(struct terminal *);
int /*<<< orphan*/ move_cursor(struct terminal *, int, int /*<<< orphan*/);
int sum(struct parm_t *);
void curs_nl(struct terminal *term, struct parm_t *parm) {
  int num = sum(parm);
  if (num <= 0)
    num = 1;
  move_cursor(term, num, 0);
  cr(term);
}


x86 assembly (clang, -O0):
<curs_nl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <sum@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jg     115d <curs_nl+0x2d>
movl   $0x1,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
xor    %edx,%edx
call   1050 <move_cursor@plt>
mov    -0x8(%rbp),%rdi
call   1030 <cr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<curs_nl>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1040 <sum@plt>
test   %eax,%eax
mov    $0x1,%esi
cmovg  %eax,%esi
mov    %rbx,%rdi
xor    %edx,%edx
call   1050 <move_cursor@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <cr@plt>

LLVM IR (-O0):
%struct.terminal = type { i32 }
%struct.parm_t = type { i32 }
define void @curs_nl(%struct.terminal* %0, %struct.parm_t* %1) {
%3 = alloca %struct.terminal*
%4 = alloca %struct.parm_t*
%5 = alloca i32
store %struct.terminal* %0, %struct.terminal** %3
store %struct.parm_t* %1, %struct.parm_t** %4
%6 = load %struct.parm_t*, %struct.parm_t** %4
%7 = call i32 @sum(%struct.parm_t* %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp sle i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 1, i32* %5
br label %11
11: ; preds = %10, %2
%12 = load %struct.terminal*, %struct.terminal** %3
%13 = load i32, i32* %5
%14 = call i32 @move_cursor(%struct.terminal* %12, i32 %13, i32 0)
%15 = load %struct.terminal*, %struct.terminal** %3
%16 = call i32 @cr(%struct.terminal* %15)
ret void
}

LLVM IR (-O2):
%struct.terminal = type { i32 }
%struct.parm_t = type { i32 }
define void @curs_nl(%struct.terminal* %0, %struct.parm_t* %1) {
%3 = tail call i32 @sum(%struct.parm_t* %1)
%4 = icmp sgt i32 %3, 1
%5 = select i1 %4, i32 %3, i32 1
%6 = tail call i32 @move_cursor(%struct.terminal* %0, i32 %5, i32 0)
%7 = tail call i32 @cr(%struct.terminal* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ asprintf(char **, char *, char *);
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ free(char *);
int system(char *);
int main(int argc, char **argv) {
  assert(argc == 2);
  int out;
  {
    char *string_for_systemf;
    asprintf(&string_for_systemf, "ls %s", argv[1]);
    out = system(string_for_systemf);
    free(string_for_systemf);
  };
  return out;
}


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)
cmpl   $0x2,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    -0x20(%rbp),%rdi
lea    0xe86(%rip),%rsi
call   1060 <asprintf@plt>
mov    -0x20(%rbp),%rdi
call   1040 <system@plt>
mov    %eax,-0x14(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
xor    %eax,%eax
cmp    $0x2,%edi
sete   %al
mov    %eax,%edi
call   1050 <assert@plt>
mov    0x8(%rbx),%rdx
lea    0xe9e(%rip),%rsi
lea    0x8(%rsp),%rdi
call   1060 <asprintf@plt>
mov    0x8(%rsp),%rdi
call   1040 <system@plt>
mov    %eax,%ebx
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"ls %s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 2
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @asprintf(i8** %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = load i8*, i8** %7
%17 = call i32 @system(i8* %16)
store i32 %17, i32* %6
%18 = load i8*, i8** %7
%19 = call i32 @free(i8* %18)
%20 = load i32, i32* %6
ret i32 %20
}

LLVM IR (-O2):
@.str = [6 x i8] c"ls %s\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i8*
%4 = icmp eq i32 %0, 2
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = bitcast i8** %3 to i8*
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = call i32 @asprintf(i8** %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = load i8*, i8** %3
%12 = call i32 @system(i8* %11)
%13 = load i8*, i8** %3
%14 = call i32 @free(i8* %13)
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void *);
int /*<<< orphan*/ stderr;
void rtpp_pipe_upd_cntrs_fin(void *pub) {
  fprintf(stderr,
          "Method rtpp_pipe@%p::upd_cntrs (rtpp_pipe_upd_cntrs) is invoked "
          "after destruction\x0a",
          pub);
  abort();
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [83 x i8] c"Method rtpp_pipe@%p::upd_cntrs (rtpp_pipe_upd_cntrs) is invoked after destruction\0A\00"
define void @rtpp_pipe_upd_cntrs_fin(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [83 x i8] c"Method rtpp_pipe@%p::upd_cntrs (rtpp_pipe_upd_cntrs) is invoked after destruction\0A\00"
define void @rtpp_pipe_upd_cntrs_fin(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
void *memalign(size_t, size_t);
void *pvalloc(size_t bytes) {
  size_t pagesize = (4096);
  return memalign(pagesize, (bytes + pagesize - 1) & ~(pagesize - 1));
}


x86 assembly (clang, -O0):
<pvalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x1000,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    -0x10(%rbp),%rsi
sub    $0x1,%rsi
mov    -0x10(%rbp),%rax
sub    $0x1,%rax
xor    $0xffffffffffffffff,%rax
and    %rax,%rsi
call   1030 <memalign@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pvalloc>:
lea    0xfff(%rdi),%rsi
and    $0xfffffffffffff000,%rsi
mov    $0x1000,%edi
jmp    1030 <memalign@plt>

LLVM IR (-O0):
define i8* @pvalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store i64 4096, i64* %3
%4 = load i64, i64* %3
%5 = load i64, i64* %2
%6 = load i64, i64* %3
%7 = add i64 %5, %6
%8 = sub i64 %7, 1
%9 = load i64, i64* %3
%10 = sub i64 %9, 1
%11 = xor i64 %10, -1
%12 = and i64 %8, %11
%13 = call i8* @memalign(i64 %4, i64 %12)
ret i8* %13
}

LLVM IR (-O2):
define noalias i8* @pvalloc(i64 %0) {
%2 = add i64 %0, 4095
%3 = and i64 %2, -4096
%4 = tail call align 4096 i8* @memalign(i64 4096, i64 %3)
ret i8* %4
}
int read32(unsigned int reg1) {
  unsigned int *reg;
  signed int val;
  reg = (unsigned int *)reg1;
  val = (int)*(reg);
  return val;
}


x86 assembly (clang, -O0):
<read32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read32>:
mov    %edi,%eax
mov    (%rax),%eax
ret

LLVM IR (-O0):
define i32 @read32(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
store i32* %7, i32** %3
%8 = load i32*, i32** %3
%9 = load i32, i32* %8
store i32 %9, i32* %4
%10 = load i32, i32* %4
ret i32 %10
}

LLVM IR (-O2):
define i32 @read32(i32 %0) {
%2 = zext i32 %0 to i64
%3 = inttoptr i64 %2 to i32*
%4 = load i32, i32* %3
ret i32 %4
}
double subc(double f, double g, double h) { return !h ? f : g; }


x86 assembly (clang, -O0):
<subc>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    113a <subc+0x3a>
jp     113a <subc+0x3a>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1144 <subc+0x44>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<subc>:
xorpd  %xmm3,%xmm3
cmpneqsd %xmm2,%xmm3
andpd  %xmm3,%xmm1
andnpd %xmm0,%xmm3
orpd   %xmm1,%xmm3
movapd %xmm3,%xmm0
ret

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

LLVM IR (-O2):
define double @subc(double %0, double %1, double %2) {
%4 = fcmp une double %2, 0.000000e+00
%5 = select i1 %4, double %1, double %0
ret double %5
}
unsigned short ___swab16(unsigned short x) {
  unsigned short __x = x;
  return (
      unsigned short)((((unsigned short)(__x) & (unsigned short)0x00ffU) << 8) |
                      (((unsigned short)(__x) & (unsigned short)0xff00U) >> 8));
}


x86 assembly (clang, -O0):
<___swab16>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%ax
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%eax
and    $0xff,%eax
shl    $0x8,%eax
movzwl -0x4(%rbp),%ecx
and    $0xff00,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<___swab16>:
mov    %edi,%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define zeroext i16 @___swab16(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %2
%4 = load i16, i16* %2
store i16 %4, i16* %3
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = and i32 %6, 255
%8 = shl i32 %7, 8
%9 = load i16, i16* %3
%10 = zext i16 %9 to i32
%11 = and i32 %10, 65280
%12 = ashr i32 %11, 8
%13 = or i32 %8, %12
%14 = trunc i32 %13 to i16
ret i16 %14
}

LLVM IR (-O2):
define zeroext i16 @___swab16(i16 zeroext %0) {
%2 = tail call i16 @llvm.bswap.i16(i16 %0)
ret i16 %2
}
/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ func(int);
int main() {
  int i;
  int sum = 0;
  for (i = 0; i < 10000; i++) {
    sum += func(1000);
  }
  if (sum != 10000) {
    abort();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x2710,-0x8(%rbp)
jge    116f <main+0x4f>
mov    $0x3e8,%edi
call   1040 <func@plt>
mov    %rax,%rcx
movslq -0xc(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <main+0x1d>
cmpl   $0x2710,-0xc(%rbp)
je     1183 <main+0x63>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %ebx,%ebx
mov    $0x2710,%ebp
nopw   0x0(%rax,%rax,1)
mov    $0x3e8,%edi
call   1040 <func@plt>
add    %eax,%ebx
add    $0xffffffff,%ebp
jne    1130 <main+0x10>
cmp    $0x2710,%ebx
jne    1152 <main+0x32>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
store i32 0, i32* %2
br label %4
4: ; preds = %13, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 10000
br i1 %6, label %7, label %16
7: ; preds = %4
%8 = call i64 @func(i32 1000)
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = add nsw i64 %10, %8
%12 = trunc i64 %11 to i32
store i32 %12, i32* %3
br label %13
13: ; preds = %7
%14 = load i32, i32* %2
%15 = add nsw i32 %14, 1
store i32 %15, i32* %2
br label %4
16: ; preds = %4
%17 = load i32, i32* %3
%18 = icmp ne i32 %17, 10000
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = call i32 (...) @abort()
unreachable
21: ; preds = %16
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %6, %1 ]
%3 = phi i32 [ 0, %0 ], [ %7, %1 ]
%4 = tail call i64 @func(i32 1000)
%5 = trunc i64 %4 to i32
%6 = add i32 %2, %5
%7 = add nuw nsw i32 %3, 1
%8 = icmp eq i32 %7, 10000
br i1 %8, label %9, label %1
9: ; preds = %1
%10 = icmp eq i32 %6, 10000
br i1 %10, label %13, label %11
11: ; preds = %9
%12 = tail call i32 (...) @abort()
unreachable
13: ; preds = %9
ret i32 0
}
int inv(int a) { return a ^ -1; }


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

x86 assembly (clang, -O2):
<inv>:
mov    %edi,%eax
not    %eax
ret

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

LLVM IR (-O2):
define i32 @inv(i32 %0) {
%2 = xor i32 %0, -1
ret i32 %2
}
void foo740(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo740(i32 %0) {
ret void
}
void deadend(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<deadend>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <deadend+0x9>
jmp    1109 <deadend+0x9>

x86 assembly (clang, -O2):
<deadend>:
jmp    1100 <deadend>

LLVM IR (-O0):
define void @deadend() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @deadend() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Type definitions */
struct vec2i {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ vec2i_abs(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
__attribute__((always_)) struct vec2i *psvec2i_abs(struct vec2i *result,
                                                   struct vec2i *a) {
  vec2i_abs((int32_t *)result, (int32_t *)a);
  return result;
}


x86 assembly (clang, -O0):
<psvec2i_abs>:
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 <vec2i_abs@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psvec2i_abs>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vec2i_abs@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vec2i = type { i32 }
define %struct.vec2i* @psvec2i_abs(%struct.vec2i* %0, %struct.vec2i* %1) {
%3 = alloca %struct.vec2i*
%4 = alloca %struct.vec2i*
store %struct.vec2i* %0, %struct.vec2i** %3
store %struct.vec2i* %1, %struct.vec2i** %4
%5 = load %struct.vec2i*, %struct.vec2i** %3
%6 = bitcast %struct.vec2i* %5 to i32*
%7 = load %struct.vec2i*, %struct.vec2i** %4
%8 = bitcast %struct.vec2i* %7 to i32*
%9 = call i32 @vec2i_abs(i32* %6, i32* %8)
%10 = load %struct.vec2i*, %struct.vec2i** %3
ret %struct.vec2i* %10
}

LLVM IR (-O2):
%struct.vec2i = type { i32 }
define %struct.vec2i* @psvec2i_abs(%struct.vec2i* returned %0, %struct.vec2i* %1) {
%3 = getelementptr %struct.vec2i, %struct.vec2i* %0, i64 0, i32 0
%4 = getelementptr %struct.vec2i, %struct.vec2i* %1, i64 0, i32 0
%5 = tail call i32 @vec2i_abs(i32* %3, i32* %4)
ret %struct.vec2i* %0
}
/* Type definitions */
typedef unsigned int uint8_t;

/* Variables and functions */
unsigned int mput2b(unsigned int value, uint8_t *data) {
  data[1] = value & 0xff;
  data[0] = (value >> 8) & 0xff;
  return data[0];
}


x86 assembly (clang, -O0):
<mput2b>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x4(%rbp),%ecx
shr    $0x8,%ecx
and    $0xff,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mput2b>:
mov    %edi,%eax
movzbl %al,%ecx
mov    %ecx,0x4(%rsi)
movzbl %ah,%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define i32 @mput2b(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32, i32* %3
%6 = and i32 %5, 255
%7 = load i32*, i32** %4
%8 = getelementptr inbounds i32, i32* %7, i64 1
store i32 %6, i32* %8
%9 = load i32, i32* %3
%10 = lshr i32 %9, 8
%11 = and i32 %10, 255
%12 = load i32*, i32** %4
%13 = getelementptr inbounds i32, i32* %12, i64 0
store i32 %11, i32* %13
%14 = load i32*, i32** %4
%15 = getelementptr inbounds i32, i32* %14, i64 0
%16 = load i32, i32* %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @mput2b(i32 %0, i32* nocapture writeonly %1) {
%3 = and i32 %0, 255
%4 = getelementptr inbounds i32, i32* %1, i64 1
store i32 %3, i32* %4
%5 = lshr i32 %0, 8
%6 = and i32 %5, 255
store i32 %6, i32* %1
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ GLuint;

/* Variables and functions */
int /*<<< orphan*/ glPushName(int /*<<< orphan*/);
void PushName(GLuint name) { glPushName(name); }


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

x86 assembly (clang, -O2):
<PushName>:
jmp    1030 <glPushName@plt>

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

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