xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
void exit_with_failure(const char *reason) {
  perror(reason);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<exit_with_failure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exit_with_failure>:
push   %rax
call   1030 <perror@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @exit_with_failure(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @exit_with_failure(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
int max_i(int a, int b) {
  if (a >= b)
    return a;
  return b;
}


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

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

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

LLVM IR (-O2):
define i32 @max_i(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
int cl_dev_geterasesize(const void *cfg) { return 4096; }


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

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

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

LLVM IR (-O2):
define i32 @cl_dev_geterasesize(i8* nocapture readnone %0) {
ret i32 4096
}
int *f(int *p) { return p; }


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

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

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

LLVM IR (-O2):
define i32* @f(i32* readnone returned %0) {
ret i32* %0
}
void gtk_accel_group_connect_by_path() {}


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

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

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

LLVM IR (-O2):
define void @gtk_accel_group_connect_by_path() {
ret void
}
/* Variables and functions */
scalar_t__ isspace(char);
char *skip_whitespace(char *s) {
  while (*s && isspace(*s))
    s++;
  return s;
}


x86 assembly (clang, -O0):
<skip_whitespace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1147 <skip_whitespace+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1157 <skip_whitespace+0x47>
jmp    1168 <skip_whitespace+0x58>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <skip_whitespace+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_whitespace>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1139 <skip_whitespace+0x29>
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <isspace@plt>
test   %rax,%rax
je     1139 <skip_whitespace+0x29>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <skip_whitespace+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @skip_whitespace(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %9
%5 = phi i8 [ %11, %9 ], [ %2, %1 ]
%6 = phi i8* [ %10, %9 ], [ %0, %1 ]
%7 = tail call i64 @isspace(i8 signext %5)
%8 = icmp eq i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %9, %1
%14 = phi i8* [ %0, %1 ], [ %10, %9 ], [ %6, %4 ]
ret i8* %14
}
int ld_gt_rc1(long double a1) { return (((a1) > (100))); }


x86 assembly (clang, -O0):
<ld_gt_rc1>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
flds   0xeed(%rip)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_gt_rc1>:
fldt   0x8(%rsp)
flds   0xef6(%rip)
xor    %eax,%eax
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
seta   %al
ret

LLVM IR (-O0):
define i32 @ld_gt_rc1(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fcmp ogt x86_fp80 %3, 0xK4005C800000000000000
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @ld_gt_rc1(x86_fp80 %0) {
%2 = fcmp ogt x86_fp80 %0, 0xK4005C800000000000000
%3 = zext i1 %2 to i32
ret i32 %3
}
void camera_release() { ; }


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

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

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

LLVM IR (-O2):
define void @camera_release() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, char *, size_t);
void swap(void *pa, void *pb, size_t size) {
  char buffer[size];
  memcpy(buffer, pa, size);
  memcpy(pa, pb, size);
  memcpy(pb, buffer, size);
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x30(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x30(%rbp),%rsi
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdx,%r12
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsp,%rbx
lea    0xf(%rdx),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <memcpy@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %r12,%rdx
call   1030 <memcpy@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r12,%rdx
call   1030 <memcpy@plt>
lea    -0x20(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @swap(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%9 = load i64, i64* %6
%10 = call i8* @llvm.stacksave()
store i8* %10, i8** %7
%11 = alloca i8, i64 %9
store i64 %9, i64* %8
%12 = load i8*, i8** %4
%13 = load i64, i64* %6
%14 = call i32 @memcpy(i8* %11, i8* %12, i64 %13)
%15 = load i8*, i8** %4
%16 = load i8*, i8** %5
%17 = load i64, i64* %6
%18 = call i32 @memcpy(i8* %15, i8* %16, i64 %17)
%19 = load i8*, i8** %5
%20 = load i64, i64* %6
%21 = call i32 @memcpy(i8* %19, i8* %11, i64 %20)
%22 = load i8*, i8** %7
ret void
}

LLVM IR (-O2):
define void @swap(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8, i64 %2
%5 = call i32 @memcpy(i8* %4, i8* %0, i64 %2)
%6 = call i32 @memcpy(i8* %0, i8* %1, i64 %2)
%7 = call i32 @memcpy(i8* %1, i8* %4, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fortune_cookie(char *);
int main(int argc, char **argv) {
  char quote[] = "Cookies make you fat";
  fortune_cookie(quote);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xed3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xed0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xece(%rip),%eax
mov    %eax,-0x20(%rbp)
mov    0xec9(%rip),%al
mov    %al,-0x1c(%rbp)
lea    -0x30(%rbp),%rdi
call   1030 <fortune_cookie@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x74616620756f79,%rax
mov    %rax,0xd(%rsp)
mov    %rsp,%rdi
call   1030 <fortune_cookie@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.quote = [21 x i8] c"Cookies make you fat\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [21 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [21 x i8]* %6 to i8*
%8 = getelementptr inbounds [21 x i8], [21 x i8]* %6, i64 0, i64 0
%9 = call i32 @fortune_cookie(i8* %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.quote = [21 x i8] c"Cookies make you fat\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [21 x i8]
%4 = getelementptr inbounds [21 x i8], [21 x i8]* %3, i64 0, i64 0
%5 = call i32 @fortune_cookie(i8* %4)
ret i32 0
}
void *string_writer(void *ud, char c) {
  char *str = ud;
  *(str++) = c;
  return (void *)str;
}


x86 assembly (clang, -O0):
<string_writer>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x9(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_writer>:
mov    %sil,(%rdi)
lea    0x1(%rdi),%rax
ret

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

LLVM IR (-O2):
define i8* @string_writer(i8* writeonly %0, i8 signext %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %1, i8* %0
ret i8* %3
}
void ft_add_test_case(char **data, char *dest, char *src, char *n) {
  data[0] = dest;
  data[1] = src;
  data[2] = n;
}


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

x86 assembly (clang, -O2):
<ft_add_test_case>:
mov    %rsi,(%rdi)
mov    %rdx,0x8(%rdi)
mov    %rcx,0x10(%rdi)
ret

LLVM IR (-O0):
define void @ft_add_test_case(i8** %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8** %0, i8*** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %6
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 0
store i8* %9, i8** %11
%12 = load i8*, i8** %7
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
store i8* %12, i8** %14
%15 = load i8*, i8** %8
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 2
store i8* %15, i8** %17
ret void
}

LLVM IR (-O2):
define void @ft_add_test_case(i8** nocapture writeonly %0, i8* %1, i8* %2, i8* %3) {
store i8* %1, i8** %0
%5 = getelementptr inbounds i8*, i8** %0, i64 1
store i8* %2, i8** %5
%6 = getelementptr inbounds i8*, i8** %0, i64 2
store i8* %3, i8** %6
ret void
}
__attribute__((always_)) void __ISB(void) {}


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

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

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

LLVM IR (-O2):
define void @__ISB() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ yyparse();
main() {
  yyparse();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @yyparse()
ret i32 0
}
int read_hist(fname)
char fname[255];
{ return (0); }


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

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

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

LLVM IR (-O2):
define i32 @read_hist(i8* nocapture readnone %0) {
ret i32 0
}
void gtk_entry_completion_set_minimum_key_length() {}


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

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

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

LLVM IR (-O2):
define void @gtk_entry_completion_set_minimum_key_length() {
ret void
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ memset(int *, int /*<<< orphan*/, int);
void read(int count[], int size) {
  memset(count, 0, size * sizeof(int));
  int ch;
  while ((ch = getchar()) != EOF) {
    count[ch]++;
  }
}


x86 assembly (clang, -O0):
<read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edx
xor    %esi,%esi
call   1030 <memset@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x10(%rbp)
mov    0x2e93(%rip),%rcx
cmp    (%rcx),%eax
je     1173 <read+0x53>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
add    $0x1,%edx
mov    %edx,(%rax,%rcx,4)
jmp    1144 <read+0x24>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0x0(,%rsi,4),%edx
xor    %esi,%esi
call   1030 <memset@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2ea5(%rip),%r14
cmp    (%r14),%eax
je     1162 <read+0x42>
nopl   0x0(%rax,%rax,1)
cltq
addl   $0x1,(%rbx,%rax,4)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%r14),%eax
jne    1150 <read+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EOF = global i32 0
define void @read(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** %3
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = mul i64 %8, 4
%10 = trunc i64 %9 to i32
%11 = call i32 @memset(i32* %6, i32 0, i32 %10)
br label %12
12: ; preds = %16, %2
%13 = call i32 (...) @getchar()
store i32 %13, i32* %5
%14 = load i32, i32* @EOF
%15 = icmp ne i32 %13, %14
br i1 %15, label %16, label %23
16: ; preds = %12
%17 = load i32*, i32** %3
%18 = load i32, i32* %5
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* %17, i64 %19
%21 = load i32, i32* %20
%22 = add nsw i32 %21, 1
store i32 %22, i32* %20
br label %12
23: ; preds = %12
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
define void @read(i32* %0, i32 %1) {
%3 = shl i32 %1, 2
%4 = tail call i32 @memset(i32* %0, i32 0, i32 %3)
%5 = tail call i32 (...) @getchar()
%6 = load i32, i32* @EOF
%7 = icmp eq i32 %5, %6
br i1 %7, label %17, label %8
8: ; preds = %2, %8
%9 = phi i32 [ %14, %8 ], [ %5, %2 ]
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = add nsw i32 %12, 1
store i32 %13, i32* %11
%14 = tail call i32 (...) @getchar()
%15 = load i32, i32* @EOF
%16 = icmp eq i32 %14, %15
br i1 %16, label %17, label %8
17: ; preds = %8, %2
ret void
}
void SynthOS_nullEnableInterrupts() {}


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

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

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

LLVM IR (-O2):
define void @SynthOS_nullEnableInterrupts() {
ret void
}
/* Variables and functions */
int Swap32(int);
float SwapFloat(float x) {
  typedef union {
    float f;
    int i;
    unsigned int ui;
  } floatint_t;
  floatint_t fi;
  fi.f = x;
  fi.i = Swap32(fi.i);
  return fi.f;
}


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

x86 assembly (clang, -O2):
<SwapFloat>:
push   %rax
movd   %xmm0,%edi
call   1030 <Swap32@plt>
movd   %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
%union.floatint_t = type { float }
define float @SwapFloat(float %0) {
%2 = alloca float
%3 = alloca %union.floatint_t
store float %0, float* %2
%4 = load float, float* %2
%5 = bitcast %union.floatint_t* %3 to float*
store float %4, float* %5
%6 = bitcast %union.floatint_t* %3 to i32*
%7 = load i32, i32* %6
%8 = call i32 @Swap32(i32 %7)
%9 = bitcast %union.floatint_t* %3 to i32*
store i32 %8, i32* %9
%10 = bitcast %union.floatint_t* %3 to float*
%11 = load float, float* %10
ret float %11
}

LLVM IR (-O2):
define float @SwapFloat(float %0) {
%2 = bitcast float %0 to i32
%3 = tail call i32 @Swap32(i32 %2)
%4 = bitcast i32 %3 to float
ret float %4
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int close(int /*<<< orphan*/);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ perror(char *);
int32_t tms_close_port(int32_t fd) {
  if (close(fd) == -1) {
    perror("close_port: Error closing port - ");
    return errno;
  }
  return (0);
}


x86 assembly (clang, -O0):
<tms_close_port>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <close@plt>
cmp    $0xffffffff,%eax
jne    1159 <tms_close_port+0x39>
lea    0xebd(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1160 <tms_close_port+0x40>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tms_close_port>:
push   %rax
call   1030 <close@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
je     1131 <tms_close_port+0x11>
pop    %rcx
ret
lea    0xec8(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"close_port: Error closing port - \00"
@errno = global i32 0
define i32 @tms_close_port(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 @close(i32 %4)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = call i32 @perror(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* @errno
store i32 %9, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %7
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@.str = [34 x i8] c"close_port: Error closing port - \00"
@errno = global i32 0
define i32 @tms_close_port(i32 %0) {
%2 = tail call i32 @close(i32 %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @errno
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %6, %4 ], [ 0, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ PTHREAD_CANCEL_ASYNCHRONOUS;
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/);
int /*<<< orphan*/ pthread_setcanceltype(int /*<<< orphan*/,
                                         int /*<<< orphan*/ *);
int /*<<< orphan*/ sleep(int);
void *a_thread_func() {
  pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
  sleep(10);
  perror("Thread couldn't be canceled (at cleanup time), timing out\n");
  pthread_exit(0);
  return NULL;
}


x86 assembly (clang, -O0):
<a_thread_func>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <pthread_setcanceltype@plt>
mov    $0xa,%edi
call   1060 <sleep@plt>
lea    0xe99(%rip),%rdi
call   1040 <perror@plt>
xor    %edi,%edi
call   1030 <pthread_exit@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_thread_func>:
push   %rax
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1050 <pthread_setcanceltype@plt>
mov    $0xa,%edi
call   1060 <sleep@plt>
lea    0xe9e(%rip),%rdi
call   1040 <perror@plt>
xor    %edi,%edi
call   1030 <pthread_exit@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@PTHREAD_CANCEL_ASYNCHRONOUS = global i32 0
@.str = [59 x i8] c"Thread couldn't be canceled (at cleanup time), timing out\0A\00"
define i8* @a_thread_func() {
%1 = load i32, i32* @PTHREAD_CANCEL_ASYNCHRONOUS
%2 = call i32 @pthread_setcanceltype(i32 %1, i32* null)
%3 = call i32 @sleep(i32 10)
%4 = call i32 @perror(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @pthread_exit(i32 0)
ret i8* null
}

LLVM IR (-O2):
@PTHREAD_CANCEL_ASYNCHRONOUS = global i32 0
@.str = [59 x i8] c"Thread couldn't be canceled (at cleanup time), timing out\0A\00"
define noalias i8* @a_thread_func() {
%1 = load i32, i32* @PTHREAD_CANCEL_ASYNCHRONOUS
%2 = tail call i32 @pthread_setcanceltype(i32 %1, i32* null)
%3 = tail call i32 @sleep(i32 10)
%4 = tail call i32 @perror(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @pthread_exit(i32 0)
ret i8* null
}
void __attribute__((weak)) exti3_isr() { debug_handler(__FUNCTION__); }


x86 assembly (clang, -O0):
<exti3_isr>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <debug_handler@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<exti3_isr>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <debug_handler@plt>

LLVM IR (-O0):
@__FUNCTION__.exti3_isr = [10 x i8] c"exti3_isr\00"
define weak void @exti3_isr() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__FUNCTION__.exti3_isr, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__FUNCTION__.exti3_isr = [10 x i8] c"exti3_isr\00"
define weak void @exti3_isr() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__FUNCTION__.exti3_isr, i64 0, i64 0))
ret void
}
/* Variables and functions */
int errno;
int lseek64(int, long long, int);
int lseek_file(int fd, long long offset, int whence) {
  int ret;
  ret = lseek64(fd, offset, whence);
  if (ret < 0)
    return -errno;
  return 0;
}


x86 assembly (clang, -O0):
<lseek_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <lseek64@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    1151 <lseek_file+0x41>
xor    %eax,%eax
mov    0x2e99(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <lseek_file+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lseek_file>:
push   %rax
call   1030 <lseek64@plt>
mov    0x2ec3(%rip),%rcx
xor    %edx,%edx
sub    (%rcx),%edx
sar    $0x1f,%eax
and    %edx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@errno = global i32 0
define i32 @lseek_file(i32 %0, i64 %1, i32 %2) {
%4 = tail call i32 @lseek64(i32 %0, i64 %1, i32 %2)
%5 = icmp slt i32 %4, 0
%6 = load i32, i32* @errno
%7 = sub nsw i32 0, %6
%8 = select i1 %5, i32 %7, i32 0
ret i32 %8
}
void del_trigger(struct trigger *trigger) {}


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

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

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

LLVM IR (-O2):
%struct.trigger = type opaque
define void @del_trigger(%struct.trigger* nocapture %0) {
ret void
}
/* Variables and functions */
size_t nextPow2(size_t v) {
  v = v | (v >> 1);
  v = v | (v >> 2);
  v = v | (v >> 4);
  v = v | (v >> 8);
  return v + 1;
}


x86 assembly (clang, -O0):
<nextPow2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
shr    $0x1,%rcx
or     %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
shr    $0x2,%rcx
or     %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
shr    $0x4,%rcx
or     %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
shr    $0x8,%rcx
or     %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nextPow2>:
mov    %rdi,%rax
shr    %rax
or     %rdi,%rax
mov    %rax,%rcx
shr    $0x2,%rcx
or     %rax,%rcx
mov    %rcx,%rdx
shr    $0x4,%rdx
or     %rcx,%rdx
mov    %rdx,%rax
shr    $0x8,%rax
or     %rdx,%rax
add    $0x1,%rax
ret

LLVM IR (-O0):
define i64 @nextPow2(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load i64, i64* %2
%5 = lshr i64 %4, 1
%6 = or i64 %3, %5
store i64 %6, i64* %2
%7 = load i64, i64* %2
%8 = load i64, i64* %2
%9 = lshr i64 %8, 2
%10 = or i64 %7, %9
store i64 %10, i64* %2
%11 = load i64, i64* %2
%12 = load i64, i64* %2
%13 = lshr i64 %12, 4
%14 = or i64 %11, %13
store i64 %14, i64* %2
%15 = load i64, i64* %2
%16 = load i64, i64* %2
%17 = lshr i64 %16, 8
%18 = or i64 %15, %17
store i64 %18, i64* %2
%19 = load i64, i64* %2
%20 = add i64 %19, 1
ret i64 %20
}

LLVM IR (-O2):
define i64 @nextPow2(i64 %0) {
%2 = lshr i64 %0, 1
%3 = or i64 %2, %0
%4 = lshr i64 %3, 2
%5 = or i64 %4, %3
%6 = lshr i64 %5, 4
%7 = or i64 %6, %5
%8 = lshr i64 %7, 8
%9 = or i64 %8, %7
%10 = add i64 %9, 1
ret i64 %10
}
/* Variables and functions */
char *SeqUtil_addRes(char *, int, char);
char *SeqUtil_addGaps(char *seq, int length) {
  return SeqUtil_addRes(seq, length, '-');
}


x86 assembly (clang, -O0):
<SeqUtil_addGaps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x2d,%edx
call   1030 <SeqUtil_addRes@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SeqUtil_addGaps>:
mov    $0x2d,%edx
jmp    1030 <SeqUtil_addRes@plt>

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

LLVM IR (-O2):
define i8* @SeqUtil_addGaps(i8* %0, i32 %1) {
%3 = tail call i8* @SeqUtil_addRes(i8* %0, i32 %1, i8 signext 45)
ret i8* %3
}
/* Variables and functions */
unsigned long ntohl(int /*<<< orphan*/);
unsigned long get_from_arp(unsigned char *data, int size) {
  if (size < 16)
    return 0;
  return ntohl(0);
}


x86 assembly (clang, -O0):
<get_from_arp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x10,-0x14(%rbp)
jge    1136 <get_from_arp+0x26>
movq   $0x0,-0x8(%rbp)
jmp    1141 <get_from_arp+0x31>
xor    %edi,%edi
call   1030 <ntohl@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_from_arp>:
cmp    $0x10,%esi
jge    1118 <get_from_arp+0x8>
xor    %eax,%eax
ret
xor    %edi,%edi
jmp    1030 <ntohl@plt>

LLVM IR (-O0):
define i64 @get_from_arp(i8* %0, i32 %1) {
%3 = alloca i64
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp slt i32 %6, 16
br i1 %7, label %8, label %9
8: ; preds = %2
store i64 0, i64* %3
br label %11
9: ; preds = %2
%10 = call i64 @ntohl(i32 0)
store i64 %10, i64* %3
br label %11
11: ; preds = %9, %8
%12 = load i64, i64* %3
ret i64 %12
}

LLVM IR (-O2):
define i64 @get_from_arp(i8* nocapture readnone %0, i32 %1) {
%3 = icmp slt i32 %1, 16
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i64 @ntohl(i32 0)
br label %6
6: ; preds = %2, %4
%7 = phi i64 [ %5, %4 ], [ 0, %2 ]
ret i64 %7
}
int GifIMax(int l, int r) { return l > r ? l : r; }


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

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

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

LLVM IR (-O2):
define i32 @GifIMax(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
int div1(int a, int (*op)(int, int)) {
  int x;
  x = (*op)(2, 3);
  return a / x;
}


x86 assembly (clang, -O0):
<div1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x2,%edi
mov    $0x3,%esi
call   *-0x10(%rbp)
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x14(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<div1>:
push   %rbx
mov    %rsi,%rax
mov    %edi,%ebx
mov    $0x2,%edi
mov    $0x3,%esi
call   *%rax
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @div1(i32 %0, i32 (i32, i32)* nocapture %1) {
%3 = tail call i32 %1(i32 2, i32 3)
%4 = sdiv i32 %0, %3
ret i32 %4
}
void reclaimMemory() {}


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

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

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

LLVM IR (-O2):
define void @reclaimMemory() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ble_server_app_main();
int /*<<< orphan*/ blink_app_main();
int /*<<< orphan*/ nfc_app_main();
void app_main() {
  nfc_app_main();
  blink_app_main();
  ble_server_app_main();
}


x86 assembly (clang, -O0):
<app_main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <nfc_app_main@plt>
mov    $0x0,%al
call   1030 <blink_app_main@plt>
mov    $0x0,%al
call   1050 <ble_server_app_main@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<app_main>:
push   %rax
xor    %eax,%eax
call   1040 <nfc_app_main@plt>
xor    %eax,%eax
call   1030 <blink_app_main@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <ble_server_app_main@plt>

LLVM IR (-O0):
define void @app_main() {
%1 = call i32 (...) @nfc_app_main()
%2 = call i32 (...) @blink_app_main()
%3 = call i32 (...) @ble_server_app_main()
ret void
}

LLVM IR (-O2):
define void @app_main() {
%1 = tail call i32 (...) @nfc_app_main()
%2 = tail call i32 (...) @blink_app_main()
%3 = tail call i32 (...) @ble_server_app_main()
ret void
}
unsigned long cp_hash_float(void *addr) {
  unsigned long *p = (unsigned long *)addr;
  return *p;
}


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

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

LLVM IR (-O0):
define i64 @cp_hash_float(i8* %0) {
%2 = alloca i8*
%3 = alloca i64*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i64*
store i64* %5, i64** %3
%6 = load i64*, i64** %3
%7 = load i64, i64* %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @cp_hash_float(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ OpenSSL_add_ssl_algorithms();
int /*<<< orphan*/ SSL_write(int /*<<< orphan*/, char *, int /*<<< orphan*/);
int /*<<< orphan*/ exit(int);
int main() {
  char mytmp[10];
  mytmp[0] = 0;
  OpenSSL_add_ssl_algorithms();
  SSL_write(0, mytmp, 0);
  exit(0x0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x0,-0xe(%rbp)
mov    $0x0,%al
call   1040 <OpenSSL_add_ssl_algorithms@plt>
lea    -0xe(%rbp),%rsi
xor    %edx,%edx
mov    %edx,%edi
call   1030 <SSL_write@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movb   $0x0,0xe(%rsp)
xor    %eax,%eax
call   1040 <OpenSSL_add_ssl_algorithms@plt>
lea    0xe(%rsp),%rsi
xor    %edi,%edi
xor    %edx,%edx
call   1030 <SSL_write@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
store i8 0, i8* %3
%4 = call i32 (...) @OpenSSL_add_ssl_algorithms()
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%6 = call i32 @SSL_write(i32 0, i8* %5, i32 0)
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
store i8 0, i8* %2
%3 = tail call i32 (...) @OpenSSL_add_ssl_algorithms()
%4 = call i32 @SSL_write(i32 0, i8* %2, i32 0)
%5 = call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
void memcpy() {}


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

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

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

LLVM IR (-O2):
define void @memcpy() {
ret void
}
const char *String_Brief(void) { return "String Object"; }


x86 assembly (clang, -O0):
<String_Brief>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<String_Brief>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [14 x i8] c"String Object\00"
define i8* @String_Brief() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [14 x i8] c"String Object\00"
define i8* @String_Brief() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}
int rec_sum_array(int *arr, int i) {
  if (arr[i] == '\0') {
    return 0;
  } else {
    return arr[i] + rec_sum_array(arr, i + 1);
  }
}


x86 assembly (clang, -O0):
<rec_sum_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    113d <rec_sum_array+0x2d>
movl   $0x0,-0x4(%rbp)
jmp    1164 <rec_sum_array+0x54>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
call   1030 <rec_sum_array@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rec_sum_array>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
test   %ecx,%ecx
je     112d <rec_sum_array+0x2d>
lea    (%rdi,%rax,4),%rdx
add    $0x4,%rdx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    %ecx,%eax
mov    (%rdx),%ecx
add    $0x4,%rdx
test   %ecx,%ecx
jne    1120 <rec_sum_array+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @rec_sum_array(i32* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 0
br i1 %6, label %16, label %7
7: ; preds = %2, %7
%8 = phi i64 [ %11, %7 ], [ %3, %2 ]
%9 = phi i32 [ %14, %7 ], [ %5, %2 ]
%10 = phi i32 [ %12, %7 ], [ 0, %2 ]
%11 = add i64 %8, 1
%12 = add nsw i32 %9, %10
%13 = getelementptr inbounds i32, i32* %0, i64 %11
%14 = load i32, i32* %13
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %7
16: ; preds = %7, %2
%17 = phi i32 [ 0, %2 ], [ %12, %7 ]
ret i32 %17
}
/* Variables and functions */
long long llrint(double);
__attribute__((weak)) long long int llrintl(long double x) {
  return llrint((double)x);
}


x86 assembly (clang, -O0):
<llrintl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <llrint@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<llrintl>:
fldt   0x8(%rsp)
fstpl  -0x8(%rsp)
movsd  -0x8(%rsp),%xmm0
jmp    1030 <llrint@plt>

LLVM IR (-O0):
define weak i64 @llrintl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fptrunc x86_fp80 %3 to double
%5 = call i64 @llrint(double %4)
ret i64 %5
}

LLVM IR (-O2):
define weak i64 @llrintl(x86_fp80 %0) {
%2 = fptrunc x86_fp80 %0 to double
%3 = tail call i64 @llrint(double %2)
ret i64 %3
}
/* Variables and functions */
char getchar();
int clear_s(void) {
  while (getchar() != '\n')
    ;
}


x86 assembly (clang, -O0):
<clear_s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     1130 <clear_s+0x20>
jmp    1118 <clear_s+0x8>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_s>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
jne    1120 <clear_s+0x10>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @clear_s() {
%1 = alloca i32
br label %2
2: ; preds = %6, %0
%3 = call signext i8 (...) @getchar()
%4 = sext i8 %3 to i32
%5 = icmp ne i32 %4, 10
br i1 %5, label %6, label %7
6: ; preds = %2
br label %2
7: ; preds = %2
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @clear_s() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 (...) @getchar()
%3 = icmp eq i8 %2, 10
br i1 %3, label %4, label %1
4: ; preds = %1
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  if (n % 2 == 0) {
    printf("PAR\n");
  } else {
    printf("IMPAR\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1164 <main+0x44>
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
jmp    1170 <main+0x50>
lea    0xe98(%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
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
testb  $0x1,0x4(%rsp)
lea    0xec7(%rip),%rax
lea    0xebe(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"PAR\0A\00"
@.str.2 = [7 x i8] c"IMPAR\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = srem i32 %4, 2
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@str = [6 x i8] c"IMPAR\00"
@str.3 = [4 x i8] c"PAR\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = and i32 %4, 1
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0)
%8 = call i32 @puts(i8* dereferenceable(1) %7)
ret i32 0
}
/* Type definitions */
struct __sk_buff {
  int vlan_tci;
};
typedef int __u16;

/* Variables and functions */
int __attribute__((section("filter"), used)) hashfilter(struct __sk_buff *skb) {
  __u16 vlan_id = skb->vlan_tci & 0x0fff;
  switch (vlan_id) {
  case 2:
  case 4:
    return -1;
  default:
    return 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<hashfilter>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
and    $0xfff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
sub    $0x2,%eax
je     113b <hashfilter+0x3b>
jmp    112a <hashfilter+0x2a>
mov    -0x18(%rbp),%eax
sub    $0x4,%eax
jne    1147 <hashfilter+0x47>
jmp    113b <hashfilter+0x3b>
movl   $0xffffffff,-0x4(%rbp)
jmp    114e <hashfilter+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashfilter>:
mov    $0xfff,%eax
and    (%rdi),%eax
add    $0xfffffffe,%eax
and    $0xfffffffd,%eax
cmp    $0x1,%eax
sbb    %eax,%eax
ret

LLVM IR (-O0):
%struct.__sk_buff = type { i32 }
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 (%struct.__sk_buff*)* @hashfilter to i8*)], section "llvm.metadata"
define i32 @hashfilter(%struct.__sk_buff* %0) section "filter" {
%2 = alloca i32
%3 = alloca %struct.__sk_buff*
%4 = alloca i32
store %struct.__sk_buff* %0, %struct.__sk_buff** %3
%5 = load %struct.__sk_buff*, %struct.__sk_buff** %3
%6 = getelementptr inbounds %struct.__sk_buff, %struct.__sk_buff* %5, i32 0, i32 0
%7 = load i32, i32* %6
%8 = and i32 %7, 4095
store i32 %8, i32* %4
%9 = load i32, i32* %4
switch i32 %9, label %11 [
i32 2, label %10
i32 4, label %10
]
10: ; preds = %1, %1
store i32 -1, i32* %2
br label %12
11: ; preds = %1
store i32 0, i32* %2
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
%struct.__sk_buff = type { i32 }
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 (%struct.__sk_buff*)* @hashfilter to i8*)], section "llvm.metadata"
define i32 @hashfilter(%struct.__sk_buff* nocapture %0) section "filter" {
%2 = getelementptr inbounds %struct.__sk_buff, %struct.__sk_buff* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = and i32 %3, 4095
%5 = icmp eq i32 %4, 2
%6 = icmp eq i32 %4, 4
%7 = or i1 %5, %6
%8 = sext i1 %7 to i32
ret i32 %8
}