xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ atoi(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int exit_b(int argc, char **argv) {
  if (argc == 0) {
    exit(0);
  } else if (argc > 0) {
    exit(atoi(argv[1]));
  }
  return 0;
}


x86 assembly (clang, -O0):
<exit_b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1140 <exit_b+0x20>
xor    %edi,%edi
call   1040 <exit@plt>
cmpl   $0x0,-0x4(%rbp)
jle    115e <exit_b+0x3e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <atoi@plt>
mov    %eax,%edi
call   1040 <exit@plt>
jmp    1163 <exit_b+0x43>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exit_b>:
push   %rax
test   %edi,%edi
je     112b <exit_b+0xb>
jg     1132 <exit_b+0x12>
xor    %eax,%eax
pop    %rcx
ret
xor    %edi,%edi
call   1040 <exit@plt>
mov    0x8(%rsi),%rdi
call   1030 <atoi@plt>
mov    %eax,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @exit_b(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 @exit(i32 0)
unreachable
9: ; preds = %2
%10 = load i32, i32* %3
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %18
12: ; preds = %9
%13 = load i8**, i8*** %4
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i32 @atoi(i8* %15)
%17 = call i32 @exit(i32 %16)
unreachable
18: ; preds = %9
br label %19
19: ; preds = %18
ret i32 0
}

LLVM IR (-O2):
define i32 @exit_b(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @exit(i32 0)
unreachable
6: ; preds = %2
%7 = icmp sgt i32 %0, 0
br i1 %7, label %8, label %13
8: ; preds = %6
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @atoi(i8* %10)
%12 = tail call i32 @exit(i32 %11)
unreachable
13: ; preds = %6
ret i32 0
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t reverseBits_fun_uint16_t(uint16_t x) {
  uint16_t r = x;
  int i = 15;
  while (x >>= 1) {
    r = (r << 1) | (x & 1);
    --i;
  }
  return r << i;
}


x86 assembly (clang, -O0):
<reverseBits_fun_uint16_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0xf,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
je     1145 <reverseBits_fun_uint16_t+0x45>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    -0x4(%rbp),%ecx
and    $0x1,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1114 <reverseBits_fun_uint16_t+0x14>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverseBits_fun_uint16_t>:
mov    $0xf,%ecx
cmp    $0x2,%edi
jae    110e <reverseBits_fun_uint16_t+0xe>
mov    %edi,%eax
jmp    1134 <reverseBits_fun_uint16_t+0x34>
mov    $0xf,%ecx
mov    %edi,%eax
mov    %edi,%edx
nopw   0x0(%rax,%rax,1)
sar    %edx
mov    %edx,%esi
and    $0x1,%esi
lea    (%rsi,%rax,2),%eax
add    $0xffffffff,%ecx
cmp    $0x3,%edi
mov    %edx,%edi
ja     1120 <reverseBits_fun_uint16_t+0x20>
shl    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @reverseBits_fun_uint16_t(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ %0, %1 ]
%5 = phi i32 [ %11, %3 ], [ 15, %1 ]
%6 = phi i32 [ %10, %3 ], [ %0, %1 ]
%7 = ashr i32 %4, 1
%8 = shl i32 %6, 1
%9 = and i32 %7, 1
%10 = or i32 %8, %9
%11 = add nsw i32 %5, -1
%12 = icmp ult i32 %4, 4
br i1 %12, label %13, label %3
13: ; preds = %3, %1
%14 = phi i32 [ %0, %1 ], [ %10, %3 ]
%15 = phi i32 [ 15, %1 ], [ %11, %3 ]
%16 = shl i32 %14, %15
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ p_sat_colours(char);
int /*<<< orphan*/ printf(char *);
int strlen(char *);
void p_sat_buf(char *buf) {
  int i;
  for (i = 0; i < strlen(buf); i++)
    p_sat_colours(buf[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<p_sat_buf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jge    117e <p_sat_buf+0x4e>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1050 <p_sat_colours@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1143 <p_sat_buf+0x13>
lea    0xe7b(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p_sat_buf>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
test   %eax,%eax
jle    116d <p_sat_buf+0x3d>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%edi
call   1050 <p_sat_colours@plt>
add    $0x1,%rbx
mov    %r14,%rdi
call   1040 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1150 <p_sat_buf+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @p_sat_buf(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %13
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = tail call i32 @p_sat_colours(i8 signext %7)
%9 = add nuw nsw i64 %5, 1
%10 = tail call i32 @strlen(i8* %0)
%11 = sext i32 %10 to i64
%12 = icmp slt i64 %9, %11
br i1 %12, label %4, label %13
13: ; preds = %4, %1
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
float sqrtf(float);
float futrts_sqrt32(float x) { return sqrtf(x); }


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

x86 assembly (clang, -O2):
<futrts_sqrt32>:
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     111d <futrts_sqrt32+0xd>
sqrtss %xmm0,%xmm0
ret
jmp    1030 <sqrtf@plt>

LLVM IR (-O0):
define float @futrts_sqrt32(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @sqrtf(float %3)
ret float %4
}

LLVM IR (-O2):
define float @futrts_sqrt32(float %0) {
%2 = tail call float @sqrtf(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ app_main_loop();
int /*<<< orphan*/ printf(char *);
int main(int agv, char *ags[]) {
  printf("=========================================\n"
         "===This is computer Repository manager===\n"
         "=========================================\n");
  app_main_loop();
  printf("good bye.\n");
  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)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <app_main_loop@plt>
lea    0xf2f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [127 x i8] c"=========================================\0A===This is computer Repository manager===\0A=========================================\0A\00"
@.str.1 = [11 x i8] c"good bye.\0A\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 @printf(i8* getelementptr inbounds ([127 x i8], [127 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @app_main_loop()
%8 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [126 x i8] c"=========================================\0A===This is computer Repository manager===\0A=========================================\00"
@str.2 = [10 x i8] c"good bye.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([126 x i8], [126 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @app_main_loop()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gui_clear_status_text(int);
void gui_clear_status_text_all(void) {
  gui_clear_status_text(0);
  gui_clear_status_text(1);
  gui_clear_status_text(2);
  gui_clear_status_text(3);
}


x86 assembly (clang, -O0):
<gui_clear_status_text_all>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <gui_clear_status_text@plt>
mov    $0x1,%edi
call   1030 <gui_clear_status_text@plt>
mov    $0x2,%edi
call   1030 <gui_clear_status_text@plt>
mov    $0x3,%edi
call   1030 <gui_clear_status_text@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gui_clear_status_text_all>:
push   %rax
xor    %edi,%edi
call   1030 <gui_clear_status_text@plt>
mov    $0x1,%edi
call   1030 <gui_clear_status_text@plt>
mov    $0x2,%edi
call   1030 <gui_clear_status_text@plt>
mov    $0x3,%edi
pop    %rax
jmp    1030 <gui_clear_status_text@plt>

LLVM IR (-O0):
define void @gui_clear_status_text_all() {
%1 = call i32 @gui_clear_status_text(i32 0)
%2 = call i32 @gui_clear_status_text(i32 1)
%3 = call i32 @gui_clear_status_text(i32 2)
%4 = call i32 @gui_clear_status_text(i32 3)
ret void
}

LLVM IR (-O2):
define void @gui_clear_status_text_all() {
%1 = tail call i32 @gui_clear_status_text(i32 0)
%2 = tail call i32 @gui_clear_status_text(i32 1)
%3 = tail call i32 @gui_clear_status_text(i32 2)
%4 = tail call i32 @gui_clear_status_text(i32 3)
ret void
}
/* Type definitions */
struct move_t {
  int dummy;
};

/* Variables and functions */
int move_compare(struct move_t *, struct move_t *);
int __move_compare_generic(const void *lhs, const void *rhs) {
  return move_compare((struct move_t *)lhs, (struct move_t *)rhs);
}


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

x86 assembly (clang, -O2):
<__move_compare_generic>:
jmp    1030 <move_compare@plt>

LLVM IR (-O0):
%struct.move_t = type { i32 }
define i32 @__move_compare_generic(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to %struct.move_t*
%7 = load i8*, i8** %4
%8 = bitcast i8* %7 to %struct.move_t*
%9 = call i32 @move_compare(%struct.move_t* %6, %struct.move_t* %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.move_t = type { i32 }
define i32 @__move_compare_generic(i8* %0, i8* %1) {
%3 = bitcast i8* %0 to %struct.move_t*
%4 = bitcast i8* %1 to %struct.move_t*
%5 = tail call i32 @move_compare(%struct.move_t* %3, %struct.move_t* %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ gmx_dist(int, char **);
int main(int argc, char *argv[]) {
  gmx_dist(argc, argv);
  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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <gmx_dist@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @gmx_dist(i32 %0, i8** %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fake_a_rnd(int, int, int);
long nr_seeds(long skip_count) {
  long li;
  for (li = 1L; li <= skip_count; li++) {
    fake_a_rnd((int)(72 * 0.4), (int)(72 * 1.6), 41);
    fake_a_rnd((int)(72 * 0.4), (int)(72 * 1.6), 42);
  }
  return (0L);
}


x86 assembly (clang, -O0):
<nr_seeds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jg     116b <nr_seeds+0x5b>
mov    $0x1c,%edi
mov    $0x73,%esi
mov    $0x29,%edx
call   1030 <fake_a_rnd@plt>
mov    $0x1c,%edi
mov    $0x73,%esi
mov    $0x2a,%edx
call   1030 <fake_a_rnd@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <nr_seeds+0x14>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nr_seeds>:
push   %rbx
test   %rdi,%rdi
jle    114e <nr_seeds+0x3e>
mov    %rdi,%rbx
nopl   0x0(%rax)
mov    $0x1c,%edi
mov    $0x73,%esi
mov    $0x29,%edx
call   1030 <fake_a_rnd@plt>
mov    $0x1c,%edi
mov    $0x73,%esi
mov    $0x2a,%edx
call   1030 <fake_a_rnd@plt>
add    $0xffffffffffffffff,%rbx
jne    1120 <nr_seeds+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @nr_seeds(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store i64 1, i64* %3
br label %4
4: ; preds = %11, %1
%5 = load i64, i64* %3
%6 = load i64, i64* %2
%7 = icmp sle i64 %5, %6
br i1 %7, label %8, label %14
8: ; preds = %4
%9 = call i32 @fake_a_rnd(i32 28, i32 115, i32 41)
%10 = call i32 @fake_a_rnd(i32 28, i32 115, i32 42)
br label %11
11: ; preds = %8
%12 = load i64, i64* %3
%13 = add nsw i64 %12, 1
store i64 %13, i64* %3
br label %4
14: ; preds = %4
ret i64 0
}

LLVM IR (-O2):
define i64 @nr_seeds(i64 %0) {
%2 = icmp slt i64 %0, 1
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %7, %3 ], [ 1, %1 ]
%5 = tail call i32 @fake_a_rnd(i32 28, i32 115, i32 41)
%6 = tail call i32 @fake_a_rnd(i32 28, i32 115, i32 42)
%7 = add nuw i64 %4, 1
%8 = icmp eq i64 %4, %0
br i1 %8, label %9, label %3
9: ; preds = %3, %1
ret i64 0
}
/* Type definitions */
typedef int fpu_control_t;
typedef int fexcept_t;

/* Variables and functions */
int FE_ALL_EXCEPT;
int /*<<< orphan*/ _FPU_GETCW(int);
int /*<<< orphan*/ _FPU_SETCW(int);
int fesetexceptflag(const fexcept_t *flagp, int excepts) {
  fpu_control_t temp;
  _FPU_GETCW(temp);
  temp &= ~(excepts & FE_ALL_EXCEPT);
  temp |= (*flagp & excepts & FE_ALL_EXCEPT);
  _FPU_SETCW(temp);
  return 0;
}


x86 assembly (clang, -O0):
<fesetexceptflag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <_FPU_GETCW@plt>
mov    -0xc(%rbp),%eax
mov    0x2e9f(%rip),%rcx
and    (%rcx),%eax
xor    $0xffffffff,%eax
and    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    -0xc(%rbp),%eax
mov    0x2e84(%rip),%rcx
and    (%rcx),%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1040 <_FPU_SETCW@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fesetexceptflag>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
call   1030 <_FPU_GETCW@plt>
mov    0x2eab(%rip),%rax
and    (%rax),%ebx
and    (%r14),%ebx
mov    %ebx,%edi
call   1040 <_FPU_SETCW@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@FE_ALL_EXCEPT = global i32 0
define i32 @fesetexceptflag(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32, i32* %5
%7 = call i32 @_FPU_GETCW(i32 %6)
%8 = load i32, i32* %4
%9 = load i32, i32* @FE_ALL_EXCEPT
%10 = and i32 %8, %9
%11 = xor i32 %10, -1
%12 = load i32, i32* %5
%13 = and i32 %12, %11
store i32 %13, i32* %5
%14 = load i32*, i32** %3
%15 = load i32, i32* %14
%16 = load i32, i32* %4
%17 = and i32 %15, %16
%18 = load i32, i32* @FE_ALL_EXCEPT
%19 = and i32 %17, %18
%20 = load i32, i32* %5
%21 = or i32 %20, %19
store i32 %21, i32* %5
%22 = load i32, i32* %5
%23 = call i32 @_FPU_SETCW(i32 %22)
ret i32 0
}

LLVM IR (-O2):
@FE_ALL_EXCEPT = global i32 0
define i32 @fesetexceptflag(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @_FPU_GETCW(i32 undef)
%4 = load i32, i32* @FE_ALL_EXCEPT
%5 = load i32, i32* %0
%6 = and i32 %4, %1
%7 = and i32 %6, %5
%8 = tail call i32 @_FPU_SETCW(i32 %7)
ret i32 0
}
int g(int i) { return (i + 2) >= i; }


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2,%eax
cmp    -0x4(%rbp),%eax
setge  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @g(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 2
%5 = load i32, i32* %2
%6 = icmp sge i32 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @g(i32 %0) {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
long ftell(int /*<<< orphan*/ *);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
long getFileSize(FILE *file) {
  fseek(file, 0, SEEK_END);
  long file_size = ftell(file);
  rewind(file);
  return file_size;
}


x86 assembly (clang, -O0):
<getFileSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea1(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1050 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1040 <ftell@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <rewind@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getFileSize>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eaa(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1050 <fseek@plt>
mov    %rbx,%rdi
call   1040 <ftell@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <rewind@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@SEEK_END = global i32 0
define i64 @getFileSize(i32* %0) {
%2 = alloca i32*
%3 = alloca i64
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* @SEEK_END
%6 = call i32 @fseek(i32* %4, i32 0, i32 %5)
%7 = load i32*, i32** %2
%8 = call i64 @ftell(i32* %7)
store i64 %8, i64* %3
%9 = load i32*, i32** %2
%10 = call i32 @rewind(i32* %9)
%11 = load i64, i64* %3
ret i64 %11
}

LLVM IR (-O2):
@SEEK_END = global i32 0
define i64 @getFileSize(i32* nocapture %0) {
%2 = load i32, i32* @SEEK_END
%3 = tail call i32 @fseek(i32* %0, i32 0, i32 %2)
%4 = tail call i64 @ftell(i32* %0)
%5 = tail call i32 @rewind(i32* %0)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ pfan_draw_paragraph(char *, unsigned short **);
void Test_paragraph(unsigned short displays[8][156]) {
  pfan_draw_paragraph("Lorem ipsum dolor sit amet, consectetur adipiscing "
                      "elit. Vestibulum porta libero nec blandit laoreet. "
                      "Fusce bibendum tincidunt nunc, et pretium mi tincidunt "
                      "ut. Nunc sit amet neque finibus, sagittis nibh sed.",
                      displays);
}


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

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

LLVM IR (-O0):
@.str = [209 x i8] c"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum porta libero nec blandit laoreet. Fusce bibendum tincidunt nunc, et pretium mi tincidunt ut. Nunc sit amet neque finibus, sagittis nibh sed.\00"
define void @Test_paragraph([156 x i16]* %0) {
%2 = alloca [156 x i16]*
store [156 x i16]* %0, [156 x i16]** %2
%3 = load [156 x i16]*, [156 x i16]** %2
%4 = bitcast [156 x i16]* %3 to i16**
%5 = call i32 @pfan_draw_paragraph(i8* getelementptr inbounds ([209 x i8], [209 x i8]* @.str, i64 0, i64 0), i16** %4)
ret void
}

LLVM IR (-O2):
@.str = [209 x i8] c"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum porta libero nec blandit laoreet. Fusce bibendum tincidunt nunc, et pretium mi tincidunt ut. Nunc sit amet neque finibus, sagittis nibh sed.\00"
define void @Test_paragraph([156 x i16]* %0) {
%2 = bitcast [156 x i16]* %0 to i16**
%3 = tail call i32 @pfan_draw_paragraph(i8* getelementptr inbounds ([209 x i8], [209 x i8]* @.str, i64 0, i64 0), i16** %2)
ret void
}
int NameConflictTest2() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @NameConflictTest2() {
ret i32 0
}
int color_offset_f4(int x, int y) {
  return ((y << 10) + (((x << 10) * 333) / 107) - (12396 << 10)) >> 10;
}


x86 assembly (clang, -O0):
<color_offset_f4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0xa,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shl    $0xa,%eax
imul   $0x14d,%eax,%eax
mov    $0x6b,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
sub    $0xc1b000,%eax
sar    $0xa,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<color_offset_f4>:
shl    $0xa,%esi
imul   $0x53400,%edi,%eax
cltq
imul   $0x4c8f8d29,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
add    %esi,%eax
add    $0xff3e5000,%eax
sar    $0xa,%eax
ret

LLVM IR (-O0):
define i32 @color_offset_f4(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 = shl i32 %5, 10
%7 = load i32, i32* %3
%8 = shl i32 %7, 10
%9 = mul nsw i32 %8, 333
%10 = sdiv i32 %9, 107
%11 = add nsw i32 %6, %10
%12 = sub nsw i32 %11, 12693504
%13 = ashr i32 %12, 10
ret i32 %13
}

LLVM IR (-O2):
define i32 @color_offset_f4(i32 %0, i32 %1) {
%3 = shl i32 %1, 10
%4 = mul i32 %0, 340992
%5 = sdiv i32 %4, 107
%6 = add nsw i32 %5, -12693504
%7 = add i32 %6, %3
%8 = ashr i32 %7, 10
ret i32 %8
}
void SPI1_TX_ISR(void) {}


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

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

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

LLVM IR (-O2):
define void @SPI1_TX_ISR() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RunReceiverStateMachine(void *);
int /*<<< orphan*/ RunSenderStateMachine(void *);
void RunStateMachine(void *pObject) {
  RunSenderStateMachine(pObject);
  RunReceiverStateMachine(pObject);
}


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

x86 assembly (clang, -O2):
<RunStateMachine>:
push   %rbx
mov    %rdi,%rbx
call   1030 <RunSenderStateMachine@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <RunReceiverStateMachine@plt>

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

LLVM IR (-O2):
define void @RunStateMachine(i8* %0) {
%2 = tail call i32 @RunSenderStateMachine(i8* %0)
%3 = tail call i32 @RunReceiverStateMachine(i8* %0)
ret void
}
void b_os_string_copy(unsigned char *dst, unsigned char *src) {
  asm volatile("call 0x00100080" : : "S"(src), "D"(dst));
}


x86 assembly (clang, -O0):
<b_os_string_copy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdi
call   100080 <completed.0+0xfc060>
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_os_string_copy>:
call   100080 <completed.0+0xfc060>
ret

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

LLVM IR (-O2):
define void @b_os_string_copy(i8* %0, i8* %1) {
tail call void asm sideeffect "call 0x00100080", "{si},{di},~{dirflag},~{fpsr},~{flags}"(i8* %1, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void format() {
  fprintf(stderr, "format: launcher [--logdir logdir] [--pthread libdir] [-o "
                  "|--outfile stdoutput_redirect] [-m] program [args]\n");
  exit(EXIT_FAILURE);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [110 x i8] c"format: launcher [--logdir logdir] [--pthread libdir] [-o |--outfile stdoutput_redirect] [-m] program [args]\0A\00"
@EXIT_FAILURE = global i32 0
define void @format() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([110 x i8], [110 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [110 x i8] c"format: launcher [--logdir logdir] [--pthread libdir] [-o |--outfile stdoutput_redirect] [-m] program [args]\0A\00"
@EXIT_FAILURE = global i32 0
define void @format() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([110 x i8], [110 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ dofree(void *);
void free(void *ptr) { dofree(ptr); }


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

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

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

LLVM IR (-O2):
define void @free(i8* %0) {
%2 = tail call i32 @dofree(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cpuid(int, unsigned int *, unsigned int *, unsigned int *,
                         unsigned int *);
int is_avx2_supported() {
  unsigned int eax, ebx, ecx, edx;
  ecx = 0;
  cpuid(7, &eax, &ebx, &ecx, &edx);
  return (ebx & (1 << 5)) ? 1 : 0;
}


x86 assembly (clang, -O0):
<is_avx2_supported>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0xc(%rbp)
mov    $0x7,%edi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
lea    -0xc(%rbp),%rcx
lea    -0x10(%rbp),%r8
call   1030 <cpuid@plt>
mov    -0x8(%rbp),%edx
and    $0x20,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_avx2_supported>:
sub    $0x18,%rsp
movl   $0x0,0x8(%rsp)
lea    0x14(%rsp),%rsi
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
lea    0x10(%rsp),%r8
mov    $0x7,%edi
call   1030 <cpuid@plt>
mov    0xc(%rsp),%eax
shr    $0x5,%eax
and    $0x1,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @is_avx2_supported() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %3
%5 = call i32 @cpuid(i32 7, i32* %1, i32* %2, i32* %3, i32* %4)
%6 = load i32, i32* %2
%7 = and i32 %6, 32
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 1, i32 0
ret i32 %10
}

LLVM IR (-O2):
define i32 @is_avx2_supported() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
store i32 0, i32* %3
%9 = call i32 @cpuid(i32 7, i32* %1, i32* %2, i32* %3, i32* %4)
%10 = load i32, i32* %2
%11 = lshr i32 %10, 5
%12 = and i32 %11, 1
ret i32 %12
}
void INT_Excep_RSCAN_CHERRINT(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_RSCAN_CHERRINT() {
ret void
}
int fputchar(c)
char c;
{ return putchar(c); }


x86 assembly (clang, -O0):
<fputchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
mov    $0x0,%al
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fputchar>:
movsbl %dil,%edi
xor    %eax,%eax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define i32 @fputchar(i32 %0) {
%2 = alloca i8
%3 = trunc i32 %0 to i8
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @fputchar(i32 %0) {
%2 = shl i32 %0, 24
%3 = ashr exact i32 %2, 24
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %3)
ret i32 %4
}
void internal(void) {}


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

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

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

LLVM IR (-O2):
define void @internal() {
ret void
}
/* Variables and functions */
void *malloc(size_t);
void *__gnat_malloc(size_t size) {
  void *res;
  res = malloc(size);
  return res;
}


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

x86 assembly (clang, -O2):
<__gnat_malloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @__gnat_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, long, int /*<<< orphan*/);
size_t ftell(int /*<<< orphan*/ *);
size_t fsize(const char *filename) {
  FILE *f;
  size_t siz = 0L;
  f = fopen(filename, "rb");
  if (f != NULL) {
    fseek(f, 0L, SEEK_END);
    siz = ftell(f);
    fclose(f);
  }
  return siz;
}


x86 assembly (clang, -O0):
<fsize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea1(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     119f <fsize+0x5f>
mov    -0x10(%rbp),%rdi
mov    0x2e6a(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   1050 <fseek@plt>
mov    -0x10(%rbp),%rdi
call   1040 <ftell@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsize>:
push   %r14
push   %rbx
push   %rax
lea    0xeb5(%rip),%rsi
call   1060 <fopen@plt>
test   %rax,%rax
je     1183 <fsize+0x43>
mov    %rax,%rbx
mov    0x2e89(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <fseek@plt>
mov    %rbx,%rdi
call   1040 <ftell@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    %r14,%rax
jmp    1185 <fsize+0x45>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"rb\00"
@SEEK_END = global i32 0
define i64 @fsize(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = load i32, i32* @SEEK_END
%6 = tail call i32 @fseek(i32* %2, i64 0, i32 %5)
%7 = tail call i64 @ftell(i32* %2)
%8 = tail call i32 @fclose(i32* %2)
br label %9
9: ; preds = %4, %1
%10 = phi i64 [ %7, %4 ], [ 0, %1 ]
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ UART_SendChar(char);
void PrintChar(char c) { UART_SendChar(c); }


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

x86 assembly (clang, -O2):
<PrintChar>:
jmp    1030 <UART_SendChar@plt>

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

LLVM IR (-O2):
define void @PrintChar(i8 signext %0) {
%2 = tail call i32 @UART_SendChar(i8 signext %0)
ret void
}
void pd_select_polarity(int port, int polarity) {}


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

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

LLVM IR (-O0):
define void @pd_select_polarity(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @pd_select_polarity(i32 %0, i32 %1) {
ret void
}
void modulo_signed_var_Bad_FN(unsigned int len, int i) {
  char arr[len];
  arr[i % len] = 123;
}


x86 assembly (clang, -O0):
<modulo_signed_var_Bad_FN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x20(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
xor    %edx,%edx
divl   -0x4(%rbp)
mov    -0x20(%rbp),%rax
mov    %edx,%ecx
movb   $0x7b,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @modulo_signed_var_Bad_FN(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
%9 = call i8* @llvm.stacksave()
store i8* %9, i8** %5
%10 = alloca i8, i64 %8
store i64 %8, i64* %6
%11 = load i32, i32* %4
%12 = load i32, i32* %3
%13 = urem i32 %11, %12
%14 = zext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %10, i64 %14
store i8 123, i8* %15
%16 = load i8*, i8** %5
ret void
}

LLVM IR (-O2):
define void @modulo_signed_var_Bad_FN(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PutLitChar(char);
void PutLitStr(char *s) {
  char *p = s;
  if (!s)
    return;
  while (*p) {
    PutLitChar(*p);
    p++;
  }
}


x86 assembly (clang, -O0):
<PutLitStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1134 <PutLitStr+0x24>
jmp    1163 <PutLitStr+0x53>
jmp    1139 <PutLitStr+0x29>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1163 <PutLitStr+0x53>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <PutLitChar@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1139 <PutLitStr+0x29>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PutLitStr>:
push   %rbx
test   %rdi,%rdi
je     1143 <PutLitStr+0x33>
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1143 <PutLitStr+0x33>
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl %al,%edi
call   1030 <PutLitChar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <PutLitStr+0x20>
pop    %rbx
ret

LLVM IR (-O0):
define void @PutLitStr(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
%5 = load i8*, i8** %2
%6 = icmp ne i8* %5, null
br i1 %6, label %8, label %7
7: ; preds = %1
br label %19
8: ; preds = %1
br label %9
9: ; preds = %13, %8
%10 = load i8*, i8** %3
%11 = load i8, i8* %10
%12 = icmp ne i8 %11, 0
br i1 %12, label %13, label %19
13: ; preds = %9
%14 = load i8*, i8** %3
%15 = load i8, i8* %14
%16 = call i32 @PutLitChar(i8 signext %15)
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %3
br label %9
19: ; preds = %7, %9
ret void
}

LLVM IR (-O2):
define void @PutLitStr(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i8 [ %11, %6 ], [ %4, %3 ]
%8 = phi i8* [ %10, %6 ], [ %0, %3 ]
%9 = tail call i32 @PutLitChar(i8 signext %7)
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %6
13: ; preds = %6, %3, %1
ret void
}
/* Variables and functions */
double bico(int, int);
double pow(int, int);
double Pbinom(int N, int ni, double p) {
  return bico(N, ni) * pow(p, ni) * pow(1 - p, N - ni);
}


x86 assembly (clang, -O0):
<Pbinom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <bico@plt>
movsd  %xmm0,-0x20(%rbp)
cvttsd2si -0x10(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xe97(%rip),%xmm0
subsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%edi
mov    -0x4(%rbp),%esi
sub    -0x8(%rbp),%esi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Pbinom>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
movsd  %xmm0,0x10(%rsp)
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <bico@plt>
movsd  %xmm0,0x8(%rsp)
cvttsd2si 0x10(%rsp),%edi
mov    %ebx,%esi
call   1040 <pow@plt>
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0xea4(%rip),%xmm0
subsd  0x10(%rsp),%xmm0
cvttsd2si %xmm0,%edi
sub    %ebx,%ebp
mov    %ebp,%esi
call   1040 <pow@plt>
mulsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define double @Pbinom(i32 %0, i32 %1, double %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca double
store i32 %0, i32* %4
store i32 %1, i32* %5
store double %2, double* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = call double @bico(i32 %7, i32 %8)
%10 = load double, double* %6
%11 = fptosi double %10 to i32
%12 = load i32, i32* %5
%13 = call double @pow(i32 %11, i32 %12)
%14 = fmul double %9, %13
%15 = load double, double* %6
%16 = fsub double 1.000000e+00, %15
%17 = fptosi double %16 to i32
%18 = load i32, i32* %4
%19 = load i32, i32* %5
%20 = sub nsw i32 %18, %19
%21 = call double @pow(i32 %17, i32 %20)
%22 = fmul double %14, %21
ret double %22
}

LLVM IR (-O2):
define double @Pbinom(i32 %0, i32 %1, double %2) {
%4 = tail call double @bico(i32 %0, i32 %1)
%5 = fptosi double %2 to i32
%6 = tail call double @pow(i32 %5, i32 %1)
%7 = fmul double %4, %6
%8 = fsub double 1.000000e+00, %2
%9 = fptosi double %8 to i32
%10 = sub nsw i32 %0, %1
%11 = tail call double @pow(i32 %9, i32 %10)
%12 = fmul double %7, %11
ret double %12
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int __api(int, unsigned long);
int rt_set_deadline(struct timeval *tv) {
  unsigned long ms = tv->tv_sec * 1000 + tv->tv_usec / 1000;
  return (__api(6, ms) == 1) ? 0 : 1;
}


x86 assembly (clang, -O0):
<rt_set_deadline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x3e8,(%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    $0x6,%edi
call   1030 <__api@plt>
mov    %eax,%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x1,%edx
cmove  %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rt_set_deadline>:
push   %rax
movslq (%rdi),%rax
imul   $0x3e8,%rax,%rax
movslq 0x4(%rdi),%rcx
imul   $0x10624dd3,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
movslq %ecx,%rsi
add    %rax,%rsi
mov    $0x6,%edi
call   1030 <__api@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @rt_set_deadline(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
%3 = alloca i64
store %struct.timeval* %0, %struct.timeval** %2
%4 = load %struct.timeval*, %struct.timeval** %2
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 0
%6 = load i32, i32* %5
%7 = mul nsw i32 %6, 1000
%8 = load %struct.timeval*, %struct.timeval** %2
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %8, i32 0, i32 1
%10 = load i32, i32* %9
%11 = sdiv i32 %10, 1000
%12 = add nsw i32 %7, %11
%13 = sext i32 %12 to i64
store i64 %13, i64* %3
%14 = load i64, i64* %3
%15 = call i32 @__api(i32 6, i64 %14)
%16 = icmp eq i32 %15, 1
%17 = zext i1 %16 to i64
%18 = select i1 %16, i32 0, i32 1
ret i32 %18
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @rt_set_deadline(%struct.timeval* nocapture %0) {
%2 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 1000
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%6 = load i32, i32* %5
%7 = sdiv i32 %6, 1000
%8 = add nsw i32 %7, %4
%9 = sext i32 %8 to i64
%10 = tail call i32 @__api(i32 6, i64 %9)
%11 = icmp ne i32 %10, 1
%12 = zext i1 %11 to i32
ret i32 %12
}
int test_imm_13uint8_reg(unsigned char val) {
  return ((val) & (0x13 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_13uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0x13,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_13uint8_reg>:
test   $0x13,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_13uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 19
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
long long fastmod(long long, long long, long long);
long long int inversemod(long long int n, long long int m) {
  return fastmod(n, m - 2, m);
}


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

x86 assembly (clang, -O2):
<inversemod>:
mov    %rsi,%rdx
add    $0xfffffffffffffffe,%rsi
jmp    1030 <fastmod@plt>

LLVM IR (-O0):
define i64 @inversemod(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = sub nsw i64 %6, 2
%8 = load i64, i64* %4
%9 = call i64 @fastmod(i64 %5, i64 %7, i64 %8)
ret i64 %9
}

LLVM IR (-O2):
define i64 @inversemod(i64 %0, i64 %1) {
%3 = add nsw i64 %1, -2
%4 = tail call i64 @fastmod(i64 %0, i64 %3, i64 %1)
ret i64 %4
}
/* Variables and functions */
int isdigit(unsigned int);
int _eml_parse822_is_digit(char c) { return isdigit((unsigned)c); }


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

x86 assembly (clang, -O2):
<_eml_parse822_is_digit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @_eml_parse822_is_digit(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -48
%4 = icmp ult i32 %3, 10
%5 = zext i1 %4 to i32
ret i32 %5
}
int __access_noerrno(const char *file, int type) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @__access_noerrno(i8* nocapture readnone %0, i32 %1) {
ret i32 -1
}
unsigned getval_387() { return 1304674969U; }


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

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

LLVM IR (-O0):
define i32 @getval_387() {
ret i32 1304674969
}

LLVM IR (-O2):
define i32 @getval_387() {
ret i32 1304674969
}