xunge/DecIR huggingface dataset:
/* Type definitions */
struct mt19937_state {
  int dummy;
};

/* Variables and functions */
double mt19937_genrand_int32(struct mt19937_state *);
double mt19937_genrand_real1(struct mt19937_state *rng) {
  return mt19937_genrand_int32(rng) * (1.0 / 4294967295.0);
}


x86 assembly (clang, -O0):
<mt19937_genrand_real1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <mt19937_genrand_int32@plt>
movsd  0xed3(%rip),%xmm1
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mt19937_genrand_real1>:
push   %rax
call   1030 <mt19937_genrand_int32@plt>
mulsd  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
%struct.mt19937_state = type { i32 }
define double @mt19937_genrand_real1(%struct.mt19937_state* %0) {
%2 = alloca %struct.mt19937_state*
store %struct.mt19937_state* %0, %struct.mt19937_state** %2
%3 = load %struct.mt19937_state*, %struct.mt19937_state** %2
%4 = call double @mt19937_genrand_int32(%struct.mt19937_state* %3)
%5 = fmul double %4, 0x3DF0000000100000
ret double %5
}

LLVM IR (-O2):
%struct.mt19937_state = type { i32 }
define double @mt19937_genrand_real1(%struct.mt19937_state* %0) {
%2 = tail call double @mt19937_genrand_int32(%struct.mt19937_state* %0)
%3 = fmul double %2, 0x3DF0000000100000
ret double %3
}
int atoi(char s[]) {
  int i, n;
  n = 0;
  for (i = 0; s[i] >= '0' && s[i] <= '9'; i++) {
    n = 10 * n + (s[i] - '0');
  }
  return n;
}


