xunge/DecIR huggingface dataset:
unpercep(x, y, z, r, g, b) double x, y, z;
int *r, *g, *b;
{
  *r = x * (1 << 8 - 6);
  *g = y * (1 << 8 - 7);
  *b = z * (1 << 8 - 6);
}


x86 assembly (clang, -O0):
<unpercep>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
mov    %rdi,-0x28(%rbp)
mov    %rsi,-0x30(%rbp)
mov    %rdx,-0x38(%rbp)
movsd  0xed9(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
movsd  0xeca(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
cvttsd2si %xmm0,%ecx
mov    -0x30(%rbp),%rax
mov    %ecx,(%rax)
movsd  0xeab(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
cvttsd2si %xmm0,%ecx
mov    -0x38(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unpercep>:
movsd  0xef8(%rip),%xmm3
mulsd  %xmm3,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,(%rdi)
addsd  %xmm1,%xmm1
cvttsd2si %xmm1,%eax
mov    %eax,(%rsi)
mulsd  %xmm3,%xmm2
cvttsd2si %xmm2,%eax
mov    %eax,(%rdx)
ret

LLVM IR (-O0):
define i32 @unpercep(double %0, double %1, double %2, i32* %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i32*
store double %0, double* %8
store double %1, double* %9
store double %2, double* %10
store i32* %3, i32** %11
store i32* %4, i32** %12
store i32* %5, i32** %13
%14 = load double, double* %8
%15 = fmul double %14, 4.000000e+00
%16 = fptosi double %15 to i32
%17 = load i32*, i32** %11
store i32 %16, i32* %17
%18 = load double, double* %9
%19 = fmul double %18, 2.000000e+00
%20 = fptosi double %19 to i32
%21 = load i32*, i32** %12
store i32 %20, i32* %21
%22 = load double, double* %10
%23 = fmul double %22, 4.000000e+00
%24 = fptosi double %23 to i32
%25 = load i32*, i32** %13
store i32 %24, i32* %25
%26 = load i32, i32* %7
ret i32 %26
}

LLVM IR (-O2):
define i32 @unpercep(double %0, double %1, double %2, i32* nocapture writeonly %3, i32* nocapture writeonly %4, i32* nocapture writeonly %5) {
%7 = fmul double %0, 4.000000e+00
%8 = fptosi double %7 to i32
store i32 %8, i32* %3
%9 = fmul double %1, 2.000000e+00
%10 = fptosi double %9 to i32
store i32 %10, i32* %4
%11 = fmul double %2, 4.000000e+00
%12 = fptosi double %11 to i32
store i32 %12, i32* %5
ret i32 undef
}
float f4(float x, unsigned char y) { return x * y; }


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

x86 assembly (clang, -O2):
<f4>:
cvtsi2ss %edi,%xmm1
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @f4(float %0, i8 zeroext %1) {
%3 = alloca float
%4 = alloca i8
store float %0, float* %3
store i8 %1, i8* %4
%5 = load float, float* %3
%6 = load i8, i8* %4
%7 = zext i8 %6 to i32
%8 = sitofp i32 %7 to float
%9 = fmul float %5, %8
ret float %9
}

LLVM IR (-O2):
define float @f4(float %0, i8 zeroext %1) {
%3 = uitofp i8 %1 to float
%4 = fmul float %3, %0
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ cpuid(int *, int);
int has_avx(void) {
  int info[4];
  cpuid(info, 0x00000001);
  return ((info[2] & ((int)1 << 28)) != 0);
}


x86 assembly (clang, -O0):
<has_avx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1030 <cpuid@plt>
mov    -0x8(%rbp),%eax
and    $0x10000000,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<has_avx>:
sub    $0x18,%rsp
mov    %rsp,%rdi
mov    $0x1,%esi
call   1030 <cpuid@plt>
mov    0x8(%rsp),%eax
shr    $0x1c,%eax
and    $0x1,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @has_avx() {
%1 = alloca [4 x i32]
%2 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%3 = call i32 @cpuid(i32* %2, i32 1)
%4 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 2
%5 = load i32, i32* %4
%6 = and i32 %5, 268435456
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @has_avx() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%4 = call i32 @cpuid(i32* %3, i32 1)
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 2
%6 = load i32, i32* %5
%7 = lshr i32 %6, 28
%8 = and i32 %7, 1
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ abort();
long double foo(long double);
int main(void) {
  if (foo(-1.0L) != 3.1415926535897932384626433832795029L)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %rsp,%rax
fld1
fchs
fstpt  (%rax)
call   1040 <foo@plt>
fld    %st(0)
fstp   %st(0)
fldt   0xeb9(%rip)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jne    115e <main+0x3e>
jp     115e <main+0x3e>
jmp    1165 <main+0x45>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
fld1
fchs
fstpt  (%rsp)
call   1040 <foo@plt>
fldt   0xeca(%rip)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jne    1147 <main+0x27>
jp     1147 <main+0x27>
xor    %eax,%eax
add    $0x18,%rsp
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call x86_fp80 @foo(x86_fp80 0xKBFFF8000000000000000)
%3 = fcmp une x86_fp80 %2, 0xK4000C90FDAA22168C235
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call x86_fp80 @foo(x86_fp80 0xKBFFF8000000000000000)
%2 = fcmp une x86_fp80 %1, 0xK4000C90FDAA22168C235
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_sw_volume_to_linear() {
  printf("NOT IMPLEMENTED:"
         "pa_sw_volume_to_linear"
         "\n");
}


x86 assembly (clang, -O0):
<pa_sw_volume_to_linear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [40 x i8] c"NOT IMPLEMENTED:pa_sw_volume_to_linear\0A\00"
define i32 @pa_sw_volume_to_linear() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [39 x i8] c"NOT IMPLEMENTED:pa_sw_volume_to_linear\00"
define i32 @pa_sw_volume_to_linear() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ fill_with_junk(int *, int *, int *);
void code_transformer(int *instructions, int *new_shellcode, int *num_inst) {
  fill_with_junk(instructions, new_shellcode, num_inst);
}


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

x86 assembly (clang, -O2):
<code_transformer>:
jmp    1030 <fill_with_junk@plt>

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

LLVM IR (-O2):
define void @code_transformer(i32* %0, i32* %1, i32* %2) {
%4 = tail call i32 @fill_with_junk(i32* %0, i32* %1, i32* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PerimeterOfSquare(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ stdin;
int main(int argc, char *argv[]) {
  int number = 0;
  fflush(stdin);
  scanf("%d", &number);
  printf("%llu\n", PerimeterOfSquare(number));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
lea    0xe8e(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x14(%rbp),%edi
call   1060 <PerimeterOfSquare@plt>
mov    %eax,%esi
lea    0xe77(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
lea    0xea2(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1060 <PerimeterOfSquare@plt>
lea    0xe8b(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [3 x i8] c"%d\00"
@.str.1 = [6 x i8] c"%llu\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%7 = load i32, i32* @stdin
%8 = call i32 @fflush(i32 %7)
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
%10 = load i32, i32* %6
%11 = call i32 @PerimeterOfSquare(i32 %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %11)
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [3 x i8] c"%d\00"
@.str.1 = [6 x i8] c"%llu\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = load i32, i32* @stdin
%6 = tail call i32 @fflush(i32 %5)
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%8 = load i32, i32* %3
%9 = call i32 @PerimeterOfSquare(i32 %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}
char equalFitness(double objective_value_x, double constraint_value_x,
                  double objective_value_y, double constraint_value_y) {
  char result;
  result = 0;
  if ((constraint_value_x == constraint_value_y) &&
      (objective_value_x == objective_value_y))
    result = 1;
  return (result);
}


x86 assembly (clang, -O0):
<equalFitness>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movb   $0x0,-0x21(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jne    114c <equalFitness+0x4c>
jp     114c <equalFitness+0x4c>
movsd  -0x8(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jne    114c <equalFitness+0x4c>
jp     114c <equalFitness+0x4c>
movb   $0x1,-0x21(%rbp)
movsbl -0x21(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<equalFitness>:
ucomisd %xmm3,%xmm1
setnp  %al
sete   %cl
and    %al,%cl
ucomisd %xmm2,%xmm0
setnp  %dl
sete   %al
and    %dl,%al
and    %cl,%al
ret

LLVM IR (-O0):
define signext i8 @equalFitness(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca i8
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
store i8 0, i8* %9
%10 = load double, double* %6
%11 = load double, double* %8
%12 = fcmp oeq double %10, %11
br i1 %12, label %13, label %18
13: ; preds = %4
%14 = load double, double* %5
%15 = load double, double* %7
%16 = fcmp oeq double %14, %15
br i1 %16, label %17, label %18
17: ; preds = %13
store i8 1, i8* %9
br label %18
18: ; preds = %17, %13, %4
%19 = load i8, i8* %9
ret i8 %19
}

LLVM IR (-O2):
define signext i8 @equalFitness(double %0, double %1, double %2, double %3) {
%5 = fcmp oeq double %1, %3
%6 = fcmp oeq double %0, %2
%7 = and i1 %6, %5
%8 = zext i1 %7 to i8
ret i8 %8
}
/* Variables and functions */
int /*<<< orphan*/ addConst(char *, int);
scalar_t__ addObject(int, int);
void addConstPtr(char *name, int classIndex, int pointer) {
  int handle;
  handle = (int)addObject(classIndex, pointer);
  addConst(name, handle);
}


x86 assembly (clang, -O0):
<addConstPtr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <addObject@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <addConst@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addConstPtr>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
mov    %edx,%esi
call   1030 <addObject@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <addConst@plt>

LLVM IR (-O0):
define void @addConstPtr(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i64 @addObject(i32 %8, i32 %9)
%11 = trunc i64 %10 to i32
store i32 %11, i32* %7
%12 = load i8*, i8** %4
%13 = load i32, i32* %7
%14 = call i32 @addConst(i8* %12, i32 %13)
ret void
}

LLVM IR (-O2):
define void @addConstPtr(i8* %0, i32 %1, i32 %2) {
%4 = tail call i64 @addObject(i32 %1, i32 %2)
%5 = trunc i64 %4 to i32
%6 = tail call i32 @addConst(i8* %0, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Msp430GpioC__0__GeneralIO__set();
void LedsP__Led0__set(void) { Msp430GpioC__0__GeneralIO__set(); }


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

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

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

LLVM IR (-O2):
define void @LedsP__Led0__set() {
%1 = tail call i32 (...) @Msp430GpioC__0__GeneralIO__set()
ret void
}
void hisi_mntn_inform(void) {}


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

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

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

LLVM IR (-O2):
define void @hisi_mntn_inform() {
ret void
}
void cursor_init(void) {}


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

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

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

LLVM IR (-O2):
define void @cursor_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ display();
int /*<<< orphan*/ exit(int);
void Keyboard(unsigned char key, int x, int y) {
  if (key == 27) {
    exit(-1);
  } else if (key == 'q') {
    exit(-1);
  }
  display();
}


x86 assembly (clang, -O0):
<Keyboard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x1b,%eax
jne    114b <Keyboard+0x2b>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
movzbl -0x1(%rbp),%eax
cmp    $0x71,%eax
jne    1162 <Keyboard+0x42>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
jmp    1167 <Keyboard+0x47>
mov    $0x0,%al
call   1030 <display@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Keyboard>:
push   %rax
cmp    $0x71,%dil
je     1135 <Keyboard+0x15>
cmp    $0x1b,%dil
je     1135 <Keyboard+0x15>
xor    %eax,%eax
pop    %rcx
jmp    1030 <display@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @Keyboard(i8 zeroext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = icmp eq i32 %8, 27
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = call i32 @exit(i32 -1)
unreachable
12: ; preds = %3
%13 = load i8, i8* %4
%14 = zext i8 %13 to i32
%15 = icmp eq i32 %14, 113
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = call i32 @exit(i32 -1)
unreachable
18: ; preds = %12
br label %19
19: ; preds = %18
%20 = call i32 (...) @display()
ret void
}

LLVM IR (-O2):
define void @Keyboard(i8 zeroext %0, i32 %1, i32 %2) {
switch i8 %0, label %8 [
i8 27, label %4
i8 113, label %6
]
4: ; preds = %3
%5 = tail call i32 @exit(i32 -1)
unreachable
6: ; preds = %3
%7 = tail call i32 @exit(i32 -1)
unreachable
8: ; preds = %3
%9 = tail call i32 (...) @display()
ret void
}
/* Variables and functions */
void *dlsym(void *, char const *);
void *Exynos_OSAL_dlsym(void *handle, const char *symbol) {
  return dlsym(handle, symbol);
}


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

x86 assembly (clang, -O2):
<Exynos_OSAL_dlsym>:
jmp    1030 <dlsym@plt>

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

LLVM IR (-O2):
define i8* @Exynos_OSAL_dlsym(i8* %0, i8* %1) {
%3 = tail call i8* @dlsym(i8* %0, i8* %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_tacos() {
  char *s = "Free Tacos!\n";
  printf("%s", s);
}


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

x86 assembly (clang, -O2):
<print_tacos>:
lea    0xef6(%rip),%rdi
lea    0xee2(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"Free Tacos!\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define void @print_tacos() {
%1 = alloca i8*
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
%3 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"Free Tacos!\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define void @print_tacos() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
int null_checkhost(a1)
struct sockaddr *a1;
{
  return (0);
}


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

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

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

LLVM IR (-O2):
%struct.sockaddr = type opaque
define i32 @null_checkhost(%struct.sockaddr* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t nva_grd8(void *base, uint32_t addr) {
  return *(((volatile uint8_t *)base) + addr);
}


x86 assembly (clang, -O0):
<nva_grd8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nva_grd8>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @nva_grd8(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %6, i64 %8
%10 = load volatile i32, i32* %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @nva_grd8(i8* %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %3, i64 %4
%6 = load volatile i32, i32* %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ pciconfig_read(unsigned char, unsigned char, unsigned int,
                                  int, unsigned int *);
long pci_config_read_long(unsigned char bus, unsigned char dev, int func,
                          unsigned cmd) {
  unsigned retval;
  pciconfig_read(bus, dev << 3, cmd, 4, &retval);
  return retval;
}


x86 assembly (clang, -O0):
<pci_config_read_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    %edx,-0x8(%rbp)
mov    %ecx,-0xc(%rbp)
mov    -0x1(%rbp),%sil
movzbl -0x2(%rbp),%eax
shl    $0x3,%eax
mov    -0xc(%rbp),%edx
mov    $0x4,%ecx
lea    -0x10(%rbp),%r8
movzbl %sil,%edi
movzbl %al,%esi
call   1030 <pciconfig_read@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pci_config_read_long>:
push   %rax
shl    $0x3,%sil
movzbl %sil,%esi
lea    0x4(%rsp),%r8
mov    %ecx,%edx
mov    $0x4,%ecx
call   1030 <pciconfig_read@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @pci_config_read_long(i8 zeroext %0, i8 zeroext %1, i32 %2, i32 %3) {
%5 = alloca i8
%6 = alloca i8
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %5
store i8 %1, i8* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i8, i8* %5
%11 = load i8, i8* %6
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 3
%14 = trunc i32 %13 to i8
%15 = load i32, i32* %8
%16 = call i32 @pciconfig_read(i8 zeroext %10, i8 zeroext %14, i32 %15, i32 4, i32* %9)
%17 = load i32, i32* %9
%18 = zext i32 %17 to i64
ret i64 %18
}

LLVM IR (-O2):
define i64 @pci_config_read_long(i8 zeroext %0, i8 zeroext %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = bitcast i32* %5 to i8*
%7 = shl i8 %1, 3
%8 = call i32 @pciconfig_read(i8 zeroext %0, i8 zeroext %7, i32 %3, i32 4, i32* %5)
%9 = load i32, i32* %5
%10 = zext i32 %9 to i64
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern long shmem_long_cswap(long *target, long cond, long value, int pe) {
  printf("\nOpenSHMEM Analyzer\n");
}


x86 assembly (clang, -O0):
<shmem_long_cswap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [21 x i8] c"\0AOpenSHMEM Analyzer\0A\00"
define i64 @shmem_long_cswap(i64* %0, i64 %1, i64 %2, i32 %3) {
%5 = alloca i64
%6 = alloca i64*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i32
store i64* %0, i64** %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i32 %3, i32* %9
%10 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%11 = load i64, i64* %5
ret i64 %11
}

LLVM IR (-O2):
@str = [20 x i8] c"\0AOpenSHMEM Analyzer\00"
define i64 @shmem_long_cswap(i64* nocapture readnone %0, i64 %1, i64 %2, i32 %3) {
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i64 undef
}
/* Variables and functions */
int /*<<< orphan*/ testInsertLookupDifferentKeys();
int /*<<< orphan*/ testInsertLookupSameKeys();
int /*<<< orphan*/ testInsertSingleElement();
int /*<<< orphan*/ testIsempty();
int /*<<< orphan*/ testLookupSingleElement();
int /*<<< orphan*/ testRemoveElementsDifferentKeys();
int /*<<< orphan*/ testRemoveElementsSameKeys();
int /*<<< orphan*/ testRemoveSingleElement();
void correctnessTest() {
  testIsempty();
  testInsertSingleElement();
  testLookupSingleElement();
  testInsertLookupDifferentKeys();
  testInsertLookupSameKeys();
  testRemoveSingleElement();
  testRemoveElementsDifferentKeys();
  testRemoveElementsSameKeys();
}


x86 assembly (clang, -O0):
<correctnessTest>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1070 <testIsempty@plt>
mov    $0x0,%al
call   10a0 <testInsertSingleElement@plt>
mov    $0x0,%al
call   1060 <testLookupSingleElement@plt>
mov    $0x0,%al
call   1080 <testInsertLookupDifferentKeys@plt>
mov    $0x0,%al
call   1090 <testInsertLookupSameKeys@plt>
mov    $0x0,%al
call   1040 <testRemoveSingleElement@plt>
mov    $0x0,%al
call   1030 <testRemoveElementsDifferentKeys@plt>
mov    $0x0,%al
call   1050 <testRemoveElementsSameKeys@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<correctnessTest>:
push   %rax
xor    %eax,%eax
call   1070 <testIsempty@plt>
xor    %eax,%eax
call   10a0 <testInsertSingleElement@plt>
xor    %eax,%eax
call   1060 <testLookupSingleElement@plt>
xor    %eax,%eax
call   1080 <testInsertLookupDifferentKeys@plt>
xor    %eax,%eax
call   1090 <testInsertLookupSameKeys@plt>
xor    %eax,%eax
call   1040 <testRemoveSingleElement@plt>
xor    %eax,%eax
call   1030 <testRemoveElementsDifferentKeys@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <testRemoveElementsSameKeys@plt>

LLVM IR (-O0):
define void @correctnessTest() {
%1 = call i32 (...) @testIsempty()
%2 = call i32 (...) @testInsertSingleElement()
%3 = call i32 (...) @testLookupSingleElement()
%4 = call i32 (...) @testInsertLookupDifferentKeys()
%5 = call i32 (...) @testInsertLookupSameKeys()
%6 = call i32 (...) @testRemoveSingleElement()
%7 = call i32 (...) @testRemoveElementsDifferentKeys()
%8 = call i32 (...) @testRemoveElementsSameKeys()
ret void
}

LLVM IR (-O2):
define void @correctnessTest() {
%1 = tail call i32 (...) @testIsempty()
%2 = tail call i32 (...) @testInsertSingleElement()
%3 = tail call i32 (...) @testLookupSingleElement()
%4 = tail call i32 (...) @testInsertLookupDifferentKeys()
%5 = tail call i32 (...) @testInsertLookupSameKeys()
%6 = tail call i32 (...) @testRemoveSingleElement()
%7 = tail call i32 (...) @testRemoveElementsDifferentKeys()
%8 = tail call i32 (...) @testRemoveElementsSameKeys()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ popNarray(char *, int);
void poppointer4_(char *ppp) { popNarray(ppp, 4); }


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

x86 assembly (clang, -O2):
<poppointer4_>:
mov    $0x4,%esi
jmp    1030 <popNarray@plt>

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

LLVM IR (-O2):
define void @poppointer4_(i8* %0) {
%2 = tail call i32 @popNarray(i8* %0, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void c(int x) { write(1, "C\n", 2); }


x86 assembly (clang, -O0):
<c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
lea    0xed9(%rip),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
mov    $0x2,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"C\0A\00"
define void @c(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @write(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"C\0A\00"
define void @c(i32 %0) {
%2 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
ret void
}
void cxl_pci_disable_device(struct pci_dev *dev) {}


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

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

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

LLVM IR (-O2):
%struct.pci_dev = type opaque
define void @cxl_pci_disable_device(%struct.pci_dev* nocapture %0) {
ret void
}
int main() { return 3 % 2; }


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*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void random_drop_init(void) { srand(time(NULL)); }


x86 assembly (clang, -O0):
<random_drop_init>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_drop_init>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <srand@plt>

LLVM IR (-O0):
define void @random_drop_init() {
%1 = call i32 @time(i32* null)
%2 = call i32 @srand(i32 %1)
ret void
}

LLVM IR (-O2):
define void @random_drop_init() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
ret void
}
void erasePixel(short x, short y) {}


x86 assembly (clang, -O0):
<erasePixel>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @erasePixel(i16 signext %0, i16 signext %1) {
ret void
}
double _Complex mul_double_cr(double _Complex a, double b) { return a * b; }


x86 assembly (clang, -O0):
<mul_double_cr>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
mulsd  %xmm2,%xmm1
mulsd  %xmm2,%xmm0
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm0,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
pop    %rbp
ret

x86 assembly (clang, -O2):
<mul_double_cr>:
mulsd  %xmm2,%xmm0
mulsd  %xmm2,%xmm1
ret

LLVM IR (-O0):
define { double, double } @mul_double_cr(double %0, double %1, double %2) {
%4 = alloca { double, double }
%5 = alloca { double, double }
%6 = alloca double
%7 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 0
store double %0, double* %7
%8 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 1
store double %1, double* %8
store double %2, double* %6
%9 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 0
%10 = load double, double* %9
%11 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 1
%12 = load double, double* %11
%13 = load double, double* %6
%14 = fmul double %10, %13
%15 = fmul double %12, %13
%16 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 0
%17 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 1
store double %14, double* %16
store double %15, double* %17
%18 = load { double, double }, { double, double }* %4
ret { double, double } %18
}

LLVM IR (-O2):
define { double, double } @mul_double_cr(double %0, double %1, double %2) {
%4 = fmul double %0, %2
%5 = fmul double %1, %2
%6 = insertvalue { double, double } poison, double %4, 0
%7 = insertvalue { double, double } %6, double %5, 1
ret { double, double } %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ highest_bit_index(int /*<<< orphan*/);
int /*<<< orphan*/ single_bit(int /*<<< orphan*/);
uint64_t highest_bit(uint64_t bits) {
  return single_bit(highest_bit_index(bits));
}


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

x86 assembly (clang, -O2):
<highest_bit>:
push   %rax
call   1030 <highest_bit_index@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <single_bit@plt>

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

LLVM IR (-O2):
define i32 @highest_bit(i32 %0) {
%2 = tail call i32 @highest_bit_index(i32 %0)
%3 = tail call i32 @single_bit(i32 %2)
ret i32 %3
}
/* Variables and functions */
int ebbrt_newlib_isatty(int);
int isatty(int fd) { return ebbrt_newlib_isatty(fd); }


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

x86 assembly (clang, -O2):
<isatty>:
jmp    1030 <ebbrt_newlib_isatty@plt>

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

LLVM IR (-O2):
define i32 @isatty(i32 %0) {
%2 = tail call i32 @ebbrt_newlib_isatty(i32 %0)
ret i32 %2
}
/* Type definitions */
struct reset_control {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ WARN_ON(int);
int reset_control_status(struct reset_control *rstc) {
  WARN_ON(1);
  return 0;
}


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

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

LLVM IR (-O0):
%struct.reset_control = type { i32 }
define i32 @reset_control_status(%struct.reset_control* %0) {
%2 = alloca %struct.reset_control*
store %struct.reset_control* %0, %struct.reset_control** %2
%3 = call i32 @WARN_ON(i32 1)
ret i32 0
}

LLVM IR (-O2):
%struct.reset_control = type { i32 }
define i32 @reset_control_status(%struct.reset_control* nocapture readnone %0) {
%2 = tail call i32 @WARN_ON(i32 1)
ret i32 0
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
scalar_t__ getpid();
uint64_t getMachineId() { return (uint64_t)getpid() % (2 ^ (5)); }


x86 assembly (clang, -O0):
<getMachineId>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    $0x7,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getMachineId>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
movslq %eax,%rcx
imul   $0xffffffff92492493,%rcx,%rax
shr    $0x20,%rax
add    %ecx,%eax
mov    %eax,%edx
shr    $0x1f,%edx
sar    $0x2,%eax
add    %edx,%eax
lea    0x0(,%rax,8),%edx
sub    %edx,%eax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @getMachineId() {
%1 = call i64 (...) @getpid()
%2 = trunc i64 %1 to i32
%3 = srem i32 %2, 7
ret i32 %3
}

LLVM IR (-O2):
define i32 @getMachineId() {
%1 = tail call i64 (...) @getpid()
%2 = trunc i64 %1 to i32
%3 = srem i32 %2, 7
ret i32 %3
}
int ecm_sfe_ipv4_init(struct dentry *dentry) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.dentry = type opaque
define i32 @ecm_sfe_ipv4_init(%struct.dentry* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void SysCtlVoltageEventConfig(uint32_t ui32Config) {
  (*((volatile uint32_t *)(0x400FE038))) = ui32Config;
}


x86 assembly (clang, -O0):
<SysCtlVoltageEventConfig>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x400fe038,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlVoltageEventConfig>:
mov    %edi,0x400fe038
ret

LLVM IR (-O0):
define void @SysCtlVoltageEventConfig(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
store volatile i32 %3, i32* inttoptr (i64 1074782264 to i32*)
ret void
}

LLVM IR (-O2):
define void @SysCtlVoltageEventConfig(i32 %0) {
store volatile i32 %0, i32* inttoptr (i64 1074782264 to i32*)
ret void
}
int fun1136() { return 1136; }


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

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

LLVM IR (-O0):
define i32 @fun1136() {
ret i32 1136
}

LLVM IR (-O2):
define i32 @fun1136() {
ret i32 1136
}
int stoi(const char *str) {
  int i = 0;
  while (*str != '\0') {
    i = i * 10 + *str - '0';
    str++;
  }
  return i;
}


x86 assembly (clang, -O0):
<stoi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1143 <stoi+0x43>
imul   $0xa,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
add    %ecx,%eax
sub    $0x30,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <stoi+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stoi>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <stoi+0x28>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
lea    (%rax,%rax,4),%eax
lea    (%rcx,%rax,2),%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <stoi+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @stoi(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %13, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %12, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = mul nsw i32 %6, 10
%10 = add i32 %9, -48
%11 = add i32 %10, %8
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %16
}
float convert_float_rtp(unsigned long long int x) {
  union {
    unsigned long int u;
    float f;
  } u;
  u.f = (float)x;
  if ((unsigned long long int)u.f < x && x < (0xffffff8000000000ULL))
    u.u++;
  return u.f;
}


x86 assembly (clang, -O0):
<convert_float_rtp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
shr    %rdx
mov    %eax,%ecx
and    $0x1,%ecx
or     %rdx,%rcx
cvtsi2ss %rcx,%xmm0
addss  %xmm0,%xmm0
cvtsi2ss %rax,%xmm1
movss  %xmm1,-0x18(%rbp)
test   %rax,%rax
movss  %xmm0,-0x14(%rbp)
js     1145 <convert_float_rtp+0x45>
movss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  0xea4(%rip),%xmm2
movaps %xmm0,%xmm1
subss  %xmm2,%xmm1
cvttss2si %xmm1,%rcx
cvttss2si %xmm0,%rax
mov    %rax,%rdx
sar    $0x3f,%rdx
and    %rdx,%rcx
or     %rcx,%rax
cmp    -0x8(%rbp),%rax
jae    11a4 <convert_float_rtp+0xa4>
movabs $0xffffff8000000000,%rax
ff ff ff
cmp    %rax,-0x8(%rbp)
jae    11a4 <convert_float_rtp+0xa4>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_float_rtp>:
test   %rdi,%rdi
js     110c <convert_float_rtp+0xc>
cvtsi2ss %rdi,%xmm1
jmp    1123 <convert_float_rtp+0x23>
mov    %rdi,%rax
shr    %rax
mov    %edi,%ecx
and    $0x1,%ecx
or     %rax,%rcx
cvtsi2ss %rcx,%xmm1
addss  %xmm1,%xmm1
cvttss2si %xmm1,%rax
mov    %rax,%rcx
sar    $0x3f,%rcx
movaps %xmm1,%xmm0
subss  0xec6(%rip),%xmm0
cvttss2si %xmm0,%rdx
and    %rcx,%rdx
or     %rax,%rdx
mov    %rdi,%rax
shr    $0x27,%rax
cmp    %rdi,%rdx
jb     115e <convert_float_rtp+0x5e>
movdqa %xmm1,%xmm0
cmp    $0x1ffffff,%eax
jae    1170 <convert_float_rtp+0x70>
jmp    1174 <convert_float_rtp+0x74>
movd   %xmm1,%ecx
add    $0x1,%ecx
movd   %ecx,%xmm0
cmp    $0x1ffffff,%eax
jb     1174 <convert_float_rtp+0x74>
movdqa %xmm1,%xmm0
ret

LLVM IR (-O0):
%union.anon = type { i64 }
define float @convert_float_rtp(i64 %0) {
%2 = alloca i64
%3 = alloca %union.anon
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = uitofp i64 %4 to float
%6 = bitcast %union.anon* %3 to float*
store float %5, float* %6
%7 = bitcast %union.anon* %3 to float*
%8 = load float, float* %7
%9 = fptoui float %8 to i64
%10 = load i64, i64* %2
%11 = icmp ult i64 %9, %10
br i1 %11, label %12, label %19
12: ; preds = %1
%13 = load i64, i64* %2
%14 = icmp ult i64 %13, -549755813888
br i1 %14, label %15, label %19
15: ; preds = %12
%16 = bitcast %union.anon* %3 to i64*
%17 = load i64, i64* %16
%18 = add i64 %17, 1
store i64 %18, i64* %16
br label %19
19: ; preds = %15, %12, %1
%20 = bitcast %union.anon* %3 to float*
%21 = load float, float* %20
ret float %21
}

LLVM IR (-O2):
define float @convert_float_rtp(i64 %0) {
%2 = uitofp i64 %0 to float
%3 = fptoui float %2 to i64
%4 = icmp ult i64 %3, %0
%5 = icmp ult i64 %0, -549755813888
%6 = and i1 %5, %4
%7 = bitcast float %2 to i32
%8 = add i32 %7, 1
%9 = bitcast i32 %8 to float
%10 = select i1 %6, float %9, float %2
ret float %10
}
unsigned int cvmx_coremask_range(unsigned int low, unsigned int high) {
  return ((0xFFFFFFFFu >> ((32) - 1 - high + low)) << low);
}


x86 assembly (clang, -O0):
<cvmx_coremask_range>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x1f,%ecx
sub    -0x8(%rbp),%ecx
add    -0x4(%rbp),%ecx
mov    $0xffffffff,%eax
shr    %cl,%eax
mov    -0x4(%rbp),%ecx
shl    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cvmx_coremask_range>:
mov    %edi,%ecx
sub    %esi,%ecx
add    $0x1f,%cl
mov    $0xffffffff,%eax
shr    %cl,%eax
mov    %edi,%ecx
shl    %cl,%eax
ret

LLVM IR (-O0):
define i32 @cvmx_coremask_range(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = sub i32 31, %5
%7 = load i32, i32* %3
%8 = add i32 %6, %7
%9 = lshr i32 -1, %8
%10 = load i32, i32* %3
%11 = shl i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @cvmx_coremask_range(i32 %0, i32 %1) {
%3 = add i32 %0, 31
%4 = sub i32 %3, %1
%5 = lshr i32 -1, %4
%6 = shl i32 %5, %0
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isgraph(int);
void t_isgraph_0x2f() {
  Assert_real((isgraph(47)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isgraph.c",
              240, ("isgraph should be 1 for /"));
}


x86 assembly (clang, -O0):
<t_isgraph_0x2f>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2f,%edi
call   1040 <isgraph@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0xf0,%edx
lea    0xf65(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isgraph_0x2f>:
push   %rax
mov    $0x2f,%edi
call   1040 <isgraph@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0xf0,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for /\00"
define void @t_isgraph_0x2f() {
%1 = call i32 @isgraph(i32 47)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 240, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for /\00"
define void @t_isgraph_0x2f() {
%1 = tail call i32 @isgraph(i32 47)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 240, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void gtk_drag_finish() {}


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

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

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

LLVM IR (-O2):
define void @gtk_drag_finish() {
ret void
}
void func8(void) {}


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

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

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

LLVM IR (-O2):
define void @func8() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
void destroy_vector(int **vector) {
  if (vector && *vector) {
    free(*vector);
    vector = NULL;
  }
}


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

x86 assembly (clang, -O2):
<destroy_vector>:
test   %rdi,%rdi
je     1122 <destroy_vector+0x12>
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1122 <destroy_vector+0x12>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @destroy_vector(i32** %0) {
%2 = icmp eq i32** %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = load i32*, i32** %0
%5 = icmp eq i32* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @free(i32* %4)
br label %8
8: ; preds = %6, %3, %1
ret void
}