xunge/DecIR huggingface dataset:
int ft_fibonacci(int index) {
  if (index < 0)
    return (-1);
  if (index == 0)
    return (0);
  if (index == 1)
    return (1);
  else
    return (ft_fibonacci(index - 1) + ft_fibonacci(index - 2));
}


x86 assembly (clang, -O0):
<ft_fibonacci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1131 <ft_fibonacci+0x21>
movl   $0xffffffff,-0x4(%rbp)
jmp    1180 <ft_fibonacci+0x70>
cmpl   $0x0,-0x8(%rbp)
jne    1147 <ft_fibonacci+0x37>
movl   $0x0,-0x4(%rbp)
jmp    1180 <ft_fibonacci+0x70>
cmpl   $0x1,-0x8(%rbp)
jne    115d <ft_fibonacci+0x4d>
movl   $0x1,-0x4(%rbp)
jmp    1180 <ft_fibonacci+0x70>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <ft_fibonacci@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <ft_fibonacci@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_fibonacci>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
js     1136 <ft_fibonacci+0x26>
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%ebx
jb     1132 <ft_fibonacci+0x22>
lea    -0x1(%rbx),%edi
call   1030 <ft_fibonacci@plt>
add    %eax,%ebp
add    $0xfffffffe,%ebx
cmp    $0x2,%ebx
jae    1120 <ft_fibonacci+0x10>
add    %ebp,%ebx
jmp    113b <ft_fibonacci+0x2b>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @ft_fibonacci(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %14, label %3
3: ; preds = %1, %7
%4 = phi i32 [ %10, %7 ], [ %0, %1 ]
%5 = phi i32 [ %11, %7 ], [ 0, %1 ]
%6 = icmp ult i32 %4, 2
br i1 %6, label %12, label %7
7: ; preds = %3
%8 = add nsw i32 %4, -1
%9 = tail call i32 @ft_fibonacci(i32 %8)
%10 = add nsw i32 %4, -2
%11 = add nsw i32 %9, %5
br label %3
12: ; preds = %3
%13 = add nsw i32 %4, %5
br label %14
14: ; preds = %12, %1
%15 = phi i32 [ %13, %12 ], [ -1, %1 ]
ret i32 %15
}
int elg_pform_num_nodes() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @elg_pform_num_nodes() {
ret i32 1
}
int audio_systems(void) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @audio_systems() {
ret i32 0
}
void gensh() {}


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

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

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

LLVM IR (-O2):
define void @gensh() {
ret void
}
/* Type definitions */
typedef void FILE;

/* Variables and functions */
int /*<<< orphan*/ abort();
void *tmpfile();
void *setup() {
  FILE *file = tmpfile();
  if (!file)
    abort();
  return file;
}


x86 assembly (clang, -O0):
<setup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <tmpfile@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1145 <setup+0x25>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup>:
push   %rax
xor    %eax,%eax
call   1040 <tmpfile@plt>
test   %rax,%rax
je     112f <setup+0xf>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @setup() {
%1 = alloca i8*
%2 = call i8* (...) @tmpfile()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = icmp ne i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %0
%8 = load i8*, i8** %1
ret i8* %8
}

LLVM IR (-O2):
define noalias i8* @setup() {
%1 = tail call i8* (...) @tmpfile()
%2 = icmp eq i8* %1, null
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i8* %1
}
int float_ne_xxxx(int a, int b) {
  if (a < 0) {
    a = 0x80000000u - a;
  }
  if (b < 0) {
    b = 0x80000000u - b;
  }
  return a != b;
}


x86 assembly (clang, -O0):
<float_ne_xxxx>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111f <float_ne_xxxx+0x1f>
mov    $0x80000000,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1134 <float_ne_xxxx+0x34>
mov    $0x80000000,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<float_ne_xxxx>:
mov    $0x80000000,%ecx
mov    $0x80000000,%edx
sub    %edi,%edx
test   %edi,%edi
cmovns %edi,%edx
sub    %esi,%ecx
test   %esi,%esi
cmovns %esi,%ecx
xor    %eax,%eax
cmp    %ecx,%edx
setne  %al
ret

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

