xunge/DecIR huggingface dataset:
void do_66pushb_pos(void) {
  unsigned long long int block[3];
  __asm__ __volatile__("movq  %0, %%rdx\n\t"
                       "pushq $0x55555555\n\t"
                       "movq  %%rsp, 0(%%rdx)\n\t"
                       ".byte 0x66,0x6A,0x22\n\t"
                       "movq  %%rsp, 8(%%rdx)\n\t"
                       "popq  %%rax\n\t"
                       "movq  %%rax,16(%%rdx)\n\t"
                       "movq  0(%%rdx),%%rsp\n\t"
                       "addq  $8, %%rsp"
                       :
                       : "r"(&block)
                       : "rax", "rdx", "cc", "memory");
  printf("66pushb_pos: delta %lld, top64 0x%016llx\n", block[0] - block[1],
         block[2]);
}


x86 assembly (clang, -O0):
<do_66pushb_pos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x20(%rbp),%rcx
mov    %rcx,%rdx
push   $0x55555555
mov    %rsp,(%rdx)
pushw  $0x22
mov    %rsp,0x8(%rdx)
pop    %rax
mov    %rax,0x10(%rdx)
mov    (%rdx),%rsp
add    $0x8,%rsp
mov    -0x20(%rbp),%rsi
sub    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_66pushb_pos>:
sub    $0x18,%rsp
mov    %rsp,%rcx
mov    %rcx,%rdx
push   $0x55555555
mov    %rsp,(%rdx)
pushw  $0x22
mov    %rsp,0x8(%rdx)
pop    %rax
mov    %rax,0x10(%rdx)
mov    (%rdx),%rsp
add    $0x8,%rsp
mov    (%rsp),%rsi
mov    0x10(%rsp),%rdx
sub    0x8(%rsp),%rsi
lea    0xeb6(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [42 x i8] c"66pushb_pos: delta %lld, top64 0x%016llx\0A\00"
define void @do_66pushb_pos() {
%1 = alloca [3 x i64]
%2 = getelementptr inbounds [3 x i64], [3 x i64]* %1, i64 0, i64 0
%3 = load i64, i64* %2
%4 = getelementptr inbounds [3 x i64], [3 x i64]* %1, i64 0, i64 1
%5 = load i64, i64* %4
%6 = sub i64 %3, %5
%7 = getelementptr inbounds [3 x i64], [3 x i64]* %1, i64 0, i64 2
%8 = load i64, i64* %7
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i64 %6, i64 %8)
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c"66pushb_pos: delta %lld, top64 0x%016llx\0A\00"
define void @do_66pushb_pos() {
%1 = alloca [3 x i64]
%2 = bitcast [3 x i64]* %1 to i8*
%3 = getelementptr inbounds [3 x i64], [3 x i64]* %1, i64 0, i64 0
%4 = load i64, i64* %3
%5 = getelementptr inbounds [3 x i64], [3 x i64]* %1, i64 0, i64 1
%6 = load i64, i64* %5
%7 = sub i64 %4, %6
%8 = getelementptr inbounds [3 x i64], [3 x i64]* %1, i64 0, i64 2
%9 = load i64, i64* %8
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i64 %7, i64 %9)
ret void
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  size_t gl_pathc;
};
typedef TYPE_1__ glob_t;

/* Variables and functions */
size_t chpl_glob_num(const glob_t glb) { return glb.gl_pathc; }


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

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

LLVM IR (-O0):
%struct.TYPE_3__ = type { i64 }
define i64 @chpl_glob_num(i64 %0) {
%2 = alloca %struct.TYPE_3__
%3 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %2, i32 0, i32 0
store i64 %0, i64* %3
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %2, i32 0, i32 0
%5 = load i64, i64* %4
ret i64 %5
}

