xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ clock_hi();
int /*<<< orphan*/ data_hi();
void idle(void) {
  clock_hi();
  data_hi();
}


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

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

LLVM IR (-O0):
define void @idle() {
%1 = call i32 (...) @clock_hi()
%2 = call i32 (...) @data_hi()
ret void
}

LLVM IR (-O2):
define void @idle() {
%1 = tail call i32 (...) @clock_hi()
%2 = tail call i32 (...) @data_hi()
ret void
}
char *conversor_string(void *dados) { return (char *)dados; }


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

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

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

LLVM IR (-O2):
define i8* @conversor_string(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
void curses_cleanup(void *opaque) { endwin(); }


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

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

LLVM IR (-O0):
define void @curses_cleanup(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @endwin()
ret void
}

LLVM IR (-O2):
define void @curses_cleanup(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @endwin()
ret void
}
int noStack() {
  int a = 3 + 4;
  return a;
}


x86 assembly (clang, -O0):
<noStack>:
push   %rbp
mov    %rsp,%rbp
movl   $0x7,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @noStack() {
ret i32 7
}
char *sha384base64(bitstr, bitcnt)
unsigned char *bitstr;
unsigned long bitcnt;
{ return ((char *)shacomp(384, 3, bitstr, bitcnt)); }


x86 assembly (clang, -O0):
<sha384base64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    $0x180,%edi
mov    $0x3,%esi
mov    $0x0,%al
call   1030 <shacomp@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sha384base64>:
push   %rax
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    $0x180,%edi
mov    $0x3,%esi
xor    %eax,%eax
call   1030 <shacomp@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i8* @sha384base64(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i32 (i32, i32, i8*, i64, ...) bitcast (i32 (...)* @shacomp to i32 (i32, i32, i8*, i64, ...)*)(i32 384, i32 3, i8* %5, i64 %6)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
ret i8* %9
}

LLVM IR (-O2):
define i8* @sha384base64(i8* %0, i64 %1) {
%3 = tail call i32 (i32, i32, i8*, i64, ...) bitcast (i32 (...)* @shacomp to i32 (i32, i32, i8*, i64, ...)*)(i32 384, i32 3, i8* %0, i64 %1)
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int rec_eukl(int, int);
int /*<<< orphan*/ system(char *);
int main() {
  int result;
  result = rec_eukl(4, 8);
  printf("%d\n", result);
  system("pause");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
mov    $0x8,%esi
call   1050 <rec_eukl@plt>
lea    0xeb9(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
lea    0xeaf(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = tail call i32 @rec_eukl(i32 4, i32 8)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
char pathSeparator() { return ':'; }


x86 assembly (clang, -O0):
<pathSeparator>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3a,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathSeparator>:
mov    $0x3a,%al
ret

LLVM IR (-O0):
define signext i8 @pathSeparator() {
ret i8 58
}

LLVM IR (-O2):
define signext i8 @pathSeparator() {
ret i8 58
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int a;
  printf("Soma de valores\n");
  scanf("%d", &a);
  printf("\n O resultado %d", a + a);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed9(%rip),%rdi
call   1030 <puts@plt>
lea    0xeca(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%esi
add    %esi,%esi
lea    0xea5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Soma de valores\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [17 x i8] c"\0A O resultado %d\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = load i32, i32* %1
%6 = add nsw i32 %4, %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [17 x i8] c"\0A O resultado %d\00"
@str = [16 x i8] c"Soma de valores\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = shl nsw i32 %5, 1
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
unsigned long long unsignedlonglong_ignoring_longint(unsigned long long x,
                                                     long int y) {
  return x;
}


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

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

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

LLVM IR (-O2):
define i64 @unsignedlonglong_ignoring_longint(i64 returned %0, i64 %1) {
ret i64 %0
}
void glLightfv(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glLightfv() {
ret void
}
int ordering_lossy_gt_1(void) {
  return ((int)-(((int)-(
      ((int)0x37EF) << (8 * (((!!(((!!(sizeof(int))) * ((sizeof(int)) - 1)))) *
                              ((((!!(sizeof(int))) * ((sizeof(int)) - 1))) -
                               1))))))));
}


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

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

LLVM IR (-O0):
define i32 @ordering_lossy_gt_1() {
ret i32 938409984
}

LLVM IR (-O2):
define i32 @ordering_lossy_gt_1() {
ret i32 938409984
}
/* Variables and functions */
scalar_t__ M_PI;
float deg2rad(float deg) { return deg / 360.0f * 2.0f * (float)M_PI; }


x86 assembly (clang, -O0):
<deg2rad>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeee(%rip),%xmm1
divss  %xmm1,%xmm0
movss  0xede(%rip),%xmm1
mulss  %xmm1,%xmm0
mov    0x2ebb(%rip),%rax
cvtsi2ssq (%rax),%xmm1
mulss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<deg2rad>:
divss  0xef8(%rip),%xmm0
addss  %xmm0,%xmm0
mov    0x2ed5(%rip),%rax
cvtsi2ssq (%rax),%xmm1
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
@M_PI = global i64 0
define float @deg2rad(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fdiv float %3, 3.600000e+02
%5 = fmul float %4, 2.000000e+00
%6 = load i64, i64* @M_PI
%7 = sitofp i64 %6 to float
%8 = fmul float %5, %7
ret float %8
}

LLVM IR (-O2):
@M_PI = global i64 0
define float @deg2rad(float %0) {
%2 = fdiv float %0, 3.600000e+02
%3 = fmul float %2, 2.000000e+00
%4 = load i64, i64* @M_PI
%5 = sitofp i64 %4 to float
%6 = fmul float %3, %5
ret float %6
}
/* Variables and functions */
unsigned int WordToHost(unsigned int);
unsigned int WordToMachine(unsigned int word) { return WordToHost(word); }


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

x86 assembly (clang, -O2):
<WordToMachine>:
jmp    1030 <WordToHost@plt>

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

LLVM IR (-O2):
define i32 @WordToMachine(i32 %0) {
%2 = tail call i32 @WordToHost(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ test_bool();
int /*<<< orphan*/ test_float();
int main() {
  test_bool();
  test_float();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <test_bool@plt>
mov    $0x0,%al
call   1040 <test_float@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_bool@plt>
xor    %eax,%eax
call   1040 <test_float@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_bool()
%3 = call i32 (...) @test_float()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_bool()
%2 = tail call i32 (...) @test_float()
ret i32 0
}
void BinaryOperator(float f, double d, long double ld) {
  f = f * d;
  f = d * f;
  f = f * ld;
  f = ld * f;
  d = d * ld;
  d = ld * d;
}


x86 assembly (clang, -O0):
<BinaryOperator>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
movss  %xmm0,-0x4(%rbp)
movsd  %xmm1,-0x10(%rbp)
fstpt  -0x20(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movsd  -0x10(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
flds   -0x4(%rbp)
fldt   -0x20(%rbp)
fmulp  %st,%st(1)
fstps  -0x4(%rbp)
fldt   -0x20(%rbp)
flds   -0x4(%rbp)
fmulp  %st,%st(1)
fstps  -0x4(%rbp)
fldl   -0x10(%rbp)
fldt   -0x20(%rbp)
fmulp  %st,%st(1)
fstpl  -0x10(%rbp)
fldt   -0x20(%rbp)
fldl   -0x10(%rbp)
fmulp  %st,%st(1)
fstpl  -0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @BinaryOperator(float %0, double %1, x86_fp80 %2) {
%4 = alloca float
%5 = alloca double
%6 = alloca x86_fp80
store float %0, float* %4
store double %1, double* %5
store x86_fp80 %2, x86_fp80* %6
%7 = load float, float* %4
%8 = fpext float %7 to double
%9 = load double, double* %5
%10 = fmul double %8, %9
%11 = fptrunc double %10 to float
store float %11, float* %4
%12 = load double, double* %5
%13 = load float, float* %4
%14 = fpext float %13 to double
%15 = fmul double %12, %14
%16 = fptrunc double %15 to float
store float %16, float* %4
%17 = load float, float* %4
%18 = fpext float %17 to x86_fp80
%19 = load x86_fp80, x86_fp80* %6
%20 = fmul x86_fp80 %18, %19
%21 = fptrunc x86_fp80 %20 to float
store float %21, float* %4
%22 = load x86_fp80, x86_fp80* %6
%23 = load float, float* %4
%24 = fpext float %23 to x86_fp80
%25 = fmul x86_fp80 %22, %24
%26 = fptrunc x86_fp80 %25 to float
store float %26, float* %4
%27 = load double, double* %5
%28 = fpext double %27 to x86_fp80
%29 = load x86_fp80, x86_fp80* %6
%30 = fmul x86_fp80 %28, %29
%31 = fptrunc x86_fp80 %30 to double
store double %31, double* %5
%32 = load x86_fp80, x86_fp80* %6
%33 = load double, double* %5
%34 = fpext double %33 to x86_fp80
%35 = fmul x86_fp80 %32, %34
%36 = fptrunc x86_fp80 %35 to double
store double %36, double* %5
ret void
}

LLVM IR (-O2):
define void @BinaryOperator(float %0, double %1, x86_fp80 %2) {
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ matrix_multiply_ext(float const *, float const *, float *);
float *matrix_multiply_new(const float matrix1[4 * 4],
                           const float matrix2[4 * 4]) {
  float *matrix_out = (float *)malloc(sizeof(float) * 4);
  matrix_multiply_ext(matrix1, matrix2, matrix_out);
  return matrix_out;
}


x86 assembly (clang, -O0):
<matrix_multiply_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x10,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <matrix_multiply_ext@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matrix_multiply_new>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    $0x10,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rax,%rdx
call   1040 <matrix_multiply_ext@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define float* @matrix_multiply_new(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
%5 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%6 = call i64 @malloc(i32 16)
%7 = inttoptr i64 %6 to float*
store float* %7, float** %5
%8 = load float*, float** %3
%9 = load float*, float** %4
%10 = load float*, float** %5
%11 = call i32 @matrix_multiply_ext(float* %8, float* %9, float* %10)
%12 = load float*, float** %5
ret float* %12
}

LLVM IR (-O2):
define float* @matrix_multiply_new(float* %0, float* %1) {
%3 = tail call i64 @malloc(i32 16)
%4 = inttoptr i64 %3 to float*
%5 = tail call i32 @matrix_multiply_ext(float* %0, float* %1, float* %4)
ret float* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int n = 10;
  printf("%d\n", n);
  char cc = 'a';
  char *ptr = &cc;
  printf("%c\n", *ptr);
  int *c = &n;
  printf("%d\n", *c);
  int r;
  r = 0;
  return r;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
movb   $0x61,-0x9(%rbp)
lea    -0x9(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%esi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
lea    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
mov    $0x61,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
store i8 97, i8* %3
store i8* %3, i8** %4
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %11)
store i32* %2, i32** %5
%13 = load i32*, i32** %5
%14 = load i32, i32* %13
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %14)
store i32 0, i32* %6
%16 = load i32, i32* %6
ret i32 %16
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 97)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 10)
ret i32 0
}
void pcp_def_pwr_fan_metrics(struct activity *a) {}


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

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

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

LLVM IR (-O2):
%struct.activity = type opaque
define void @pcp_def_pwr_fan_metrics(%struct.activity* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ OPENSSL_LH_DOALL_FUNCARG;
typedef int /*<<< orphan*/ OPENSSL_LH_DOALL_FUNC;
typedef int /*<<< orphan*/ OPENSSL_LHASH;

/* Variables and functions */
int /*<<< orphan*/ doall_util_fn(int /*<<< orphan*/ *, int, int /*<<< orphan*/,
                                 int /*<<< orphan*/, void *);
void OPENSSL_LH_doall_arg(OPENSSL_LHASH *lh, OPENSSL_LH_DOALL_FUNCARG func,
                          void *arg) {
  doall_util_fn(lh, 1, (OPENSSL_LH_DOALL_FUNC)0, func, arg);
}


x86 assembly (clang, -O0):
<OPENSSL_LH_doall_arg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%r8
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <doall_util_fn@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OPENSSL_LH_doall_arg>:
mov    %rdx,%r8
mov    %esi,%ecx
mov    $0x1,%esi
xor    %edx,%edx
jmp    1030 <doall_util_fn@plt>

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

LLVM IR (-O2):
define void @OPENSSL_LH_doall_arg(i32* %0, i32 %1, i8* %2) {
%4 = tail call i32 @doall_util_fn(i32* %0, i32 1, i32 0, i32 %1, i8* %2)
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_bool();
int /*<<< orphan*/ free(int *);
int *malloc(int);
int main() {
  bool selector = __VERIFIER_nondet_bool();
  int *ptr = NULL;
  if (!selector) {
    ptr = malloc(sizeof(int));
  }
  if (!selector) {
    *ptr = 666;
    free(ptr);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_bool@plt>
mov    %eax,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1169 <main+0x39>
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1186 <main+0x56>
mov    -0x10(%rbp),%rax
movl   $0x29a,(%rax)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_bool@plt>
test   %eax,%eax
jne    1154 <main+0x24>
mov    $0x4,%edi
call   1050 <malloc@plt>
movl   $0x29a,(%rax)
mov    %rax,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32 0, i32* %1
%4 = call i32 (...) @__VERIFIER_nondet_bool()
store i32 %4, i32* %2
store i32* null, i32** %3
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %0
%8 = call i32* @malloc(i32 4)
store i32* %8, i32** %3
br label %9
9: ; preds = %7, %0
%10 = load i32, i32* %2
%11 = icmp ne i32 %10, 0
br i1 %11, label %16, label %12
12: ; preds = %9
%13 = load i32*, i32** %3
store i32 666, i32* %13
%14 = load i32*, i32** %3
%15 = call i32 @free(i32* %14)
br label %16
16: ; preds = %12, %9
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_bool()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32* @malloc(i32 4)
store i32 666, i32* %4
%5 = tail call i32 @free(i32* %4)
br label %6
6: ; preds = %0, %3
ret i32 0
}
float scale_midi_to_f(unsigned char data) { return 0.0078f * (float)data; }


x86 assembly (clang, -O0):
<scale_midi_to_f>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cvtsi2ss %eax,%xmm1
movss  0xee6(%rip),%xmm0
mulss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<scale_midi_to_f>:
cvtsi2ss %edi,%xmm0
mulss  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define float @scale_midi_to_f(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = uitofp i8 %3 to float
%5 = fmul float 0x3F7FF2E480000000, %4
ret float %5
}

LLVM IR (-O2):
define float @scale_midi_to_f(i8 zeroext %0) {
%2 = uitofp i8 %0 to float
%3 = fmul float %2, 0x3F7FF2E480000000
ret float %3
}
char directiontochar(int direction) {
  switch (direction) {
  case 0:
    return 'l';
  case 1:
    return 'u';
  case 2:
    return 'r';
  case 3:
    return 'd';
  case 5:
    return 's';
  case 6:
    return 'w';
  case 4:
    return 'n';
  default:
    return '?';
  }
}


x86 assembly (clang, -O0):
<directiontochar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x6,%rax
ja     116b <directiontochar+0x6b>
mov    -0x10(%rbp),%rax
lea    0xedd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x6c,-0x1(%rbp)
jmp    116f <directiontochar+0x6f>
movb   $0x75,-0x1(%rbp)
jmp    116f <directiontochar+0x6f>
movb   $0x72,-0x1(%rbp)
jmp    116f <directiontochar+0x6f>
movb   $0x64,-0x1(%rbp)
jmp    116f <directiontochar+0x6f>
movb   $0x73,-0x1(%rbp)
jmp    116f <directiontochar+0x6f>
movb   $0x77,-0x1(%rbp)
jmp    116f <directiontochar+0x6f>
movb   $0x6e,-0x1(%rbp)
jmp    116f <directiontochar+0x6f>
movb   $0x3f,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<directiontochar>:
lea    0x0(,%rdi,8),%ecx
movabs $0x77736e6472756c,%rdx
shr    %cl,%rdx
cmp    $0x7,%edi
mov    $0x3f,%eax
cmovb  %edx,%eax
ret

LLVM IR (-O0):
define signext i8 @directiontochar(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %12 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
i32 3, label %8
i32 5, label %9
i32 6, label %10
i32 4, label %11
]
5: ; preds = %1
store i8 108, i8* %2
br label %13
6: ; preds = %1
store i8 117, i8* %2
br label %13
7: ; preds = %1
store i8 114, i8* %2
br label %13
8: ; preds = %1
store i8 100, i8* %2
br label %13
9: ; preds = %1
store i8 115, i8* %2
br label %13
10: ; preds = %1
store i8 119, i8* %2
br label %13
11: ; preds = %1
store i8 110, i8* %2
br label %13
12: ; preds = %1
store i8 63, i8* %2
br label %13
13: ; preds = %12, %11, %10, %9, %8, %7, %6, %5
%14 = load i8, i8* %2
ret i8 %14
}

LLVM IR (-O2):
define signext i8 @directiontochar(i32 %0) {
%2 = icmp ult i32 %0, 7
%3 = zext i32 %0 to i56
%4 = shl nuw nsw i56 %3, 3
%5 = lshr i56 33622440197387628, %4
%6 = trunc i56 %5 to i8
%7 = select i1 %2, i8 %6, i8 63
ret i8 %7
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ error_reason(char *, unsigned long long);
void *misc_calloc(size_t n, size_t size) {
  void *result;
  result = calloc(n, size);
  if (result == NULL) {
    error_reason("Could not allocate %lld bytes of memory",
                 (unsigned long long)n * (unsigned long long)size);
  }
  return result;
}


x86 assembly (clang, -O0):
<misc_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1161 <misc_calloc+0x41>
mov    -0x8(%rbp),%rsi
imul   -0x10(%rbp),%rsi
lea    0xea4(%rip),%rdi
call   1030 <error_reason@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<misc_calloc>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1040 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114b <misc_calloc+0x2b>
imul   %r15,%r14
lea    0xebd(%rip),%rdi
mov    %r14,%rsi
call   1030 <error_reason@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [40 x i8] c"Could not allocate %lld bytes of memory\00"
define i8* @misc_calloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i64, i64* %3
%13 = load i64, i64* %4
%14 = mul i64 %12, %13
%15 = call i32 @error_reason(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i64 %14)
br label %16
16: ; preds = %11, %2
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
@.str = [40 x i8] c"Could not allocate %lld bytes of memory\00"
define noalias i8* @misc_calloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = mul i64 %1, %0
%7 = tail call i32 @error_reason(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i64 %6)
br label %8
8: ; preds = %5, %2
ret i8* %3
}
int XGetWMClientMachine() {}


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

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

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

LLVM IR (-O2):
define i32 @XGetWMClientMachine() {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(int /*<<< orphan*/, int /*<<< orphan*/ *);
size_t fwrite(const void *ptr, size_t size, size_t count, FILE *file) {
  size_t left = size * count;
  const char *out = ptr;
  while (left--)
    fputc(*out++, file);
  return count;
}


x86 assembly (clang, -O0):
<fwrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
imul   -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x28(%rbp)
cmp    $0x0,%rax
je     1176 <fwrite+0x66>
mov    -0x30(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x30(%rbp)
movsbl (%rax),%edi
mov    -0x20(%rbp),%rsi
call   1030 <fputc@plt>
jmp    113d <fwrite+0x2d>
mov    -0x18(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fwrite>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r13
imul   %rdx,%r13
test   %r13,%r13
je     1146 <fwrite+0x36>
mov    %rcx,%r15
mov    %rdi,%r12
xor    %ebx,%ebx
movsbl (%r12,%rbx,1),%edi
mov    %r15,%rsi
call   1030 <fputc@plt>
add    $0x1,%rbx
cmp    %rbx,%r13
jne    1130 <fwrite+0x20>
mov    %r14,%rax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i64 @fwrite(i8* nocapture %0, i64 %1, i64 returned %2, i32* nocapture %3) {
%5 = mul i64 %2, %1
%6 = icmp eq i64 %5, 0
br i1 %6, label %16, label %7
7: ; preds = %4, %7
%8 = phi i8* [ %11, %7 ], [ %0, %4 ]
%9 = phi i64 [ %10, %7 ], [ %5, %4 ]
%10 = add i64 %9, -1
%11 = getelementptr inbounds i8, i8* %8, i64 1
%12 = load i8, i8* %8
%13 = sext i8 %12 to i32
%14 = tail call i32 @fputc(i32 %13, i32* %3)
%15 = icmp eq i64 %10, 0
br i1 %15, label %16, label %7
16: ; preds = %7, %4
ret i64 %2
}
int main(int argc, char **argv) { ; }


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printk(char *, char *, unsigned int, char *, char *);
void assert_fail(char *exp, char *file, unsigned int line, char *func) {
  printk("%s:%d: %s: Assertion \'%s\' failed.\n", file, line, func, exp);
  while (1)
    ;
}


x86 assembly (clang, -O0):
<assert_fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%r8
lea    0xec3(%rip),%rdi
call   1030 <printk@plt>
jmp    1142 <assert_fail+0x32>

x86 assembly (clang, -O2):
<assert_fail>:
push   %rax
mov    %rdi,%r8
lea    0xee5(%rip),%rdi
call   1030 <printk@plt>
jmp    1120 <assert_fail+0x10>

LLVM IR (-O0):
@.str = [35 x i8] c"%s:%d: %s: Assertion '%s' failed.\0A\00"
define void @assert_fail(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i8*, i8** %6
%10 = load i32, i32* %7
%11 = load i8*, i8** %8
%12 = load i8*, i8** %5
%13 = call i32 @printk(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %9, i32 %10, i8* %11, i8* %12)
br label %14
14: ; preds = %4, %14
br label %14
}

LLVM IR (-O2):
@.str = [35 x i8] c"%s:%d: %s: Assertion '%s' failed.\0A\00"
define void @assert_fail(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = tail call i32 @printk(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2, i8* %3, i8* %0)
br label %6
6: ; preds = %4, %6
br label %6
}
int check_int128() { return sizeof(__int128); }


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

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

LLVM IR (-O0):
define i32 @check_int128() {
ret i32 16
}

LLVM IR (-O2):
define i32 @check_int128() {
ret i32 16
}
/* Type definitions */
typedef int off_t;

/* Variables and functions */
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int sendfile(int, int, int *, int);
int main() {
  int fd = open("havesendfile.c", 0);
  off_t o = 0;
  off_t r = sendfile(1, fd, &o, 23);
  if (r != -1)
    printf("sent %llu bytes.\n", r);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
xor    %esi,%esi
call   1050 <open@plt>
mov    %eax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    $0x1,%edi
lea    -0xc(%rbp),%rdx
mov    $0x17,%ecx
call   1040 <sendfile@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0xffffffff,-0x10(%rbp)
je     1189 <main+0x59>
mov    -0x10(%rbp),%esi
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %esi,%esi
call   1050 <open@plt>
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rdx
mov    $0x1,%edi
mov    %eax,%esi
mov    $0x17,%ecx
call   1040 <sendfile@plt>
cmp    $0xffffffff,%eax
je     1170 <main+0x40>
lea    0xea6(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"havesendfile.c\00"
@.str.1 = [18 x i8] c"sent %llu bytes.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = tail call i32 @open(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 0)
%3 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%4 = call i32 @sendfile(i32 1, i32 %2, i32* %1, i32 23)
%5 = icmp eq i32 %4, -1
br i1 %5, label %8, label %6
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %4)
br label %8
8: ; preds = %6, %0
ret i32 0
}
/* Variables and functions */
int bar3(int *, int, int *);
int f6c(int *p, int *q) { return !p ? bar3(q, 2, p) : bar3(p, 2, q); }


x86 assembly (clang, -O0):
<f6c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1145 <f6c+0x35>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x2,%esi
call   1030 <bar3@plt>
mov    %eax,-0x14(%rbp)
jmp    115a <f6c+0x4a>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x2,%esi
call   1030 <bar3@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f6c>:
mov    %rsi,%rdx
test   %rdi,%rdi
je     1122 <f6c+0x12>
mov    $0x2,%esi
jmp    1030 <bar3@plt>
mov    %rdx,%rdi
mov    $0x2,%esi
xor    %edx,%edx
jmp    1030 <bar3@plt>

LLVM IR (-O0):
define i32 @f6c(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 = icmp ne i32* %5, null
br i1 %6, label %11, label %7
7: ; preds = %2
%8 = load i32*, i32** %4
%9 = load i32*, i32** %3
%10 = call i32 @bar3(i32* %8, i32 2, i32* %9)
br label %15
11: ; preds = %2
%12 = load i32*, i32** %3
%13 = load i32*, i32** %4
%14 = call i32 @bar3(i32* %12, i32 2, i32* %13)
br label %15
15: ; preds = %11, %7
%16 = phi i32 [ %10, %7 ], [ %14, %11 ]
ret i32 %16
}

LLVM IR (-O2):
define i32 @f6c(i32* %0, i32* %1) {
%3 = icmp eq i32* %0, null
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @bar3(i32* %1, i32 2, i32* null)
br label %8
6: ; preds = %2
%7 = tail call i32 @bar3(i32* %0, i32 2, i32* %1)
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ %5, %4 ], [ %7, %6 ]
ret i32 %9
}
int erdIsDigit(char c) { return (c >= '0' && c <= '9'); }


x86 assembly (clang, -O0):
<erdIsDigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <erdIsDigit+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<erdIsDigit>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @erdIsDigit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @erdIsDigit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
scalar_t__ endst();
int /*<<< orphan*/ expression();
int /*<<< orphan*/ modstk(int /*<<< orphan*/);
int /*<<< orphan*/ ret();
doreturn() {
  if (endst() == 0)
    expression();
  modstk(0);
  ret();
}


x86 assembly (clang, -O0):
<doreturn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <endst@plt>
cmp    $0x0,%rax
jne    1160 <doreturn+0x20>
mov    $0x0,%al
call   1040 <expression@plt>
xor    %edi,%edi
call   1050 <modstk@plt>
mov    $0x0,%al
call   1030 <ret@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doreturn>:
push   %rax
xor    %eax,%eax
call   1060 <endst@plt>
test   %rax,%rax
jne    1154 <doreturn+0x14>
xor    %eax,%eax
call   1040 <expression@plt>
xor    %edi,%edi
call   1050 <modstk@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <ret@plt>

LLVM IR (-O0):
define i32 @doreturn() {
%1 = alloca i32
%2 = call i64 (...) @endst()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @expression()
br label %6
6: ; preds = %4, %0
%7 = call i32 @modstk(i32 0)
%8 = call i32 (...) @ret()
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @doreturn() {
%1 = tail call i64 (...) @endst()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @expression()
br label %5
5: ; preds = %3, %0
%6 = tail call i32 @modstk(i32 0)
%7 = tail call i32 (...) @ret()
ret i32 undef
}
/* Variables and functions */
int sin(float);
float tcsc(float a) { return (1 / sin(a)); }


x86 assembly (clang, -O0):
<tcsc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sin@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcsc>:
push   %rax
call   1030 <sin@plt>
lea    0x1(%rax),%ecx
xor    %edx,%edx
cmp    $0x3,%ecx
cmovb  %eax,%edx
xorps  %xmm0,%xmm0
cvtsi2ss %edx,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @tcsc(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i32 @sin(float %3)
%5 = sdiv i32 1, %4
%6 = sitofp i32 %5 to float
ret float %6
}

LLVM IR (-O2):
define float @tcsc(float %0) {
%2 = tail call i32 @sin(float %0)
%3 = add i32 %2, 1
%4 = icmp ult i32 %3, 3
%5 = select i1 %4, i32 %2, i32 0
%6 = sitofp i32 %5 to float
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ non_fatal(char *, char *);
void pragendm() { non_fatal("\"#pragma endmacro\" illegal outside macro", ""); }


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

x86 assembly (clang, -O2):
<pragendm>:
lea    0xee9(%rip),%rdi
lea    0xf0a(%rip),%rsi
jmp    1030 <non_fatal@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"\22#pragma endmacro\22 illegal outside macro\00"
@.str.1 = [1 x i8] zeroinitializer
define void @pragendm() {
%1 = call i32 @non_fatal(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"\22#pragma endmacro\22 illegal outside macro\00"
@.str.1 = [1 x i8] zeroinitializer
define void @pragendm() {
%1 = tail call i32 @non_fatal(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int bar(int *p) {
  int x = p[0] + p[1];
  return x;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
add    0x4(%rcx),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
mov    0x4(%rdi),%eax
add    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @bar(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 0
%6 = load i32, i32* %5
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
%10 = add nsw i32 %6, %9
store i32 %10, i32* %3
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @bar(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = add nsw i32 %4, %2
ret i32 %5
}
/* Type definitions */
struct VAL_cell {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ VAL_cell_recursive_print(struct VAL_cell *);
void VAL_cell_repr(struct VAL_cell *self) { VAL_cell_recursive_print(self); }


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

x86 assembly (clang, -O2):
<VAL_cell_repr>:
jmp    1030 <VAL_cell_recursive_print@plt>

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

LLVM IR (-O2):
%struct.VAL_cell = type { i32 }
define void @VAL_cell_repr(%struct.VAL_cell* %0) {
%2 = tail call i32 @VAL_cell_recursive_print(%struct.VAL_cell* %0)
ret void
}
/* Variables and functions */
int sqrt(double);
double invsqrt(double x) { return 1. / sqrt(x); }


x86 assembly (clang, -O0):
<invsqrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sqrt@plt>
cvtsi2sd %eax,%xmm1
movsd  0xecd(%rip),%xmm0
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<invsqrt>:
push   %rax
call   1030 <sqrt@plt>
cvtsi2sd %eax,%xmm1
movsd  0xede(%rip),%xmm0
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @invsqrt(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @sqrt(double %3)
%5 = sitofp i32 %4 to double
%6 = fdiv double 1.000000e+00, %5
ret double %6
}

LLVM IR (-O2):
define double @invsqrt(double %0) {
%2 = tail call i32 @sqrt(double %0)
%3 = sitofp i32 %2 to double
%4 = fdiv double 1.000000e+00, %3
ret double %4
}
/* Variables and functions */
bool audio_close(void *UNUSED_handle __attribute__((__unused__))) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @audio_close(i8* nocapture readnone %0) {
ret i32 0
}
void UARTWakeUpConfig(unsigned long ulBase, unsigned long ulWakeup) {
  ;
  ;
  (*((volatile unsigned long *)(ulBase + 0x0000000C))) &= ~0x00000800;
  (*((volatile unsigned long *)(ulBase + 0x0000000C))) |= ulWakeup;
}


x86 assembly (clang, -O0):
<UARTWakeUpConfig>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%rcx
and    $0xfffffffffffff7ff,%rcx
mov    %rcx,0xc(%rax)
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%rcx
or     %rdx,%rcx
mov    %rcx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTWakeUpConfig>:
andq   $0xfffffffffffff7ff,0xc(%rdi)
ff
or     %rsi,0xc(%rdi)
ret

LLVM IR (-O0):
define void @UARTWakeUpConfig(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = add i64 %5, 12
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = and i64 %8, -2049
store volatile i64 %9, i64* %7
%10 = load i64, i64* %4
%11 = load i64, i64* %3
%12 = add i64 %11, 12
%13 = inttoptr i64 %12 to i64*
%14 = load volatile i64, i64* %13
%15 = or i64 %14, %10
store volatile i64 %15, i64* %13
ret void
}

LLVM IR (-O2):
define void @UARTWakeUpConfig(i64 %0, i64 %1) {
%3 = add i64 %0, 12
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
%6 = and i64 %5, -2049
store volatile i64 %6, i64* %4
%7 = load volatile i64, i64* %4
%8 = or i64 %7, %1
store volatile i64 %8, i64* %4
ret void
}
void stream_keep_disk_active(void) {}


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

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

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

LLVM IR (-O2):
define void @stream_keep_disk_active() {
ret void
}
XEnableAccessControl() {}


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

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

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

LLVM IR (-O2):
define i32 @XEnableAccessControl() {
ret i32 undef
}
int testArith() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @testArith() {
ret i32 0
}
int lb_is_parallel(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @lb_is_parallel() {
ret i32 0
}