LLVM IR (-O2):
define i32 @float_ne_xxxx(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 0
%4 = sub i32 -2147483648, %0
%5 = select i1 %3, i32 %4, i32 %0
%6 = icmp slt i32 %1, 0
%7 = sub i32 -2147483648, %1
%8 = select i1 %6, i32 %7, i32 %1
%9 = icmp ne i32 %5, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
int is_power_of_two(unsigned int x) { return ((x != 0) && !(x & (x - 1))); }


x86 assembly (clang, -O0):
<is_power_of_two>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     112c <is_power_of_two+0x2c>
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_power_of_two>:
test   %edi,%edi
je     110f <is_power_of_two+0xf>
lea    -0x1(%rdi),%ecx
xor    %eax,%eax
test   %ecx,%edi
sete   %al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @is_power_of_two(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load i32, i32* %2
%7 = load i32, i32* %2
%8 = sub i32 %7, 1
%9 = and i32 %6, %8
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
br label %12
12: ; preds = %5, %1
%13 = phi i1 [ false, %1 ], [ %11, %5 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @is_power_of_two(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32 @llvm.ctpop.i32(i32 %0)
%5 = icmp ult i32 %4, 2
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
void atomic_store_128_relaxed(__int128 *ptr, __int128 val) {
  __atomic_store_n(ptr, val, 0);
}


x86 assembly (clang, -O0):
<atomic_store_128_relaxed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    %rdi,-0x18(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x30(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    %rcx,-0x38(%rbp)
mov    %rax,-0x40(%rbp)
lea    -0x40(%rbp),%rdx
mov    $0x10,%edi
xor    %ecx,%ecx
call   1030 <__atomic_store@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atomic_store_128_relaxed>:
sub    $0x18,%rsp
mov    %rdi,%rax
mov    %rdx,0x8(%rsp)
mov    %rsi,(%rsp)
mov    %rsp,%rdx
mov    $0x10,%edi
mov    %rax,%rsi
xor    %ecx,%ecx
call   1030 <__atomic_store@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @atomic_store_128_relaxed(i128* %0, i64 %1, i64 %2) {
%4 = alloca i128
%5 = alloca i128*
%6 = alloca i128
%7 = alloca i128
%8 = bitcast i128* %4 to { i64, i64 }*
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 0
store i64 %1, i64* %9
%10 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 1
store i64 %2, i64* %10
%11 = load i128, i128* %4
store i128* %0, i128** %5
store i128 %11, i128* %6
%12 = load i128*, i128** %5
%13 = load i128, i128* %6
store i128 %13, i128* %7
%14 = bitcast i128* %12 to i8*
%15 = bitcast i128* %7 to i8*
ret void
}

LLVM IR (-O2):
define void @atomic_store_128_relaxed(i128* %0, i64 %1, i64 %2) {
%4 = alloca i128
%5 = zext i64 %2 to i128
%6 = shl nuw i128 %5, 64
%7 = zext i64 %1 to i128
%8 = or i128 %6, %7
store i128 %8, i128* %4
%9 = bitcast i128* %0 to i8*
%10 = bitcast i128* %4 to i8*
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gen_op_store_lr();
void spr_write_lr(void *opaque, int sprn) { gen_op_store_lr(); }


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

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

LLVM IR (-O0):
define void @spr_write_lr(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 (...) @gen_op_store_lr()
ret void
}

LLVM IR (-O2):
define void @spr_write_lr(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 (...) @gen_op_store_lr()
ret void
}
int isArmstrong(int n) {
  int a = 0, t = n;
  while (t > 0) {
    a += (t % 10) * (t % 10) * (t % 10);
    t /= 10;
  }
  return a == n;
}


x86 assembly (clang, -O0):
<isArmstrong>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    116c <isArmstrong+0x6c>
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    -0x14(%rbp),%edx
imul   %eax,%edx
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x10(%rbp),%eax
imul   %edx,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
jmp    1114 <isArmstrong+0x14>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isArmstrong>:
xor    %r9d,%r9d
test   %edi,%edi
jle    1136 <isArmstrong+0x36>
mov    $0xcccccccd,%r8d
mov    %edi,%ecx
nop
mov    %ecx,%esi
imul   %r8,%rsi
shr    $0x23,%rsi
lea    (%rsi,%rsi,1),%eax
lea    (%rax,%rax,4),%eax
mov    %ecx,%edx
sub    %eax,%edx
mov    %edx,%eax
imul   %edx,%eax
imul   %edx,%eax
add    %eax,%r9d
cmp    $0x9,%ecx
mov    %esi,%ecx
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
store i32 %0, i32* %2
store i32 0, i32* %3
%5 = load i32, i32* %2
store i32 %5, i32* %4
br label %6
6: ; preds = %9, %1
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %22
9: ; preds = %6
%10 = load i32, i32* %4
%11 = srem i32 %10, 10
%12 = load i32, i32* %4
%13 = srem i32 %12, 10
%14 = mul nsw i32 %11, %13
%15 = load i32, i32* %4
%16 = srem i32 %15, 10
%17 = mul nsw i32 %14, %16
%18 = load i32, i32* %3
%19 = add nsw i32 %18, %17
store i32 %19, i32* %3
%20 = load i32, i32* %4
%21 = sdiv i32 %20, 10
store i32 %21, i32* %4
br label %6
22: ; preds = %6
%23 = load i32, i32* %3
%24 = load i32, i32* %2
%25 = icmp eq i32 %23, %24
%26 = zext i1 %25 to i32
ret i32 %26
}

LLVM IR (-O2):
define i32 @isArmstrong(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %12
3: ; preds = %1, %3
%4 = phi i32 [ %10, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = urem i32 %4, 10
%7 = mul nuw nsw i32 %6, %6
%8 = mul nuw nsw i32 %7, %6
%9 = add nuw nsw i32 %8, %5
%10 = udiv i32 %4, 10
%11 = icmp ult i32 %4, 10
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i32 [ 0, %1 ], [ %9, %3 ]
%14 = icmp eq i32 %13, %0
%15 = zext i1 %14 to i32
ret i32 %15
}
/* Variables and functions */
void *realloc(void *, size_t);
void *reallocarray(void *, size_t, size_t);
void *pfasta_reallocarray(void *ptr, size_t nmemb, size_t size) {
  if (reallocarray == NULL) {
    return realloc(ptr, nmemb * size);
  } else {
    return reallocarray(ptr, nmemb, size);
  }
}


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

x86 assembly (clang, -O2):
<pfasta_reallocarray>:
jmp    1030 <reallocarray@plt>

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

LLVM IR (-O2):
define i8* @pfasta_reallocarray(i8* %0, i64 %1, i64 %2) {
%4 = tail call i8* @reallocarray(i8* %0, i64 %1, i64 %2)
ret i8* %4
}
/* Type definitions */
struct _CSSOM_ListItem_Int {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CSSOM_free(struct _CSSOM_ListItem_Int *);
void ListItem_Int_free(struct _CSSOM_ListItem_Int *item) { CSSOM_free(item); }


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

x86 assembly (clang, -O2):
<ListItem_Int_free>:
jmp    1030 <CSSOM_free@plt>

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

LLVM IR (-O2):
%struct._CSSOM_ListItem_Int = type { i32 }
define void @ListItem_Int_free(%struct._CSSOM_ListItem_Int* %0) {
%2 = tail call i32 @CSSOM_free(%struct._CSSOM_ListItem_Int* %0)
ret void
}
void *move_ptr_align8(void *ptr, unsigned long offset) {
  return (void *)(((unsigned long)(ptr + offset) + 7) & (~7));
}


x86 assembly (clang, -O0):
<move_ptr_align8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
add    $0x7,%rax
and    $0xfffffffffffffff8,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<move_ptr_align8>:
lea    (%rdi,%rsi,1),%rax
add    $0x7,%rax
and    $0xfffffffffffffff8,%rax
ret

LLVM IR (-O0):
define i8* @move_ptr_align8(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = getelementptr i8, i8* %5, i64 %6
%8 = ptrtoint i8* %7 to i64
%9 = add i64 %8, 7
%10 = and i64 %9, -8
%11 = inttoptr i64 %10 to i8*
ret i8* %11
}

LLVM IR (-O2):
define i8* @move_ptr_align8(i8* %0, i64 %1) {
%3 = getelementptr i8, i8* %0, i64 %1
%4 = ptrtoint i8* %3 to i64
%5 = add i64 %4, 7
%6 = and i64 %5, -8
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}
/* Type definitions */
typedef int /*<<< orphan*/ input_data;

/* Variables and functions */
int /*<<< orphan*/ Encode_one_symbol(unsigned int);
int /*<<< orphan*/ Encode_stop();
int main() {
  unsigned int input_data[] = {0, 0, 1};
  unsigned int input_length = sizeof(input_data) / sizeof(unsigned int);
  for (int idx = 0; idx < input_length; idx++) {
    Encode_one_symbol(input_data[idx]);
  }
  Encode_stop();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec8(%rip),%eax
mov    %eax,-0x8(%rbp)
movl   $0x3,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jae    1178 <main+0x58>
movslq -0x18(%rbp),%rax
mov    -0x10(%rbp,%rax,4),%edi
call   1030 <Encode_one_symbol@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1151 <main+0x31>
mov    $0x0,%al
call   1040 <Encode_stop@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.input_data = [3 x i32] [i32 0, i32 0, i32 1]
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i32]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [3 x i32]* %2 to i8*
store i32 3, i32* %3
store i32 0, i32* %4
br label %6
6: ; preds = %16, %0
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = icmp ult i32 %7, %8
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 %12
%14 = load i32, i32* %13
%15 = call i32 @Encode_one_symbol(i32 %14)
br label %16
16: ; preds = %10
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 1
store i32 %18, i32* %4
br label %6
19: ; preds = %6
%20 = call i32 (...) @Encode_stop()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @Encode_one_symbol(i32 0)
%2 = tail call i32 @Encode_one_symbol(i32 0)
%3 = tail call i32 @Encode_one_symbol(i32 1)
%4 = tail call i32 (...) @Encode_stop()
ret i32 0
}
/* Variables and functions */
long get_num(char *, char *);
char *tt_redtopology(char *, int, long);
char *macttRedtopology(char *arg) {
  int tbl;
  long top;
  top = get_num("ttRedTopology", arg);
  tbl = (int)get_num("ttRedTopology", arg);
  return tt_redtopology(arg, tbl, top);
}


x86 assembly (clang, -O0):
<macttRedtopology>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <get_num@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb5(%rip),%rdi
call   1030 <get_num@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1040 <tt_redtopology@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<macttRedtopology>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
lea    0xed1(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <get_num@plt>
mov    %rax,%r15
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <get_num@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %r15,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <tt_redtopology@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"ttRedTopology\00"
define i8* @macttRedtopology(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @get_num(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %5)
store i64 %6, i64* %4
%7 = load i8*, i8** %2
%8 = call i64 @get_num(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = trunc i64 %8 to i32
store i32 %9, i32* %3
%10 = load i8*, i8** %2
%11 = load i32, i32* %3
%12 = load i64, i64* %4
%13 = call i8* @tt_redtopology(i8* %10, i32 %11, i64 %12)
ret i8* %13
}

LLVM IR (-O2):
@.str = [14 x i8] c"ttRedTopology\00"
define i8* @macttRedtopology(i8* %0) {
%2 = tail call i64 @get_num(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i64 @get_num(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = trunc i64 %3 to i32
%5 = tail call i8* @tt_redtopology(i8* %0, i32 %4, i64 %2)
ret i8* %5
}
void Lut_Lut2Luv(double *out, double *in) {
  out[0] = in[0] * 100.0;
  out[1] = (in[1] * 65535.0 / 256.0) - 128.0;
  out[2] = (in[2] * 65535.0 / 256.0) - 128.0;
}


x86 assembly (clang, -O0):
<Lut_Lut2Luv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  0xf00(%rip),%xmm0
mulsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  0xee0(%rip),%xmm0
mulsd  0x8(%rax),%xmm0
movsd  0xecb(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xeb7(%rip),%xmm1
subsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movsd  0xeae(%rip),%xmm0
mulsd  0x10(%rax),%xmm0
movsd  0xe99(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe85(%rip),%xmm1
subsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Lut_Lut2Luv>:
movsd  (%rsi),%xmm0
mulsd  0xef4(%rip),%xmm0
movsd  %xmm0,(%rdi)
movsd  0xef0(%rip),%xmm0
movsd  0x8(%rsi),%xmm1
mulsd  %xmm0,%xmm1
movsd  0xee7(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xee3(%rip),%xmm3
addsd  %xmm3,%xmm1
movsd  %xmm1,0x8(%rdi)
mulsd  0x10(%rsi),%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm3,%xmm0
movsd  %xmm0,0x10(%rdi)
ret

LLVM IR (-O0):
define void @Lut_Lut2Luv(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %4
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = fmul double %7, 1.000000e+02
%9 = load double*, double** %3
%10 = getelementptr inbounds double, double* %9, i64 0
store double %8, double* %10
%11 = load double*, double** %4
%12 = getelementptr inbounds double, double* %11, i64 1
%13 = load double, double* %12
%14 = fmul double %13, 6.553500e+04
%15 = fdiv double %14, 2.560000e+02
%16 = fsub double %15, 1.280000e+02
%17 = load double*, double** %3
%18 = getelementptr inbounds double, double* %17, i64 1
store double %16, double* %18
%19 = load double*, double** %4
%20 = getelementptr inbounds double, double* %19, i64 2
%21 = load double, double* %20
%22 = fmul double %21, 6.553500e+04
%23 = fdiv double %22, 2.560000e+02
%24 = fsub double %23, 1.280000e+02
%25 = load double*, double** %3
%26 = getelementptr inbounds double, double* %25, i64 2
store double %24, double* %26
ret void
}

LLVM IR (-O2):
define void @Lut_Lut2Luv(double* nocapture writeonly %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = fmul double %3, 1.000000e+02
store double %4, double* %0
%5 = getelementptr inbounds double, double* %1, i64 1
%6 = load double, double* %5
%7 = fmul double %6, 6.553500e+04
%8 = fmul double %7, 3.906250e-03
%9 = fadd double %8, -1.280000e+02
%10 = getelementptr inbounds double, double* %0, i64 1
store double %9, double* %10
%11 = getelementptr inbounds double, double* %1, i64 2
%12 = load double, double* %11
%13 = fmul double %12, 6.553500e+04
%14 = fmul double %13, 3.906250e-03
%15 = fadd double %14, -1.280000e+02
%16 = getelementptr inbounds double, double* %0, i64 2
store double %15, double* %16
ret void
}
void test95_Arr_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @test95_Arr_targetInit__I() {
ret void
}
/* Variables and functions */
int is_prime(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  printf("%d", is_prime(n));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <is_prime@plt>
mov    %eax,%esi
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @is_prime(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ deny();
int /*<<< orphan*/ jolly();
int main(void) {
  jolly();
  jolly();
  jolly();
  deny();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <jolly@plt>
mov    $0x0,%al
call   1030 <jolly@plt>
mov    $0x0,%al
call   1030 <jolly@plt>
mov    $0x0,%al
call   1040 <deny@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <jolly@plt>
xor    %eax,%eax
call   1030 <jolly@plt>
xor    %eax,%eax
call   1030 <jolly@plt>
xor    %eax,%eax
call   1040 <deny@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @jolly()
%3 = call i32 (...) @jolly()
%4 = call i32 (...) @jolly()
%5 = call i32 (...) @deny()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @jolly()
%2 = tail call i32 (...) @jolly()
%3 = tail call i32 (...) @jolly()
%4 = tail call i32 (...) @deny()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ scrprintf(char *, int, int, int);
void attrset(int a, int fg, int bg) {
  scrprintf("\033[%d;%d;%dm", a, 30 + fg, 40 + bg);
}


x86 assembly (clang, -O0):
<attrset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
add    $0x1e,%edx
mov    -0xc(%rbp),%ecx
add    $0x28,%ecx
lea    0xec9(%rip),%rdi
call   1030 <scrprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<attrset>:
mov    %edi,%r8d
lea    0x1e(%rsi),%eax
lea    0x28(%rdx),%ecx
lea    0xee0(%rip),%rdi
mov    %r8d,%esi
mov    %eax,%edx
jmp    1030 <scrprintf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"\1B[%d;%d;%dm\00"
define void @attrset(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = add nsw i32 30, %8
%10 = load i32, i32* %6
%11 = add nsw i32 40, %10
%12 = call i32 @scrprintf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %9, i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"\1B[%d;%d;%dm\00"
define void @attrset(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, 30
%5 = add nsw i32 %2, 40
%6 = tail call i32 @scrprintf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %4, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RTLD_LAZY;
int /*<<< orphan*/ dlclose(void *);
char *dlerror();
void *dlopen(char *, int /*<<< orphan*/);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  void *handle = dlopen("nodel2mod3.so", RTLD_LAZY);
  if (handle == NULL) {
    printf("%s\n", dlerror());
    exit(1);
  }
  dlclose(handle);
  exit(1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e7a(%rip),%rax
mov    (%rax),%esi
lea    0xe91(%rip),%rdi
call   1050 <dlopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    11a3 <main+0x53>
mov    $0x0,%al
call   1030 <dlerror@plt>
mov    %rax,%rsi
lea    0xe7a(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rdi
call   1070 <dlclose@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2e88(%rip),%rax
mov    (%rax),%esi
lea    0xe9f(%rip),%rdi
call   1050 <dlopen@plt>
test   %rax,%rax
jne    118b <main+0x3b>
xor    %eax,%eax
call   1030 <dlerror@plt>
lea    0xe95(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    %rax,%rdi
call   1070 <dlclose@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"nodel2mod3.so\00"
@RTLD_LAZY = global i32 0
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = load i32, i32* @RTLD_LAZY
%4 = call i8* @dlopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %3)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %11
7: ; preds = %0
%8 = call i8* (...) @dlerror()
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %0
%12 = load i8*, i8** %2
%13 = call i32 @dlclose(i8* %12)
%14 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [14 x i8] c"nodel2mod3.so\00"
@RTLD_LAZY = global i32 0
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = load i32, i32* @RTLD_LAZY
%2 = tail call i8* @dlopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = tail call i8* (...) @dlerror()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %0
%9 = tail call i32 @dlclose(i8* %2)
%10 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, unsigned char);
void vga_setcurs(char x, char y) {
  unsigned short pos = (y * 80) + x;
  outb(0x3D4, 0x0F);
  outb(0x3D5, (unsigned char)pos & 0xFF);
  outb(0x3D4, 0x0E);
  outb(0x3D5, (unsigned char)(pos >> 8) & 0xFF);
}


x86 assembly (clang, -O0):
<vga_setcurs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
imul   $0x50,%eax,%eax
movsbl -0x1(%rbp),%ecx
add    %ecx,%eax
mov    %ax,-0x4(%rbp)
mov    $0x3d4,%edi
mov    $0xf,%esi
call   1030 <outb@plt>
mov    -0x4(%rbp),%ax
movzbl %al,%eax
and    $0xff,%eax
mov    $0x3d5,%edi
movzbl %al,%esi
call   1030 <outb@plt>
mov    $0x3d4,%edi
mov    $0xe,%esi
call   1030 <outb@plt>
movzwl -0x4(%rbp),%eax
sar    $0x8,%eax
movzbl %al,%eax
and    $0xff,%eax
mov    $0x3d5,%edi
movzbl %al,%esi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vga_setcurs>:
push   %rbx
lea    (%rsi,%rsi,4),%ebx
shl    $0x4,%ebx
add    %edi,%ebx
mov    $0x3d4,%edi
mov    $0xf,%esi
call   1030 <outb@plt>
movzbl %bl,%esi
mov    $0x3d5,%edi
call   1030 <outb@plt>
mov    $0x3d4,%edi
mov    $0xe,%esi
call   1030 <outb@plt>
movzbl %bh,%esi
mov    $0x3d5,%edi
pop    %rbx
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @vga_setcurs(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i16
store i8 %0, i8* %3
store i8 %1, i8* %4
%6 = load i8, i8* %4
%7 = sext i8 %6 to i32
%8 = mul nsw i32 %7, 80
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = add nsw i32 %8, %10
%12 = trunc i32 %11 to i16
store i16 %12, i16* %5
%13 = call i32 @outb(i32 980, i8 zeroext 15)
%14 = load i16, i16* %5
%15 = trunc i16 %14 to i8
%16 = zext i8 %15 to i32
%17 = and i32 %16, 255
%18 = trunc i32 %17 to i8
%19 = call i32 @outb(i32 981, i8 zeroext %18)
%20 = call i32 @outb(i32 980, i8 zeroext 14)
%21 = load i16, i16* %5
%22 = zext i16 %21 to i32
%23 = ashr i32 %22, 8
%24 = trunc i32 %23 to i8
%25 = zext i8 %24 to i32
%26 = and i32 %25, 255
%27 = trunc i32 %26 to i8
%28 = call i32 @outb(i32 981, i8 zeroext %27)
ret void
}

LLVM IR (-O2):
define void @vga_setcurs(i8 signext %0, i8 signext %1) {
%3 = sext i8 %1 to i16
%4 = mul nsw i16 %3, 80
%5 = sext i8 %0 to i16
%6 = add nsw i16 %4, %5
%7 = tail call i32 @outb(i32 980, i8 zeroext 15)
%8 = trunc i16 %6 to i8
%9 = tail call i32 @outb(i32 981, i8 zeroext %8)
%10 = tail call i32 @outb(i32 980, i8 zeroext 14)
%11 = lshr i16 %6, 8
%12 = trunc i16 %11 to i8
%13 = tail call i32 @outb(i32 981, i8 zeroext %12)
ret void
}
double get_mass(int ch) {
  switch (ch) {
  case 'C':
    return 12.01;
  case 'H':
    return 1.008;
  case 'O':
    return 16.00;
  case 'N':
    return 14.01;
  }
  return 0.0;
}


x86 assembly (clang, -O0):
<get_mass>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffbd,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0xc,%eax
ja     1178 <get_mass+0x78>
mov    -0x18(%rbp),%rax
lea    0xef9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movsd  0xee0(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1180 <get_mass+0x80>
movsd  0xec6(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1180 <get_mass+0x80>
movsd  0xeac(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1180 <get_mass+0x80>
movsd  0xe92(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1180 <get_mass+0x80>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_mass>:
add    $0xffffffbd,%edi
cmp    $0xc,%edi
ja     1129 <get_mass+0x29>
movsd  0xef0(%rip),%xmm0
lea    0xf09(%rip),%rax
movslq (%rax,%rdi,4),%rcx
add    %rax,%rcx
jmp    *%rcx
movsd  0xef0(%rip),%xmm0
ret
xorps  %xmm0,%xmm0
ret
movsd  0xed3(%rip),%xmm0
ret
movsd  0xed2(%rip),%xmm0
ret

LLVM IR (-O0):
define double @get_mass(i32 %0) {
%2 = alloca double
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %9 [
i32 67, label %5
i32 72, label %6
i32 79, label %7
i32 78, label %8
]
5: ; preds = %1
store double 1.201000e+01, double* %2
br label %10
6: ; preds = %1
store double 1.008000e+00, double* %2
br label %10
7: ; preds = %1
store double 1.600000e+01, double* %2
br label %10
8: ; preds = %1
store double 1.401000e+01, double* %2
br label %10
9: ; preds = %1
store double 0.000000e+00, double* %2
br label %10
10: ; preds = %9, %8, %7, %6, %5
%11 = load double, double* %2
ret double %11
}

LLVM IR (-O2):
define double @get_mass(i32 %0) {
switch i32 %0, label %5 [
i32 67, label %6
i32 72, label %2
i32 79, label %3
i32 78, label %4
]
2: ; preds = %1
br label %6
3: ; preds = %1
br label %6
4: ; preds = %1
br label %6
5: ; preds = %1
br label %6
6: ; preds = %1, %5, %4, %3, %2
%7 = phi double [ 0.000000e+00, %5 ], [ 1.401000e+01, %4 ], [ 1.600000e+01, %3 ], [ 1.008000e+00, %2 ], [ 1.201000e+01, %1 ]
ret double %7
}
extern unsigned int cpuid_ecx(unsigned int op) {
  unsigned int eax, ecx;
  __asm__("cpuid" : "=a"(eax), "=c"(ecx) : "0"(op) : "bx", "dx");
  return ecx;
}


x86 assembly (clang, -O0):
<cpuid_ecx>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cpuid
mov    %eax,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid_ecx>:
push   %rbx
mov    %edi,%eax
cpuid
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @cpuid_ecx(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call { i32, i32 } asm "cpuid", "={ax},={cx},0,~{bx},~{dx},~{dirflag},~{fpsr},~{flags}"(i32 %5)
%7 = extractvalue { i32, i32 } %6, 0
%8 = extractvalue { i32, i32 } %6, 1
store i32 %7, i32* %3
store i32 %8, i32* %4
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
define i32 @cpuid_ecx(i32 %0) {
%2 = tail call { i32, i32 } asm "cpuid", "={ax},={cx},0,~{bx},~{dx},~{dirflag},~{fpsr},~{flags}"(i32 %0)
%3 = extractvalue { i32, i32 } %2, 1
ret i32 %3
}
/* Type definitions */
struct _reent {
  int dummy;
};

/* Variables and functions */
int bt_sys_open(char const *, int, int);
int _open_r(struct _reent *r, const char *name, int flags, int mode) {
  return bt_sys_open(name, flags, mode);
}


x86 assembly (clang, -O0):
<_open_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <bt_sys_open@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_open_r>:
mov    %rsi,%rdi
mov    %edx,%esi
mov    %ecx,%edx
jmp    1030 <bt_sys_open@plt>

LLVM IR (-O0):
%struct._reent = type { i32 }
define i32 @_open_r(%struct._reent* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca %struct._reent*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store %struct._reent* %0, %struct._reent** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i8*, i8** %6
%10 = load i32, i32* %7
%11 = load i32, i32* %8
%12 = call i32 @bt_sys_open(i8* %9, i32 %10, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
%struct._reent = type { i32 }
define i32 @_open_r(%struct._reent* nocapture readnone %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @bt_sys_open(i8* %1, i32 %2, i32 %3)
ret i32 %5
}
unsigned unsigned_min(unsigned x, unsigned y) {
  if (x <= y) {
    return x;
  } else {
    return y;
  }
}


x86 assembly (clang, -O0):
<unsigned_min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
ja     1121 <unsigned_min+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <unsigned_min+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unsigned_min>:
mov    %edi,%eax
cmp    %esi,%edi
cmova  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @unsigned_min(i32 %0, i32 %1) {
%3 = icmp ugt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ boot_from_file(char *);
int /*<<< orphan*/ build_env();
int main(int argc, char **argv) {
  build_env();
  if (argc == 1)
    boot_from_file("foundation.cx");
  else
    boot_from_file(argv[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    $0x0,%al
call   1030 <build_env@plt>
cmpl   $0x1,-0x8(%rbp)
jne    1158 <main+0x38>
lea    0xeb2(%rip),%rdi
call   1040 <boot_from_file@plt>
jmp    1165 <main+0x45>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <boot_from_file@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <build_env@plt>
cmp    $0x1,%ebp
jne    113d <main+0x1d>
lea    0xec5(%rip),%rdi
jmp    1141 <main+0x21>
mov    0x8(%rbx),%rdi
call   1040 <boot_from_file@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [14 x i8] c"foundation.cx\00"
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 = call i32 (...) @build_env()
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @boot_from_file(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %16
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @boot_from_file(i8* %14)
br label %16
16: ; preds = %11, %9
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"foundation.cx\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 (...) @build_env()
%4 = icmp eq i32 %0, 1
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
br label %8
8: ; preds = %2, %5
%9 = phi i8* [ %7, %5 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), %2 ]
%10 = tail call i32 @boot_from_file(i8* %9)
ret i32 0
}
void gtk_tree_sortable_set_sort_func() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_sortable_set_sort_func() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage() {
  printf("Usage: decimalToRoman number\n");
  printf("Accepted values are between 1 and 3999\n");
}


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

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef9(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"Usage: decimalToRoman number\0A\00"
@.str.1 = [40 x i8] c"Accepted values are between 1 and 3999\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [29 x i8] c"Usage: decimalToRoman number\00"
@str.2 = [39 x i8] c"Accepted values are between 1 and 3999\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int sscanf(char const *, char *, double *);
int /*<<< orphan*/ stderr;
double parse_double_or_exit(char const *str, char const *name) {
  double value;
  if (sscanf(str, "%lf", &value) != 1) {
    fprintf(stderr, "\nErro no argumento \"%s\".\n\n", name);
    exit(2);
  }
  return value;
}


x86 assembly (clang, -O0):
<parse_double_or_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb5(%rip),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <sscanf@plt>
cmp    $0x1,%eax
je     1180 <parse_double_or_exit+0x50>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xe93(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1050 <exit@plt>
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_double_or_exit>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0xec1(%rip),%rsi
lea    0x8(%rsp),%rdx
call   1040 <sscanf@plt>
cmp    $0x1,%eax
jne    115a <parse_double_or_exit+0x2a>
movsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
lea    0xe9a(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@stderr = global i32 0
@.str.1 = [27 x i8] c"\0AErro no argumento \22%s\22.\0A\0A\00"
define double @parse_double_or_exit(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca double
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i32 @sscanf(i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %5)
%8 = icmp ne i32 %7, 1
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = load i8*, i8** %4
%12 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* %11)
%13 = call i32 @exit(i32 2)
unreachable
14: ; preds = %2
%15 = load double, double* %5
ret double %15
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@stderr = global i32 0
@.str.1 = [27 x i8] c"\0AErro no argumento \22%s\22.\0A\0A\00"
define double @parse_double_or_exit(i8* nocapture %0, i8* %1) {
%3 = alloca double
%4 = bitcast double* %3 to i8*
%5 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %3)
%6 = icmp eq i32 %5, 1
br i1 %6, label %11, label %7
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%10 = call i32 @exit(i32 2)
unreachable
11: ; preds = %2
%12 = load double, double* %3
ret double %12
}
/* Variables and functions */
int /*<<< orphan*/ fb_hRtInit();
void fb_hDoInit(void) { fb_hRtInit(); }


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

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

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

LLVM IR (-O2):
define void @fb_hDoInit() {
%1 = tail call i32 (...) @fb_hRtInit()
ret void
}
int _on_zero(int index, void *pack, int len) { return 1; }


x86 assembly (clang, -O0):
<_on_zero>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @_on_zero(i32 %0, i8* nocapture readnone %1, i32 %2) {
ret i32 1
}