x86 assembly (clang, -O0):
<atoi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x11(%rbp)
jl     1145 <atoi+0x45>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1155 <atoi+0x55>
jmp    117b <atoi+0x7b>
imul   $0xa,-0x10(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <atoi+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atoi>:
mov    (%rdi),%cl
lea    -0x30(%rcx),%edx
xor    %eax,%eax
cmp    $0x9,%dl
ja     113b <atoi+0x3b>
add    $0x1,%rdi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl %cl,%ecx
lea    (%rax,%rax,4),%eax
lea    (%rcx,%rax,2),%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
lea    -0x30(%rcx),%edx
add    $0x1,%rdi
cmp    $0xa,%dl
jb     1120 <atoi+0x20>
ret

LLVM IR (-O0):
define i32 @atoi(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %4
store i32 0, i32* %3
br label %5
5: ; preds = %34, %1
%6 = load i8*, i8** %2
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp sge i32 %11, 48
br i1 %12, label %13, label %21
13: ; preds = %5
%14 = load i8*, i8** %2
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp sle i32 %19, 57
br label %21
21: ; preds = %13, %5
%22 = phi i1 [ false, %5 ], [ %20, %13 ]
br i1 %22, label %23, label %37
23: ; preds = %21
%24 = load i32, i32* %4
%25 = mul nsw i32 10, %24
%26 = load i8*, i8** %2
%27 = load i32, i32* %3
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i8, i8* %26, i64 %28
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = sub nsw i32 %31, 48
%33 = add nsw i32 %25, %32
store i32 %33, i32* %4
br label %34
34: ; preds = %23
%35 = load i32, i32* %3
%36 = add nsw i32 %35, 1
store i32 %36, i32* %3
br label %5
37: ; preds = %21
%38 = load i32, i32* %4
ret i32 %38
}

LLVM IR (-O2):
define i32 @atoi(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = add i8 %2, -48
%4 = icmp ult i8 %3, 10
br i1 %4, label %5, label %18
5: ; preds = %1, %5
%6 = phi i64 [ %13, %5 ], [ 0, %1 ]
%7 = phi i8 [ %15, %5 ], [ %2, %1 ]
%8 = phi i32 [ %12, %5 ], [ 0, %1 ]
%9 = zext i8 %7 to i32
%10 = mul nsw i32 %8, 10
%11 = add i32 %10, -48
%12 = add i32 %11, %9
%13 = add nuw nsw i64 %6, 1
%14 = getelementptr inbounds i8, i8* %0, i64 %13
%15 = load i8, i8* %14
%16 = add i8 %15, -48
%17 = icmp ult i8 %16, 10
br i1 %17, label %5, label %18
18: ; preds = %5, %1
%19 = phi i32 [ 0, %1 ], [ %12, %5 ]
ret i32 %19
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ zword(int /*<<< orphan*/);
uint16_t read16low(uint16_t address) { return zword(address); }


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

x86 assembly (clang, -O2):
<read16low>:
jmp    1030 <zword@plt>

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

LLVM IR (-O2):
define i32 @read16low(i32 %0) {
%2 = tail call i32 @zword(i32 %0)
ret i32 %2
}
void foo2() {
  int *test = 0;
  *test = 5;
}


x86 assembly (clang, -O0):
<foo2>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x5,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @foo2() {
%1 = alloca i32*
store i32* null, i32** %1
%2 = load i32*, i32** %1
store i32 5, i32* %2
ret void
}

LLVM IR (-O2):
void delay1u5(void) {
  int i;
  for (i = 0; i < 100; i++)
    ;
}


x86 assembly (clang, -O0):
<delay1u5>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jge    1128 <delay1u5+0x28>
jmp    111a <delay1u5+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <delay1u5+0xb>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @delay1u5() {
ret void
}
int f3(void) { return 1 / (sizeof(int) / 3 - 1); }


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

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

LLVM IR (-O0):
define i32 @f3() {
ret i32 poison
}

LLVM IR (-O2):
define i32 @f3() {
ret i32 poison
}
int test5u(unsigned int x) { return x / 10U < 2; }


x86 assembly (clang, -O0):
<test5u>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
cmp    $0x2,%eax
setb   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test5u>:
xor    %eax,%eax
cmp    $0x14,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @test5u(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = udiv i32 %3, 10
%5 = icmp ult i32 %4, 2
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @test5u(i32 %0) {
%2 = icmp ult i32 %0, 20
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int f275(int *);
int f276(int *p) { return f275(p); }


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

x86 assembly (clang, -O2):
<f276>:
jmp    1030 <f275@plt>

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

LLVM IR (-O2):
define i32 @f276(i32* %0) {
%2 = tail call i32 @f275(i32* %0)
ret i32 %2
}
void operator() {}


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

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

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

LLVM IR (-O2):
define void @operator() {
ret void
}
int main() { return sizeof(_Bool); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int main(void) {
  double result;
  result = (3.31e-8 * 2.01e-7) / (7.16e-6 + 2.01e-8);
  printf("The result of (3.31e-8 * 2.01e-7) / (7.16e-6 + 2.01e-8) is: %e\n",
         result);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
movsd  0xee0(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [64 x i8] c"The result of (3.31e-8 * 2.01e-7) / (7.16e-6 + 2.01e-8) is: %e\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
store double 0x3E0FD67BC5D04525, double* %2
%3 = load double, double* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0), double %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [64 x i8] c"The result of (3.31e-8 * 2.01e-7) / (7.16e-6 + 2.01e-8) is: %e\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0), double 0x3E0FD67BC5D04525)
ret i32 0
}
int valid_fsize(int size) { return (size == 4) || (size == 8); }


x86 assembly (clang, -O0):
<valid_fsize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x4,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1120 <valid_fsize+0x20>
cmpl   $0x8,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<valid_fsize>:
add    $0xfffffffc,%edi
xor    %eax,%eax
test   $0xfffffffb,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @valid_fsize(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 4
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 8
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @valid_fsize(i32 %0) {
%2 = icmp eq i32 %0, 4
%3 = icmp eq i32 %0, 8
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void win() { printf("Win function executed."); }


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

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

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

LLVM IR (-O2):
@.str = [23 x i8] c"Win function executed.\00"
define void @win() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double RAND_MAX;
double rand();
float random_number(float min_num, float max_num) {
  float cislo = rand() / (1.0 + RAND_MAX);
  return (cislo * (max_num - min_num) + min_num);
}


x86 assembly (clang, -O0):
<random_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
movsd  0xecf(%rip),%xmm1
mov    0x2eb0(%rip),%rax
addsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  -0x8(%rbp),%xmm2
subss  -0x4(%rbp),%xmm2
movss  -0x4(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_number>:
push   %rax
movss  %xmm1,0x4(%rsp)
movss  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2ebe(%rip),%rax
movsd  (%rax),%xmm1
addsd  0xeca(%rip),%xmm1
divsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm1
movss  0x4(%rsp),%xmm0
movss  (%rsp),%xmm2
subss  %xmm2,%xmm0
mulss  %xmm1,%xmm0
addss  %xmm2,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define float @random_number(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 double (...) @rand()
%7 = load double, double* @RAND_MAX
%8 = fadd double 1.000000e+00, %7
%9 = fdiv double %6, %8
%10 = fptrunc double %9 to float
store float %10, float* %5
%11 = load float, float* %5
%12 = load float, float* %4
%13 = load float, float* %3
%14 = fsub float %12, %13
%15 = load float, float* %3
%16 = call float @llvm.fmuladd.f32(float %11, float %14, float %15)
ret float %16
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define float @random_number(float %0, float %1) {
%3 = tail call double (...) @rand()
%4 = load double, double* @RAND_MAX
%5 = fadd double %4, 1.000000e+00
%6 = fdiv double %3, %5
%7 = fptrunc double %6 to float
%8 = fsub float %1, %0
%9 = tail call float @llvm.fmuladd.f32(float %7, float %8, float %0)
ret float %9
}
/* Variables and functions */
int /*<<< orphan*/ gen6_instdone1_bit(int, char *);
int /*<<< orphan*/ init_gen75_instdone();
void init_gen8_instdone(void) {
  gen6_instdone1_bit(1 << 23, "FBC");
  gen6_instdone1_bit(1 << 22, "SDE");
  init_gen75_instdone();
}


x86 assembly (clang, -O0):
<init_gen8_instdone>:
push   %rbp
mov    %rsp,%rbp
mov    $0x800000,%edi
lea    0xed0(%rip),%rsi
call   1040 <gen6_instdone1_bit@plt>
mov    $0x400000,%edi
lea    0xec3(%rip),%rsi
call   1040 <gen6_instdone1_bit@plt>
mov    $0x0,%al
call   1030 <init_gen75_instdone@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_gen8_instdone>:
push   %rax
lea    0xed8(%rip),%rsi
mov    $0x800000,%edi
call   1040 <gen6_instdone1_bit@plt>
lea    0xecb(%rip),%rsi
mov    $0x400000,%edi
call   1040 <gen6_instdone1_bit@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <init_gen75_instdone@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"FBC\00"
@.str.1 = [4 x i8] c"SDE\00"
define void @init_gen8_instdone() {
%1 = call i32 @gen6_instdone1_bit(i32 8388608, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @gen6_instdone1_bit(i32 4194304, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (...) @init_gen75_instdone()
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"FBC\00"
@.str.1 = [4 x i8] c"SDE\00"
define void @init_gen8_instdone() {
%1 = tail call i32 @gen6_instdone1_bit(i32 8388608, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @gen6_instdone1_bit(i32 4194304, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (...) @init_gen75_instdone()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ err(int, char *, char const *, int, char const *);
void *realloc(void *, size_t);
void *xrealloc_(void *p, size_t size, const char *file, int line,
                const char *func) {
  p = realloc(p, size);
  if (!p)
    err(1, "%s:%d (%s): realloc() failed", file, line, func);
  return p;
}


x86 assembly (clang, -O0):
<xrealloc_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1173 <xrealloc_+0x53>
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x28(%rbp),%r8
mov    $0x1,%edi
lea    0xe92(%rip),%rsi
call   1030 <err@plt>
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc_>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %r8,%r14
mov    %ecx,%r15d
mov    %rdx,%rbx
call   1040 <realloc@plt>
mov    %rax,%rbp
test   %rax,%rax
jne    1157 <xrealloc_+0x37>
lea    0xebc(%rip),%rsi
mov    $0x1,%edi
mov    %rbx,%rdx
mov    %r15d,%ecx
mov    %r14,%r8
call   1030 <err@plt>
mov    %rbp,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [29 x i8] c"%s:%d (%s): realloc() failed\00"
define i8* @xrealloc_(i8* %0, i64 %1, i8* %2, i32 %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
store i8* %0, i8** %6
store i64 %1, i64* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%11 = load i8*, i8** %6
%12 = load i64, i64* %7
%13 = call i8* @realloc(i8* %11, i64 %12)
store i8* %13, i8** %6
%14 = load i8*, i8** %6
%15 = icmp ne i8* %14, null
br i1 %15, label %21, label %16
16: ; preds = %5
%17 = load i8*, i8** %8
%18 = load i32, i32* %9
%19 = load i8*, i8** %10
%20 = call i32 @err(i32 1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %17, i32 %18, i8* %19)
br label %21
21: ; preds = %16, %5
%22 = load i8*, i8** %6
ret i8* %22
}

LLVM IR (-O2):
@.str = [29 x i8] c"%s:%d (%s): realloc() failed\00"
define noalias i8* @xrealloc_(i8* nocapture %0, i64 %1, i8* %2, i32 %3, i8* %4) {
%6 = tail call i8* @realloc(i8* %0, i64 %1)
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %3, i8* %4)
br label %10
10: ; preds = %8, %5
ret i8* %6
}
void av_packet_ref() {}


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

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

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

LLVM IR (-O2):
define void @av_packet_ref() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void cleanup(int signum) { exit(EXIT_SUCCESS); }


x86 assembly (clang, -O0):
<cleanup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<cleanup>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define void @cleanup(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @EXIT_SUCCESS
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define void @cleanup(i32 %0) {
%2 = load i32, i32* @EXIT_SUCCESS
%3 = tail call i32 @exit(i32 %2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void logging_Warning(char *fct_name, char *text) {
  printf("Warning - %s : %s\n", fct_name, text);
}


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"Warning - %s : %s\0A\00"
define void @logging_Warning(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 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"Warning - %s : %s\0A\00"
define void @logging_Warning(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("\nunimd: Extract a binary image from a .IMD file\n");
  printf("example: $ unimd STRINGS1.IMD # creates a disk image called "
         "strings1.bin\n");
  printf("         $ unimd STRINGS1.IMD ~/strings.bin # specify the output "
         "filename\n\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0c(%rip),%rdi
call   1030 <puts@plt>
lea    0xf49(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [49 x i8] c"\0Aunimd: Extract a binary image from a .IMD file\0A\00"
@.str.1 = [74 x i8] c"example: $ unimd STRINGS1.IMD # creates a disk image called strings1.bin\0A\00"
@.str.2 = [76 x i8] c" $ unimd STRINGS1.IMD ~/strings.bin # specify the output filename\0A\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [48 x i8] c"\0Aunimd: Extract a binary image from a .IMD file\00"
@str.3 = [73 x i8] c"example: $ unimd STRINGS1.IMD # creates a disk image called strings1.bin\00"
@str.4 = [75 x i8] c" $ unimd STRINGS1.IMD ~/strings.bin # specify the output filename\0A\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([75 x i8], [75 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
void halt_error(const char *msg) {
  perror(msg);
  exit(1);
}


x86 assembly (clang, -O0):
<halt_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<halt_error>:
push   %rax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @halt_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @halt_error(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
void foo081() {}


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

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

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

LLVM IR (-O2):
define void @foo081() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
void amd_list_features() {
  print("AMD Feature listing not yet implemented!");
  return;
}


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

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

LLVM IR (-O0):
@.str = [41 x i8] c"AMD Feature listing not yet implemented!\00"
define void @amd_list_features() {
%1 = call i32 @print(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"AMD Feature listing not yet implemented!\00"
define void @amd_list_features() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
int setuid(uid_t uid) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @setuid(i32 %0) {
ret i32 0
}
void CameraThresholdSet(unsigned long ulBase, unsigned long ulThreshold) {
  (*((volatile unsigned long *)(ulBase + 0x00000044))) &= ~0x0000007F;
  (*((volatile unsigned long *)(ulBase + 0x00000044))) |= (ulThreshold - 1);
}


x86 assembly (clang, -O0):
<CameraThresholdSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x44(%rax),%rcx
and    $0xffffffffffffff80,%rcx
mov    %rcx,0x44(%rax)
mov    -0x10(%rbp),%rdx
sub    $0x1,%rdx
mov    -0x8(%rbp),%rax
mov    0x44(%rax),%rcx
or     %rdx,%rcx
mov    %rcx,0x44(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<CameraThresholdSet>:
andq   $0xffffffffffffff80,0x44(%rdi)
add    $0xffffffffffffffff,%rsi
or     %rsi,0x44(%rdi)
ret

LLVM IR (-O0):
define void @CameraThresholdSet(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, 68
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = and i64 %8, -128
store volatile i64 %9, i64* %7
%10 = load i64, i64* %4
%11 = sub i64 %10, 1
%12 = load i64, i64* %3
%13 = add i64 %12, 68
%14 = inttoptr i64 %13 to i64*
%15 = load volatile i64, i64* %14
%16 = or i64 %15, %11
store volatile i64 %16, i64* %14
ret void
}

LLVM IR (-O2):
define void @CameraThresholdSet(i64 %0, i64 %1) {
%3 = add i64 %0, 68
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
%6 = and i64 %5, -128
store volatile i64 %6, i64* %4
%7 = add i64 %1, -1
%8 = load volatile i64, i64* %4
%9 = or i64 %8, %7
store volatile i64 %9, i64* %4
ret void
}
/* Type definitions */
struct sockaddr_in {
  int /*<<< orphan*/ sin_addr;
};
struct sockaddr {
  int dummy;
};

/* Variables and functions */
char *inet_ntoa(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void print_ip(struct sockaddr *addr) {
  printf("\t<%s>\n", inet_ntoa(((struct sockaddr_in *)addr)->sin_addr));
}


x86 assembly (clang, -O0):
<print_ip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <inet_ntoa@plt>
mov    %rax,%rsi
lea    0xebf(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_ip>:
push   %rax
mov    (%rdi),%edi
call   1030 <inet_ntoa@plt>
lea    0xed1(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
%struct.sockaddr_in = type { i32 }
@.str = [7 x i8] c"\09<%s>\0A\00"
define void @print_ip(%struct.sockaddr* %0) {
%2 = alloca %struct.sockaddr*
store %struct.sockaddr* %0, %struct.sockaddr** %2
%3 = load %struct.sockaddr*, %struct.sockaddr** %2
%4 = bitcast %struct.sockaddr* %3 to %struct.sockaddr_in*
%5 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i32 0, i32 0
%6 = load i32, i32* %5
%7 = call i8* @inet_ntoa(i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
@.str = [7 x i8] c"\09<%s>\0A\00"
define void @print_ip(%struct.sockaddr* nocapture %0) {
%2 = getelementptr %struct.sockaddr, %struct.sockaddr* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = tail call i8* @inet_ntoa(i32 %3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int base64_decode_chars_signed(int /*<<< orphan*/ *, int const,
                               int /*<<< orphan*/ *);
int base64_decode_chars(const char *code_in, const int length_in,
                        char *plaintext_out) {
  return base64_decode_chars_signed((int8_t *)code_in, length_in,
                                    (int8_t *)plaintext_out);
}


x86 assembly (clang, -O0):
<base64_decode_chars>:
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),%esi
mov    -0x18(%rbp),%rdx
call   1030 <base64_decode_chars_signed@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<base64_decode_chars>:
jmp    1030 <base64_decode_chars_signed@plt>

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

LLVM IR (-O2):
define i32 @base64_decode_chars(i8* %0, i32 %1, i8* %2) {
%4 = bitcast i8* %0 to i32*
%5 = bitcast i8* %2 to i32*
%6 = tail call i32 @base64_decode_chars_signed(i32* %4, i32 %1, i32* %5)
ret i32 %6
}
/* Variables and functions */
int fork();
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i, p;
  for (i = 0; i < 2; i++) {
    printf("i=%d\n", i);
    p = fork();
    if (p > 0)
      fork();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    117d <main+0x5d>
mov    -0x8(%rbp),%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <fork@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    116a <main+0x4a>
mov    $0x0,%al
call   1040 <fork@plt>
jmp    116f <main+0x4f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <fork@plt>
test   %eax,%eax
jle    1141 <main+0x21>
xor    %eax,%eax
call   1040 <fork@plt>
lea    0xeb8(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <fork@plt>
test   %eax,%eax
jle    1164 <main+0x44>
xor    %eax,%eax
call   1040 <fork@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"i=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %4
4: ; preds = %16, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 2
br i1 %6, label %7, label %19
7: ; preds = %4
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = call i32 (...) @fork()
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = icmp sgt i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %7
%14 = call i32 (...) @fork()
br label %15
15: ; preds = %13, %7
br label %16
16: ; preds = %15
%17 = load i32, i32* %2
%18 = add nsw i32 %17, 1
store i32 %18, i32* %2
br label %4
19: ; preds = %4
%20 = load i32, i32* %1
ret i32 %20
}

LLVM IR (-O2):
@.str = [6 x i8] c"i=%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = tail call i32 (...) @fork()
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 (...) @fork()
br label %6
6: ; preds = %0, %4
%7 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 1)
%8 = tail call i32 (...) @fork()
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %6
%11 = tail call i32 (...) @fork()
br label %12
12: ; preds = %10, %6
ret i32 0
}
/* Variables and functions */
scalar_t__ RAND_MAX;
double rand();
int sin(int);
int triuksmas(int i, int N) {
  double r = rand() / (double)RAND_MAX;
  return r + .8 * (127 + 127 * sin(i * 6.28 / 2000.0));
}


x86 assembly (clang, -O0):
<triuksmas>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    0x2eac(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xeaf(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe9b(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sin@plt>
movsd  -0x18(%rbp),%xmm1
imul   $0x7f,%eax,%eax
add    $0x7f,%eax
cvtsi2sd %eax,%xmm0
movsd  0xe6f(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<triuksmas>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <rand@plt>
mov    0x2eb3(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
mulsd  0xead(%rip),%xmm0
divsd  0xead(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sin@plt>
mov    %eax,%ecx
shl    $0x7,%ecx
sub    %eax,%ecx
add    $0x7f,%ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
mulsd  0xe93(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
cvttsd2si %xmm0,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define i32 @triuksmas(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = call double (...) @rand()
%7 = load i64, i64* @RAND_MAX
%8 = sitofp i64 %7 to double
%9 = fdiv double %6, %8
store double %9, double* %5
%10 = load double, double* %5
%11 = load i32, i32* %3
%12 = sitofp i32 %11 to double
%13 = fmul double %12, 6.280000e+00
%14 = fdiv double %13, 2.000000e+03
%15 = fptosi double %14 to i32
%16 = call i32 @sin(i32 %15)
%17 = mul nsw i32 127, %16
%18 = add nsw i32 127, %17
%19 = sitofp i32 %18 to double
%20 = call double @llvm.fmuladd.f64(double 8.000000e-01, double %19, double %10)
%21 = fptosi double %20 to i32
ret i32 %21
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define i32 @triuksmas(i32 %0, i32 %1) {
%3 = tail call double (...) @rand()
%4 = load i64, i64* @RAND_MAX
%5 = sitofp i64 %4 to double
%6 = fdiv double %3, %5
%7 = sitofp i32 %0 to double
%8 = fmul double %7, 6.280000e+00
%9 = fdiv double %8, 2.000000e+03
%10 = fptosi double %9 to i32
%11 = tail call i32 @sin(i32 %10)
%12 = mul nsw i32 %11, 127
%13 = add nsw i32 %12, 127
%14 = sitofp i32 %13 to double
%15 = tail call double @llvm.fmuladd.f64(double %14, double 8.000000e-01, double %6)
%16 = fptosi double %15 to i32
ret i32 %16
}
void gtk_tree_path_new() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_path_new() {
ret void
}
/* Variables and functions */
int strtol(char *, char **, int /*<<< orphan*/);
int getNum(int *ptr, char *tok) {
  int i;
  char *end;
  i = strtol(tok, &end, 0);
  if (*end)
    return 10;
  *ptr = i;
  return 0;
}


x86 assembly (clang, -O0):
<getNum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x28(%rbp),%rsi
xor    %edx,%edx
call   1030 <strtol@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x28(%rbp),%rax
cmpb   $0x0,(%rax)
je     114b <getNum+0x3b>
movl   $0xa,-0x4(%rbp)
jmp    115b <getNum+0x4b>
mov    -0x1c(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getNum>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rax
mov    %rdi,%rbx
lea    0x8(%rsp),%rsi
mov    %rax,%rdi
xor    %edx,%edx
call   1030 <strtol@plt>
mov    0x8(%rsp),%rdx
mov    $0xa,%ecx
cmpb   $0x0,(%rdx)
jne    113d <getNum+0x2d>
mov    %eax,(%rbx)
xor    %ecx,%ecx
mov    %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @getNum(i32* nocapture writeonly %0, i8* %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call i32 @strtol(i8* %1, i8** %3, i32 0)
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 %5, i32* %0
br label %10
10: ; preds = %2, %9
%11 = phi i32 [ 0, %9 ], [ 10, %2 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ cpputest_free_location(void *, char *, int);
void freeAllocation(void *memory) {
  cpputest_free_location(
      memory,
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/AOKP/kernel_sony_msm8974ab/refs/heads/1.kgsl/"
      "CppUTest/tests/AllocationInCFile.c",
      14);
}


x86 assembly (clang, -O0):
<freeAllocation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0xe,%edx
call   1030 <cpputest_free_location@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeAllocation>:
lea    0xee9(%rip),%rsi
mov    $0xe,%edx
jmp    1030 <cpputest_free_location@plt>

LLVM IR (-O0):
@.str = [170 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AOKP/kernel_sony_msm8974ab/refs/heads/1.kgsl/CppUTest/tests/AllocationInCFile.c\00"
define void @freeAllocation(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @cpputest_free_location(i8* %3, i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 14)
ret void
}

LLVM IR (-O2):
@.str = [170 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AOKP/kernel_sony_msm8974ab/refs/heads/1.kgsl/CppUTest/tests/AllocationInCFile.c\00"
define void @freeAllocation(i8* %0) {
%2 = tail call i32 @cpputest_free_location(i8* %0, i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 14)
ret void
}
/* Variables and functions */
bool prime(int a, int *p) {
  while (*p * *p <= a) {
    if (a % *p == 0)
      return false;
    p++;
  }
  return true;
}


x86 assembly (clang, -O0):
<prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
imul   (%rcx),%eax
cmp    -0x8(%rbp),%eax
jg     1151 <prime+0x51>
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%rcx
cltd
idivl  (%rcx)
cmp    $0x0,%edx
jne    1140 <prime+0x40>
movl   $0x0,-0x4(%rbp)
jmp    1158 <prime+0x58>
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
jmp    110b <prime+0xb>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prime>:
mov    (%rsi),%ecx
mov    %ecx,%eax
imul   %ecx,%eax
mov    $0x1,%r8d
cmp    %edi,%eax
jg     1138 <prime+0x38>
add    $0x4,%rsi
cs nopw 0x0(%rax,%rax,1)
nop
mov    %edi,%eax
cltd
idiv   %ecx
test   %edx,%edx
je     113c <prime+0x3c>
mov    (%rsi),%ecx
mov    %ecx,%eax
imul   %ecx,%eax
add    $0x4,%rsi
cmp    %edi,%eax
jle    1120 <prime+0x20>
mov    %r8d,%eax
ret
xor    %r8d,%r8d
mov    %r8d,%eax
ret

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

LLVM IR (-O2):
define i32 @prime(i32 %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = mul nsw i32 %3, %3
%5 = icmp sgt i32 %4, %0
br i1 %5, label %16, label %10
6: ; preds = %10
%7 = load i32, i32* %15
%8 = mul nsw i32 %7, %7
%9 = icmp sgt i32 %8, %0
br i1 %9, label %16, label %10
10: ; preds = %2, %6
%11 = phi i32 [ %7, %6 ], [ %3, %2 ]
%12 = phi i32* [ %15, %6 ], [ %1, %2 ]
%13 = srem i32 %0, %11
%14 = icmp eq i32 %13, 0
%15 = getelementptr inbounds i32, i32* %12, i64 1
br i1 %14, label %16, label %6
16: ; preds = %10, %6, %2
%17 = phi i32 [ 1, %2 ], [ 1, %6 ], [ 0, %10 ]
ret i32 %17
}
void disable_branch_predictor(void) {}


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

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

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

LLVM IR (-O2):
define void @disable_branch_predictor() {
ret void
}
/* Type definitions */
struct kvm_vcpu {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ BUG();
void kvm_handle_pmu_event(struct kvm_vcpu *vcpu) { BUG(); }


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

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

LLVM IR (-O0):
%struct.kvm_vcpu = type { i32 }
define void @kvm_handle_pmu_event(%struct.kvm_vcpu* %0) {
%2 = alloca %struct.kvm_vcpu*
store %struct.kvm_vcpu* %0, %struct.kvm_vcpu** %2
%3 = call i32 (...) @BUG()
ret void
}

LLVM IR (-O2):
%struct.kvm_vcpu = type { i32 }
define void @kvm_handle_pmu_event(%struct.kvm_vcpu* nocapture readnone %0) {
%2 = tail call i32 (...) @BUG()
ret void
}
int argument_count(char *argv) {
  int argc = 0;
  while (*argv)
    if (*argv++ == ',')
      ++argc;
  return (argc > 0) ? ++argc : 0;
}


x86 assembly (clang, -O0):
<argument_count>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <argument_count+0x45>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x2c,%eax
jne    1140 <argument_count+0x40>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <argument_count+0xf>
cmpl   $0x0,-0xc(%rbp)
jle    1160 <argument_count+0x60>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    %eax,-0x10(%rbp)
jmp    116a <argument_count+0x6a>
xor    %eax,%eax
mov    %eax,-0x10(%rbp)
jmp    116a <argument_count+0x6a>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<argument_count>:
mov    (%rdi),%cl
test   %cl,%cl
je     112d <argument_count+0x2d>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
xor    %edx,%edx
cmp    $0x2c,%cl
sete   %dl
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <argument_count+0x10>
test   %eax,%eax
je     112d <argument_count+0x2d>
add    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @argument_count(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %17, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = icmp eq i8 %5, 44
%10 = zext i1 %9 to i32
%11 = add nuw nsw i32 %6, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = icmp eq i32 %11, 0
%16 = add nuw nsw i32 %11, 1
br i1 %15, label %17, label %18
17: ; preds = %1, %14
br label %18
18: ; preds = %14, %17
%19 = phi i32 [ 0, %17 ], [ %16, %14 ]
ret i32 %19
}
void PS_NullCoordScale(float hfactor, float vfactor) {}


x86 assembly (clang, -O0):
<PS_NullCoordScale>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @PS_NullCoordScale(float %0, float %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, char *, size_t);
void swap_memory(void *data1, void *data2, size_t size) {
  char temp[size];
  memcpy(temp, data1, size);
  memcpy(data1, data2, size);
  memcpy(data2, temp, size);
}


x86 assembly (clang, -O0):
<swap_memory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x30(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x30(%rbp),%rsi
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_memory>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdx,%r12
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsp,%rbx
lea    0xf(%rdx),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <memcpy@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %r12,%rdx
call   1030 <memcpy@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r12,%rdx
call   1030 <memcpy@plt>
lea    -0x20(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @swap_memory(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%9 = load i64, i64* %6
%10 = call i8* @llvm.stacksave()
store i8* %10, i8** %7
%11 = alloca i8, i64 %9
store i64 %9, i64* %8
%12 = load i8*, i8** %4
%13 = load i64, i64* %6
%14 = call i32 @memcpy(i8* %11, i8* %12, i64 %13)
%15 = load i8*, i8** %4
%16 = load i8*, i8** %5
%17 = load i64, i64* %6
%18 = call i32 @memcpy(i8* %15, i8* %16, i64 %17)
%19 = load i8*, i8** %5
%20 = load i64, i64* %6
%21 = call i32 @memcpy(i8* %19, i8* %11, i64 %20)
%22 = load i8*, i8** %7
ret void
}

LLVM IR (-O2):
define void @swap_memory(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8, i64 %2
%5 = call i32 @memcpy(i8* %4, i8* %0, i64 %2)
%6 = call i32 @memcpy(i8* %0, i8* %1, i64 %2)
%7 = call i32 @memcpy(i8* %1, i8* %4, i64 %2)
ret void
}