xunge/DecIR huggingface dataset:
double Square(double x) { return x * x; }


x86 assembly (clang, -O0):
<Square>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Square>:
mulsd  %xmm0,%xmm0
ret

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

LLVM IR (-O2):
define double @Square(double %0) {
%2 = fmul double %0, %0
ret double %2
}
/* Variables and functions */
scalar_t__ isascii(int);
void libraryFunction1() {
  char kb2[5];
  int X = 1000;
  if (isascii(X)) {
    kb2[0] = X;
  }
}


x86 assembly (clang, -O0):
<libraryFunction1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x3e8,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <isascii@plt>
cmp    $0x0,%rax
je     1137 <libraryFunction1+0x27>
mov    -0xc(%rbp),%eax
mov    %al,-0x5(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libraryFunction1>:
mov    $0x3e8,%edi
jmp    1030 <isascii@plt>

LLVM IR (-O0):
define void @libraryFunction1() {
%1 = alloca [5 x i8]
%2 = alloca i32
store i32 1000, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isascii(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = load i32, i32* %2
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
store i8 %8, i8* %9
br label %10
10: ; preds = %6, %0
ret void
}

LLVM IR (-O2):
define void @libraryFunction1() {
%1 = tail call i64 @isascii(i32 1000)
ret void
}
char dj_autodetect_sd(void) { return 0; }


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

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

LLVM IR (-O0):
define signext i8 @dj_autodetect_sd() {
ret i8 0
}

LLVM IR (-O2):
define signext i8 @dj_autodetect_sd() {
ret i8 0
}
int __dcmp(long x1m1, long x1m2, long x2m1, long x2m2) {
  if (x1m1 > x2m1)
    return 1;
  if (x1m1 < x2m1)
    return -1;
  if (x1m2 > x2m2)
    return 1;
  if (x1m2 < x2m2)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<__dcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jle    112e <__dcmp+0x2e>
movl   $0x1,-0x4(%rbp)
jmp    1183 <__dcmp+0x83>
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jge    1148 <__dcmp+0x48>
movl   $0xffffffff,-0x4(%rbp)
jmp    1183 <__dcmp+0x83>
mov    -0x18(%rbp),%rax
cmp    -0x28(%rbp),%rax
jle    1162 <__dcmp+0x62>
movl   $0x1,-0x4(%rbp)
jmp    1183 <__dcmp+0x83>
mov    -0x18(%rbp),%rax
cmp    -0x28(%rbp),%rax
jge    117c <__dcmp+0x7c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1183 <__dcmp+0x83>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__dcmp>:
mov    $0x1,%eax
cmp    %rdx,%rdi
jg     1123 <__dcmp+0x23>
mov    $0xffffffff,%eax
jl     1123 <__dcmp+0x23>
mov    $0x1,%eax
cmp    %rcx,%rsi
jg     1123 <__dcmp+0x23>
setl   %al
movzbl %al,%eax
neg    %eax
ret

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

LLVM IR (-O2):
define i32 @__dcmp(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = icmp sgt i64 %0, %2
br i1 %5, label %13, label %6
6: ; preds = %4
%7 = icmp slt i64 %0, %2
br i1 %7, label %13, label %8
8: ; preds = %6
%9 = icmp sgt i64 %1, %3
br i1 %9, label %13, label %10
10: ; preds = %8
%11 = icmp slt i64 %1, %3
%12 = sext i1 %11 to i32
br label %13
13: ; preds = %10, %8, %6, %4
%14 = phi i32 [ 1, %4 ], [ -1, %6 ], [ 1, %8 ], [ %12, %10 ]
ret i32 %14
}
/* Variables and functions */
int compute_diagonal_difference();
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d", compute_diagonal_difference());
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <compute_diagonal_difference@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 (...) @compute_diagonal_difference()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int isatty(int fildes) {
  switch (fildes) {
  case 0:
    return 1;
  case 1:
    return 1;
  case 2:
    return 1;
  default:
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<isatty>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     113c <isatty+0x3c>
jmp    111a <isatty+0x1a>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
je     1148 <isatty+0x48>
jmp    112b <isatty+0x2b>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     1154 <isatty+0x54>
jmp    1160 <isatty+0x60>
movl   $0x1,-0x4(%rbp)
jmp    116c <isatty+0x6c>
movl   $0x1,-0x4(%rbp)
jmp    116c <isatty+0x6c>
movl   $0x1,-0x4(%rbp)
jmp    116c <isatty+0x6c>
jmp    1165 <isatty+0x65>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @isatty(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %8 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
]
5: ; preds = %1
store i32 1, i32* %2
br label %10
6: ; preds = %1
store i32 1, i32* %2
br label %10
7: ; preds = %1
store i32 1, i32* %2
br label %10
8: ; preds = %1
br label %9
9: ; preds = %8
store i32 0, i32* %2
br label %10
10: ; preds = %9, %7, %6, %5
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @isatty(i32 %0) {
%2 = icmp ult i32 %0, 3
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ merge(int *, int, int, int);
void mergesort(int *nums, int p, int r) {
  int q;
  if (p < r) {
    q = (p + r) / 2;
    mergesort(nums, p, q);
    mergesort(nums, q + 1, r);
    merge(nums, p, q, r);
  }
}


x86 assembly (clang, -O0):
<mergesort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1182 <mergesort+0x62>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1040 <mergesort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <mergesort@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1030 <merge@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mergesort>:
cmp    %edx,%esi
jge    1172 <mergesort+0x52>
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%r12d
mov    %rdi,%r15
lea    (%r14,%r12,1),%eax
mov    %eax,%ebx
shr    $0x1f,%ebx
add    %eax,%ebx
sar    %ebx
mov    %ebx,%edx
call   1040 <mergesort@plt>
lea    0x1(%rbx),%esi
mov    %r15,%rdi
mov    %r14d,%edx
call   1040 <mergesort@plt>
mov    %r15,%rdi
mov    %r12d,%esi
mov    %ebx,%edx
mov    %r14d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <merge@plt>
ret

LLVM IR (-O0):
define void @mergesort(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %28
11: ; preds = %3
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = add nsw i32 %12, %13
%15 = sdiv i32 %14, 2
store i32 %15, i32* %7
%16 = load i32*, i32** %4
%17 = load i32, i32* %5
%18 = load i32, i32* %7
%19 = load i32*, i32** %4
%20 = load i32, i32* %7
%21 = add nsw i32 %20, 1
%22 = load i32, i32* %6
%23 = load i32*, i32** %4
%24 = load i32, i32* %5
%25 = load i32, i32* %7
%26 = load i32, i32* %6
%27 = call i32 @merge(i32* %23, i32 %24, i32 %25, i32 %26)
br label %28
28: ; preds = %11, %3
ret void
}

LLVM IR (-O2):
define void @mergesort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %6, label %5
5: ; preds = %3, %6
ret void
6: ; preds = %3
%7 = add nsw i32 %2, %1
%8 = sdiv i32 %7, 2
tail call void @mergesort(i32* %0, i32 %1, i32 %8)
%9 = add nsw i32 %8, 1
tail call void @mergesort(i32* %0, i32 %9, i32 %2)
%10 = tail call i32 @merge(i32* %0, i32 %1, i32 %8, i32 %2)
br label %5
}
int test_imm_85int16_mem(short *val) {
  return ((*val) & (-0x85 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_85int16_mem>:
movzwl (%rdi),%eax
test   $0xff7b,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_85int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -133
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int fun_iptr(void) { return 8; }


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

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

LLVM IR (-O0):
define i32 @fun_iptr() {
ret i32 8
}

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

/* Variables and functions */
int g_DUMMY_cons_fputc(char c, FILE *file) {
  c = c;
  file = file;
  return 0;
}


x86 assembly (clang, -O0):
<g_DUMMY_cons_fputc>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x1(%rbp),%al
mov    %al,-0x1(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @g_DUMMY_cons_fputc(i8 signext %0, i32* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
int /*<<< orphan*/ printid(float);
int main() {
  float a = 2, b = 3;
  b *= a;
  print("b 6.000000");
  printid(b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xecd(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xebc(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
lea    0xea9(%rip),%rdi
call   1030 <print@plt>
movss  -0xc(%rbp),%xmm0
call   1040 <printid@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedc(%rip),%rdi
call   1030 <print@plt>
movss  0xecb(%rip),%xmm0
call   1040 <printid@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"b 6.000000\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
store i32 0, i32* %1
store float 2.000000e+00, float* %2
store float 3.000000e+00, float* %3
%4 = load float, float* %2
%5 = load float, float* %3
%6 = fmul float %5, %4
store float %6, float* %3
%7 = call i32 @print(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%8 = load float, float* %3
%9 = call i32 @printid(float %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"b 6.000000\00"
define i32 @main() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printid(float 6.000000e+00)
ret i32 0
}
/* Type definitions */
typedef unsigned long long uint64_t;

/* Variables and functions */
uint64_t lcg64(uint64_t x) { return 6364136223846793005ull * x + 1; }


x86 assembly (clang, -O0):
<lcg64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movabs $0x5851f42d4c957f2d,%rax
f4 51 58
imul   -0x8(%rbp),%rax
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcg64>:
movabs $0x5851f42d4c957f2d,%rax
f4 51 58
imul   %rdi,%rax
add    $0x1,%rax
ret

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

LLVM IR (-O2):
define i64 @lcg64(i64 %0) {
%2 = mul i64 %0, 6364136223846793005
%3 = add i64 %2, 1
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ RTFBraceLevel(int);
void RTFSetBraceLevel(int level) { (void)RTFBraceLevel(level); }


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

x86 assembly (clang, -O2):
<RTFSetBraceLevel>:
jmp    1030 <RTFBraceLevel@plt>

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

LLVM IR (-O2):
define void @RTFSetBraceLevel(i32 %0) {
%2 = tail call i32 @RTFBraceLevel(i32 %0)
ret void
}
/* Variables and functions */
float atan2f(float, float);
float vec2_angle(float *a) { return atan2f(a[1], a[0]); }


x86 assembly (clang, -O0):
<vec2_angle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm1
call   1030 <atan2f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec2_angle>:
movss  (%rdi),%xmm1
movss  0x4(%rdi),%xmm0
jmp    1030 <atan2f@plt>

LLVM IR (-O0):
define float @vec2_angle(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 1
%5 = load float, float* %4
%6 = load float*, float** %2
%7 = getelementptr inbounds float, float* %6, i64 0
%8 = load float, float* %7
%9 = call float @atan2f(float %5, float %8)
ret float %9
}

LLVM IR (-O2):
define float @vec2_angle(float* nocapture %0) {
%2 = getelementptr inbounds float, float* %0, i64 1
%3 = load float, float* %2
%4 = load float, float* %0
%5 = tail call float @atan2f(float %3, float %4)
ret float %5
}
/* Variables and functions */
int errno;
int syscall(int, int, int /*<<< orphan*/, int /*<<< orphan*/,
            int /*<<< orphan*/, int /*<<< orphan*/);
int set_uid(int n) {
  int ret = syscall(76, n, 0, 0, 0, 0);
  if (ret < 0) {
    errno = -ret;
    return -1;
  }
  return ret;
}


x86 assembly (clang, -O0):
<set_uid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    $0x4c,%edi
xor    %r9d,%r9d
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <syscall@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    115b <set_uid+0x4b>
xor    %ecx,%ecx
sub    -0xc(%rbp),%ecx
mov    0x2e93(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    1161 <set_uid+0x51>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_uid>:
push   %rax
mov    %edi,%esi
mov    $0x4c,%edi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <syscall@plt>
test   %eax,%eax
js     112d <set_uid+0x1d>
pop    %rcx
ret
neg    %eax
mov    0x2eaa(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @set_uid(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @syscall(i32 76, i32 %5, i32 0, i32 0, i32 0, i32 0)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32, i32* %4
%11 = sub nsw i32 0, %10
store i32 %11, i32* @errno
store i32 -1, i32* %2
br label %14
12: ; preds = %1
%13 = load i32, i32* %4
store i32 %13, i32* %2
br label %14
14: ; preds = %12, %9
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @set_uid(i32 %0) {
%2 = tail call i32 @syscall(i32 76, i32 %0, i32 0, i32 0, i32 0, i32 0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = sub nsw i32 0, %2
store i32 %5, i32* @errno
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ -1, %4 ], [ %2, %1 ]
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
long calculate_double_hash_key(int /*<<< orphan*/ *, long);
long int jumpSizedoubleInsert_HashTable(wchar_t *word_str,
                                        long int current_hash_key,
                                        long int hash_table_length) {
  long int jump_size, hash_key;
  jump_size = calculate_double_hash_key(word_str, (long int)hash_table_length);
  hash_key = (current_hash_key + jump_size) % ((long int)hash_table_length);
  return hash_key;
}


x86 assembly (clang, -O0):
<jumpSizedoubleInsert_HashTable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <calculate_double_hash_key@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
add    -0x20(%rbp),%rax
cqto
idivq  -0x18(%rbp)
mov    %rdx,-0x28(%rbp)
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jumpSizedoubleInsert_HashTable>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdx,%rsi
call   1030 <calculate_double_hash_key@plt>
add    %r14,%rax
mov    %rax,%rcx
or     %rbx,%rcx
shr    $0x20,%rcx
je     113b <jumpSizedoubleInsert_HashTable+0x2b>
cqto
idiv   %rbx
mov    %rdx,%rax
jmp    1141 <jumpSizedoubleInsert_HashTable+0x31>
xor    %edx,%edx
div    %ebx
mov    %edx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @jumpSizedoubleInsert_HashTable(i32* %0, i64 %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i32* %0, i32** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%9 = load i32*, i32** %4
%10 = load i64, i64* %6
%11 = call i64 @calculate_double_hash_key(i32* %9, i64 %10)
store i64 %11, i64* %7
%12 = load i64, i64* %5
%13 = load i64, i64* %7
%14 = add nsw i64 %12, %13
%15 = load i64, i64* %6
%16 = srem i64 %14, %15
store i64 %16, i64* %8
%17 = load i64, i64* %8
ret i64 %17
}

LLVM IR (-O2):
define i64 @jumpSizedoubleInsert_HashTable(i32* %0, i64 %1, i64 %2) {
%4 = tail call i64 @calculate_double_hash_key(i32* %0, i64 %2)
%5 = add nsw i64 %4, %1
%6 = srem i64 %5, %2
ret i64 %6
}
/* Type definitions */
struct cfbuf_obj {
  int dummy;
};

/* Variables and functions */
int cfbuf__setup(struct cfbuf_obj *, char *, char);
int setup(struct cfbuf_obj *f, char *file_path, char mode) {
  return cfbuf__setup(f, file_path, mode);
}


x86 assembly (clang, -O0):
<setup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movsbl -0x11(%rbp),%edx
call   1030 <cfbuf__setup@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup>:
jmp    1030 <cfbuf__setup@plt>

LLVM IR (-O0):
%struct.cfbuf_obj = type { i32 }
define i32 @setup(%struct.cfbuf_obj* %0, i8* %1, i8 signext %2) {
%4 = alloca %struct.cfbuf_obj*
%5 = alloca i8*
%6 = alloca i8
store %struct.cfbuf_obj* %0, %struct.cfbuf_obj** %4
store i8* %1, i8** %5
store i8 %2, i8* %6
%7 = load %struct.cfbuf_obj*, %struct.cfbuf_obj** %4
%8 = load i8*, i8** %5
%9 = load i8, i8* %6
%10 = call i32 @cfbuf__setup(%struct.cfbuf_obj* %7, i8* %8, i8 signext %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.cfbuf_obj = type { i32 }
define i32 @setup(%struct.cfbuf_obj* %0, i8* %1, i8 signext %2) {
%4 = tail call i32 @cfbuf__setup(%struct.cfbuf_obj* %0, i8* %1, i8 signext %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ econais_ec19d_binary_file_delete(char *);
void ext_configuration_delete(void) {
  econais_ec19d_binary_file_delete("kaa_configuration.bin");
}


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"kaa_configuration.bin\00"
define void @ext_configuration_delete() {
%1 = call i32 @econais_ec19d_binary_file_delete(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"kaa_configuration.bin\00"
define void @ext_configuration_delete() {
%1 = tail call i32 @econais_ec19d_binary_file_delete(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}
extern void eFree(ptr) void *const ptr;
{
  ;
  free(ptr);
}


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

x86 assembly (clang, -O2):
<eFree>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @eFree(i8* nocapture %0) {
tail call void @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("This is a test.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%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
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"This is a test.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [16 x i8] c"This is a test.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int cmp_int(const void *__1, const void *__2) {
  return *(int *)__1 - *(int *)__2;
}


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

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

LLVM IR (-O0):
define i32 @cmp_int(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 i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @cmp_int(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int *acs_map;
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ printf(char *, int);
int main() {
  int v;
  initscr();
  v = acs_map['x'];
  endwin();
  printf("%d\n", v);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <initscr@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%rax
mov    0x1e0(%rax),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <endwin@plt>
mov    -0x8(%rbp),%esi
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <initscr@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%rax
mov    0x1e0(%rax),%ebx
xor    %eax,%eax
call   1050 <endwin@plt>
lea    0xeaa(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@acs_map = global i32* null
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @initscr()
%2 = load i32*, i32** @acs_map
%3 = getelementptr inbounds i32, i32* %2, i64 120
%4 = load i32, i32* %3
%5 = tail call i32 (...) @endwin()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int SIZE_MAX;
size_t internal_npow2(size_t n) {
  size_t next = 1;
  if (n >= SIZE_MAX / 2) {
    next = SIZE_MAX;
  } else {
    while (next < n)
      next <<= 1;
  }
  return next;
}


x86 assembly (clang, -O0):
<internal_npow2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
cmp    %rcx,%rax
jb     114e <internal_npow2+0x4e>
mov    0x2e96(%rip),%rax
movslq (%rax),%rax
mov    %rax,-0x10(%rbp)
jmp    1177 <internal_npow2+0x77>
jmp    1153 <internal_npow2+0x53>
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    1172 <internal_npow2+0x72>
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1153 <internal_npow2+0x53>
jmp    1177 <internal_npow2+0x77>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<internal_npow2>:
mov    0x2ed1(%rip),%rax
movslq (%rax),%rax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
movslq %ecx,%rcx
cmp    %rdi,%rcx
jbe    112b <internal_npow2+0x2b>
mov    $0x1,%ecx
mov    %rcx,%rax
add    %rcx,%rcx
cmp    %rdi,%rax
jb     1120 <internal_npow2+0x20>
ret

LLVM IR (-O0):
@SIZE_MAX = global i32 0
define i64 @internal_npow2(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store i64 1, i64* %3
%4 = load i64, i64* %2
%5 = load i32, i32* @SIZE_MAX
%6 = sdiv i32 %5, 2
%7 = sext i32 %6 to i64
%8 = icmp uge i64 %4, %7
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32, i32* @SIZE_MAX
%11 = sext i32 %10 to i64
store i64 %11, i64* %3
br label %21
12: ; preds = %1
br label %13
13: ; preds = %17, %12
%14 = load i64, i64* %3
%15 = load i64, i64* %2
%16 = icmp ult i64 %14, %15
br i1 %16, label %17, label %20
17: ; preds = %13
%18 = load i64, i64* %3
%19 = shl i64 %18, 1
store i64 %19, i64* %3
br label %13
20: ; preds = %13
br label %21
21: ; preds = %20, %9
%22 = load i64, i64* %3
ret i64 %22
}

LLVM IR (-O2):
@SIZE_MAX = global i32 0
define i64 @internal_npow2(i64 %0) {
%2 = load i32, i32* @SIZE_MAX
%3 = sdiv i32 %2, 2
%4 = sext i32 %3 to i64
%5 = icmp ugt i64 %4, %0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = sext i32 %2 to i64
br label %12
8: ; preds = %1, %8
%9 = phi i64 [ %11, %8 ], [ 1, %1 ]
%10 = icmp ult i64 %9, %0
%11 = shl i64 %9, 1
br i1 %10, label %8, label %12
12: ; preds = %8, %6
%13 = phi i64 [ %7, %6 ], [ %9, %8 ]
ret i64 %13
}
/* Variables and functions */
int inb(short);
int /*<<< orphan*/ outb(short, char);
void serial_rxint(short combase, char c) {
  c = (c && c);
  c = c | (inb(combase + 1) & ~0x01);
  outb(combase + 1, c);
}


x86 assembly (clang, -O0):
<serial_rxint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movsbl -0x3(%rbp),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x4(%rbp)
je     1154 <serial_rxint+0x34>
movsbl -0x3(%rbp),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x4(%rbp)
mov    -0x4(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %al,-0x3(%rbp)
movsbl -0x3(%rbp),%eax
mov    %eax,-0x8(%rbp)
movswl -0x2(%rbp),%eax
add    $0x1,%eax
movswl %ax,%edi
call   1040 <inb@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
and    $0xfffffffe,%ecx
or     %ecx,%eax
mov    %al,-0x3(%rbp)
movswl -0x2(%rbp),%eax
add    $0x1,%eax
movswl %ax,%edi
movsbl -0x3(%rbp),%esi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_rxint>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
test   %sil,%sil
setne  %bpl
add    $0x1,%edi
movswl %di,%ebx
mov    %ebx,%edi
call   1040 <inb@plt>
and    $0xfe,%eax
or     %ebp,%eax
movsbl %al,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @serial_rxint(i16 signext %0, i8 signext %1) {
%3 = alloca i16
%4 = alloca i8
store i16 %0, i16* %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i8, i8* %4
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br label %12
12: ; preds = %8, %2
%13 = phi i1 [ false, %2 ], [ %11, %8 ]
%14 = zext i1 %13 to i32
%15 = trunc i32 %14 to i8
store i8 %15, i8* %4
%16 = load i8, i8* %4
%17 = sext i8 %16 to i32
%18 = load i16, i16* %3
%19 = sext i16 %18 to i32
%20 = add nsw i32 %19, 1
%21 = trunc i32 %20 to i16
%22 = call i32 @inb(i16 signext %21)
%23 = and i32 %22, -2
%24 = or i32 %17, %23
%25 = trunc i32 %24 to i8
store i8 %25, i8* %4
%26 = load i16, i16* %3
%27 = sext i16 %26 to i32
%28 = add nsw i32 %27, 1
%29 = trunc i32 %28 to i16
%30 = load i8, i8* %4
%31 = call i32 @outb(i16 signext %29, i8 signext %30)
ret void
}

LLVM IR (-O2):
define void @serial_rxint(i16 signext %0, i8 signext %1) {
%3 = icmp ne i8 %1, 0
%4 = zext i1 %3 to i32
%5 = add i16 %0, 1
%6 = tail call i32 @inb(i16 signext %5)
%7 = and i32 %6, 254
%8 = or i32 %7, %4
%9 = trunc i32 %8 to i8
%10 = tail call i32 @outb(i16 signext %5, i8 signext %9)
ret void
}
int sipxfaddr(int unit, unsigned long int network, unsigned char *node) {
  int result = 1;
  return result;
}


x86 assembly (clang, -O0):
<sipxfaddr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @sipxfaddr(i32 %0, i64 %1, i8* nocapture readnone %2) {
ret i32 1
}
/* Variables and functions */
scalar_t__ isgreaterequal(float, float);
scalar_t__ isnan(float);
float __fmaxf(float x, float y) {
  return (isgreaterequal(x, y) || isnan(y)) ? x : y;
}


x86 assembly (clang, -O0):
<__fmaxf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1040 <isgreaterequal@plt>
cmp    $0x0,%rax
jne    115f <__fmaxf+0x3f>
movss  -0x8(%rbp),%xmm0
call   1030 <isnan@plt>
cmp    $0x0,%rax
je     116e <__fmaxf+0x4e>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1178 <__fmaxf+0x58>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__fmaxf>:
push   %rax
movss  %xmm0,0x4(%rsp)
movss  %xmm1,(%rsp)
call   1040 <isgreaterequal@plt>
test   %rax,%rax
je     113e <__fmaxf+0x1e>
movss  0x4(%rsp),%xmm0
pop    %rax
ret
movss  (%rsp),%xmm0
call   1030 <isnan@plt>
test   %rax,%rax
je     1158 <__fmaxf+0x38>
movss  0x4(%rsp),%xmm0
movss  %xmm0,(%rsp)
movss  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @__fmaxf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call i64 @isgreaterequal(float %5, float %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %2
%10 = load float, float* %4
%11 = call i64 @isnan(float %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %9, %2
%14 = load float, float* %3
br label %17
15: ; preds = %9
%16 = load float, float* %4
br label %17
17: ; preds = %15, %13
%18 = phi float [ %14, %13 ], [ %16, %15 ]
ret float %18
}

LLVM IR (-O2):
define float @__fmaxf(float %0, float %1) {
%3 = tail call i64 @isgreaterequal(float %0, float %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i64 @isnan(float %1)
%7 = icmp eq i64 %6, 0
%8 = select i1 %7, float %1, float %0
br label %9
9: ; preds = %5, %2
%10 = phi float [ %0, %2 ], [ %8, %5 ]
ret float %10
}
/* Variables and functions */
int /*<<< orphan*/ pthread_exit(void *);
void *thread(void *vargp) {
  int *ptr = (int *)vargp;
  pthread_exit((void *)*ptr);
}


x86 assembly (clang, -O0):
<thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movslq (%rax),%rdi
call   1030 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread>:
movslq (%rdi),%rdi
jmp    1030 <pthread_exit@plt>

LLVM IR (-O0):
define i8* @thread(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
store i32* %6, i32** %4
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i8*
%11 = call i32 @pthread_exit(i8* %10)
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
define noalias i8* @thread(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @pthread_exit(i8* %5)
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ PUT32(int, int);
int /*<<< orphan*/ i2c_start();
int /*<<< orphan*/ i2c_stop();
scalar_t__ i2c_write_byte(unsigned int);
void send_command(unsigned int cmd) {
  PUT32(0x20200028, 1 << 25);
  i2c_start();
  if (i2c_write_byte(0x78)) {
  }
  if (i2c_write_byte(0x00)) {
  }
  if (i2c_write_byte(cmd)) {
  }
  i2c_stop();
}


x86 assembly (clang, -O0):
<send_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x20200028,%edi
mov    $0x2000000,%esi
call   1030 <PUT32@plt>
mov    $0x0,%al
call   1050 <i2c_start@plt>
mov    $0x78,%edi
call   1060 <i2c_write_byte@plt>
cmp    $0x0,%rax
je     117a <send_command+0x3a>
jmp    117a <send_command+0x3a>
xor    %edi,%edi
call   1060 <i2c_write_byte@plt>
cmp    $0x0,%rax
je     1190 <send_command+0x50>
jmp    1190 <send_command+0x50>
mov    -0x4(%rbp),%edi
call   1060 <i2c_write_byte@plt>
cmp    $0x0,%rax
je     11a7 <send_command+0x67>
jmp    11a7 <send_command+0x67>
mov    $0x0,%al
call   1040 <i2c_stop@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_command>:
push   %rbx
mov    %edi,%ebx
mov    $0x20200028,%edi
mov    $0x2000000,%esi
call   1030 <PUT32@plt>
xor    %eax,%eax
call   1050 <i2c_start@plt>
mov    $0x78,%edi
call   1060 <i2c_write_byte@plt>
xor    %edi,%edi
call   1060 <i2c_write_byte@plt>
mov    %ebx,%edi
call   1060 <i2c_write_byte@plt>
xor    %eax,%eax
pop    %rbx
jmp    1040 <i2c_stop@plt>

LLVM IR (-O0):
define void @send_command(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @PUT32(i32 538968104, i32 33554432)
%4 = call i32 (...) @i2c_start()
%5 = call i64 @i2c_write_byte(i32 120)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
br label %8
8: ; preds = %7, %1
%9 = call i64 @i2c_write_byte(i32 0)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %8
br label %12
12: ; preds = %11, %8
%13 = load i32, i32* %2
%14 = call i64 @i2c_write_byte(i32 %13)
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %12
br label %17
17: ; preds = %16, %12
%18 = call i32 (...) @i2c_stop()
ret void
}

LLVM IR (-O2):
define void @send_command(i32 %0) {
%2 = tail call i32 @PUT32(i32 538968104, i32 33554432)
%3 = tail call i32 (...) @i2c_start()
%4 = tail call i64 @i2c_write_byte(i32 120)
%5 = tail call i64 @i2c_write_byte(i32 0)
%6 = tail call i64 @i2c_write_byte(i32 %0)
%7 = tail call i32 (...) @i2c_stop()
ret void
}
int atoint(char *s) {
  int i = 0, n = 0;
  while (1) {
    if (s[n]) {
      i += (int)s[n];
      i *= 10;
    } else
      break;
    n++;
  }
  return i / 10;
}


x86 assembly (clang, -O0):
<atoint>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1146 <atoint+0x46>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
imul   $0xa,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    114b <atoint+0x4b>
jmp    1159 <atoint+0x59>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <atoint+0x16>
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<atoint>:
mov    (%rdi),%cl
test   %cl,%cl
je     1127 <atoint+0x27>
add    $0x1,%rdi
xor    %edx,%edx
nopl   0x0(%rax)
movsbl %cl,%eax
add    %edx,%eax
lea    (%rax,%rax,1),%ecx
lea    (%rcx,%rcx,4),%edx
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <atoint+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @atoint(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %11, %4 ], [ 0, %1 ]
%6 = phi i8 [ %13, %4 ], [ %2, %1 ]
%7 = phi i32 [ %10, %4 ], [ 0, %1 ]
%8 = sext i8 %6 to i32
%9 = add nsw i32 %7, %8
%10 = mul nsw i32 %9, 10
%11 = add nuw nsw i64 %5, 1
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i32 [ 0, %1 ], [ %9, %4 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int memclose(void *mfd) {
  free(mfd);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @memclose(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret i32 0
}
/* Variables and functions */
double exp2(float);
float volumetric_fog_texture_z_to_world(float texture_z,
                                        float slice_z_log2_scale) {
  float world_z = exp2(texture_z / slice_z_log2_scale) - 1.0;
  return world_z;
}


x86 assembly (clang, -O0):
<volumetric_fog_texture_z_to_world>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
call   1030 <exp2@plt>
movsd  0xec7(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<volumetric_fog_texture_z_to_world>:
push   %rax
divss  %xmm1,%xmm0
call   1030 <exp2@plt>
addsd  0xede(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @volumetric_fog_texture_z_to_world(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* %4
%8 = fdiv float %6, %7
%9 = call double @exp2(float %8)
%10 = fsub double %9, 1.000000e+00
%11 = fptrunc double %10 to float
store float %11, float* %5
%12 = load float, float* %5
ret float %12
}

LLVM IR (-O2):
define float @volumetric_fog_texture_z_to_world(float %0, float %1) {
%3 = fdiv float %0, %1
%4 = tail call double @exp2(float %3)
%5 = fadd double %4, -1.000000e+00
%6 = fptrunc double %5 to float
ret float %6
}
void fk425m(ra, dec, rapm, decpm) double *ra, *dec;
double *rapm, *decpm;
{
  double parallax = 0.0;
  double rv = 0.0;
  fk425pv(ra, dec, rapm, decpm, &parallax, &rv);
  return;
}


x86 assembly (clang, -O0):
<fk425m>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    -0x28(%rbp),%r8
lea    -0x30(%rbp),%r9
mov    $0x0,%al
call   1030 <fk425pv@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fk425m>:
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
movq   $0x0,0x8(%rsp)
lea    0x10(%rsp),%r8
lea    0x8(%rsp),%r9
xor    %eax,%eax
call   1030 <fk425pv@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @fk425m(double* %0, double* %1, double* %2, double* %3) {
%5 = alloca double*
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
%9 = alloca double
%10 = alloca double
store double* %0, double** %5
store double* %1, double** %6
store double* %2, double** %7
store double* %3, double** %8
store double 0.000000e+00, double* %9
store double 0.000000e+00, double* %10
%11 = load double*, double** %5
%12 = load double*, double** %6
%13 = load double*, double** %7
%14 = load double*, double** %8
%15 = call i32 (double*, double*, double*, double*, double*, double*, ...) bitcast (i32 (...)* @fk425pv to i32 (double*, double*, double*, double*, double*, double*, ...)*)(double* %11, double* %12, double* %13, double* %14, double* %9, double* %10)
ret void
}

LLVM IR (-O2):
define void @fk425m(double* %0, double* %1, double* %2, double* %3) {
%5 = alloca double
%6 = alloca double
%7 = bitcast double* %5 to i8*
store double 0.000000e+00, double* %5
%8 = bitcast double* %6 to i8*
store double 0.000000e+00, double* %6
%9 = call i32 (double*, double*, double*, double*, double*, double*, ...) bitcast (i32 (...)* @fk425pv to i32 (double*, double*, double*, double*, double*, double*, ...)*)(double* %0, double* %1, double* %2, double* %3, double* %5, double* %6)
ret void
}
int tegra_bpmp_running(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @tegra_bpmp_running() {
ret i32 0
}
unsigned LPCStatusBlockAddressGet(unsigned long ulBase) {
  ;
  return ((*((volatile unsigned long *)(ulBase + 0x000000A0))));
}


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

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

LLVM IR (-O0):
define i32 @LPCStatusBlockAddressGet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 160
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @LPCStatusBlockAddressGet(i64 %0) {
%2 = add i64 %0, 160
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = trunc i64 %4 to i32
ret i32 %5
}
/* Variables and functions */
scalar_t__ abs(long);
int lisp_atan2(long dy, long dx) {
  if (dx <= 0)
    if (dy > 0)
      return abs(dx) <= abs(dy);
  return 0;
}


x86 assembly (clang, -O0):
<lisp_atan2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jg     116b <lisp_atan2+0x5b>
cmpq   $0x0,-0x10(%rbp)
jle    1166 <lisp_atan2+0x56>
mov    -0x18(%rbp),%rdi
call   1030 <abs@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <abs@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
setle  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1172 <lisp_atan2+0x62>
jmp    116b <lisp_atan2+0x5b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lisp_atan2>:
test   %rsi,%rsi
setle  %al
test   %rdi,%rdi
setg   %cl
and    %al,%cl
mov    %rsi,%rax
neg    %rax
cmovs  %rsi,%rax
cmp    %rdi,%rax
setle  %al
and    %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @lisp_atan2(i64 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %5
%7 = icmp sle i64 %6, 0
br i1 %7, label %8, label %19
8: ; preds = %2
%9 = load i64, i64* %4
%10 = icmp sgt i64 %9, 0
br i1 %10, label %11, label %18
11: ; preds = %8
%12 = load i64, i64* %5
%13 = call i64 @abs(i64 %12)
%14 = load i64, i64* %4
%15 = call i64 @abs(i64 %14)
%16 = icmp sle i64 %13, %15
%17 = zext i1 %16 to i32
store i32 %17, i32* %3
br label %20
18: ; preds = %8
br label %19
19: ; preds = %18, %2
store i32 0, i32* %3
br label %20
20: ; preds = %19, %11
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @lisp_atan2(i64 %0, i64 %1) {
%3 = icmp slt i64 %1, 1
%4 = icmp sgt i64 %0, 0
%5 = and i1 %4, %3
%6 = tail call i64 @llvm.abs.i64(i64 %1, i1 true)
%7 = icmp sle i64 %6, %0
%8 = select i1 %5, i1 %7, i1 false
%9 = zext i1 %8 to i32
ret i32 %9
}