xunge/DecIR huggingface dataset:
/* Variables and functions */
float logf(int /*<<< orphan*/);
int /*<<< orphan*/ tanhf(float);
float phi(float _x) { return -logf(tanhf(_x / 2.0f + 1e-12)); }


x86 assembly (clang, -O0):
<phi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xece(%rip),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeb6(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <tanhf@plt>
mov    %eax,%edi
call   1040 <logf@plt>
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<phi>:
push   %rax
mulss  0xed7(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0xed3(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <tanhf@plt>
mov    %eax,%edi
call   1040 <logf@plt>
xorps  0xec4(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @phi(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fdiv float %3, 2.000000e+00
%5 = fpext float %4 to double
%6 = fadd double %5, 0x3D719799812DEA11
%7 = fptrunc double %6 to float
%8 = call i32 @tanhf(float %7)
%9 = call float @logf(i32 %8)
%10 = fneg float %9
ret float %10
}

LLVM IR (-O2):
define float @phi(float %0) {
%2 = fmul float %0, 5.000000e-01
%3 = fpext float %2 to double
%4 = fadd double %3, 0x3D719799812DEA11
%5 = fptrunc double %4 to float
%6 = tail call i32 @tanhf(float %5)
%7 = tail call float @logf(i32 %6)
%8 = fneg float %7
ret float %8
}
/* Variables and functions */
scalar_t__ size_to_objp(size_t);
void *compare_mem_context(size_t n) { return (void *)size_to_objp(n); }


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

x86 assembly (clang, -O2):
<compare_mem_context>:
jmp    1030 <size_to_objp@plt>

LLVM IR (-O0):
define i8* @compare_mem_context(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @size_to_objp(i64 %3)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
define i8* @compare_mem_context(i64 %0) {
%2 = tail call i64 @size_to_objp(i64 %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
/* Variables and functions */
char *crypt(char *, char *);
scalar_t__ strlen(char *);
char *kattach_thedawn_chkpass(char *dfpass, char *encpass) {
  char *passwd;
  if (strlen(dfpass) == 0)
    return (NULL);
  passwd = crypt(dfpass, encpass);
  return (passwd);
}


x86 assembly (clang, -O0):
<kattach_thedawn_chkpass>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x0,%rax
jne    1150 <kattach_thedawn_chkpass+0x30>
movq   $0x0,-0x8(%rbp)
jmp    1169 <kattach_thedawn_chkpass+0x49>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <crypt@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kattach_thedawn_chkpass>:
cmpb   $0x0,(%rdi)
je     111a <kattach_thedawn_chkpass+0xa>
jmp    1030 <crypt@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @kattach_thedawn_chkpass(i8* %0, i8* %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i8* @crypt(i8* %0, i8* %1)
br label %7
7: ; preds = %2, %5
%8 = phi i8* [ %6, %5 ], [ null, %2 ]
ret i8* %8
}
unsigned t2(unsigned X) { return __builtin_clz(X); }


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

x86 assembly (clang, -O2):
<t2>:
bsr    %edi,%eax
xor    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @t2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @llvm.ctlz.i32(i32 %3, i1 true)
ret i32 %4
}

LLVM IR (-O2):
define i32 @t2(i32 %0) {
%2 = tail call i32 @llvm.ctlz.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ assume(int);
int main() {
  int i;
  int k;
  assume(0 <= k && k <= 1 && i == 1);
  while (1) {
    i = i + 1;
    k = k - 1;
    assert(1 <= i + k && i + k <= 2 && i >= 1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
xor    %ecx,%ecx
cmp    -0xc(%rbp),%ecx
mov    %al,-0xd(%rbp)
jg     1158 <main+0x38>
xor    %eax,%eax
cmpl   $0x1,-0xc(%rbp)
mov    %al,-0xd(%rbp)
jg     1158 <main+0x38>
cmpl   $0x1,-0x8(%rbp)
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assume@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edx
add    -0xc(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %edx,%ecx
mov    %al,-0xe(%rbp)
jg     11ad <main+0x8d>
mov    -0x8(%rbp),%ecx
add    -0xc(%rbp),%ecx
xor    %eax,%eax
cmp    $0x2,%ecx
mov    %al,-0xe(%rbp)
jg     11ad <main+0x8d>
cmpl   $0x1,-0x8(%rbp)
setge  %al
mov    %al,-0xe(%rbp)
mov    -0xe(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
jmp    1165 <main+0x45>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <assume@plt>
nopl   0x0(%rax,%rax,1)
xor    %edi,%edi
call   1030 <assert@plt>
jmp    1130 <main+0x10>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assume(i32 0)
br label %2
2: ; preds = %2, %0
%3 = tail call i32 @assert(i32 0)
br label %2
}
float tan(float x) { return native_tan(((x)*0.01745329251f)); }


x86 assembly (clang, -O0):
<tan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xedb(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    $0x1,%al
call   1030 <native_tan@plt>
cvtsi2ss %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tan>:
push   %rax
mulss  0xee7(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
mov    $0x1,%al
call   1030 <native_tan@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @tan(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float %3, 0x3F91DF46A0000000
%5 = fpext float %4 to double
%6 = call i32 (double, ...) bitcast (i32 (...)* @native_tan to i32 (double, ...)*)(double %5)
%7 = sitofp i32 %6 to float
ret float %7
}

LLVM IR (-O2):
define float @tan(float %0) {
%2 = fmul float %0, 0x3F91DF46A0000000
%3 = fpext float %2 to double
%4 = tail call i32 (double, ...) bitcast (i32 (...)* @native_tan to i32 (double, ...)*)(double %3)
%5 = sitofp i32 %4 to float
ret float %5
}
int isPrime(n) {
  int i;
  if (n == 0 || n == 1 || n == 2 || n == 3)
    return 1;
  for (i = 2; i <= n / 2; i++) {
    if (n % i == 0)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<isPrime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112f <isPrime+0x2f>
cmpl   $0x1,-0x8(%rbp)
je     112f <isPrime+0x2f>
cmpl   $0x2,-0x8(%rbp)
je     112f <isPrime+0x2f>
cmpl   $0x3,-0x8(%rbp)
jne    113b <isPrime+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1196 <isPrime+0x96>
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jg     118f <isPrime+0x8f>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    117c <isPrime+0x7c>
movl   $0x0,-0x4(%rbp)
jmp    1196 <isPrime+0x96>
jmp    1181 <isPrime+0x81>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1142 <isPrime+0x42>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPrime>:
mov    $0x1,%r8d
cmp    $0x4,%edi
jl     1137 <isPrime+0x37>
mov    %edi,%esi
shr    %esi
neg    %esi
mov    $0x2,%ecx
cs nopw 0x0(%rax,%rax,1)
mov    %edi,%eax
cltd
idiv   %ecx
test   %edx,%edx
je     113b <isPrime+0x3b>
lea    (%rsi,%rcx,1),%eax
add    $0x1,%eax
add    $0x1,%ecx
cmp    $0x1,%eax
jne    1120 <isPrime+0x20>
mov    %r8d,%eax
ret
xor    %r8d,%r8d
mov    %r8d,%eax
ret

LLVM IR (-O0):
define i32 @isPrime(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 0
br i1 %6, label %16, label %7
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 1
br i1 %9, label %16, label %10
10: ; preds = %7
%11 = load i32, i32* %3
%12 = icmp eq i32 %11, 2
br i1 %12, label %16, label %13
13: ; preds = %10
%14 = load i32, i32* %3
%15 = icmp eq i32 %14, 3
br i1 %15, label %16, label %17
16: ; preds = %13, %10, %7, %1
store i32 1, i32* %2
br label %34
17: ; preds = %13
store i32 2, i32* %4
br label %18
18: ; preds = %30, %17
%19 = load i32, i32* %4
%20 = load i32, i32* %3
%21 = sdiv i32 %20, 2
%22 = icmp sle i32 %19, %21
br i1 %22, label %23, label %33
23: ; preds = %18
%24 = load i32, i32* %3
%25 = load i32, i32* %4
%26 = srem i32 %24, %25
%27 = icmp eq i32 %26, 0
br i1 %27, label %28, label %29
28: ; preds = %23
store i32 0, i32* %2
br label %34
29: ; preds = %23
br label %30
30: ; preds = %29
%31 = load i32, i32* %4
%32 = add nsw i32 %31, 1
store i32 %32, i32* %4
br label %18
33: ; preds = %18
store i32 1, i32* %2
br label %34
34: ; preds = %33, %28, %16
%35 = load i32, i32* %2
ret i32 %35
}

LLVM IR (-O2):
define i32 @isPrime(i32 %0) {
%2 = icmp slt i32 %0, 4
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = lshr i32 %0, 1
br label %8
5: ; preds = %8
%6 = add nuw nsw i32 %9, 1
%7 = icmp eq i32 %9, %4
br i1 %7, label %12, label %8
8: ; preds = %3, %5
%9 = phi i32 [ %6, %5 ], [ 2, %3 ]
%10 = srem i32 %0, %9
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %8, %5, %1
%13 = phi i32 [ 1, %1 ], [ 0, %8 ], [ 1, %5 ]
ret i32 %13
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void SysCtlPeripheralSleepEnable(uint32_t ui32Peripheral) {
  ;
  (*((volatile unsigned long
          *)(((unsigned long)(0x400fe700 + ((ui32Peripheral & 0xff00) >> 8)) &
              0xF0000000) |
             0x02000000 |
             (((unsigned long)(0x400fe700 + ((ui32Peripheral & 0xff00) >> 8)) &
               0x000FFFFF)
              << 5) |
             ((ui32Peripheral & 0xff) << 2)))) = 1;
}


x86 assembly (clang, -O0):
<SysCtlPeripheralSleepEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff00,%eax
sar    $0x8,%eax
add    $0x400fe700,%eax
cltq
movabs $0xf0000000,%rcx
and    %rcx,%rax
or     $0x2000000,%rax
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
sar    $0x8,%ecx
add    $0x400fe700,%ecx
movslq %ecx,%rcx
and    $0xfffff,%rcx
shl    $0x5,%rcx
or     %rcx,%rax
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
shl    $0x2,%ecx
movslq %ecx,%rcx
or     %rcx,%rax
movq   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlPeripheralSleepEnable>:
movzbl %dil,%eax
shr    $0x3,%edi
and    $0x1fe0,%edi
shl    $0x2,%eax
or     %edi,%eax
movq   $0x1,0x43fce000(%rax)
ret

LLVM IR (-O0):
define void @SysCtlPeripheralSleepEnable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 65280
%5 = ashr i32 %4, 8
%6 = add nsw i32 1074784000, %5
%7 = sext i32 %6 to i64
%8 = and i64 %7, 4026531840
%9 = or i64 %8, 33554432
%10 = load i32, i32* %2
%11 = and i32 %10, 65280
%12 = ashr i32 %11, 8
%13 = add nsw i32 1074784000, %12
%14 = sext i32 %13 to i64
%15 = and i64 %14, 1048575
%16 = shl i64 %15, 5
%17 = or i64 %9, %16
%18 = load i32, i32* %2
%19 = and i32 %18, 255
%20 = shl i32 %19, 2
%21 = sext i32 %20 to i64
%22 = or i64 %17, %21
%23 = inttoptr i64 %22 to i64*
store volatile i64 1, i64* %23
ret void
}

LLVM IR (-O2):
define void @SysCtlPeripheralSleepEnable(i32 %0) {
%2 = lshr i32 %0, 3
%3 = and i32 %2, 8160
%4 = shl i32 %0, 2
%5 = and i32 %4, 1020
%6 = or i32 %5, %3
%7 = or i32 %6, 1140645888
%8 = zext i32 %7 to i64
%9 = inttoptr i64 %8 to i64*
store volatile i64 1, i64* %9
ret void
}
void swap(float *a, float *b) {
  float tmp = *a;
  *a = *b;
  *b = tmp;
}


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

x86 assembly (clang, -O2):
<swap>:
movss  (%rdi),%xmm0
movss  (%rsi),%xmm1
movss  %xmm1,(%rdi)
movss  %xmm0,(%rsi)
ret

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

LLVM IR (-O2):
define void @swap(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = load float, float* %1
store float %4, float* %0
store float %3, float* %1
ret void
}
/* Variables and functions */
char **readdir_raw(char *, int /*<<< orphan*/, char *);
char **stb_readdir_files_mask(char *dir, char *wild) {
  return readdir_raw(dir, 0, wild);
}


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

x86 assembly (clang, -O2):
<stb_readdir_files_mask>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <readdir_raw@plt>

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

LLVM IR (-O2):
define i8** @stb_readdir_files_mask(i8* %0, i8* %1) {
%3 = tail call i8** @readdir_raw(i8* %0, i32 0, i8* %1)
ret i8** %3
}
/* Variables and functions */
int snprintf_TODO(char *str, size_t size, const char *format, ...) { return 0; }


x86 assembly (clang, -O0):
<snprintf_TODO>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @snprintf_TODO(i8* %0, i64 %1, i8* %2, ...) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
ret i32 0
}

LLVM IR (-O2):
define i32 @snprintf_TODO(i8* nocapture readnone %0, i64 %1, i8* nocapture readnone %2, ...) {
ret i32 0
}
/* Variables and functions */
long shortestCuboidPathSq(int, int, int);
long sqrt(long);
int isCuboidPathInteger(int w, int h, int l) {
  long pathSq = shortestCuboidPathSq(w, h, l);
  long path = sqrt(pathSq);
  return path * path == pathSq;
}


x86 assembly (clang, -O0):
<isCuboidPathInteger>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <shortestCuboidPathSq@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <sqrt@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
imul   -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isCuboidPathInteger>:
push   %rbx
call   1030 <shortestCuboidPathSq@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <sqrt@plt>
imul   %rax,%rax
xor    %ecx,%ecx
cmp    %rbx,%rax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @isCuboidPathInteger(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64
%8 = alloca i64
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = call i64 @shortestCuboidPathSq(i32 %9, i32 %10, i32 %11)
store i64 %12, i64* %7
%13 = load i64, i64* %7
%14 = call i64 @sqrt(i64 %13)
store i64 %14, i64* %8
%15 = load i64, i64* %8
%16 = load i64, i64* %8
%17 = mul nsw i64 %15, %16
%18 = load i64, i64* %7
%19 = icmp eq i64 %17, %18
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @isCuboidPathInteger(i32 %0, i32 %1, i32 %2) {
%4 = tail call i64 @shortestCuboidPathSq(i32 %0, i32 %1, i32 %2)
%5 = tail call i64 @sqrt(i64 %4)
%6 = mul nsw i64 %5, %5
%7 = icmp eq i64 %6, %4
%8 = zext i1 %7 to i32
ret i32 %8
}
void foo176(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo176(i32 %0) {
ret void
}
int test_imm_C1uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0xC1 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_C1uint64_midword_reg>:
test   $0xc10000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_C1uint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 16
%5 = and i64 %4, 193
%6 = icmp ne i64 %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_C1uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 12648448
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int file_exists(const char *filename) {
  FILE *stream = fopen(filename, "r");
  if (stream != NULL) {
    fclose(stream);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1160 <file_exists+0x40>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x1,-0x4(%rbp)
jmp    1167 <file_exists+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exists>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1141 <file_exists+0x21>
mov    %rax,%rdi
call   1030 <fclose@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
define i32 @file_exists(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %6, i32** %4
%7 = load i32*, i32** %4
%8 = icmp ne i32* %7, null
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32*, i32** %4
%11 = call i32 @fclose(i32* %10)
store i32 1, i32* %2
br label %13
12: ; preds = %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %9
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @file_exists(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int /*<<< orphan*/,
                           char const *);
int /*<<< orphan*/ stderr;
void label(const char *msg) {
  static int count = 0;
  fprintf(stderr, "[%d]: %s\n", count++, msg);
}


x86 assembly (clang, -O0):
<label>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    0x2f01(%rip),%edx
mov    %edx,%eax
add    $0x1,%eax
mov    %eax,0x2ef6(%rip)
mov    -0x8(%rbp),%rcx
lea    0xebf(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<label>:
mov    %rdi,%rcx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
mov    0x2f0a(%rip),%edx
lea    0x1(%rdx),%eax
mov    %eax,0x2f01(%rip)
lea    0xece(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@label.count = internal global i32 0
@stderr = global i32 0
@.str = [10 x i8] c"[%d]: %s\0A\00"
define void @label(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* @label.count
%5 = add nsw i32 %4, 1
store i32 %5, i32* @label.count
%6 = load i8*, i8** %2
%7 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %4, i8* %6)
ret void
}

LLVM IR (-O2):
@label.count = internal unnamed_addr global i32 0
@stderr = global i32 0
@.str = [10 x i8] c"[%d]: %s\0A\00"
define void @label(i8* %0) {
%2 = load i32, i32* @stderr
%3 = load i32, i32* @label.count
%4 = add nsw i32 %3, 1
store i32 %4, i32* @label.count
%5 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3, i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ BN_CTX;
typedef int /*<<< orphan*/ BIGNUM;

/* Variables and functions */
int BN_is_prime_fasttest(int /*<<< orphan*/ const *, int,
                         void (*)(int, int, void *), int /*<<< orphan*/ *,
                         void *, int /*<<< orphan*/);
int BN_is_prime(const BIGNUM *a, int checks, void (*callback)(int, int, void *),
                BN_CTX *ctx_passed, void *cb_arg) {
  return BN_is_prime_fasttest(a, checks, callback, ctx_passed, cb_arg, 0);
}


x86 assembly (clang, -O0):
<BN_is_prime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
xor    %r9d,%r9d
call   1030 <BN_is_prime_fasttest@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BN_is_prime>:
xor    %r9d,%r9d
jmp    1030 <BN_is_prime_fasttest@plt>

LLVM IR (-O0):
define i32 @BN_is_prime(i32* %0, i32 %1, void (i32, i32, i8*)* %2, i32* %3, i8* %4) {
%6 = alloca i32*
%7 = alloca i32
%8 = alloca void (i32, i32, i8*)*
%9 = alloca i32*
%10 = alloca i8*
store i32* %0, i32** %6
store i32 %1, i32* %7
store void (i32, i32, i8*)* %2, void (i32, i32, i8*)** %8
store i32* %3, i32** %9
store i8* %4, i8** %10
%11 = load i32*, i32** %6
%12 = load i32, i32* %7
%13 = load void (i32, i32, i8*)*, void (i32, i32, i8*)** %8
%14 = load i32*, i32** %9
%15 = load i8*, i8** %10
%16 = call i32 @BN_is_prime_fasttest(i32* %11, i32 %12, void (i32, i32, i8*)* %13, i32* %14, i8* %15, i32 0)
ret i32 %16
}

LLVM IR (-O2):
define i32 @BN_is_prime(i32* %0, i32 %1, void (i32, i32, i8*)* %2, i32* %3, i8* %4) {
%6 = tail call i32 @BN_is_prime_fasttest(i32* %0, i32 %1, void (i32, i32, i8*)* %2, i32* %3, i8* %4, i32 0)
ret i32 %6
}
/* Variables and functions */
scalar_t__ shim_enosys(int /*<<< orphan*/, int, unsigned int, unsigned int);
int shim_fsmount(int fd, unsigned int flags, unsigned int ms_flags) {
  return (int)shim_enosys(0, fd, flags, ms_flags);
}


x86 assembly (clang, -O0):
<shim_fsmount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
xor    %edi,%edi
call   1030 <shim_enosys@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shim_fsmount>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <shim_enosys@plt>

LLVM IR (-O0):
define i32 @shim_fsmount(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 i64 @shim_enosys(i32 0, i32 %7, i32 %8, i32 %9)
%11 = trunc i64 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @shim_fsmount(i32 %0, i32 %1, i32 %2) {
%4 = tail call i64 @shim_enosys(i32 0, i32 %0, i32 %1, i32 %2)
%5 = trunc i64 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ name_tree_done();
void name_storage_done(void) {
  name_tree_done();
  return;
}


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

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

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

LLVM IR (-O2):
define void @name_storage_done() {
%1 = tail call i32 (...) @name_tree_done()
ret void
}
int goodMod(int value, int mod) {
  int result = value % mod;
  if (result >= 0)
    return result;
  return mod + result;
}


x86 assembly (clang, -O0):
<goodMod>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1129 <goodMod+0x29>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1132 <goodMod+0x32>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<goodMod>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
sar    $0x1f,%eax
and    %esi,%eax
add    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @goodMod(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = icmp slt i32 %3, 0
%5 = select i1 %4, i32 %1, i32 0
%6 = add nsw i32 %5, %3
ret i32 %6
}
int axp_set_pekinfo(struct platform_device *pdev) {
  int ret = 0;
  return ret;
}


x86 assembly (clang, -O0):
<axp_set_pekinfo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.platform_device = type opaque
define i32 @axp_set_pekinfo(%struct.platform_device* %0) {
%2 = alloca %struct.platform_device*
%3 = alloca i32
store %struct.platform_device* %0, %struct.platform_device** %2
store i32 0, i32* %3
%4 = load i32, i32* %3
ret i32 %4
}

LLVM IR (-O2):
%struct.platform_device = type opaque
define i32 @axp_set_pekinfo(%struct.platform_device* nocapture readnone %0) {
ret i32 0
}
double topocentric_sun_right_ascension(double alpha_deg, double delta_alpha) {
  return alpha_deg + delta_alpha;
}


x86 assembly (clang, -O0):
<topocentric_sun_right_ascension>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<topocentric_sun_right_ascension>:
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @topocentric_sun_right_ascension(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fadd double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @topocentric_sun_right_ascension(double %0, double %1) {
%3 = fadd double %0, %1
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ charIn(char *, int);
int /*<<< orphan*/ findElem(char *, int, char);
char *malloc(int);
int /*<<< orphan*/ printf(char *);
void ex4() {
  int MAX_SIZE = 256;
  char *phrase = malloc(MAX_SIZE), alone;
  printf("Digita uma frase: ");
  charIn(phrase, MAX_SIZE);
  printf("O que deseja procurar: ");
  charIn(&alone, 1);
  findElem(phrase, MAX_SIZE, alone);
}


x86 assembly (clang, -O0):
<ex4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x100,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
lea    0xe9e(%rip),%rdi
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1040 <charIn@plt>
lea    0xe99(%rip),%rdi
call   1050 <printf@plt>
lea    -0x11(%rbp),%rdi
mov    $0x1,%esi
call   1040 <charIn@plt>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
movsbl -0x11(%rbp),%edx
call   1030 <findElem@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ex4>:
push   %rbx
sub    $0x10,%rsp
mov    $0x100,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
lea    0xea7(%rip),%rdi
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x100,%esi
call   1040 <charIn@plt>
lea    0xea1(%rip),%rdi
call   1050 <printf@plt>
lea    0xf(%rsp),%rdi
mov    $0x1,%esi
call   1040 <charIn@plt>
movsbl 0xf(%rsp),%edx
mov    %rbx,%rdi
mov    $0x100,%esi
call   1030 <findElem@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Digita uma frase: \00"
@.str.1 = [24 x i8] c"O que deseja procurar: \00"
define void @ex4() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8
store i32 256, i32* %1
%4 = load i32, i32* %1
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %2
%6 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%7 = load i8*, i8** %2
%8 = load i32, i32* %1
%9 = call i32 @charIn(i8* %7, i32 %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @charIn(i8* %3, i32 1)
%12 = load i8*, i8** %2
%13 = load i32, i32* %1
%14 = load i8, i8* %3
%15 = call i32 @findElem(i8* %12, i32 %13, i8 signext %14)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"Digita uma frase: \00"
@.str.1 = [24 x i8] c"O que deseja procurar: \00"
define void @ex4() {
%1 = alloca i8
%2 = tail call dereferenceable_or_null(256) i8* @malloc(i32 256)
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @charIn(i8* %2, i32 256)
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @charIn(i8* %1, i32 1)
%7 = load i8, i8* %1
%8 = call i32 @findElem(i8* %2, i32 256, i8 signext %7)
ret void
}
/* Variables and functions */
int cfg_processor_get_addr(char *, char *);
int cfg_basic_timer_get_int_addr(void) {
  return cfg_processor_get_addr("basictimer", "intaddr");
}


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

x86 assembly (clang, -O2):
<cfg_basic_timer_get_int_addr>:
lea    0xee9(%rip),%rdi
lea    0xeed(%rip),%rsi
jmp    1030 <cfg_processor_get_addr@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"basictimer\00"
@.str.1 = [8 x i8] c"intaddr\00"
define i32 @cfg_basic_timer_get_int_addr() {
%1 = call i32 @cfg_processor_get_addr(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [11 x i8] c"basictimer\00"
@.str.1 = [8 x i8] c"intaddr\00"
define i32 @cfg_basic_timer_get_int_addr() {
%1 = tail call i32 @cfg_processor_get_addr(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int accumulate(int /*<<< orphan*/);
int /*<<< orphan*/ atoi(char *);
int main(int argc, char **argv) {
  int i;
  for (i = 1; i < argc; i++) {
    accumulate(atoi(*(++argv)));
  }
  return accumulate(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   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1176 <main+0x56>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,%edi
call   1030 <accumulate@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113d <main+0x1d>
xor    %edi,%edi
call   1030 <accumulate@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
cmp    $0x2,%edi
jl     1159 <main+0x39>
mov    %rsi,%r14
mov    %edi,%r15d
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r14,%rbx,8),%rdi
call   1040 <atoi@plt>
mov    %eax,%edi
call   1030 <accumulate@plt>
add    $0x1,%rbx
cmp    %ebx,%r15d
jne    1140 <main+0x20>
xor    %edi,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <accumulate@plt>

LLVM IR (-O0):
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 1, i32* %6
br label %7
7: ; preds = %17, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %20
11: ; preds = %7
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i32 1
store i8** %13, i8*** %5
%14 = load i8*, i8** %13
%15 = call i32 @atoi(i8* %14)
%16 = call i32 @accumulate(i32 %15)
br label %17
17: ; preds = %11
%18 = load i32, i32* %6
%19 = add nsw i32 %18, 1
store i32 %19, i32* %6
br label %7
20: ; preds = %7
%21 = call i32 @accumulate(i32 0)
ret i32 %21
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %13
4: ; preds = %2, %4
%5 = phi i32 [ %11, %4 ], [ 1, %2 ]
%6 = phi i8** [ %7, %4 ], [ %1, %2 ]
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @atoi(i8* %8)
%10 = tail call i32 @accumulate(i32 %9)
%11 = add nuw nsw i32 %5, 1
%12 = icmp eq i32 %11, %0
br i1 %12, label %13, label %4
13: ; preds = %4, %2
%14 = tail call i32 @accumulate(i32 0)
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ handle_QUIT(int /*<<< orphan*/);
int gen_QUIT() {
  handle_QUIT(0);
  return 0;
}


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

x86 assembly (clang, -O2):
<gen_QUIT>:
push   %rax
xor    %edi,%edi
call   1030 <handle_QUIT@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @gen_QUIT() {
%1 = call i32 @handle_QUIT(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @gen_QUIT() {
%1 = tail call i32 @handle_QUIT(i32 0)
ret i32 0
}
int mus_char_to_uninterpreted_int(const unsigned char *inp) {
  int o;
  unsigned char *outp;
  outp = (unsigned char *)&o;
  outp[0] = inp[0];
  outp[1] = inp[1];
  outp[2] = inp[2];
  outp[3] = inp[3];
  return (o);
}


x86 assembly (clang, -O0):
<mus_char_to_uninterpreted_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x8(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x8(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @mus_char_to_uninterpreted_int(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = bitcast i32* %3 to i8*
store i8* %5, i8** %4
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = load i8*, i8** %4
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 %8, i8* %10
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = load i8, i8* %12
%14 = load i8*, i8** %4
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8 %13, i8* %15
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i64 2
%18 = load i8, i8* %17
%19 = load i8*, i8** %4
%20 = getelementptr inbounds i8, i8* %19, i64 2
store i8 %18, i8* %20
%21 = load i8*, i8** %2
%22 = getelementptr inbounds i8, i8* %21, i64 3
%23 = load i8, i8* %22
%24 = load i8*, i8** %4
%25 = getelementptr inbounds i8, i8* %24, i64 3
store i8 %23, i8* %25
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @mus_char_to_uninterpreted_int(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = load i8, i8* %3
%5 = getelementptr inbounds i8, i8* %0, i64 2
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %0, i64 3
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = shl nuw i32 %9, 24
%11 = zext i8 %6 to i32
%12 = shl nuw nsw i32 %11, 16
%13 = zext i8 %4 to i32
%14 = shl nuw nsw i32 %13, 8
%15 = zext i8 %2 to i32
%16 = or i32 %14, %15
%17 = or i32 %16, %12
%18 = or i32 %17, %10
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ prune_linear_by_minmax(int /*<<< orphan*/,
                                          int /*<<< orphan*/);
int /*<<< orphan*/ unknown_function();
void call_prune_linear_by_minmax_Good() {
  prune_linear_by_minmax(unknown_function(), unknown_function());
}


x86 assembly (clang, -O0):
<call_prune_linear_by_minmax_Good>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <unknown_function@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <unknown_function@plt>
mov    -0x4(%rbp),%edi
mov    %eax,%esi
call   1030 <prune_linear_by_minmax@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_prune_linear_by_minmax_Good>:
push   %rbx
xor    %eax,%eax
call   1040 <unknown_function@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <unknown_function@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <prune_linear_by_minmax@plt>

LLVM IR (-O0):
define void @call_prune_linear_by_minmax_Good() {
%1 = call i32 (...) @unknown_function()
%2 = call i32 (...) @unknown_function()
%3 = call i32 @prune_linear_by_minmax(i32 %1, i32 %2)
ret void
}

LLVM IR (-O2):
define void @call_prune_linear_by_minmax_Good() {
%1 = tail call i32 (...) @unknown_function()
%2 = tail call i32 (...) @unknown_function()
%3 = tail call i32 @prune_linear_by_minmax(i32 %1, i32 %2)
ret void
}
/* Type definitions */
struct VectorNumBase {
  int dummy;
};

/* Variables and functions */
size_t GetVectorNumSize(struct VectorNumBase *);
size_t get_vector_num_size(struct VectorNumBase *basev) {
  return GetVectorNumSize(basev);
}


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

x86 assembly (clang, -O2):
<get_vector_num_size>:
jmp    1030 <GetVectorNumSize@plt>

LLVM IR (-O0):
%struct.VectorNumBase = type { i32 }
define i64 @get_vector_num_size(%struct.VectorNumBase* %0) {
%2 = alloca %struct.VectorNumBase*
store %struct.VectorNumBase* %0, %struct.VectorNumBase** %2
%3 = load %struct.VectorNumBase*, %struct.VectorNumBase** %2
%4 = call i64 @GetVectorNumSize(%struct.VectorNumBase* %3)
ret i64 %4
}

LLVM IR (-O2):
%struct.VectorNumBase = type { i32 }
define i64 @get_vector_num_size(%struct.VectorNumBase* %0) {
%2 = tail call i64 @GetVectorNumSize(%struct.VectorNumBase* %0)
ret i64 %2
}
double neg_fun(double lhs) { return -lhs; }


x86 assembly (clang, -O0):
<neg_fun>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<neg_fun>:
xorps  0xef9(%rip),%xmm0
ret

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

LLVM IR (-O2):
define double @neg_fun(double %0) {
%2 = fneg double %0
ret double %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int cdb_inquiry(unsigned char *, int /*<<< orphan*/, int /*<<< orphan*/,
                int /*<<< orphan*/);
int cdb_inquiry_simple(unsigned char *cdb, uint16_t alloc_len) {
  return cdb_inquiry(cdb, 0, 0, alloc_len);
}


x86 assembly (clang, -O0):
<cdb_inquiry_simple>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%ecx
xor    %edx,%edx
mov    %edx,%esi
call   1030 <cdb_inquiry@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdb_inquiry_simple>:
mov    %esi,%ecx
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <cdb_inquiry@plt>

LLVM IR (-O0):
define i32 @cdb_inquiry_simple(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 = load i32, i32* %4
%7 = call i32 @cdb_inquiry(i8* %5, i32 0, i32 0, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @cdb_inquiry_simple(i8* %0, i32 %1) {
%3 = tail call i32 @cdb_inquiry(i8* %0, i32 0, i32 0, i32 %1)
ret i32 %3
}
unsigned short int f54(unsigned short int x, long int y) {
  return (x << (8 * 2 - y)) ^ (x >> y);
}


x86 assembly (clang, -O0):
<f54>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
mov    $0x10,%ecx
sub    -0x10(%rbp),%rcx
shl    %cl,%eax
movzwl -0x2(%rbp),%edx
mov    -0x10(%rbp),%rcx
sar    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f54>:
mov    $0x10,%cl
sub    %sil,%cl
mov    %edi,%eax
shl    %cl,%eax
mov    %esi,%ecx
shr    %cl,%edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @f54(i16 zeroext %0, i64 %1) {
%3 = alloca i16
%4 = alloca i64
store i16 %0, i16* %3
store i64 %1, i64* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i64, i64* %4
%8 = sub nsw i64 16, %7
%9 = trunc i64 %8 to i32
%10 = shl i32 %6, %9
%11 = load i16, i16* %3
%12 = zext i16 %11 to i32
%13 = load i64, i64* %4
%14 = trunc i64 %13 to i32
%15 = ashr i32 %12, %14
%16 = xor i32 %10, %15
%17 = trunc i32 %16 to i16
ret i16 %17
}

LLVM IR (-O2):
define zeroext i16 @f54(i16 zeroext %0, i64 %1) {
%3 = zext i16 %0 to i32
%4 = trunc i64 %1 to i32
%5 = sub i32 16, %4
%6 = shl i32 %3, %5
%7 = lshr i32 %3, %4
%8 = xor i32 %6, %7
%9 = trunc i32 %8 to i16
ret i16 %9
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ term_all();
void sigint_handler() {
  fprintf(stdout, "\n[Ctrl+C]\n");
  term_all();
}


x86 assembly (clang, -O0):
<sigint_handler>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <term_all@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigint_handler>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <term_all@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [11 x i8] c"\0A[Ctrl+C]\0A\00"
define void @sigint_handler() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @term_all()
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [11 x i8] c"\0A[Ctrl+C]\0A\00"
define void @sigint_handler() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @term_all()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ utl_strlen(char *);
char *utl_strncat(char *, char *, int /*<<< orphan*/);
char *utl_strcat(char *dst, char *str) {
  return (utl_strncat(dst, str, utl_strlen(str)));
}


x86 assembly (clang, -O0):
<utl_strcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <utl_strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <utl_strncat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utl_strcat>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <utl_strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <utl_strncat@plt>

LLVM IR (-O0):
define i8* @utl_strcat(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 = load i8*, i8** %4
%8 = call i32 @utl_strlen(i8* %7)
%9 = call i8* @utl_strncat(i8* %5, i8* %6, i32 %8)
ret i8* %9
}

LLVM IR (-O2):
define i8* @utl_strcat(i8* %0, i8* %1) {
%3 = tail call i32 @utl_strlen(i8* %1)
%4 = tail call i8* @utl_strncat(i8* %0, i8* %1, i32 %3)
ret i8* %4
}