xunge/DecIR huggingface dataset:
int d_blt_rr1(double a1, double a2) { return (__builtin_isless(a1, a2)); }


x86 assembly (clang, -O0):
<d_blt_rr1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_blt_rr1>:
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
ret

LLVM IR (-O0):
define i32 @d_blt_rr1(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 = fcmp olt double %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @d_blt_rr1(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_menu() {
  printf("0.-Exit\n");
  printf("1.-Print List\n");
  printf("2.-Size of the list\n");
  printf("3.-Insert in the end of the list\n");
  printf("4.-Insert in the beginning of the list\n");
}


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

x86 assembly (clang, -O2):
<print_menu>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee4(%rip),%rdi
call   1030 <puts@plt>
lea    0xee6(%rip),%rdi
call   1030 <puts@plt>
lea    0xeee(%rip),%rdi
call   1030 <puts@plt>
lea    0xf03(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"0.-Exit\0A\00"
@.str.1 = [15 x i8] c"1.-Print List\0A\00"
@.str.2 = [21 x i8] c"2.-Size of the list\0A\00"
@.str.3 = [34 x i8] c"3.-Insert in the end of the list\0A\00"
@.str.4 = [40 x i8] c"4.-Insert in the beginning of the list\0A\00"
define void @print_menu() {
%1 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [8 x i8] c"0.-Exit\00"
@str.5 = [14 x i8] c"1.-Print List\00"
@str.6 = [20 x i8] c"2.-Size of the list\00"
@str.7 = [33 x i8] c"3.-Insert in the end of the list\00"
@str.8 = [39 x i8] c"4.-Insert in the beginning of the list\00"
define void @print_menu() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.5, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.6, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.7, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.8, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ mbus_remote_register_write(int, int, int);
void set_pmu_sleep_clk_default() {
  mbus_remote_register_write(0x7, 0x19,
                             ((1 << 13) | (1 << 9) | (0 << 5) | (3)));
  delay(100);
  mbus_remote_register_write(0x7, 0x19,
                             ((1 << 13) | (1 << 9) | (0 << 5) | (3)));
  delay(100);
  mbus_remote_register_write(0x7, 0x15,
                             ((0 << 19) | (0 << 18) | (0 << 17) | (3 << 14) |
                              (1 << 13) | (1 << 9) | (0 << 5) | (3)));
  delay(100 * 10);
}


x86 assembly (clang, -O0):
<set_pmu_sleep_clk_default>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7,%edi
mov    $0x19,%esi
mov    $0x2203,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x7,%edi
mov    $0x19,%esi
mov    $0x2203,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x7,%edi
mov    $0x15,%esi
mov    $0xe203,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x3e8,%edi
call   1030 <delay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_pmu_sleep_clk_default>:
push   %rax
mov    $0x7,%edi
mov    $0x19,%esi
mov    $0x2203,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x7,%edi
mov    $0x19,%esi
mov    $0x2203,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x7,%edi
mov    $0x15,%esi
mov    $0xe203,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x3e8,%edi
pop    %rax
jmp    1030 <delay@plt>

LLVM IR (-O0):
define void @set_pmu_sleep_clk_default() {
%1 = call i32 @mbus_remote_register_write(i32 7, i32 25, i32 8707)
%2 = call i32 @delay(i32 100)
%3 = call i32 @mbus_remote_register_write(i32 7, i32 25, i32 8707)
%4 = call i32 @delay(i32 100)
%5 = call i32 @mbus_remote_register_write(i32 7, i32 21, i32 57859)
%6 = call i32 @delay(i32 1000)
ret void
}

LLVM IR (-O2):
define void @set_pmu_sleep_clk_default() {
%1 = tail call i32 @mbus_remote_register_write(i32 7, i32 25, i32 8707)
%2 = tail call i32 @delay(i32 100)
%3 = tail call i32 @mbus_remote_register_write(i32 7, i32 25, i32 8707)
%4 = tail call i32 @delay(i32 100)
%5 = tail call i32 @mbus_remote_register_write(i32 7, i32 21, i32 57859)
%6 = tail call i32 @delay(i32 1000)
ret void
}
double glmDeterminant2d(const double m[4]) { return m[0] * m[3] - m[2] * m[1]; }


x86 assembly (clang, -O0):
<glmDeterminant2d>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm1
mov    -0x8(%rbp),%rax
mulsd  0x8(%rax),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmDeterminant2d>:
movsd  0x8(%rdi),%xmm1
mulsd  0x10(%rdi),%xmm1
movsd  (%rdi),%xmm0
mulsd  0x18(%rdi),%xmm0
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @glmDeterminant2d(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = load double*, double** %2
%7 = getelementptr inbounds double, double* %6, i64 3
%8 = load double, double* %7
%9 = load double*, double** %2
%10 = getelementptr inbounds double, double* %9, i64 2
%11 = load double, double* %10
%12 = load double*, double** %2
%13 = getelementptr inbounds double, double* %12, i64 1
%14 = load double, double* %13
%15 = fmul double %11, %14
%16 = fneg double %15
%17 = call double @llvm.fmuladd.f64(double %5, double %8, double %16)
ret double %17
}

LLVM IR (-O2):
define double @glmDeterminant2d(double* nocapture %0) {
%2 = load double, double* %0
%3 = getelementptr inbounds double, double* %0, i64 3
%4 = load double, double* %3
%5 = getelementptr inbounds double, double* %0, i64 2
%6 = load double, double* %5
%7 = getelementptr inbounds double, double* %0, i64 1
%8 = load double, double* %7
%9 = fneg double %6
%10 = fmul double %8, %9
%11 = tail call double @llvm.fmuladd.f64(double %2, double %4, double %10)
ret double %11
}
int isArmstrong(int x) {
  int r = 0;
  int backUp = x;
  while (x != 0) {
    int m = x % 10;
    r += m * m * m;
    x /= 10;
  }
  if (r == backUp)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<isArmstrong>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1150 <isArmstrong+0x50>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
imul   -0x14(%rbp),%eax
imul   -0x14(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    1114 <isArmstrong+0x14>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    1168 <isArmstrong+0x68>
movl   $0x1,-0x4(%rbp)
jmp    116f <isArmstrong+0x6f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isArmstrong>:
xor    %r9d,%r9d
test   %edi,%edi
je     1146 <isArmstrong+0x46>
mov    %edi,%eax
nopl   0x0(%rax)
movslq %eax,%rdx
imul   $0x66666667,%rdx,%rax
mov    %rax,%rsi
shr    $0x3f,%rsi
sar    $0x22,%rax
add    %esi,%eax
lea    (%rax,%rax,1),%esi
lea    (%rsi,%rsi,4),%r8d
mov    %edx,%ecx
sub    %r8d,%ecx
mov    %ecx,%esi
imul   %ecx,%esi
imul   %ecx,%esi
add    %esi,%r9d
add    $0x9,%edx
cmp    $0x12,%edx
ja     1110 <isArmstrong+0x10>
xor    %eax,%eax
cmp    %edi,%r9d
sete   %al
ret

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

LLVM IR (-O2):
define i32 @isArmstrong(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %10, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = srem i32 %4, 10
%7 = mul nsw i32 %6, %6
%8 = mul nsw i32 %7, %6
%9 = add nsw i32 %8, %5
%10 = sdiv i32 %4, 10
%11 = add i32 %4, 9
%12 = icmp ult i32 %11, 19
br i1 %12, label %13, label %3
13: ; preds = %3, %1
%14 = phi i32 [ 0, %1 ], [ %9, %3 ]
%15 = icmp eq i32 %14, %0
%16 = zext i1 %15 to i32
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ OpenSSL_no_config();
void OPENSSL_no_config(void) { (void)OpenSSL_no_config(); }


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

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

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

LLVM IR (-O2):
define void @OPENSSL_no_config() {
%1 = tail call i32 (...) @OpenSSL_no_config()
ret void
}
/* Variables and functions */
unsigned char call6a(unsigned char);
unsigned char call6(unsigned char uc) { return (call6a(uc)); }


x86 assembly (clang, -O0):
<call6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <call6a@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call6>:
jmp    1030 <call6a@plt>

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

LLVM IR (-O2):
define zeroext i8 @call6(i8 zeroext %0) {
%2 = tail call zeroext i8 @call6a(i8 zeroext %0)
ret i8 %2
}
int __attribute__((stdcall)) version_major() { return 1; }


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

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

LLVM IR (-O0):
define i32 @version_major() {
ret i32 1
}

LLVM IR (-O2):
define i32 @version_major() {
ret i32 1
}
unsigned long bit_lowest_pos(register unsigned long value) {
  unsigned long pos = 0;
  while (!(value & 1)) {
    value >>= 1;
    ++pos;
  }
  return pos;
}


x86 assembly (clang, -O0):
<bit_lowest_pos>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
and    $0x1,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    112e <bit_lowest_pos+0x2e>
jmp    114b <bit_lowest_pos+0x4b>
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <bit_lowest_pos+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_lowest_pos>:
xor    %eax,%eax
test   $0x1,%dil
jne    1120 <bit_lowest_pos+0x20>
mov    %rdi,%rcx
nopl   0x0(%rax,%rax,1)
shr    %rcx
add    $0x1,%rax
test   $0x2,%dil
mov    %rcx,%rdi
je     1110 <bit_lowest_pos+0x10>
ret

LLVM IR (-O0):
define i64 @bit_lowest_pos(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store i64 0, i64* %3
br label %4
4: ; preds = %9, %1
%5 = load i64, i64* %2
%6 = and i64 %5, 1
%7 = icmp ne i64 %6, 0
%8 = xor i1 %7, true
br i1 %8, label %9, label %14
9: ; preds = %4
%10 = load i64, i64* %2
%11 = lshr i64 %10, 1
store i64 %11, i64* %2
%12 = load i64, i64* %3
%13 = add i64 %12, 1
store i64 %13, i64* %3
br label %4
14: ; preds = %4
%15 = load i64, i64* %3
ret i64 %15
}

LLVM IR (-O2):
define i64 @bit_lowest_pos(i64 %0) {
%2 = and i64 %0, 1
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i64 [ %7, %4 ], [ %0, %1 ]
%7 = lshr i64 %6, 1
%8 = add i64 %5, 1
%9 = and i64 %6, 2
%10 = icmp eq i64 %9, 0
br i1 %10, label %4, label %11
11: ; preds = %4, %1
%12 = phi i64 [ 0, %1 ], [ %8, %4 ]
ret i64 %12
}
void Bug3037889(void) {
  *((char *)0x42e0 - 1) = 1;
  *((char *)0x42e0 + 1) = 1;
  *((char *)(0x42e0 - 1)) = 1;
}


x86 assembly (clang, -O0):
<Bug3037889>:
push   %rbp
mov    %rsp,%rbp
mov    $0x42e0,%eax
movb   $0x1,-0x1(%rax)
mov    $0x42e0,%eax
movb   $0x1,0x1(%rax)
mov    $0x42df,%eax
movb   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Bug3037889>:
movb   $0x1,0x42e1
01
movb   $0x1,0x42df
01
ret

LLVM IR (-O0):
define void @Bug3037889() {
store i8 1, i8* getelementptr inbounds (i8, i8* inttoptr (i64 17120 to i8*), i64 -1)
store i8 1, i8* getelementptr inbounds (i8, i8* inttoptr (i64 17120 to i8*), i64 1)
store i8 1, i8* inttoptr (i64 17119 to i8*)
ret void
}

LLVM IR (-O2):
define void @Bug3037889() {
store i8 1, i8* inttoptr (i64 17121 to i8*)
store i8 1, i8* inttoptr (i64 17119 to i8*)
ret void
}
int main() {
  int a = 0;
  int b;
  if (a == 0) {
    b = a;
    b++;
    b++;
    return b;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    113f <main+0x3f>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1146 <main+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 2
}
/* Variables and functions */
scalar_t__ asinl(long double);
int /*<<< orphan*/ link_failure_asinl();
void test_asinl(long double ld) {
  if (asinl(ld) != asinl(ld))
    link_failure_asinl();
}


x86 assembly (clang, -O0):
<test_asinl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <asinl@plt>
mov    %rax,-0x18(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <asinl@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
je     1163 <test_asinl+0x43>
mov    $0x0,%al
call   1030 <link_failure_asinl@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_asinl>:
push   %rbx
sub    $0x20,%rsp
fldt   0x30(%rsp)
fld    %st(0)
fstpt  0x14(%rsp)
fstpt  (%rsp)
call   1040 <asinl@plt>
mov    %rax,%rbx
fldt   0x14(%rsp)
fstpt  (%rsp)
call   1040 <asinl@plt>
cmp    %rax,%rbx
jne    1151 <test_asinl+0x31>
add    $0x20,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
jmp    1030 <link_failure_asinl@plt>

LLVM IR (-O0):
define void @test_asinl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call i64 @asinl(x86_fp80 %3)
%5 = load x86_fp80, x86_fp80* %2
%6 = call i64 @asinl(x86_fp80 %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_asinl()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_asinl(x86_fp80 %0) {
%2 = tail call i64 @asinl(x86_fp80 %0)
%3 = tail call i64 @asinl(x86_fp80 %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_asinl()
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lgen(char *, char *, int);
void cgldswtch(int n) { lgen("%s\t$%c%d,%%rdx", "movq", n); }


x86 assembly (clang, -O0):
<cgldswtch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xedb(%rip),%rdi
lea    0xee3(%rip),%rsi
call   1030 <lgen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgldswtch>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
lea    0xeef(%rip),%rsi
jmp    1030 <lgen@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%s\09$%c%d,%%rdx\00"
@.str.1 = [5 x i8] c"movq\00"
define void @cgldswtch(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @lgen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s\09$%c%d,%%rdx\00"
@.str.1 = [5 x i8] c"movq\00"
define void @cgldswtch(i32 %0) {
%2 = tail call i32 @lgen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %0)
ret void
}
double test12(double a) { return a * 2; }


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

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

LLVM IR (-O0):
define double @test12(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 2.000000e+00
ret double %4
}

LLVM IR (-O2):
define double @test12(double %0) {
%2 = fmul double %0, 2.000000e+00
ret double %2
}
/* Type definitions */
struct i2c_client {
  int dummy;
};
struct device {
  int dummy;
};

/* Variables and functions */
int i2c_master_recv(struct i2c_client *, void *, int);
struct i2c_client *to_i2c_client(struct device *);
int ft5x06_i2c_recv(struct device *dev, void *buf, int len) {
  struct i2c_client *client = to_i2c_client(dev);
  int count = i2c_master_recv(client, buf, len);
  return count < 0 ? count : 0;
}


x86 assembly (clang, -O0):
<ft5x06_i2c_recv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <to_i2c_client@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <i2c_master_recv@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jge    1168 <ft5x06_i2c_recv+0x48>
mov    -0x24(%rbp),%eax
mov    %eax,-0x28(%rbp)
jmp    1172 <ft5x06_i2c_recv+0x52>
xor    %eax,%eax
mov    %eax,-0x28(%rbp)
jmp    1172 <ft5x06_i2c_recv+0x52>
mov    -0x28(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft5x06_i2c_recv>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rsi,%rbx
call   1030 <to_i2c_client@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1040 <i2c_master_recv@plt>
mov    %eax,%ecx
sar    $0x1f,%ecx
and    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.device = type { i32 }
%struct.i2c_client = type { i32 }
define i32 @ft5x06_i2c_recv(%struct.device* %0, i8* %1, i32 %2) {
%4 = alloca %struct.device*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca %struct.i2c_client*
%8 = alloca i32
store %struct.device* %0, %struct.device** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%9 = load %struct.device*, %struct.device** %4
%10 = call %struct.i2c_client* @to_i2c_client(%struct.device* %9)
store %struct.i2c_client* %10, %struct.i2c_client** %7
%11 = load %struct.i2c_client*, %struct.i2c_client** %7
%12 = load i8*, i8** %5
%13 = load i32, i32* %6
%14 = call i32 @i2c_master_recv(%struct.i2c_client* %11, i8* %12, i32 %13)
store i32 %14, i32* %8
%15 = load i32, i32* %8
%16 = icmp slt i32 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %3
%18 = load i32, i32* %8
br label %20
19: ; preds = %3
br label %20
20: ; preds = %19, %17
%21 = phi i32 [ %18, %17 ], [ 0, %19 ]
ret i32 %21
}

LLVM IR (-O2):
%struct.device = type { i32 }
%struct.i2c_client = type { i32 }
define i32 @ft5x06_i2c_recv(%struct.device* %0, i8* %1, i32 %2) {
%4 = tail call %struct.i2c_client* @to_i2c_client(%struct.device* %0)
%5 = tail call i32 @i2c_master_recv(%struct.i2c_client* %4, i8* %1, i32 %2)
%6 = icmp slt i32 %5, 0
%7 = select i1 %6, i32 %5, i32 0
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ traverse(char *, int);
int main(int argc, char *argv[]) {
  traverse(argv[1], 1);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
mov    $0x1,%esi
call   1030 <traverse@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @traverse(i8* %4, i32 1)
ret i32 0
}
/* Type definitions */
struct databuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct databuf *);
void dbuf_free(struct databuf *dbuf) { free(dbuf); }


x86 assembly (clang, -O0):
<dbuf_free>:
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):
<dbuf_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.databuf = type { i32 }
define void @dbuf_free(%struct.databuf* %0) {
%2 = alloca %struct.databuf*
store %struct.databuf* %0, %struct.databuf** %2
%3 = load %struct.databuf*, %struct.databuf** %2
%4 = call i32 @free(%struct.databuf* %3)
ret void
}

LLVM IR (-O2):
%struct.databuf = type { i32 }
define void @dbuf_free(%struct.databuf* nocapture %0) {
%2 = tail call i32 @free(%struct.databuf* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ output(int, int);
void right_forward() {
  output(25, 1);
  output(24, 0);
}


x86 assembly (clang, -O0):
<right_forward>:
push   %rbp
mov    %rsp,%rbp
mov    $0x19,%edi
mov    $0x1,%esi
call   1030 <output@plt>
mov    $0x18,%edi
xor    %esi,%esi
call   1030 <output@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<right_forward>:
push   %rax
mov    $0x19,%edi
mov    $0x1,%esi
call   1030 <output@plt>
mov    $0x18,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <output@plt>

LLVM IR (-O0):
define void @right_forward() {
%1 = call i32 @output(i32 25, i32 1)
%2 = call i32 @output(i32 24, i32 0)
ret void
}

LLVM IR (-O2):
define void @right_forward() {
%1 = tail call i32 @output(i32 25, i32 1)
%2 = tail call i32 @output(i32 24, i32 0)
ret void
}
/* Variables and functions */
int the_cb(int);
extern int CallCallback(int a) { return 3 * the_cb(a); }


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

x86 assembly (clang, -O2):
<CallCallback>:
push   %rax
call   1030 <the_cb@plt>
lea    (%rax,%rax,2),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @CallCallback(i32 %0) {
%2 = tail call i32 @the_cb(i32 %0)
%3 = mul nsw i32 %2, 3
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void goUp(int dy) { printf("\e[%dA", dy); }


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

x86 assembly (clang, -O2):
<goUp>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[%dA\00"
define void @goUp(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
void *getmem(int size) { return (char *)malloc(size); }


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

x86 assembly (clang, -O2):
<getmem>:
movslq %edi,%rdi
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @getmem(i32 %0) {
%2 = sext i32 %0 to i64
%3 = tail call i8* @malloc(i64 %2)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ err(int, char *, char const *);
int open(char const *, int);
int open_or_die(const char *name, int flags) {
  int fd = open(name, flags);
  if (fd < 0)
    err(1, "Failed to open %s", name);
  return fd;
}


x86 assembly (clang, -O0):
<open_or_die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <open@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    115d <open_or_die+0x3d>
mov    -0x8(%rbp),%rdx
mov    $0x1,%edi
lea    0xea8(%rip),%rsi
call   1030 <err@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_or_die>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <open@plt>
mov    %eax,%ebp
test   %eax,%eax
jns    1145 <open_or_die+0x25>
lea    0xec8(%rip),%rsi
mov    $0x1,%edi
mov    %rbx,%rdx
call   1030 <err@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Failed to open %s\00"
define i32 @open_or_die(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @open(i8* %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = call i32 @err(i32 1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %12)
br label %14
14: ; preds = %11, %2
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
@.str = [18 x i8] c"Failed to open %s\00"
define i32 @open_or_die(i8* %0, i32 %1) {
%3 = tail call i32 @open(i8* %0, i32 %1)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %7
7: ; preds = %5, %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ PATH_MAX;
char *malloc(int /*<<< orphan*/);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
char *add_path_parts(char *dir, char *filename) {
  char *path = malloc(PATH_MAX);
  strcpy(path, dir);
  strcat(path, "/");
  strcat(path, filename);
  return path;
}


x86 assembly (clang, -O0):
<add_path_parts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rdi
lea    0xe96(%rip),%rsi
call   1050 <strcat@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <strcat@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_path_parts>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
lea    0xea2(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <strcat@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@PATH_MAX = global i32 0
@.str = [2 x i8] c"/\00"
define i8* @add_path_parts(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i32, i32* @PATH_MAX
%7 = call i8* @malloc(i32 %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = load i8*, i8** %3
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %5
%12 = call i32 @strcat(i8* %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%13 = load i8*, i8** %5
%14 = load i8*, i8** %4
%15 = call i32 @strcat(i8* %13, i8* %14)
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
@PATH_MAX = global i32 0
@.str = [2 x i8] c"/\00"
define i8* @add_path_parts(i8* %0, i8* %1) {
%3 = load i32, i32* @PATH_MAX
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
%6 = tail call i32 @strcat(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @strcat(i8* %4, i8* %1)
ret i8* %4
}
/* Variables and functions */
int check_palindrom(char *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char string[100];
  scanf("%s", string);
  printf("%d", check_palindrom(string));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    -0x70(%rbp),%rsi
lea    0xebd(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x70(%rbp),%rdi
call   1050 <check_palindrom@plt>
mov    %eax,%esi
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
lea    0xec4(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
call   1050 <check_palindrom@plt>
lea    0xead(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @check_palindrom(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ glColor3f(double, double, double);
int /*<<< orphan*/ glPopMatrix();
int /*<<< orphan*/ glPushMatrix();
int /*<<< orphan*/ glScalef(double, double, double);
int /*<<< orphan*/ glutSolidOctahedron();
void drawSOcta(void) {
  glColor3f(0.5, 0.0, 0.0);
  glPushMatrix();
  glScalef(6.0, 6.0, 6.0);
  glutSolidOctahedron();
  glPopMatrix();
}


x86 assembly (clang, -O0):
<drawSOcta>:
push   %rbp
mov    %rsp,%rbp
movsd  0xeac(%rip),%xmm0
xorps  %xmm2,%xmm2
movaps %xmm2,%xmm1
call   1050 <glColor3f@plt>
mov    $0x0,%al
call   1070 <glPushMatrix@plt>
movsd  0xe8a(%rip),%xmm2
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   1060 <glScalef@plt>
mov    $0x0,%al
call   1030 <glutSolidOctahedron@plt>
mov    $0x0,%al
call   1040 <glPopMatrix@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawSOcta>:
push   %rax
movsd  0xea7(%rip),%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
call   1050 <glColor3f@plt>
xor    %eax,%eax
call   1070 <glPushMatrix@plt>
movsd  0xe95(%rip),%xmm0
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
call   1060 <glScalef@plt>
xor    %eax,%eax
call   1030 <glutSolidOctahedron@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <glPopMatrix@plt>

LLVM IR (-O0):
define void @drawSOcta() {
%1 = call i32 @glColor3f(double 5.000000e-01, double 0.000000e+00, double 0.000000e+00)
%2 = call i32 (...) @glPushMatrix()
%3 = call i32 @glScalef(double 6.000000e+00, double 6.000000e+00, double 6.000000e+00)
%4 = call i32 (...) @glutSolidOctahedron()
%5 = call i32 (...) @glPopMatrix()
ret void
}

LLVM IR (-O2):
define void @drawSOcta() {
%1 = tail call i32 @glColor3f(double 5.000000e-01, double 0.000000e+00, double 0.000000e+00)
%2 = tail call i32 (...) @glPushMatrix()
%3 = tail call i32 @glScalef(double 6.000000e+00, double 6.000000e+00, double 6.000000e+00)
%4 = tail call i32 (...) @glutSolidOctahedron()
%5 = tail call i32 (...) @glPopMatrix()
ret void
}
/* Variables and functions */
int fxp_ln(int);
double fxp_log10_low(double x) {
  int xint = (int)(x * 65536.0 + 0.5);
  int lnum = fxp_ln(xint);
  int lden = fxp_ln(655360);
  return ((double)lnum / (double)lden);
}


x86 assembly (clang, -O0):
<fxp_log10_low>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xed2(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <fxp_ln@plt>
mov    %eax,-0x10(%rbp)
mov    $0xa0000,%edi
call   1030 <fxp_ln@plt>
mov    %eax,-0x14(%rbp)
cvtsi2sdl -0x10(%rbp),%xmm0
cvtsi2sdl -0x14(%rbp),%xmm1
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fxp_log10_low>:
push   %rbx
mulsd  0xee7(%rip),%xmm0
addsd  0xee7(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <fxp_ln@plt>
mov    %eax,%ebx
mov    $0xa0000,%edi
call   1030 <fxp_ln@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define double @fxp_log10_low(double %0) {
%2 = alloca double
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store double %0, double* %2
%6 = load double, double* %2
%7 = call double @llvm.fmuladd.f64(double %6, double 6.553600e+04, double 5.000000e-01)
%8 = fptosi double %7 to i32
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = call i32 @fxp_ln(i32 %9)
store i32 %10, i32* %4
%11 = call i32 @fxp_ln(i32 655360)
store i32 %11, i32* %5
%12 = load i32, i32* %4
%13 = sitofp i32 %12 to double
%14 = load i32, i32* %5
%15 = sitofp i32 %14 to double
%16 = fdiv double %13, %15
ret double %16
}

LLVM IR (-O2):
define double @fxp_log10_low(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double 6.553600e+04, double 5.000000e-01)
%3 = fptosi double %2 to i32
%4 = tail call i32 @fxp_ln(i32 %3)
%5 = tail call i32 @fxp_ln(i32 655360)
%6 = sitofp i32 %4 to double
%7 = sitofp i32 %5 to double
%8 = fdiv double %6, %7
ret double %8
}
OP(ed, d4) { illegal_2(); }


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

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

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @illegal_2()
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_2()
ret i32 undef
}
void logmsg(const char *msg) {}


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

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

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

LLVM IR (-O2):
define void @logmsg(i8* nocapture %0) {
ret void
}
int main(int argc, char **argv) {
  volatile char y[4000] __attribute__((aligned(0x100000)));
  return y[argc];
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
and    $0xfffffffffff00000,%rsp
sub    $0x100000,%rsp
movl   $0x0,0xfffec(%rsp)
mov    %edi,0xfffe8(%rsp)
mov    %rsi,0xfffe0(%rsp)
movslq 0xfffe8(%rsp),%rax
mov    (%rsp,%rax,1),%al
movsbl %al,%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
and    $0xfffffffffff00000,%rsp
sub    $0x100000,%rsp
movslq %edi,%rax
movsbl (%rsp,%rax,1),%eax
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [4000 x i8]
%4 = getelementptr inbounds [4000 x i8], [4000 x i8]* %3, i64 0, i64 0
%5 = sext i32 %0 to i64
%6 = getelementptr inbounds [4000 x i8], [4000 x i8]* %3, i64 0, i64 %5
%7 = load volatile i8, i8* %6
%8 = sext i8 %7 to i32
ret i32 %8
}
void in_default() { return; }


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

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

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

LLVM IR (-O2):
define void @in_default() {
ret void
}
/* Variables and functions */
char const *Atom_new(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ assert(char const *);
int /*<<< orphan*/ strlen(char const *);
const char *Atom_string(const char *str) {
  assert(str);
  return Atom_new(str, strlen(str));
}


x86 assembly (clang, -O0):
<Atom_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1050 <Atom_new@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Atom_string>:
push   %rbx
mov    %rdi,%rbx
call   1040 <assert@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1050 <Atom_new@plt>

LLVM IR (-O0):
define i8* @Atom_string(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @assert(i8* %3)
%5 = load i8*, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @strlen(i8* %6)
%8 = call i8* @Atom_new(i8* %5, i32 %7)
ret i8* %8
}

LLVM IR (-O2):
define i8* @Atom_string(i8* %0) {
%2 = tail call i32 @assert(i8* %0)
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i8* @Atom_new(i8* %0, i32 %3)
ret i8* %4
}
int xtensa_simm7(v)
int v;
{ return v >= -32 && v <= 95; }


x86 assembly (clang, -O0):
<xtensa_simm7>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0xffffffe0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <xtensa_simm7+0x20>
cmpl   $0x5f,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xtensa_simm7>:
add    $0x20,%edi
xor    %eax,%eax
cmp    $0x80,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @xtensa_simm7(i32 %0) {
%2 = add i32 %0, 32
%3 = icmp ult i32 %2, 128
%4 = zext i1 %3 to i32
ret i32 %4
}
int FlashDevUnmount() { return 0x0; }


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

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

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

LLVM IR (-O2):
define i32 @FlashDevUnmount() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage(char *prog) { printf("usage: %s [-s] filename\n", prog); }


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

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

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

LLVM IR (-O2):
@.str = [25 x i8] c"usage: %s [-s] filename\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_usage(void) {
  fprintf(stderr,
          "Usage: sm64walk [-o OFFSET] [-r REGION] [-v] FILE\n"
          "\n"
          "sm64walk v"
          "0.1"
          ": Super Mario 64 script walker\n"
          "\n"
          "Optional arguments:\n"
          " -o OFFSET    start decoding level scripts at OFFSET (default: "
          "auto-detect)\n"
          " -r REGION    region to use. valid: Europe, US, JP, Shindou\n"
          " -v           verbose progress output\n"
          "\n"
          "File arguments:\n"
          " FILE        input ROM file\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [336 x i8] c"Usage: sm64walk [-o OFFSET] [-r REGION] [-v] FILE\0A\0Asm64walk v0.1: Super Mario 64 script walker\0A\0AOptional arguments:\0A -o OFFSET start decoding level scripts at OFFSET (default: auto-detect)\0A -r REGION region to use. valid: Europe, US, JP, Shindou\0A -v verbose progress output\0A\0AFile arguments:\0A FILE input ROM file\0A\00"
@EXIT_FAILURE = global i32 0
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([336 x i8], [336 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [336 x i8] c"Usage: sm64walk [-o OFFSET] [-r REGION] [-v] FILE\0A\0Asm64walk v0.1: Super Mario 64 script walker\0A\0AOptional arguments:\0A -o OFFSET start decoding level scripts at OFFSET (default: auto-detect)\0A -r REGION region to use. valid: Europe, US, JP, Shindou\0A -v verbose progress output\0A\0AFile arguments:\0A FILE input ROM file\0A\00"
@EXIT_FAILURE = global i32 0
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([336 x i8], [336 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
float poly(float, float, float, float, int);
float quartIn(float fraction, float start, float delta, float slope) {
  return poly(fraction, start, delta, slope, 4);
}


x86 assembly (clang, -O0):
<quartIn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
movss  -0x10(%rbp),%xmm3
mov    $0x4,%edi
call   1030 <poly@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quartIn>:
mov    $0x4,%edi
jmp    1030 <poly@plt>

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

LLVM IR (-O2):
define float @quartIn(float %0, float %1, float %2, float %3) {
%5 = tail call float @poly(float %0, float %1, float %2, float %3, i32 4)
ret float %5
}
/* Type definitions */
struct hnode {
  int dummy;
};

/* Variables and functions */
void __attribute__((__unused__))
_hash_op_hnode_hh_delete_node(void (*free_func)(struct hnode *p),
                              struct hnode *p) {
  if (free_func != NULL)
    free_func(p);
}


x86 assembly (clang, -O0):
<_hash_op_hnode_hh_delete_node>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1125 <_hash_op_hnode_hh_delete_node+0x25>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_hash_op_hnode_hh_delete_node>:
test   %rdi,%rdi
je     110d <_hash_op_hnode_hh_delete_node+0xd>
mov    %rdi,%rax
mov    %rsi,%rdi
jmp    *%rax
ret

LLVM IR (-O0):
%struct.hnode = type { i32 }
define void @_hash_op_hnode_hh_delete_node(void (%struct.hnode*)* %0, %struct.hnode* %1) {
%3 = alloca void (%struct.hnode*)*
%4 = alloca %struct.hnode*
store void (%struct.hnode*)* %0, void (%struct.hnode*)** %3
store %struct.hnode* %1, %struct.hnode** %4
%5 = load void (%struct.hnode*)*, void (%struct.hnode*)** %3
%6 = icmp ne void (%struct.hnode*)* %5, null
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load void (%struct.hnode*)*, void (%struct.hnode*)** %3
%9 = load %struct.hnode*, %struct.hnode** %4
br label %10
10: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
%struct.hnode = type { i32 }
define void @_hash_op_hnode_hh_delete_node(void (%struct.hnode*)* %0, %struct.hnode* %1) {
%3 = icmp eq void (%struct.hnode*)* %0, null
br i1 %3, label %5, label %4
4: ; preds = %2
tail call void %0(%struct.hnode* %1)
br label %5
5: ; preds = %4, %2
ret void
}