LLVM IR (-O2):
define i64 @chpl_glob_num(i64 returned %0) {
ret i64 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int pthread_cancel(pthread_t a) { assert(0); }


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

x86 assembly (clang, -O2):
<pthread_cancel>:
xor    %edi,%edi
jmp    1030 <assert@plt>

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

LLVM IR (-O2):
define i32 @pthread_cancel(i32 %0) {
%2 = tail call i32 @assert(i32 0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int XUngrabPointer() {
  printf("XUngrabPointer called\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<XUngrabPointer>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [22 x i8] c"XUngrabPointer called\00"
define i32 @XUngrabPointer() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void f_acc_kernels(void) {
#pragma acc kernels
  {
#pragma acc parallel
    ;
#pragma acc kernels
    ;
#pragma acc data
    ;
#pragma acc update host(i)
#pragma acc enter data copyin(i)
#pragma acc exit data delete (i)
  }
}


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

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

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

LLVM IR (-O2):
define void @f_acc_kernels() {
ret void
}
double sq(double a) { return a * a; }


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

x86 assembly (clang, -O2):
<sq>:
mulsd  %xmm0,%xmm0
ret

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

LLVM IR (-O2):
define double @sq(double %0) {
%2 = fmul double %0, %0
ret double %2
}
int test_imm_89uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x89 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_89uint64_midword_mem>:
testb  $0x89,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_89uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 8978432
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
unsigned char highByte(int x) {
  unsigned char y;
  x = x & 0xff00;
  y = x >> 8;
  return (y);
}


x86 assembly (clang, -O0):
<highByte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff00,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<highByte>:
mov    %edi,%eax
shr    $0x8,%eax
ret

LLVM IR (-O0):
define zeroext i8 @highByte(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = and i32 %4, 65280
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = ashr i32 %6, 8
%8 = trunc i32 %7 to i8
store i8 %8, i8* %3
%9 = load i8, i8* %3
ret i8 %9
}

LLVM IR (-O2):
define zeroext i8 @highByte(i32 %0) {
%2 = lshr i32 %0, 8
%3 = trunc i32 %2 to i8
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ strncat(char *, char *, int);
int agrega_el_cien(char *buffer) {
  int len = 4;
  strncat(buffer, "cien", len);
  return len;
}


x86 assembly (clang, -O0):
<agrega_el_cien>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xecf(%rip),%rsi
call   1030 <strncat@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<agrega_el_cien>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncat@plt>
mov    $0x4,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"cien\00"
define i32 @agrega_el_cien(i8* %0) {
%2 = tail call i32 @strncat(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 4
}
void htsmsg_store_remove(const char *pathfmt, ...) {}


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

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

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

LLVM IR (-O2):
define void @htsmsg_store_remove(i8* nocapture %0, ...) {
ret void
}
double stat_fmax2(double a, double b) { return (a > b) ? a : b; }


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

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

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

LLVM IR (-O2):
define double @stat_fmax2(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
double tv2float(struct timeval *);
double diff_time(struct timeval *tv1, struct timeval *tv2) {
  return tv2float(tv1) - tv2float(tv2);
}


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

x86 assembly (clang, -O2):
<diff_time>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
call   1030 <tv2float@plt>
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
call   1030 <tv2float@plt>
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
define double @diff_time(%struct.timeval* %0, %struct.timeval* %1) {
%3 = alloca %struct.timeval*
%4 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %3
store %struct.timeval* %1, %struct.timeval** %4
%5 = load %struct.timeval*, %struct.timeval** %3
%6 = call double @tv2float(%struct.timeval* %5)
%7 = load %struct.timeval*, %struct.timeval** %4
%8 = call double @tv2float(%struct.timeval* %7)
%9 = fsub double %6, %8
ret double %9
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define double @diff_time(%struct.timeval* %0, %struct.timeval* %1) {
%3 = tail call double @tv2float(%struct.timeval* %0)
%4 = tail call double @tv2float(%struct.timeval* %1)
%5 = fsub double %3, %4
ret double %5
}
int test_imm_66uint16_reg(unsigned short val) {
  return ((val) & (0x66 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_66uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0x66,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_66uint16_reg>:
test   $0x66,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_66uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 102
%6 = icmp ne i32 %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_66uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 102
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int read4();
unsigned long long read8();
int /*<<< orphan*/ read_ftrace_file(unsigned long long);
void read_ftrace_files(void) {
  unsigned long long size;
  int count;
  int i;
  count = read4();
  for (i = 0; i < count; i++) {
    size = read8();
    read_ftrace_file(size);
  }
}


x86 assembly (clang, -O0):
<read_ftrace_files>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <read4@plt>
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1177 <read_ftrace_files+0x47>
mov    $0x0,%al
call   1040 <read8@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <read_ftrace_file@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1149 <read_ftrace_files+0x19>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_ftrace_files>:
push   %rbx
xor    %eax,%eax
call   1030 <read4@plt>
test   %eax,%eax
jle    1154 <read_ftrace_files+0x24>
mov    %eax,%ebx
xchg   %ax,%ax
xor    %eax,%eax
call   1040 <read8@plt>
mov    %rax,%rdi
call   1050 <read_ftrace_file@plt>
add    $0xffffffff,%ebx
jne    1140 <read_ftrace_files+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @read_ftrace_files() {
%1 = tail call i32 (...) @read4()
%2 = icmp sgt i32 %1, 0
br i1 %2, label %3, label %9
3: ; preds = %0, %3
%4 = phi i32 [ %7, %3 ], [ 0, %0 ]
%5 = tail call i64 (...) @read8()
%6 = tail call i32 @read_ftrace_file(i64 %5)
%7 = add nuw nsw i32 %4, 1
%8 = icmp eq i32 %7, %1
br i1 %8, label %9, label %3
9: ; preds = %3, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_usage() {
  printf("\n");
  printf("-d         use default matrix size (%dx%d)\n", 140, 140);
  printf("-s {size}  use custom matrix size\n");
  printf("-h         print this help message\n");
  printf("\n");
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xf0f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
mov    $0x8c,%edx
mov    %edx,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeee(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf03(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xebe(%rip),%rdi
mov    $0x8c,%esi
mov    $0x8c,%edx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xed2(%rip),%rdi
call   1040 <puts@plt>
lea    0xee8(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [44 x i8] c"-d use default matrix size (%dx%d)\0A\00"
@.str.2 = [35 x i8] c"-s {size} use custom matrix size\0A\00"
@.str.3 = [36 x i8] c"-h print this help message\0A\00"
define void @print_usage() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0), i32 140, i32 140)
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [44 x i8] c"-d use default matrix size (%dx%d)\0A\00"
@str = [34 x i8] c"-s {size} use custom matrix size\00"
@str.4 = [35 x i8] c"-h print this help message\00"
define void @print_usage() {
%1 = tail call i32 @putchar(i32 10)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0), i32 140, i32 140)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.4, i64 0, i64 0))
%5 = tail call i32 @putchar(i32 10)
ret void
}
void AYUVToNV12() {}


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

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

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

LLVM IR (-O2):
define void @AYUVToNV12() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ endpoint();
void endpoint_() { endpoint(); }


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

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

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

LLVM IR (-O2):
define void @endpoint_() {
%1 = tail call i32 (...) @endpoint()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glutSolidTorus(int, int, int, int);
void torus(void) { glutSolidTorus(10., 20., 16, 16); }


x86 assembly (clang, -O0):
<torus>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
mov    $0x14,%esi
mov    $0x10,%ecx
mov    %ecx,%edx
call   1030 <glutSolidTorus@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<torus>:
mov    $0xa,%edi
mov    $0x14,%esi
mov    $0x10,%edx
mov    $0x10,%ecx
jmp    1030 <glutSolidTorus@plt>

LLVM IR (-O0):
define void @torus() {
%1 = call i32 @glutSolidTorus(i32 10, i32 20, i32 16, i32 16)
ret void
}

LLVM IR (-O2):
define void @torus() {
%1 = tail call i32 @glutSolidTorus(i32 10, i32 20, i32 16, i32 16)
ret void
}
void p(int *x) {
  int y;
  int *z;
  z = &y;
  p(z);
}


x86 assembly (clang, -O0):
<p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <p@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @p(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
double drive_rpm() { return 0; }


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

x86 assembly (clang, -O2):
<drive_rpm>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @drive_rpm() {
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @drive_rpm() {
ret double 0.000000e+00
}
/* Type definitions */
struct timespec {
  int tv_nsec;
  int tv_sec;
};

/* Variables and functions */
double modf(double, double *);
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/ *);
void time_sleep(double interval) {
  struct timespec ts;
  double sec;
  ts.tv_nsec = (int)(modf(interval, &sec) * 1000000000.0);
  ts.tv_sec = (int)sec;
  nanosleep(&ts, NULL);
}


x86 assembly (clang, -O0):
<time_sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    -0x18(%rbp),%rdi
call   1030 <modf@plt>
movsd  0xebd(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x10(%rbp)
cvttsd2si -0x18(%rbp),%eax
mov    %eax,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <nanosleep@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_sleep>:
sub    $0x18,%rsp
lea    0x10(%rsp),%rdi
call   1030 <modf@plt>
mulsd  0xeca(%rip),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,0x8(%rsp)
cvttsd2si 0x10(%rsp),%eax
mov    %eax,0xc(%rsp)
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1040 <nanosleep@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define void @time_sleep(double %0) {
%2 = alloca double
%3 = alloca %struct.timespec
%4 = alloca double
store double %0, double* %2
%5 = load double, double* %2
%6 = call double @modf(double %5, double* %4)
%7 = fmul double %6, 1.000000e+09
%8 = fptosi double %7 to i32
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i32 %8, i32* %9
%10 = load double, double* %4
%11 = fptosi double %10 to i32
%12 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i32 %11, i32* %12
%13 = call i32 @nanosleep(%struct.timespec* %3, i32* null)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define void @time_sleep(double %0) {
%2 = alloca %struct.timespec
%3 = alloca double
%4 = bitcast %struct.timespec* %2 to i8*
%5 = bitcast double* %3 to i8*
%6 = call double @modf(double %0, double* %3)
%7 = fmul double %6, 1.000000e+09
%8 = fptosi double %7 to i32
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i32 %8, i32* %9
%10 = load double, double* %3
%11 = fptosi double %10 to i32
%12 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i32 %11, i32* %12
%13 = call i32 @nanosleep(%struct.timespec* %2, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ next_token();
int /*<<< orphan*/ unget_token();
void peek_token() {
  next_token();
  unget_token();
}


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

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

LLVM IR (-O0):
define void @peek_token() {
%1 = call i32 (...) @next_token()
%2 = call i32 (...) @unget_token()
ret void
}

LLVM IR (-O2):
define void @peek_token() {
%1 = tail call i32 (...) @next_token()
%2 = tail call i32 (...) @unget_token()
ret void
}
/* Variables and functions */
void stub1(double, int);
void testClosureDIrV(void (*closure)(double, int), double a1, int a2) {
  if (closure != NULL)
    (*closure)(a1, a2);
}


x86 assembly (clang, -O0):
<testClosureDIrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     112d <testClosureDIrV+0x2d>
mov    -0x8(%rbp),%rax
movsd  -0x10(%rbp),%xmm0
mov    -0x14(%rbp),%edi
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureDIrV>:
test   %rdi,%rdi
je     110c <testClosureDIrV+0xc>
mov    %rdi,%rax
mov    %esi,%edi
jmp    *%rax
ret

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

LLVM IR (-O2):
define void @testClosureDIrV(void (double, i32)* %0, double %1, i32 %2) {
%4 = icmp eq void (double, i32)* %0, null
br i1 %4, label %6, label %5
5: ; preds = %3
tail call void %0(double %1, i32 %2)
br label %6
6: ; preds = %5, %3
ret void
}
/* Type definitions */
struct in_addr {
  int dummy;
};
struct hostent {
  scalar_t__ h_addr;
};

/* Variables and functions */
struct hostent *gethostbyname(char *);
scalar_t__ inet_ntoa(struct in_addr);
char *nslookup(char *addr) {
  struct hostent *h;
  if ((h = gethostbyname(addr)) == NULL) {
    return addr;
  }
  return (char *)inet_ntoa(*((struct in_addr *)h->h_addr));
}


x86 assembly (clang, -O0):
<nslookup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <gethostbyname@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1150 <nslookup+0x30>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1162 <nslookup+0x42>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%edi
call   1030 <inet_ntoa@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nslookup>:
push   %rbx
mov    %rdi,%rbx
call   1040 <gethostbyname@plt>
test   %rax,%rax
je     113b <nslookup+0x1b>
mov    (%rax),%rax
mov    (%rax),%edi
call   1030 <inet_ntoa@plt>
mov    %rax,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.hostent = type { i64 }
%struct.in_addr = type { i32 }
define i8* @nslookup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca %struct.hostent*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call %struct.hostent* @gethostbyname(i8* %5)
store %struct.hostent* %6, %struct.hostent** %4
%7 = icmp eq %struct.hostent* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i8*, i8** %3
store i8* %9, i8** %2
br label %19
10: ; preds = %1
%11 = load %struct.hostent*, %struct.hostent** %4
%12 = getelementptr inbounds %struct.hostent, %struct.hostent* %11, i32 0, i32 0
%13 = load i64, i64* %12
%14 = inttoptr i64 %13 to %struct.in_addr*
%15 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %14, i32 0, i32 0
%16 = load i32, i32* %15
%17 = call i64 @inet_ntoa(i32 %16)
%18 = inttoptr i64 %17 to i8*
store i8* %18, i8** %2
br label %19
19: ; preds = %10, %8
%20 = load i8*, i8** %2
ret i8* %20
}

LLVM IR (-O2):
%struct.hostent = type { i64 }
%struct.in_addr = type { i32 }
define i8* @nslookup(i8* %0) {
%2 = tail call %struct.hostent* @gethostbyname(i8* %0)
%3 = icmp eq %struct.hostent* %2, null
br i1 %3, label %12, label %4
4: ; preds = %1
%5 = getelementptr inbounds %struct.hostent, %struct.hostent* %2, i64 0, i32 0
%6 = load i64, i64* %5
%7 = inttoptr i64 %6 to %struct.in_addr*
%8 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %7, i64 0, i32 0
%9 = load i32, i32* %8
%10 = tail call i64 @inet_ntoa(i32 %9)
%11 = inttoptr i64 %10 to i8*
br label %12
12: ; preds = %1, %4
%13 = phi i8* [ %11, %4 ], [ %0, %1 ]
ret i8* %13
}
int sunxi_clk_disable_prepare(struct clk *clk) { return 0; }


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

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

LLVM IR (-O0):
%struct.clk = type opaque
define i32 @sunxi_clk_disable_prepare(%struct.clk* %0) {
%2 = alloca %struct.clk*
store %struct.clk* %0, %struct.clk** %2
ret i32 0
}

LLVM IR (-O2):
%struct.clk = type opaque
define i32 @sunxi_clk_disable_prepare(%struct.clk* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int strcmp(char *, char *);
int cmp(const void *v1, const void *v2) {
  return strcmp((char *)v1, (char *)v2);
}


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

x86 assembly (clang, -O2):
<cmp>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
double sqrt(double);
double SDL_sqrt(double x) { return sqrt(x); }


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

x86 assembly (clang, -O2):
<SDL_sqrt>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     111f <SDL_sqrt+0xf>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

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

LLVM IR (-O2):
define double @SDL_sqrt(double %0) {
%2 = tail call double @sqrt(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ LOG_DAEMON;
int /*<<< orphan*/ LOG_PID;
int /*<<< orphan*/ openlog(char const *, int /*<<< orphan*/,
                           int /*<<< orphan*/);
void log_Open(const char *Name) { openlog(Name, LOG_PID, LOG_DAEMON); }


x86 assembly (clang, -O0):
<log_Open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
mov    0x2eb8(%rip),%rax
mov    (%rax),%edx
call   1030 <openlog@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_Open>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
mov    0x2ec8(%rip),%rax
mov    (%rax),%edx
jmp    1030 <openlog@plt>

LLVM IR (-O0):
@LOG_PID = global i32 0
@LOG_DAEMON = global i32 0
define void @log_Open(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @LOG_PID
%5 = load i32, i32* @LOG_DAEMON
%6 = call i32 @openlog(i8* %3, i32 %4, i32 %5)
ret void
}

LLVM IR (-O2):
@LOG_PID = global i32 0
@LOG_DAEMON = global i32 0
define void @log_Open(i8* %0) {
%2 = load i32, i32* @LOG_PID
%3 = load i32, i32* @LOG_DAEMON
%4 = tail call i32 @openlog(i8* %0, i32 %2, i32 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ x;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(size_t *, int, int, int /*<<< orphan*/ *);
void DumpSize(size_t x, FILE *D) { fwrite(&x, sizeof(x), 1, D); }


x86 assembly (clang, -O0):
<DumpSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
lea    -0x8(%rbp),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DumpSize>:
push   %rax
mov    %rsi,%rcx
mov    %rdi,(%rsp)
mov    %rsp,%rdi
mov    $0x8,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @DumpSize(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 = call i32 @fwrite(i64* %3, i32 8, i32 1, i32* %5)
ret void
}

LLVM IR (-O2):
define void @DumpSize(i64 %0, i32* nocapture %1) {
%3 = alloca i64
store i64 %0, i64* %3
%4 = call i32 @fwrite(i64* %3, i32 8, i32 1, i32* %1)
ret void
}
int getAddress(int *entry) { return *(entry + 6); }


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

x86 assembly (clang, -O2):
<getAddress>:
mov    0x18(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @getAddress(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 6
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @getAddress(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 6
%3 = load i32, i32* %2
ret i32 %3
}
int lm_support_sanlock(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @lm_support_sanlock() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ pB(char *, ...);
void init_callstack(void) {
  pB("SInt32 callstack_head:R20;");
  pB("callstack_head = %d;", ((0x400000) - 0x30000));
}


x86 assembly (clang, -O0):
<init_callstack>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <pB@plt>
lea    0xef2(%rip),%rdi
mov    $0x3d0000,%esi
mov    $0x0,%al
call   1030 <pB@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_callstack>:
push   %rax
lea    0xee8(%rip),%rdi
xor    %eax,%eax
call   1030 <pB@plt>
lea    0xef5(%rip),%rdi
mov    $0x3d0000,%esi
xor    %eax,%eax
pop    %rcx
jmp    1030 <pB@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"SInt32 callstack_head:R20;\00"
@.str.1 = [21 x i8] c"callstack_head = %d;\00"
define void @init_callstack() {
%1 = call i32 (i8*, ...) @pB(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (i8*, ...) @pB(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 3997696)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"SInt32 callstack_head:R20;\00"
@.str.1 = [21 x i8] c"callstack_head = %d;\00"
define void @init_callstack() {
%1 = tail call i32 (i8*, ...) @pB(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @pB(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 3997696)
ret void
}
const char *ls_cost_nm7_name_out(int i) {
  switch (i) {
  case 0:
    return "o0";
  case 1:
    return "o1";
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<ls_cost_nm7_name_out>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     112b <ls_cost_nm7_name_out+0x2b>
jmp    111a <ls_cost_nm7_name_out+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     113b <ls_cost_nm7_name_out+0x3b>
jmp    114b <ls_cost_nm7_name_out+0x4b>
lea    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <ls_cost_nm7_name_out+0x53>
lea    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <ls_cost_nm7_name_out+0x53>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_cost_nm7_name_out>:
xor    %ecx,%ecx
cmp    $0x1,%edi
lea    0xef7(%rip),%rax
cmove  %rax,%rcx
test   %edi,%edi
lea    0xee7(%rip),%rax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"o0\00"
@.str.1 = [3 x i8] c"o1\00"
define i8* @ls_cost_nm7_name_out(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 0, label %5
i32 1, label %6
]
5: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
6: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* null, i8** %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [3 x i8] c"o0\00"
@.str.1 = [3 x i8] c"o1\00"
define i8* @ls_cost_nm7_name_out(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* null
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ attributes;
};
typedef TYPE_1__ XCharStruct;

/* Variables and functions */
unsigned short get_XCharStruct_attributes(void *_p) {
  return (unsigned short)((XCharStruct *)_p)->attributes;
}


x86 assembly (clang, -O0):
<get_XCharStruct_attributes>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_XCharStruct_attributes>:
movzwl (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define zeroext i16 @get_XCharStruct_attributes(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i16
ret i16 %7
}

LLVM IR (-O2):
define zeroext i16 @get_XCharStruct_attributes(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i16
ret i16 %4
}
/* Variables and functions */
char tolower(unsigned char);
void StrToLowerCase(char *sPtr) {
  while (*sPtr != '\0') {
    *sPtr = tolower((unsigned char)*sPtr);
    ++sPtr;
  }
}


x86 assembly (clang, -O0):
<StrToLowerCase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1151 <StrToLowerCase+0x41>
mov    -0x8(%rbp),%rax
movzbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <StrToLowerCase+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StrToLowerCase>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1136 <StrToLowerCase+0x26>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movzbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <StrToLowerCase+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @StrToLowerCase(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @tolower(i8 zeroext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void __dispose(void *ptr) { free(ptr); }


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

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

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

LLVM IR (-O2):
define void @__dispose(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ delay_wait_us(unsigned char);
void delay_wait_us_ms(unsigned char timeout) { delay_wait_us(timeout * 1000); }


x86 assembly (clang, -O0):
<delay_wait_us_ms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
imul   $0x3e8,%eax,%eax
movzbl %al,%edi
call   1030 <delay_wait_us@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay_wait_us_ms>:
shl    $0x3,%edi
lea    (%rdi,%rdi,2),%eax
neg    %eax
movzbl %al,%edi
jmp    1030 <delay_wait_us@plt>

LLVM IR (-O0):
define void @delay_wait_us_ms(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = mul nsw i32 %4, 1000
%6 = trunc i32 %5 to i8
%7 = call i32 @delay_wait_us(i8 zeroext %6)
ret void
}

LLVM IR (-O2):
define void @delay_wait_us_ms(i8 zeroext %0) {
%2 = mul i8 %0, -24
%3 = tail call i32 @delay_wait_us(i8 zeroext %2)
ret void
}
void hdd_nan_datapath_target_config(struct hdd_context_s *hdd_ctx,
                                    struct hdd_tgt_cfg *cfg) {}


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

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

LLVM IR (-O0):
%struct.hdd_context_s = type opaque
%struct.hdd_tgt_cfg = type opaque
define void @hdd_nan_datapath_target_config(%struct.hdd_context_s* %0, %struct.hdd_tgt_cfg* %1) {
%3 = alloca %struct.hdd_context_s*
%4 = alloca %struct.hdd_tgt_cfg*
store %struct.hdd_context_s* %0, %struct.hdd_context_s** %3
store %struct.hdd_tgt_cfg* %1, %struct.hdd_tgt_cfg** %4
ret void
}

LLVM IR (-O2):
%struct.hdd_context_s = type opaque
%struct.hdd_tgt_cfg = type opaque
define void @hdd_nan_datapath_target_config(%struct.hdd_context_s* nocapture %0, %struct.hdd_tgt_cfg* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ BLE_IoBusAclDataTxAck();
void HW_IPCC_BLE_AclDataAckNot(void) {
  BLE_IoBusAclDataTxAck();
  return;
}


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

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

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

LLVM IR (-O2):
define void @HW_IPCC_BLE_AclDataAckNot() {
%1 = tail call i32 (...) @BLE_IoBusAclDataTxAck()
ret void
}
/* Variables and functions */
int errno;
int get_errno() { return errno; }


x86 assembly (clang, -O0):
<get_errno>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_errno>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @get_errno() {
%1 = load i32, i32* @errno
ret i32 %1
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @get_errno() {
%1 = load i32, i32* @errno
ret i32 %1
}
void engine_load_rdrand_int(void) {}


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

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

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

LLVM IR (-O2):
define void @engine_load_rdrand_int() {
ret void
}
void free_2d_char(char **p) {
  free(p[0]);
  free(p);
}


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

x86 assembly (clang, -O2):
<free_2d_char>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_2d_char(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = getelementptr inbounds i8*, i8** %3, i64 0
%5 = load i8*, i8** %4
%6 = load i8**, i8*** %2
%7 = bitcast i8** %6 to i8*
ret void
}

LLVM IR (-O2):
define void @free_2d_char(i8** nocapture %0) {
%2 = load i8*, i8** %0
tail call void @free(i8* %2)
%3 = bitcast i8** %0 to i8*
tail call void @free(i8* %3)
ret void
}
extern __attribute__((gnu_)) int carmen_imin(int val1, int val2) {
  if (val2 < val1)
    return val2;
  return val1;
}


x86 assembly (clang, -O0):
<carmen_imin>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <carmen_imin+0x21>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <carmen_imin+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<carmen_imin>:
mov    %edi,%eax
cmp    %edi,%esi
cmovl  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @carmen_imin(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, %0
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
int PAPI_set_cmp_granularity(int, int);
void papif_set_cmp_granularity_(int *granularity, int *cidx, int *check) {
  *check = PAPI_set_cmp_granularity(*granularity, *cidx);
}


x86 assembly (clang, -O0):
<papif_set_cmp_granularity_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
call   1030 <PAPI_set_cmp_granularity@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<papif_set_cmp_granularity_>:
push   %rbx
mov    %rdx,%rbx
mov    (%rdi),%edi
mov    (%rsi),%esi
call   1030 <PAPI_set_cmp_granularity@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @papif_set_cmp_granularity_(i32* nocapture %0, i32* nocapture %1, i32* nocapture writeonly %2) {
%4 = load i32, i32* %0
%5 = load i32, i32* %1
%6 = tail call i32 @PAPI_set_cmp_granularity(i32 %4, i32 %5)
store i32 %6, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, long long);
void f1(int x, long long y) { printf("f1: %d %lld\n", x, y); }


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
mov    %rsi,%rdx
mov    %edi,%esi
lea    0xee4(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [13 x i8] c"f1: %d %lld\0A\00"
define void @f1(i32 %0, i64 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %0, i64 %1)
ret void
}