xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ HplAtmRfa1TimerMacP__CompareA__reset();
void AtmegaCompareP__0__AtmegaCompare__reset(void) {
  HplAtmRfa1TimerMacP__CompareA__reset();
}


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

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

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

LLVM IR (-O2):
define void @AtmegaCompareP__0__AtmegaCompare__reset() {
%1 = tail call i32 (...) @HplAtmRfa1TimerMacP__CompareA__reset()
ret void
}
ISR(EE_RDY_vect) {}


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

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

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

LLVM IR (-O2):
define i32 @ISR(i32 %0) {
ret i32 undef
}
int test_imm_BFuint16_mem(unsigned short *val) {
  return ((*val) & (-0xBF << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_BFuint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -191
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void foo391(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo391(i32 %0) {
ret void
}
int __fp_unordered_compare(long double x, long double y) {
  unsigned short retval;
  __asm__("fucom %%st(1);"
          "fnstsw;"
          : "=a"(retval)
          : "t"(x), "u"(y));
  return retval;
}


x86 assembly (clang, -O0):
<__fp_unordered_compare>:
push   %rbp
mov    %rsp,%rbp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
fxch   %st(1)
fucom  %st(1)
fnstsw %ax
fstp   %st(0)
fstp   %st(0)
mov    %ax,-0x22(%rbp)
movzwl -0x22(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__fp_unordered_compare>:
fldt   0x8(%rsp)
fldt   0x18(%rsp)
fxch   %st(1)
fucom  %st(1)
fnstsw %ax
fstp   %st(0)
fstp   %st(0)
movzwl %ax,%eax
ret

LLVM IR (-O0):
define i32 @__fp_unordered_compare(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
%5 = alloca i16
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%6 = load x86_fp80, x86_fp80* %3
%7 = load x86_fp80, x86_fp80* %4
%8 = call i16 asm "fucom %st(1);fnstsw;", "={ax},{st},{st(1)},~{dirflag},~{fpsr},~{flags}"(x86_fp80 %6, x86_fp80 %7)
store i16 %8, i16* %5
%9 = load i16, i16* %5
%10 = zext i16 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @__fp_unordered_compare(x86_fp80 %0, x86_fp80 %1) {
%3 = tail call i16 asm "fucom %st(1);fnstsw;", "={ax},{st},{st(1)},~{dirflag},~{fpsr},~{flags}"(x86_fp80 %0, x86_fp80 %1)
%4 = zext i16 %3 to i32
ret i32 %4
}
/* Type definitions */
struct ecs {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _ecs_check_rw(struct ecs *, size_t, int);
scalar_t__ _ecs_cptr(struct ecs *, size_t);
void _ecs_write_f32(struct ecs *ecs, size_t off, float value) {
  _ecs_check_rw(ecs, off, sizeof(float));
  *((float *)_ecs_cptr(ecs, off)) = value;
}


x86 assembly (clang, -O0):
<_ecs_write_f32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1030 <_ecs_check_rw@plt>
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <_ecs_cptr@plt>
movss  -0x18(%rbp),%xmm0
movss  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ecs_write_f32>:
push   %r14
push   %rbx
push   %rax
movss  %xmm0,0x4(%rsp)
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0x4,%edx
call   1030 <_ecs_check_rw@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <_ecs_cptr@plt>
movss  0x4(%rsp),%xmm0
movss  %xmm0,(%rax)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.ecs = type { i32 }
define void @_ecs_write_f32(%struct.ecs* %0, i64 %1, float %2) {
%4 = alloca %struct.ecs*
%5 = alloca i64
%6 = alloca float
store %struct.ecs* %0, %struct.ecs** %4
store i64 %1, i64* %5
store float %2, float* %6
%7 = load %struct.ecs*, %struct.ecs** %4
%8 = load i64, i64* %5
%9 = call i32 @_ecs_check_rw(%struct.ecs* %7, i64 %8, i32 4)
%10 = load float, float* %6
%11 = load %struct.ecs*, %struct.ecs** %4
%12 = load i64, i64* %5
%13 = call i64 @_ecs_cptr(%struct.ecs* %11, i64 %12)
%14 = inttoptr i64 %13 to float*
store float %10, float* %14
ret void
}

LLVM IR (-O2):
%struct.ecs = type { i32 }
define void @_ecs_write_f32(%struct.ecs* %0, i64 %1, float %2) {
%4 = tail call i32 @_ecs_check_rw(%struct.ecs* %0, i64 %1, i32 4)
%5 = tail call i64 @_ecs_cptr(%struct.ecs* %0, i64 %1)
%6 = inttoptr i64 %5 to float*
store float %2, float* %6
ret void
}
int cascade(int x, int y, int z) {
  int res;
  if (x)
    return 0;
  if (y)
    return 1;
  res = 2;
  if (z)
    res = 3;
  return res * res;
}


x86 assembly (clang, -O0):
<cascade>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1123 <cascade+0x23>
movl   $0x0,-0x4(%rbp)
jmp    115b <cascade+0x5b>
cmpl   $0x0,-0xc(%rbp)
je     1139 <cascade+0x39>
movl   $0x1,-0x4(%rbp)
jmp    115b <cascade+0x5b>
movl   $0x2,-0x14(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1151 <cascade+0x51>
movl   $0x3,-0x14(%rbp)
mov    -0x14(%rbp),%eax
imul   -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cascade>:
xor    %eax,%eax
test   %edi,%edi
je     1107 <cascade+0x7>
ret
mov    $0x1,%eax
test   %esi,%esi
jne    1106 <cascade+0x6>
xor    %eax,%eax
test   %edx,%edx
setne  %al
lea    (%rax,%rax,4),%eax
add    $0x4,%eax
ret

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

LLVM IR (-O2):
define i32 @cascade(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %0, 0
br i1 %4, label %5, label %10
5: ; preds = %3
%6 = icmp eq i32 %1, 0
br i1 %6, label %7, label %10
7: ; preds = %5
%8 = icmp eq i32 %2, 0
%9 = select i1 %8, i32 4, i32 9
br label %10
10: ; preds = %5, %3, %7
%11 = phi i32 [ %9, %7 ], [ 0, %3 ], [ 1, %5 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ bar_print_message_formatted(char *, int, int, int);
void foo_print_special_message(void) {
  bar_print_message_formatted("The numbers are %d, %d and %d", 1, 2, 3);
}


x86 assembly (clang, -O0):
<foo_print_special_message>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
call   1030 <bar_print_message_formatted@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo_print_special_message>:
lea    0xee9(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
jmp    1030 <bar_print_message_formatted@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"The numbers are %d, %d and %d\00"
define void @foo_print_special_message() {
%1 = call i32 @bar_print_message_formatted(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 1, i32 2, i32 3)
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"The numbers are %d, %d and %d\00"
define void @foo_print_special_message() {
%1 = tail call i32 @bar_print_message_formatted(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 1, i32 2, i32 3)
ret void
}
void f3(int *x) {
  int i;
#pragma omp parallel for ordered
  for (i = 0; i < 100; i++)
#pragma omp ordered
    x[i / 2] = i;
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x64,-0xc(%rbp)
jge    114f <f3+0x4f>
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    -0x1c(%rbp),%edx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <f3+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
mov    $0x4,%eax
cs nopw 0x0(%rax,%rax,1)
nop
lea    -0x4(%rax),%ecx
mov    %ecx,%edx
shr    %edx
mov    %ecx,(%rdi,%rdx,4)
lea    -0x3(%rax),%ecx
mov    %ecx,%edx
shr    %edx
mov    %ecx,(%rdi,%rdx,4)
lea    -0x2(%rax),%ecx
mov    %ecx,%edx
shr    %edx
mov    %ecx,(%rdi,%rdx,4)
lea    -0x1(%rax),%ecx
mov    %ecx,%edx
shr    %edx
mov    %ecx,(%rdi,%rdx,4)
mov    %eax,%ecx
shr    %ecx
mov    %eax,(%rdi,%rcx,4)
lea    0x5(%rax),%ecx
cmp    $0x63,%eax
mov    %ecx,%eax
jne    1110 <f3+0x10>
ret

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

LLVM IR (-O2):
define void @f3(i32* nocapture writeonly %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %23, %2 ]
%4 = lshr i32 %3, 1
%5 = zext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
store i32 %3, i32* %6
%7 = add nuw nsw i32 %3, 1
%8 = lshr i32 %7, 1
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %0, i64 %9
store i32 %7, i32* %10
%11 = add nuw nsw i32 %3, 2
%12 = lshr i32 %11, 1
%13 = zext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %0, i64 %13
store i32 %11, i32* %14
%15 = add nuw nsw i32 %3, 3
%16 = lshr i32 %15, 1
%17 = zext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %0, i64 %17
store i32 %15, i32* %18
%19 = add nuw nsw i32 %3, 4
%20 = lshr i32 %19, 1
%21 = zext i32 %20 to i64
%22 = getelementptr inbounds i32, i32* %0, i64 %21
store i32 %19, i32* %22
%23 = add nuw nsw i32 %3, 5
%24 = icmp eq i32 %23, 100
br i1 %24, label %25, label %2
25: ; preds = %2
ret void
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ printf(char *, char);
int main() {
  char c;
  c = getchar();
  if (c >= 'a' && c <= 'z') {
    c = (97 + (122 - c));
    printf("\n%c\n", c);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     1174 <main+0x54>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jg     1174 <main+0x54>
movsbl -0x5(%rbp),%ecx
mov    $0x7a,%eax
sub    %ecx,%eax
add    $0x61,%eax
mov    %al,-0x5(%rbp)
lea    0xe95(%rip),%rdi
movsbl -0x5(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
lea    -0x61(%rax),%ecx
cmp    $0x19,%cl
ja     1143 <main+0x23>
mov    $0xdb,%cl
sub    %al,%cl
movsbl %cl,%esi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"\0A%c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call signext i8 (...) @getchar()
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 97
br i1 %6, label %7, label %19
7: ; preds = %0
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 122
br i1 %10, label %11, label %19
11: ; preds = %7
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = sub nsw i32 122, %13
%15 = add nsw i32 97, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %2
%17 = load i8, i8* %2
%18 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 signext %17)
br label %19
19: ; preds = %11, %7, %0
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"\0A%c\0A\00"
define i32 @main() {
%1 = tail call signext i8 (...) @getchar()
%2 = add i8 %1, -97
%3 = icmp ult i8 %2, 26
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = sub nuw i8 -37, %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 signext %5)
br label %7
7: ; preds = %4, %0
ret i32 0
}
/* Variables and functions */
int cpuid_simple(int);
int cpuinfo_has_sse2() { return (cpuid_simple(1) & 0x04000000); }


x86 assembly (clang, -O0):
<cpuinfo_has_sse2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <cpuid_simple@plt>
and    $0x4000000,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuinfo_has_sse2>:
push   %rax
mov    $0x1,%edi
call   1030 <cpuid_simple@plt>
and    $0x4000000,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @cpuinfo_has_sse2() {
%1 = call i32 @cpuid_simple(i32 1)
%2 = and i32 %1, 67108864
ret i32 %2
}

LLVM IR (-O2):
define i32 @cpuinfo_has_sse2() {
%1 = tail call i32 @cpuid_simple(i32 1)
%2 = and i32 %1, 67108864
ret i32 %2
}
/* Type definitions */
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ list_add_after(struct list_head *, struct list_head *);
int /*<<< orphan*/ list_del(struct list_head *);
void list_move(struct list_head *node, struct list_head *node_to) {
  (void)(node);
  (void)(node_to);
  list_del(node);
  list_add_after(node, node_to);
}


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

x86 assembly (clang, -O2):
<list_move>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <list_del@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <list_add_after@plt>

LLVM IR (-O0):
%struct.list_head = type { i32 }
define void @list_move(%struct.list_head* %0, %struct.list_head* %1) {
%3 = alloca %struct.list_head*
%4 = alloca %struct.list_head*
store %struct.list_head* %0, %struct.list_head** %3
store %struct.list_head* %1, %struct.list_head** %4
%5 = load %struct.list_head*, %struct.list_head** %3
%6 = load %struct.list_head*, %struct.list_head** %4
%7 = load %struct.list_head*, %struct.list_head** %3
%8 = call i32 @list_del(%struct.list_head* %7)
%9 = load %struct.list_head*, %struct.list_head** %3
%10 = load %struct.list_head*, %struct.list_head** %4
%11 = call i32 @list_add_after(%struct.list_head* %9, %struct.list_head* %10)
ret void
}

LLVM IR (-O2):
%struct.list_head = type { i32 }
define void @list_move(%struct.list_head* %0, %struct.list_head* %1) {
%3 = tail call i32 @list_del(%struct.list_head* %0)
%4 = tail call i32 @list_add_after(%struct.list_head* %0, %struct.list_head* %1)
ret void
}
int fact_1(int a) {
  if (0 > a)
    a *= -1;
  if (0 == a)
    a = 1;
  if (1 == a)
    return a;
  return a * fact_1(a - 1);
}


x86 assembly (clang, -O0):
<fact_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%eax
jle    112d <fact_1+0x1d>
imul   $0xffffffff,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%eax
jne    113f <fact_1+0x2f>
movl   $0x1,-0x8(%rbp)
mov    $0x1,%eax
cmp    -0x8(%rbp),%eax
jne    1158 <fact_1+0x48>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1174 <fact_1+0x64>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fact_1@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fact_1>:
mov    %edi,%ecx
neg    %ecx
cmovs  %edi,%ecx
mov    $0x1,%eax
cmp    $0x2,%ecx
jb     1132 <fact_1+0x32>
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
imul   %ecx,%eax
add    $0xffffffff,%ecx
mov    %ecx,%edx
neg    %edx
cmovns %edx,%ecx
cmp    $0x1,%ecx
ja     1120 <fact_1+0x20>
ret

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

LLVM IR (-O2):
define i32 @fact_1(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%3 = icmp ult i32 %2, 2
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %9, %4 ], [ %2, %1 ]
%6 = phi i32 [ %8, %4 ], [ 1, %1 ]
%7 = add nsw i32 %5, -1
%8 = mul nsw i32 %5, %6
%9 = tail call i32 @llvm.abs.i32(i32 %7, i1 true)
%10 = icmp ult i32 %9, 2
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 1, %1 ], [ %8, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void our_exit1(void) { printf("first exit handler\n"); }


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"first exit handler\0A\00"
define void @our_exit1() {
%1 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [19 x i8] c"first exit handler\00"
define void @our_exit1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  printf("podaj liczbe naturalna\n");
  scanf("%d", &n);
  int wynik = n % 3;
  printf("%d modulo 3 to %d\n", n, wynik);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xede(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
movslq 0x4(%rsp),%rsi
imul   $0x55555556,%rsi,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
lea    (%rax,%rax,2),%eax
mov    %esi,%edx
sub    %eax,%edx
lea    0xe8e(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"podaj liczbe naturalna\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [19 x i8] c"%d modulo 3 to %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = srem i32 %5, 3
store i32 %6, i32* %2
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %7, i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [19 x i8] c"%d modulo 3 to %d\0A\00"
@str = [23 x i8] c"podaj liczbe naturalna\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = srem i32 %5, 3
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %6)
ret i32 0
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *mm_calloc(size_t nmemb, size_t size) {
  size_t bytes = nmemb * size;
  void *newptr;
  newptr = malloc(bytes);
  memset(newptr, 0, bytes);
  return newptr;
}


x86 assembly (clang, -O0):
<mm_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mm_calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
imul   %rsi,%rbx
mov    %rbx,%rdi
call   1040 <malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @mm_calloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%7 = load i64, i64* %3
%8 = load i64, i64* %4
%9 = mul i64 %7, %8
store i64 %9, i64* %5
%10 = load i64, i64* %5
%11 = call i8* @malloc(i64 %10)
store i8* %11, i8** %6
%12 = load i8*, i8** %6
%13 = load i64, i64* %5
%14 = call i32 @memset(i8* %12, i32 0, i64 %13)
%15 = load i8*, i8** %6
ret i8* %15
}

LLVM IR (-O2):
define i8* @mm_calloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i32 @memset(i8* %4, i32 0, i64 %3)
ret i8* %4
}
/* Type definitions */
struct msqid_ds {
  int dummy;
};
struct msginfo {
  int msgpool;
  int msgmap;
  int msgtql;
};

/* Variables and functions */
int /*<<< orphan*/ memset(struct msginfo *, int /*<<< orphan*/, int);
int msgctl(int msgid, int cmd, struct msqid_ds *buf) {
  struct msginfo *i = (struct msginfo *)buf;
  memset(i, 0, sizeof(*i));
  i->msgpool = 9;
  i->msgmap = 100;
  i->msgtql = 9000;
  return 0;
}


x86 assembly (clang, -O0):
<msgctl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1030 <memset@plt>
mov    -0x18(%rbp),%rax
movl   $0x9,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x64,0x4(%rax)
mov    -0x18(%rbp),%rax
movl   $0x2328,0x8(%rax)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msgctl>:
push   %rbx
mov    %rdx,%rbx
mov    %rdx,%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1030 <memset@plt>
movabs $0x6400000009,%rax
mov    %rax,(%rbx)
movl   $0x2328,0x8(%rbx)
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.msqid_ds = type { i32 }
%struct.msginfo = type { i32, i32, i32 }
define i32 @msgctl(i32 %0, i32 %1, %struct.msqid_ds* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.msqid_ds*
%7 = alloca %struct.msginfo*
store i32 %0, i32* %4
store i32 %1, i32* %5
store %struct.msqid_ds* %2, %struct.msqid_ds** %6
%8 = load %struct.msqid_ds*, %struct.msqid_ds** %6
%9 = bitcast %struct.msqid_ds* %8 to %struct.msginfo*
store %struct.msginfo* %9, %struct.msginfo** %7
%10 = load %struct.msginfo*, %struct.msginfo** %7
%11 = call i32 @memset(%struct.msginfo* %10, i32 0, i32 12)
%12 = load %struct.msginfo*, %struct.msginfo** %7
%13 = getelementptr inbounds %struct.msginfo, %struct.msginfo* %12, i32 0, i32 0
store i32 9, i32* %13
%14 = load %struct.msginfo*, %struct.msginfo** %7
%15 = getelementptr inbounds %struct.msginfo, %struct.msginfo* %14, i32 0, i32 1
store i32 100, i32* %15
%16 = load %struct.msginfo*, %struct.msginfo** %7
%17 = getelementptr inbounds %struct.msginfo, %struct.msginfo* %16, i32 0, i32 2
store i32 9000, i32* %17
ret i32 0
}

LLVM IR (-O2):
%struct.msqid_ds = type { i32 }
%struct.msginfo = type { i32, i32, i32 }
define i32 @msgctl(i32 %0, i32 %1, %struct.msqid_ds* %2) {
%4 = bitcast %struct.msqid_ds* %2 to %struct.msginfo*
%5 = tail call i32 @memset(%struct.msginfo* %4, i32 0, i32 12)
%6 = getelementptr %struct.msqid_ds, %struct.msqid_ds* %2, i64 0, i32 0
store i32 9, i32* %6
%7 = getelementptr inbounds %struct.msqid_ds, %struct.msqid_ds* %2, i64 1, i32 0
store i32 100, i32* %7
%8 = getelementptr inbounds %struct.msqid_ds, %struct.msqid_ds* %2, i64 2, i32 0
store i32 9000, i32* %8
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ lf();
int /*<<< orphan*/ printF(char const *, float);
void printFN(const char *s, float f) {
  printF(s, f);
  lf();
}


x86 assembly (clang, -O0):
<printFN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movss  -0xc(%rbp),%xmm0
call   1030 <printF@plt>
mov    $0x0,%al
call   1040 <lf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printFN>:
push   %rax
call   1030 <printF@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <lf@plt>

LLVM IR (-O0):
define void @printFN(i8* %0, float %1) {
%3 = alloca i8*
%4 = alloca float
store i8* %0, i8** %3
store float %1, float* %4
%5 = load i8*, i8** %3
%6 = load float, float* %4
%7 = call i32 @printF(i8* %5, float %6)
%8 = call i32 (...) @lf()
ret void
}

LLVM IR (-O2):
define void @printFN(i8* %0, float %1) {
%3 = tail call i32 @printF(i8* %0, float %1)
%4 = tail call i32 (...) @lf()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ h_a_end();
int /*<<< orphan*/ h_a_start(char *, char const *, char const *);
int /*<<< orphan*/ h_puts(char const *);
void h_href(const char *label, const char *alt, const char *ref, ...) {
  h_a_start("href", alt, ref);
  if (label) {
    h_puts(label);
    h_a_end();
  }
}


x86 assembly (clang, -O0):
<h_href>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xead(%rip),%rdi
call   1040 <h_a_start@plt>
cmpq   $0x0,-0x8(%rbp)
je     1173 <h_href+0x43>
mov    -0x8(%rbp),%rdi
call   1030 <h_puts@plt>
mov    $0x0,%al
call   1050 <h_a_end@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h_href>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
call   1040 <h_a_start@plt>
test   %rbx,%rbx
je     1155 <h_href+0x25>
mov    %rbx,%rdi
call   1030 <h_puts@plt>
xor    %eax,%eax
pop    %rbx
jmp    1050 <h_a_end@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"href\00"
define void @h_href(i8* %0, i8* %1, i8* %2, ...) {
%4 = tail call i32 @h_a_start(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2)
%5 = icmp eq i8* %0, null
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = tail call i32 @h_puts(i8* %0)
%8 = tail call i32 (...) @h_a_end()
br label %9
9: ; preds = %6, %3
ret void
}
/* Variables and functions */
void _reduce_data(const void **data, size_t *data_size, size_t delta) {
  *data_size -= delta;
  *data += delta;
}


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

x86 assembly (clang, -O2):
<_reduce_data>:
sub    %rdx,(%rsi)
add    %rdx,(%rdi)
ret

LLVM IR (-O0):
define void @_reduce_data(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 i64, i64* %6
%8 = load i64*, i64** %5
%9 = load i64, i64* %8
%10 = sub i64 %9, %7
store i64 %10, i64* %8
%11 = load i64, i64* %6
%12 = load i8**, i8*** %4
%13 = load i8*, i8** %12
%14 = getelementptr i8, i8* %13, i64 %11
store i8* %14, i8** %12
ret void
}

LLVM IR (-O2):
define void @_reduce_data(i8** nocapture %0, i64* nocapture %1, i64 %2) {
%4 = load i64, i64* %1
%5 = sub i64 %4, %2
store i64 %5, i64* %1
%6 = load i8*, i8** %0
%7 = getelementptr i8, i8* %6, i64 %2
store i8* %7, i8** %0
ret void
}
void av_opt_get_image_size() {}


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

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

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

LLVM IR (-O2):
define void @av_opt_get_image_size() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned int);
int /*<<< orphan*/ put8(int);
void cmp_m32_imm32(unsigned int *m32, unsigned int imm32) {
  put8(0x81);
  put8(0x3D);
  put32((unsigned int)(m32));
  put32(imm32);
}


x86 assembly (clang, -O0):
<cmp_m32_imm32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x81,%edi
call   1030 <put8@plt>
mov    $0x3d,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%rax
mov    %eax,%edi
call   1040 <put32@plt>
mov    -0xc(%rbp),%edi
call   1040 <put32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_m32_imm32>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0x81,%edi
call   1030 <put8@plt>
mov    $0x3d,%edi
call   1030 <put8@plt>
mov    %ebx,%edi
call   1040 <put32@plt>
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @cmp_m32_imm32(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = call i32 @put8(i32 129)
%6 = call i32 @put8(i32 61)
%7 = load i32*, i32** %3
%8 = ptrtoint i32* %7 to i32
%9 = call i32 @put32(i32 %8)
%10 = load i32, i32* %4
%11 = call i32 @put32(i32 %10)
ret void
}

LLVM IR (-O2):
define void @cmp_m32_imm32(i32* %0, i32 %1) {
%3 = tail call i32 @put8(i32 129)
%4 = tail call i32 @put8(i32 61)
%5 = ptrtoint i32* %0 to i64
%6 = trunc i64 %5 to i32
%7 = tail call i32 @put32(i32 %6)
%8 = tail call i32 @put32(i32 %1)
ret void
}
void __exit_hack(void) {
  volatile int blah = 1;
  while (blah) {
  }
}


x86 assembly (clang, -O0):
<__exit_hack>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    $0x0,%eax
je     111c <__exit_hack+0x1c>
jmp    110b <__exit_hack+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__exit_hack>:
movl   $0x1,-0x4(%rsp)
nopl   0x0(%rax,%rax,1)
cmpl   $0x0,-0x4(%rsp)
jne    1110 <__exit_hack+0x10>
ret

LLVM IR (-O0):
define void @__exit_hack() {
%1 = alloca i32
store volatile i32 1, i32* %1
br label %2
2: ; preds = %5, %0
%3 = load volatile i32, i32* %1
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %2
br label %2
6: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @__exit_hack() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 1, i32* %1
br label %3
3: ; preds = %3, %0
%4 = load volatile i32, i32* %1
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %3
6: ; preds = %3
ret void
}
int isLeftWindow(int maxSeats, int seat) {
  return (seat <= maxSeats - 5 && seat % 4 == 1) || (seat == maxSeats - 4);
}


x86 assembly (clang, -O0):
<isLeftWindow>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x5,%ecx
cmp    %ecx,%eax
jg     1134 <isLeftWindow+0x34>
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    $0x1,%al
cmp    $0x1,%edx
mov    %al,-0x9(%rbp)
je     1145 <isLeftWindow+0x45>
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x4,%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isLeftWindow>:
lea    -0x5(%rdi),%eax
cmp    %esi,%eax
setge  %al
lea    0x3(%rsi),%ecx
test   %esi,%esi
cmovns %esi,%ecx
and    $0xfffffffc,%ecx
mov    %esi,%edx
sub    %ecx,%edx
cmp    $0x1,%edx
sete   %cl
and    %al,%cl
add    $0xfffffffc,%edi
cmp    %esi,%edi
sete   %al
or     %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @isLeftWindow(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = sub nsw i32 %6, 5
%8 = icmp sle i32 %5, %7
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32, i32* %4
%11 = srem i32 %10, 4
%12 = icmp eq i32 %11, 1
br i1 %12, label %18, label %13
13: ; preds = %9, %2
%14 = load i32, i32* %4
%15 = load i32, i32* %3
%16 = sub nsw i32 %15, 4
%17 = icmp eq i32 %14, %16
br label %18
18: ; preds = %13, %9
%19 = phi i1 [ true, %9 ], [ %17, %13 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @isLeftWindow(i32 %0, i32 %1) {
%3 = add nsw i32 %0, -5
%4 = icmp sge i32 %3, %1
%5 = srem i32 %1, 4
%6 = icmp eq i32 %5, 1
%7 = and i1 %4, %6
%8 = add nsw i32 %0, -4
%9 = icmp eq i32 %8, %1
%10 = select i1 %7, i1 true, i1 %9
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ reset_timage();
void Reset_Tiff_Image() { reset_timage(); }


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

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

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

LLVM IR (-O2):
define void @Reset_Tiff_Image() {
%1 = tail call i32 (...) @reset_timage()
ret void
}
/* Variables and functions */
int setsid();
int g_setsid(void) { return setsid(); }


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

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

LLVM IR (-O0):
define i32 @g_setsid() {
%1 = call i32 (...) @setsid()
ret i32 %1
}

LLVM IR (-O2):
define i32 @g_setsid() {
%1 = tail call i32 (...) @setsid()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *, char *);
void version(void) {
  printf("%s %s\n\nFor license and copyright information see the LICENSE file, "
         "which should\nhave been distributed with the software.\n",
         "bfi", "0.3");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xf48(%rip),%rsi
lea    0xf45(%rip),%rdx
call   1030 <printf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<version>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xf4b(%rip),%rsi
lea    0xf48(%rip),%rdx
call   1030 <printf@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [122 x i8] c"%s %s\0A\0AFor license and copyright information see the LICENSE file, which should\0Ahave been distributed with the software.\0A\00"
@.str.1 = [4 x i8] c"bfi\00"
@.str.2 = [4 x i8] c"0.3\00"
@EXIT_SUCCESS = global i32 0
define void @version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([122 x i8], [122 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
%3 = call i32 @exit(i32 %2)
unreachable
}

LLVM IR (-O2):
@.str = [122 x i8] c"%s %s\0A\0AFor license and copyright information see the LICENSE file, which should\0Ahave been distributed with the software.\0A\00"
@.str.1 = [4 x i8] c"bfi\00"
@.str.2 = [4 x i8] c"0.3\00"
@EXIT_SUCCESS = global i32 0
define void @version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([122 x i8], [122 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
%3 = tail call i32 @exit(i32 %2)
unreachable
}
/* Variables and functions */
double fabs(double);
double step_sim(double d, double offset, double origin) {
  if (fabs(d - origin) <= offset) {
    return 1.0;
  } else {
    return 0.0;
  }
}


x86 assembly (clang, -O0):
<step_sim>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm1
subsd  -0x20(%rbp),%xmm1
movaps 0xedc(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1149 <step_sim+0x49>
movsd  0xed1(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1151 <step_sim+0x51>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<step_sim>:
subsd  %xmm2,%xmm0
andpd  0xef4(%rip),%xmm0
cmpnlesd %xmm1,%xmm0
movsd  0xef7(%rip),%xmm1
andnpd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @step_sim(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
%8 = load double, double* %5
%9 = load double, double* %7
%10 = fsub double %8, %9
%11 = call double @llvm.fabs.f64(double %10)
%12 = load double, double* %6
%13 = fcmp ole double %11, %12
br i1 %13, label %14, label %15
14: ; preds = %3
store double 1.000000e+00, double* %4
br label %16
15: ; preds = %3
store double 0.000000e+00, double* %4
br label %16
16: ; preds = %15, %14
%17 = load double, double* %4
ret double %17
}

LLVM IR (-O2):
define double @step_sim(double %0, double %1, double %2) {
%4 = fsub double %0, %2
%5 = tail call double @llvm.fabs.f64(double %4)
%6 = fcmp ugt double %5, %1
%7 = select i1 %6, double 0.000000e+00, double 1.000000e+00
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void panic(const char *plaint) {
  fprintf(stderr, "%s\n", plaint);
  exit(1);
}


x86 assembly (clang, -O0):
<panic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<panic>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @panic(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @panic(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ memset(char *, char, int);
char *bf_create_array(int arr_size) {
  char *result = malloc(arr_size * sizeof(char));
  memset(result, '\0', arr_size);
  return result;
}


x86 assembly (clang, -O0):
<bf_create_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bf_create_array>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %ebp,%edx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @bf_create_array(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = mul i64 %5, 1
%7 = trunc i64 %6 to i32
%8 = call i8* @malloc(i32 %7)
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = load i32, i32* %2
%11 = call i32 @memset(i8* %9, i8 signext 0, i32 %10)
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define i8* @bf_create_array(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = tail call i32 @memset(i8* %2, i8 signext 0, i32 %0)
ret i8* %2
}
int pci_save_msi_state(struct pci_dev *dev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.pci_dev = type opaque
define i32 @pci_save_msi_state(%struct.pci_dev* nocapture readnone %0) {
ret i32 0
}
int yday_fn(const int time_var, const char *from, const char *to) {
  printf("%s %i %li %li\n", __FUNCTION__, time_var, (long)from, (long)to);
  return generic_fn(time_var, (long)from, (long)to, 1, 366);
}


x86 assembly (clang, -O0):
<yday_fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
lea    0xebb(%rip),%rdi
lea    0xec3(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x1,%ecx
mov    $0x16e,%r8d
mov    $0x0,%al
call   1030 <generic_fn@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yday_fn>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xecd(%rip),%rdi
lea    0xed5(%rip),%rsi
mov    %ebp,%edx
mov    %rbx,%rcx
mov    %r14,%r8
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    $0x1,%ecx
mov    $0x16e,%r8d
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <generic_fn@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%s %i %li %li\0A\00"
@__FUNCTION__.yday_fn = [8 x i8] c"yday_fn\00"
define i32 @yday_fn(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = ptrtoint i8* %8 to i64
%10 = load i8*, i8** %6
%11 = ptrtoint i8* %10 to i64
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__FUNCTION__.yday_fn, i64 0, i64 0), i32 %7, i64 %9, i64 %11)
%13 = load i32, i32* %4
%14 = load i8*, i8** %5
%15 = ptrtoint i8* %14 to i64
%16 = load i8*, i8** %6
%17 = ptrtoint i8* %16 to i64
%18 = call i32 (i32, i64, i64, i32, i32, ...) bitcast (i32 (...)* @generic_fn to i32 (i32, i64, i64, i32, i32, ...)*)(i32 %13, i64 %15, i64 %17, i32 1, i32 366)
ret i32 %18
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s %i %li %li\0A\00"
@__FUNCTION__.yday_fn = [8 x i8] c"yday_fn\00"
define i32 @yday_fn(i32 %0, i8* %1, i8* %2) {
%4 = ptrtoint i8* %1 to i64
%5 = ptrtoint i8* %2 to i64
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__FUNCTION__.yday_fn, i64 0, i64 0), i32 %0, i64 %4, i64 %5)
%7 = tail call i32 (i32, i64, i64, i32, i32, ...) bitcast (i32 (...)* @generic_fn to i32 (i32, i64, i64, i32, i32, ...)*)(i32 %0, i64 %4, i64 %5, i32 1, i32 366)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ pregunta(int *, char *);
int inicializa(char *mensaje) {
  int valor;
  pregunta(&valor, mensaje);
  return valor;
}


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

x86 assembly (clang, -O2):
<inicializa>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
call   1030 <pregunta@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @inicializa(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @pregunta(i32* %2, i8* %0)
%5 = load i32, i32* %2
ret i32 %5
}
/* Type definitions */
struct stack_impl {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int stack_impl_ops_pop(struct stack_impl *stack_impl) {
  printf("stack_impl::pop()\n");
  return 0;
}


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

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

LLVM IR (-O0):
%struct.stack_impl = type { i32 }
@.str = [19 x i8] c"stack_impl::pop()\0A\00"
define i32 @stack_impl_ops_pop(%struct.stack_impl* %0) {
%2 = alloca %struct.stack_impl*
store %struct.stack_impl* %0, %struct.stack_impl** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
%struct.stack_impl = type { i32 }
@str = [18 x i8] c"stack_impl::pop()\00"
define i32 @stack_impl_ops_pop(%struct.stack_impl* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret i32 0
}