xunge/DecIR huggingface dataset:
int test_imm_EFint32_mem(int *val) {
  return ((*val) & (0xEF << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_EFint32_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
and    $0xef,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_EFint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 239
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int f(int n) { return - -n; }


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

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

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

LLVM IR (-O2):
define i32 @f(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ TCXONC;
int __ioctl(int, int /*<<< orphan*/, int);
int tcflow(int fd, int action) { return __ioctl(fd, TCXONC, action); }


x86 assembly (clang, -O0):
<tcflow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
call   1030 <__ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcflow>:
mov    %esi,%edx
mov    0x2ecf(%rip),%rax
mov    (%rax),%esi
jmp    1030 <__ioctl@plt>

LLVM IR (-O0):
@TCXONC = global i32 0
define i32 @tcflow(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* @TCXONC
%7 = load i32, i32* %4
%8 = call i32 @__ioctl(i32 %5, i32 %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@TCXONC = global i32 0
define i32 @tcflow(i32 %0, i32 %1) {
%3 = load i32, i32* @TCXONC
%4 = tail call i32 @__ioctl(i32 %0, i32 %3, i32 %1)
ret i32 %4
}
void vcopy(const float *v1, float *v2) {
  signed int i = 0;
  while (i < 3) {
    v2[(signed long int)i] = v1[(signed long int)i];
    i = i + 1;
  }
}


x86 assembly (clang, -O0):
<vcopy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x3,-0x14(%rbp)
jge    1145 <vcopy+0x45>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <vcopy+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<vcopy>:
movss  (%rdi),%xmm0
movss  %xmm0,(%rsi)
movss  0x4(%rdi),%xmm0
movss  %xmm0,0x4(%rsi)
movss  0x8(%rdi),%xmm0
movss  %xmm0,0x8(%rsi)
ret

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

LLVM IR (-O2):
define void @vcopy(float* nocapture %0, float* nocapture writeonly %1) {
%3 = load float, float* %0
store float %3, float* %1
%4 = getelementptr inbounds float, float* %0, i64 1
%5 = load float, float* %4
%6 = getelementptr inbounds float, float* %1, i64 1
store float %5, float* %6
%7 = getelementptr inbounds float, float* %0, i64 2
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %1, i64 2
store float %8, float* %9
ret void
}
double max3d(double x, double y, double z) {
  return (z > y) ? ((z > x) ? z : x) : ((y > x) ? y : x);
}


x86 assembly (clang, -O0):
<max3d>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    115b <max3d+0x5b>
movsd  -0x18(%rbp),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1142 <max3d+0x42>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    114c <max3d+0x4c>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    118e <max3d+0x8e>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    117a <max3d+0x7a>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    1184 <max3d+0x84>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @max3d(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %6
%8 = load double, double* %5
%9 = fcmp ogt double %7, %8
br i1 %9, label %10, label %20
10: ; preds = %3
%11 = load double, double* %6
%12 = load double, double* %4
%13 = fcmp ogt double %11, %12
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = load double, double* %6
br label %18
16: ; preds = %10
%17 = load double, double* %4
br label %18
18: ; preds = %16, %14
%19 = phi double [ %15, %14 ], [ %17, %16 ]
br label %30
20: ; preds = %3
%21 = load double, double* %5
%22 = load double, double* %4
%23 = fcmp ogt double %21, %22
br i1 %23, label %24, label %26
24: ; preds = %20
%25 = load double, double* %5
br label %28
26: ; preds = %20
%27 = load double, double* %4
br label %28
28: ; preds = %26, %24
%29 = phi double [ %25, %24 ], [ %27, %26 ]
br label %30
30: ; preds = %28, %18
%31 = phi double [ %19, %18 ], [ %29, %28 ]
ret double %31
}

LLVM IR (-O2):
define double @max3d(double %0, double %1, double %2) {
%4 = fcmp ogt double %2, %1
%5 = fcmp ogt double %2, %0
%6 = select i1 %5, double %2, double %0
%7 = fcmp ogt double %1, %0
%8 = select i1 %7, double %1, double %0
%9 = select i1 %4, double %6, double %8
ret double %9
}
void platform_set_working_directory(char *directory) {}


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

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

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

LLVM IR (-O2):
define void @platform_set_working_directory(i8* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ tolower(unsigned char);
__attribute__((nonnull(1))) char *m_strtolower(char *p) {
  for (; *p; p++)
    *p = (char)tolower((unsigned char)*p);
  return p;
}


x86 assembly (clang, -O0):
<m_strtolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <m_strtolower+0x3e>
mov    -0x8(%rbp),%rax
movzbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <m_strtolower+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

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

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


x86 assembly (clang, -O0):
<CX4_op76>:
push   %rbp
mov    %rsp,%rbp
mov    $0x24,%edi
call   1030 <CX4_immediate_reg@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CX4_op76>:
mov    $0x24,%edi
jmp    1030 <CX4_immediate_reg@plt>

LLVM IR (-O0):
define void @CX4_op76() {
%1 = call i32 @CX4_immediate_reg(i32 36)
ret void
}

LLVM IR (-O2):
define void @CX4_op76() {
%1 = tail call i32 @CX4_immediate_reg(i32 36)
ret void
}
/* Variables and functions */
char toupper(char const);
int hash_makehash(const char *token) {
  int res = toupper(token[0]) - 'A';
  return res;
}


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

x86 assembly (clang, -O2):
<hash_makehash>:
push   %rax
movsbl (%rdi),%edi
call   1030 <toupper@plt>
movsbl %al,%eax
add    $0xffffffbf,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @hash_makehash(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = call signext i8 @toupper(i8 signext %6)
%8 = sext i8 %7 to i32
%9 = sub nsw i32 %8, 65
store i32 %9, i32* %3
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @hash_makehash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call signext i8 @toupper(i8 signext %2)
%4 = sext i8 %3 to i32
%5 = add nsw i32 %4, -65
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ EmptyStack(int /*<<< orphan*/, int *);
void astClearStatus_(int *status) {
  EmptyStack(0, status);
  *status = 0;
}


x86 assembly (clang, -O0):
<astClearStatus_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
xor    %edi,%edi
call   1030 <EmptyStack@plt>
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<astClearStatus_>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
mov    %rbx,%rsi
call   1030 <EmptyStack@plt>
movl   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @astClearStatus_(i32* %0) {
%2 = tail call i32 @EmptyStack(i32 0, i32* %0)
store i32 0, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void stub1();
void fun1(void (*ptr)()) {
  (*ptr)();
  printf("Iam in function 1\n");
}


x86 assembly (clang, -O0):
<fun1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   *-0x8(%rbp)
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun1>:
push   %rax
xor    %eax,%eax
call   *%rdi
lea    0xee4(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"Iam in function 1\0A\00"
define void @fun1(void (...)* %0) {
%2 = alloca void (...)*
store void (...)* %0, void (...)** %2
%3 = load void (...)*, void (...)** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [18 x i8] c"Iam in function 1\00"
define void @fun1(void (...)* nocapture %0) {
tail call void (...) %0()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void test2_internal() { printf("test2: target called - failure\n"); }


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

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

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

LLVM IR (-O2):
@str = [31 x i8] c"test2: target called - failure\00"
define void @test2_internal() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double cos(double);
double sin(double);
void PolarToRectD(double mag, double phase, double *outReal, double *outImag) {
  *outReal = mag * cos(phase);
  *outImag = mag * sin(phase);
}


x86 assembly (clang, -O0):
<PolarToRectD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PolarToRectD>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
movapd %xmm1,%xmm0
call   1040 <cos@plt>
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%rbx)
movsd  0x10(%rsp),%xmm0
call   1030 <sin@plt>
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%r14)
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @PolarToRectD(double %0, double %1, double* %2, double* %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double*
%8 = alloca double*
store double %0, double* %5
store double %1, double* %6
store double* %2, double** %7
store double* %3, double** %8
%9 = load double, double* %5
%10 = load double, double* %6
%11 = call double @cos(double %10)
%12 = fmul double %9, %11
%13 = load double*, double** %7
store double %12, double* %13
%14 = load double, double* %5
%15 = load double, double* %6
%16 = call double @sin(double %15)
%17 = fmul double %14, %16
%18 = load double*, double** %8
store double %17, double* %18
ret void
}

LLVM IR (-O2):
define void @PolarToRectD(double %0, double %1, double* nocapture writeonly %2, double* nocapture writeonly %3) {
%5 = tail call double @cos(double %1)
%6 = fmul double %5, %0
store double %6, double* %2
%7 = tail call double @sin(double %1)
%8 = fmul double %7, %0
store double %8, double* %3
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t eor0xf0(uint64_t x) { return x ^ 0xf0; }


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

x86 assembly (clang, -O2):
<eor0xf0>:
mov    %edi,%eax
xor    $0xf0,%eax
ret

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

LLVM IR (-O2):
define i32 @eor0xf0(i32 %0) {
%2 = xor i32 %0, 240
ret i32 %2
}
/* Variables and functions */
void *calloc(int, int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void *xcalloc(int num_of_blocks, int block_size) {
  void *mem_block;
  mem_block = calloc(num_of_blocks, block_size);
  if (mem_block == NULL) {
    fprintf(stderr, "OUT OF MEMMORY : ERR CODE");
  }
  return mem_block;
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115d <xcalloc+0x3d>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
lea    0xea8(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %rbx
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <xcalloc+0x23>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
lea    0xec2(%rip),%rsi
call   1040 <fprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"OUT OF MEMMORY : ERR CODE\00"
define i8* @xcalloc(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i8* @calloc(i32 %6, i32 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %11, %2
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"OUT OF MEMMORY : ERR CODE\00"
define noalias i8* @xcalloc(i32 %0, i32 %1) {
%3 = tail call i8* @calloc(i32 %0, i32 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %5, %2
ret i8* %3
}
int ull_equal(void *location1, void *location2) {
  return (*((unsigned long long *)location1)) ==
         (*((unsigned long long *)location2));
}


x86 assembly (clang, -O0):
<ull_equal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ull_equal>:
mov    (%rdi),%rcx
xor    %eax,%eax
cmp    (%rsi),%rcx
sete   %al
ret

LLVM IR (-O0):
define i32 @ull_equal(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 = bitcast i8* %5 to i64*
%7 = load i64, i64* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i64*
%10 = load i64, i64* %9
%11 = icmp eq i64 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @ull_equal(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp eq i64 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
char *network_error();
int /*<<< orphan*/ printf(char *, char const *, char *);
void pnerror(const char *tips) { printf("%s: %s\n", tips, network_error()); }


x86 assembly (clang, -O0):
<pnerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <network_error@plt>
mov    -0x10(%rbp),%rsi
mov    %rax,%rdx
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pnerror>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <network_error@plt>
lea    0xece(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%s: %s\0A\00"
define void @pnerror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* (...) @network_error()
%5 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s: %s\0A\00"
define void @pnerror(i8* %0) {
%2 = tail call i8* (...) @network_error()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  int x, y, z;
  x = 1;
  y = 2;
  z = 3;
  printf("The sum of %d and %d is %d \n", x, y, z);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [29 x i8] c"The sum of %d and %d is %d \0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 1, i32 2, i32 3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char const *);
void uninitvar_puts(void) {
  const char *s;
  puts(s);
}


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

x86 assembly (clang, -O2):
<uninitvar_puts>:
jmp    1030 <puts@plt>

LLVM IR (-O0):
define void @uninitvar_puts() {
%1 = alloca i8*
%2 = load i8*, i8** %1
%3 = call i32 @puts(i8* %2)
ret void
}

LLVM IR (-O2):
define void @uninitvar_puts() {
%1 = tail call i32 @puts(i8* dereferenceable(1) undef)
ret void
}
void g_closure_new_object() {}


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

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

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

LLVM IR (-O2):
define void @g_closure_new_object() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write_port(int, int);
void disable_cursor(void) {
  write_port(0x3D4, 0x0A);
  write_port(0x3D5, 0x3F);
}


x86 assembly (clang, -O0):
<disable_cursor>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3d4,%edi
mov    $0xa,%esi
call   1030 <write_port@plt>
mov    $0x3d5,%edi
mov    $0x3f,%esi
call   1030 <write_port@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<disable_cursor>:
push   %rax
mov    $0x3d4,%edi
mov    $0xa,%esi
call   1030 <write_port@plt>
mov    $0x3d5,%edi
mov    $0x3f,%esi
pop    %rax
jmp    1030 <write_port@plt>

LLVM IR (-O0):
define void @disable_cursor() {
%1 = call i32 @write_port(i32 980, i32 10)
%2 = call i32 @write_port(i32 981, i32 63)
ret void
}

LLVM IR (-O2):
define void @disable_cursor() {
%1 = tail call i32 @write_port(i32 980, i32 10)
%2 = tail call i32 @write_port(i32 981, i32 63)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Absolute(int);
int /*<<< orphan*/ STX8(int /*<<< orphan*/);
void Op8EX1(void) { STX8(Absolute(2)); }


x86 assembly (clang, -O0):
<Op8EX1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1040 <Absolute@plt>
mov    %eax,%edi
call   1030 <STX8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op8EX1>:
push   %rax
mov    $0x2,%edi
call   1040 <Absolute@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <STX8@plt>

LLVM IR (-O0):
define void @Op8EX1() {
%1 = call i32 @Absolute(i32 2)
%2 = call i32 @STX8(i32 %1)
ret void
}

LLVM IR (-O2):
define void @Op8EX1() {
%1 = tail call i32 @Absolute(i32 2)
%2 = tail call i32 @STX8(i32 %1)
ret void
}
/* Type definitions */
typedef double uint16_t;

/* Variables and functions */
float tick_to_rad(uint16_t tick) { return ((tick * 0.29) * (3.14159 / 180)); }


x86 assembly (clang, -O0):
<tick_to_rad>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xee2(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<tick_to_rad>:
mulsd  0xef8(%rip),%xmm0
mulsd  0xef8(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @tick_to_rad(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 2.900000e-01
%5 = fmul double %4, 0x3F91DF45A50DE270
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @tick_to_rad(double %0) {
%2 = fmul double %0, 2.900000e-01
%3 = fmul double %2, 0x3F91DF45A50DE270
%4 = fptrunc double %3 to float
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sticky() { printf("sticky, pb / peanutbutter.so\n"); }


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"sticky, pb / peanutbutter.so\0A\00"
define void @sticky() {
%1 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [29 x i8] c"sticky, pb / peanutbutter.so\00"
define void @sticky() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
ret void
}
int __attribute__((no)) inegv(int a) { return -a; }


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

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

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

LLVM IR (-O2):
define i32 @inegv(i32 %0) {
%2 = sub nsw i32 0, %0
ret i32 %2
}
/* Variables and functions */
float RAND_MAX;
scalar_t__ rand();
float randn() {
  int i;
  float retval = 0.0f;
  for (i = 0; i < 100; i++) {
    retval += ((float)rand()) / RAND_MAX;
  }
  return (retval - 50.0f) * 0.34641016;
}


x86 assembly (clang, -O0):
<randn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jge    1160 <randn+0x50>
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2ss %rax,%xmm0
mov    0x2ea4(%rip),%rax
divss  (%rax),%xmm0
addss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <randn+0x17>
movss  -0x8(%rbp),%xmm0
movss  0xe9b(%rip),%xmm1
subss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe83(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randn>:
push   %r14
push   %rbx
push   %rax
xorps  %xmm0,%xmm0
mov    $0x64,%ebx
mov    0x2ec5(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movss  %xmm0,0x4(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
divss  (%r14),%xmm0
movss  0x4(%rsp),%xmm1
addss  %xmm0,%xmm1
movss  %xmm1,0x4(%rsp)
movss  0x4(%rsp),%xmm0
add    $0xffffffff,%ebx
jne    1130 <randn+0x20>
addss  0xe93(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xe8f(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@RAND_MAX = global float 0.000000e+00
define float @randn() {
%1 = alloca i32
%2 = alloca float
store float 0.000000e+00, float* %2
store i32 0, i32* %1
br label %3
3: ; preds = %13, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 100
br i1 %5, label %6, label %16
6: ; preds = %3
%7 = call i64 (...) @rand()
%8 = sitofp i64 %7 to float
%9 = load float, float* @RAND_MAX
%10 = fdiv float %8, %9
%11 = load float, float* %2
%12 = fadd float %11, %10
store float %12, float* %2
br label %13
13: ; preds = %6
%14 = load i32, i32* %1
%15 = add nsw i32 %14, 1
store i32 %15, i32* %1
br label %3
16: ; preds = %3
%17 = load float, float* %2
%18 = fsub float %17, 5.000000e+01
%19 = fpext float %18 to double
%20 = fmul double %19, 0x3FD62B95850CEFA8
%21 = fptrunc double %20 to float
ret float %21
}

LLVM IR (-O2):
@RAND_MAX = global float 0.000000e+00
define float @randn() {
br label %1
1: ; preds = %0, %1
%2 = phi float [ 0.000000e+00, %0 ], [ %8, %1 ]
%3 = phi i32 [ 0, %0 ], [ %9, %1 ]
%4 = tail call i64 (...) @rand()
%5 = sitofp i64 %4 to float
%6 = load float, float* @RAND_MAX
%7 = fdiv float %5, %6
%8 = fadd float %2, %7
%9 = add nuw nsw i32 %3, 1
%10 = icmp eq i32 %9, 100
br i1 %10, label %11, label %1
11: ; preds = %1
%12 = fadd float %8, -5.000000e+01
%13 = fpext float %12 to double
%14 = fmul double %13, 0x3FD62B95850CEFA8
%15 = fptrunc double %14 to float
ret float %15
}
/* Variables and functions */
int /*<<< orphan*/ foo1(int /*<<< orphan*/);
int /*<<< orphan*/ foo2(int /*<<< orphan*/);
void bar() {
  foo1(0);
  foo2(0);
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <foo1@plt>
xor    %edi,%edi
call   1030 <foo2@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rax
xor    %edi,%edi
call   1040 <foo1@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <foo2@plt>

LLVM IR (-O0):
define void @bar() {
%1 = call i32 @foo1(i32 0)
%2 = call i32 @foo2(i32 0)
ret void
}

LLVM IR (-O2):
define void @bar() {
%1 = tail call i32 @foo1(i32 0)
%2 = tail call i32 @foo2(i32 0)
ret void
}
int big_endian(void) {
  int x = 2;
  char *s;
  s = (char *)&x;
  return (s[0] == 0);
}


x86 assembly (clang, -O0):
<big_endian>:
push   %rbp
mov    %rsp,%rbp
movl   $0x2,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @big_endian() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int fun1(int, int *, int *, int);
int g(int, int *, int *, int);
int main() {
  int loc1 = 7, loc2 = 9, loc3 = 11;
  if (g(5, &loc1, &loc2, 13) != 34)
    exit(1);
  if (fun1(1, &loc1, &loc3, 7) != 26)
    exit(2);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x7,-0x8(%rbp)
movl   $0x9,-0xc(%rbp)
movl   $0xb,-0x10(%rbp)
mov    $0x5,%edi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
mov    $0xd,%ecx
call   1040 <g@plt>
cmp    $0x22,%eax
je     117e <main+0x4e>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    $0x1,%edi
lea    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdx
mov    $0x7,%ecx
call   1030 <fun1@plt>
cmp    $0x1a,%eax
je     11a8 <main+0x78>
mov    $0x2,%edi
call   1050 <exit@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movl   $0x7,0xc(%rsp)
movl   $0x9,0x14(%rsp)
movl   $0xb,0x10(%rsp)
lea    0xc(%rsp),%rsi
lea    0x14(%rsp),%rdx
mov    $0x5,%edi
mov    $0xd,%ecx
call   1040 <g@plt>
cmp    $0x22,%eax
jne    118f <main+0x5f>
lea    0xc(%rsp),%rsi
lea    0x10(%rsp),%rdx
mov    $0x1,%edi
mov    $0x7,%ecx
call   1030 <fun1@plt>
cmp    $0x1a,%eax
jne    1199 <main+0x69>
xor    %edi,%edi
call   1050 <exit@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    $0x2,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 7, i32* %2
store i32 9, i32* %3
store i32 11, i32* %4
%5 = call i32 @g(i32 5, i32* %2, i32* %3, i32 13)
%6 = icmp ne i32 %5, 34
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @exit(i32 1)
unreachable
9: ; preds = %0
%10 = call i32 @fun1(i32 1, i32* %2, i32* %4, i32 7)
%11 = icmp ne i32 %10, 26
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = call i32 @exit(i32 2)
unreachable
14: ; preds = %9
%15 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
store i32 7, i32* %1
%5 = bitcast i32* %2 to i8*
store i32 9, i32* %2
%6 = bitcast i32* %3 to i8*
store i32 11, i32* %3
%7 = call i32 @g(i32 5, i32* %1, i32* %2, i32 13)
%8 = icmp eq i32 %7, 34
br i1 %8, label %11, label %9
9: ; preds = %0
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %0
%12 = call i32 @fun1(i32 1, i32* %1, i32* %3, i32 7)
%13 = icmp eq i32 %12, 26
br i1 %13, label %16, label %14
14: ; preds = %11
%15 = call i32 @exit(i32 2)
unreachable
16: ; preds = %11
%17 = call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
void CRadix(unsigned char **, size_t);
void cradix(unsigned char **strings, size_t n) { return CRadix(strings, n); }


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

x86 assembly (clang, -O2):
<cradix>:
jmp    1030 <CRadix@plt>

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

LLVM IR (-O2):
define void @cradix(i8** %0, i64 %1) {
tail call void @CRadix(i8** %0, i64 %1)
ret void
}
int extract_jhint(insn, invalid)
unsigned insn;
int *invalid __attribute__((unused));
{ return 4 * (((insn & 0x3FFF) ^ 0x2000) - 0x2000); }


x86 assembly (clang, -O0):
<extract_jhint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    $0x3fff,%eax
xor    $0x2000,%eax
sub    $0x2000,%eax
shl    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<extract_jhint>:
mov    %edi,%eax
shl    $0x12,%eax
sar    $0x10,%eax
ret

LLVM IR (-O0):
define i32 @extract_jhint(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32, i32* %3
%6 = and i32 %5, 16383
%7 = xor i32 %6, 8192
%8 = sub i32 %7, 8192
%9 = mul i32 4, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @extract_jhint(i32 %0, i32* nocapture readnone %1) {
%3 = shl i32 %0, 18
%4 = ashr exact i32 %3, 16
ret i32 %4
}
int main() {
  long broj = 3.141592653590L;
  int den = 0;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void swap(void **a, void **b) {
  void *t;
  t = *a;
  *a = *b;
  *b = t;
}


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

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

LLVM IR (-O0):
define void @swap(i8** %0, i8** %1) {
%3 = alloca i8**
%4 = alloca i8**
%5 = alloca i8*
store i8** %0, i8*** %3
store i8** %1, i8*** %4
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
store i8* %7, i8** %5
%8 = load i8**, i8*** %4
%9 = load i8*, i8** %8
%10 = load i8**, i8*** %3
store i8* %9, i8** %10
%11 = load i8*, i8** %5
%12 = load i8**, i8*** %4
store i8* %11, i8** %12
ret void
}

LLVM IR (-O2):
define void @swap(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** %1
store i8* %4, i8** %0
store i8* %3, i8** %1
ret void
}
int main() {
  *(volatile int *)(0x0 + 0x3000 + 0xFF200000) = 0x00800000;
  *(volatile int *)(0x0 + 0x1000 + 0xFF200000) = 0x00800000;
  *(volatile int *)(0x4 + 0x1000 + 0xFF200000) = 0x00000000;
  *(volatile int *)(0x8 + 0x1000 + 0xFF200000) = 0x00000000;
  *(volatile int *)(0xC + 0x1000 + 0xFF200000) = 0x00000000;
  *(volatile int *)(0x10 + 0x1000 + 0xFF200000) = 0x00000000;
  *(volatile int *)(0x14 + 0x1000 + 0xFF200000) = 0x00000000;
  while (1) {
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0xff203000,%eax
movl   $0x800000,(%rax)
mov    $0xff201000,%eax
movl   $0x800000,(%rax)
mov    $0xff201004,%eax
movl   $0x0,(%rax)
mov    $0xff201008,%eax
movl   $0x0,(%rax)
mov    $0xff20100c,%eax
movl   $0x0,(%rax)
mov    $0xff201010,%eax
movl   $0x0,(%rax)
mov    $0xff201014,%eax
movl   $0x0,(%rax)
jmp    1158 <main+0x58>

x86 assembly (clang, -O2):
<main>:
mov    $0xff201000,%eax
movl   $0x800000,0x2000(%rax)
movl   $0x800000,(%rax)
movl   $0x0,0x4(%rax)
movl   $0x0,0x8(%rax)
movl   $0x0,0xc(%rax)
movl   $0x0,0x10(%rax)
movl   $0x0,0x14(%rax)
nopl   0x0(%rax,%rax,1)
jmp    1140 <main+0x40>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
store volatile i32 8388608, i32* inttoptr (i64 4280299520 to i32*)
store volatile i32 8388608, i32* inttoptr (i64 4280291328 to i32*)
store volatile i32 0, i32* inttoptr (i64 4280291332 to i32*)
store volatile i32 0, i32* inttoptr (i64 4280291336 to i32*)
store volatile i32 0, i32* inttoptr (i64 4280291340 to i32*)
store volatile i32 0, i32* inttoptr (i64 4280291344 to i32*)
store volatile i32 0, i32* inttoptr (i64 4280291348 to i32*)
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
define i32 @main() {
store volatile i32 8388608, i32* inttoptr (i64 4280299520 to i32*)
store volatile i32 8388608, i32* inttoptr (i64 4280291328 to i32*)
store volatile i32 0, i32* inttoptr (i64 4280291332 to i32*)
store volatile i32 0, i32* inttoptr (i64 4280291336 to i32*)
store volatile i32 0, i32* inttoptr (i64 4280291340 to i32*)
store volatile i32 0, i32* inttoptr (i64 4280291344 to i32*)
store volatile i32 0, i32* inttoptr (i64 4280291348 to i32*)
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int sweep_get_dobldobl_start(int n, double *c) {
  int fail, ptos[2];
  ptos[0] = 1;
  ptos[1] = 0;
  fail = _ada_use_c2phc4c(619, ptos, &n, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<sweep_get_dobldobl_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x1c(%rbp)
movl   $0x0,-0x18(%rbp)
lea    -0x1c(%rbp),%rsi
mov    -0x10(%rbp),%rcx
mov    $0x26b,%edi
lea    -0x4(%rbp),%rdx
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sweep_get_dobldobl_start>:
sub    $0x18,%rsp
mov    %rsi,%rcx
mov    %edi,0xc(%rsp)
movq   $0x1,0x10(%rsp)
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
mov    $0x26b,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @sweep_get_dobldobl_start(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca double*
%5 = alloca i32
%6 = alloca [2 x i32]
store i32 %0, i32* %3
store double* %1, double** %4
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
store i32 1, i32* %7
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
store i32 0, i32* %8
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%10 = load double*, double** %4
%11 = call i32 @_ada_use_c2phc4c(i32 619, i32* %9, i32* %3, double* %10, i32 0)
store i32 %11, i32* %5
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
define i32 @sweep_get_dobldobl_start(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca [2 x i32]
store i32 %0, i32* %3
%5 = bitcast [2 x i32]* %4 to i8*
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
store i32 1, i32* %6
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
store i32 0, i32* %7
%8 = call i32 @_ada_use_c2phc4c(i32 619, i32* %6, i32* %3, double* %1, i32 0)
ret i32 %8
}
void ble_rsp_attclient_read_long(
    const struct ble_msg_attclient_read_long_rsp_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.ble_msg_attclient_read_long_rsp_t = type opaque
define void @ble_rsp_attclient_read_long(%struct.ble_msg_attclient_read_long_rsp_t* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;
typedef int /*<<< orphan*/ beval;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/ *);
int /*<<< orphan*/ htobe16(int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
void knot_wire_write_u16(uint8_t *pos, uint16_t data) {
  assert(pos);
  uint16_t beval = htobe16(data);
  memcpy(pos, &beval, sizeof(beval));
}


x86 assembly (clang, -O0):
<knot_wire_write_u16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <assert@plt>
mov    -0xc(%rbp),%edi
call   1050 <htobe16@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<knot_wire_write_u16>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <assert@plt>
mov    %ebp,%edi
call   1050 <htobe16@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1040 <memcpy@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @knot_wire_write_u16(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32*, i32** %3
%7 = call i32 @assert(i32* %6)
%8 = load i32, i32* %4
%9 = call i32 @htobe16(i32 %8)
store i32 %9, i32* %5
%10 = load i32*, i32** %3
%11 = call i32 @memcpy(i32* %10, i32* %5, i32 4)
ret void
}

LLVM IR (-O2):
define void @knot_wire_write_u16(i32* %0, i32 %1) {
%3 = alloca i32
%4 = tail call i32 @assert(i32* %0)
%5 = bitcast i32* %3 to i8*
%6 = tail call i32 @htobe16(i32 %1)
store i32 %6, i32* %3
%7 = call i32 @memcpy(i32* %0, i32* %3, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int mod_test(const char *mod_var, char **dst) {
  printf("here\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [5 x i8] c"here\00"
define i32 @mod_test(i8* nocapture readnone %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ if_freed_invalid_latent(int, int /*<<< orphan*/ *);
void call_if_freed_invalid_latent(int x) {
  if (x > 0) {
    if_freed_invalid_latent(x, NULL);
  }
}


x86 assembly (clang, -O0):
<call_if_freed_invalid_latent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1131 <call_if_freed_invalid_latent+0x21>
mov    -0x4(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <if_freed_invalid_latent@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_if_freed_invalid_latent>:
test   %edi,%edi
jle    111b <call_if_freed_invalid_latent+0xb>
xor    %esi,%esi
jmp    1030 <if_freed_invalid_latent@plt>
ret

LLVM IR (-O0):
define void @call_if_freed_invalid_latent(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 @if_freed_invalid_latent(i32 %6, i32* null)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @call_if_freed_invalid_latent(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @if_freed_invalid_latent(i32 %0, i32* null)
br label %5
5: ; preds = %3, %1
ret void
}