xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ test_bom();
int /*<<< orphan*/ test_file();
int /*<<< orphan*/ test_no_newline();
int main() {
  test_file();
  test_bom();
  test_no_newline();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_file()
%2 = tail call i32 (...) @test_bom()
%3 = tail call i32 (...) @test_no_newline()
ret i32 0
}
/* Type definitions */
struct genlist {
  int dummy;
};
struct fileinfo_list {
  int dummy;
};
struct fileinfo {
  int dummy;
};

/* Variables and functions */
scalar_t__ genlist_front(struct genlist const *);
struct fileinfo *fileinfo_list_front(const struct fileinfo_list *tthis) {
  return (struct fileinfo *)genlist_front((const struct genlist *)tthis);
}


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

x86 assembly (clang, -O2):
<fileinfo_list_front>:
jmp    1030 <genlist_front@plt>

LLVM IR (-O0):
%struct.fileinfo = type { i32 }
%struct.fileinfo_list = type { i32 }
%struct.genlist = type { i32 }
define %struct.fileinfo* @fileinfo_list_front(%struct.fileinfo_list* %0) {
%2 = alloca %struct.fileinfo_list*
store %struct.fileinfo_list* %0, %struct.fileinfo_list** %2
%3 = load %struct.fileinfo_list*, %struct.fileinfo_list** %2
%4 = bitcast %struct.fileinfo_list* %3 to %struct.genlist*
%5 = call i64 @genlist_front(%struct.genlist* %4)
%6 = inttoptr i64 %5 to %struct.fileinfo*
ret %struct.fileinfo* %6
}

LLVM IR (-O2):
%struct.fileinfo = type { i32 }
%struct.fileinfo_list = type { i32 }
%struct.genlist = type { i32 }
define %struct.fileinfo* @fileinfo_list_front(%struct.fileinfo_list* %0) {
%2 = bitcast %struct.fileinfo_list* %0 to %struct.genlist*
%3 = tail call i64 @genlist_front(%struct.genlist* %2)
%4 = inttoptr i64 %3 to %struct.fileinfo*
ret %struct.fileinfo* %4
}
char *onoff(bool) int bool;
{ return (bool ? "on" : "off"); }


x86 assembly (clang, -O0):
<onoff>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xef2(%rip),%rax
lea    0xee8(%rip),%rcx
cmp    $0x0,%edx
cmovne %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<onoff>:
test   %edi,%edi
lea    0xefa(%rip),%rcx
lea    0xef0(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"on\00"
@.str.1 = [4 x i8] c"off\00"
define i8* @onoff(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0)
ret i8* %6
}

LLVM IR (-O2):
@.str = [3 x i8] c"on\00"
@.str.1 = [4 x i8] c"off\00"
define i8* @onoff(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
/* Type definitions */
struct Event {
  int dummy;
};

/* Variables and functions */
struct Event *generate_arrive_event(double, int);
int /*<<< orphan*/ push_event(struct Event *);
void initialize_events() {
  struct Event *first_1 = generate_arrive_event(3.25, 0);
  push_event(first_1);
  struct Event *first_2 = generate_arrive_event(6.25, 1);
  push_event(first_2);
}


x86 assembly (clang, -O0):
<initialize_events>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  0xed8(%rip),%xmm0
xor    %edi,%edi
call   1040 <generate_arrive_event@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <push_event@plt>
movsd  0xeb4(%rip),%xmm0
mov    $0x1,%edi
call   1040 <generate_arrive_event@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <push_event@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialize_events>:
push   %rax
movsd  0xed7(%rip),%xmm0
xor    %edi,%edi
call   1040 <generate_arrive_event@plt>
mov    %rax,%rdi
call   1030 <push_event@plt>
movsd  0xec8(%rip),%xmm0
mov    $0x1,%edi
call   1040 <generate_arrive_event@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <push_event@plt>

LLVM IR (-O0):
%struct.Event = type { i32 }
define void @initialize_events() {
%1 = alloca %struct.Event*
%2 = alloca %struct.Event*
%3 = call %struct.Event* @generate_arrive_event(double 3.250000e+00, i32 0)
store %struct.Event* %3, %struct.Event** %1
%4 = load %struct.Event*, %struct.Event** %1
%5 = call i32 @push_event(%struct.Event* %4)
%6 = call %struct.Event* @generate_arrive_event(double 6.250000e+00, i32 1)
store %struct.Event* %6, %struct.Event** %2
%7 = load %struct.Event*, %struct.Event** %2
%8 = call i32 @push_event(%struct.Event* %7)
ret void
}

LLVM IR (-O2):
%struct.Event = type { i32 }
define void @initialize_events() {
%1 = tail call %struct.Event* @generate_arrive_event(double 3.250000e+00, i32 0)
%2 = tail call i32 @push_event(%struct.Event* %1)
%3 = tail call %struct.Event* @generate_arrive_event(double 6.250000e+00, i32 1)
%4 = tail call i32 @push_event(%struct.Event* %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int chmod(char const *, int /*<<< orphan*/);
int errno;
int __sulong_posix_chmod(const char *filename, mode_t mode) {
  {
    int native_errno = errno;
    int result = chmod(filename, mode);
    if (result == (int)-1) {
      result = (int)(long)-errno;
    }
    errno = native_errno;
    return result;
  };
}


x86 assembly (clang, -O0):
<__sulong_posix_chmod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <chmod@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    1154 <__sulong_posix_chmod+0x44>
xor    %eax,%eax
mov    0x2e93(%rip),%rcx
sub    (%rcx),%eax
cltq
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%ecx
mov    0x2e82(%rip),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__sulong_posix_chmod>:
push   %rbp
push   %rbx
push   %rax
mov    0x2ec6(%rip),%rbx
mov    (%rbx),%ebp
call   1030 <chmod@plt>
xor    %ecx,%ecx
sub    (%rbx),%ecx
cmp    $0xffffffff,%eax
cmove  %ecx,%eax
mov    %ebp,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@errno = global i32 0
define i32 @__sulong_posix_chmod(i8* nocapture %0, i32 %1) {
%3 = load i32, i32* @errno
%4 = tail call i32 @chmod(i8* %0, i32 %1)
%5 = icmp eq i32 %4, -1
%6 = load i32, i32* @errno
%7 = sub nsw i32 0, %6
%8 = select i1 %5, i32 %7, i32 %4
store i32 %3, i32* @errno
ret i32 %8
}
void XESetPrintErrorValues() {}


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

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

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

LLVM IR (-O2):
define void @XESetPrintErrorValues() {
ret void
}
int sched_getcpu() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @sched_getcpu() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
int /*<<< orphan*/ gen_comment();
int /*<<< orphan*/ newline();
int /*<<< orphan*/ output_string(char *);
multidef(char *symbol_name) {
  error("already defined");
  gen_comment();
  output_string(symbol_name);
  newline();
}


x86 assembly (clang, -O0):
<multidef>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xead(%rip),%rdi
call   1060 <error@plt>
mov    $0x0,%al
call   1040 <gen_comment@plt>
mov    -0x10(%rbp),%rdi
call   1050 <output_string@plt>
mov    $0x0,%al
call   1030 <newline@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<multidef>:
push   %rbx
mov    %rdi,%rbx
lea    0xeb5(%rip),%rdi
call   1060 <error@plt>
xor    %eax,%eax
call   1040 <gen_comment@plt>
mov    %rbx,%rdi
call   1050 <output_string@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <newline@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"already defined\00"
define i32 @multidef(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 @error(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (...) @gen_comment()
%6 = load i8*, i8** %3
%7 = call i32 @output_string(i8* %6)
%8 = call i32 (...) @newline()
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
@.str = [16 x i8] c"already defined\00"
define i32 @multidef(i8* %0) {
%2 = tail call i32 @error(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @gen_comment()
%4 = tail call i32 @output_string(i8* %0)
%5 = tail call i32 (...) @newline()
ret i32 undef
}
long long int llabs(long long int j) { return (j >= 0) ? j : -j; }


x86 assembly (clang, -O0):
<llabs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jl     1120 <llabs+0x20>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    112a <llabs+0x2a>
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @llabs(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void prompt(void) { printf("[mysh-0.1]$ "); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"[mysh-0.1]$ \00"
define void @prompt() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"[mysh-0.1]$ \00"
define void @prompt() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int *allocate_int();
int /*<<< orphan*/ free(int *);
int /*<<< orphan*/ set(int *, int);
void deref_null_ok() {
  int *p = allocate_int();
  if (p != NULL) {
    set(p, 42);
  }
  free(p);
}


x86 assembly (clang, -O0):
<deref_null_ok>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <allocate_int@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     115c <deref_null_ok+0x2c>
mov    -0x8(%rbp),%rdi
mov    $0x2a,%esi
call   1050 <set@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deref_null_ok>:
push   %rbx
xor    %eax,%eax
call   1040 <allocate_int@plt>
mov    %rax,%rbx
test   %rax,%rax
je     114d <deref_null_ok+0x1d>
mov    %rbx,%rdi
mov    $0x2a,%esi
call   1050 <set@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @deref_null_ok() {
%1 = tail call i32* (...) @allocate_int()
%2 = icmp eq i32* %1, null
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @set(i32* %1, i32 42)
br label %5
5: ; preds = %3, %0
%6 = tail call i32 @free(i32* %1)
ret void
}
int _isatty(int file) {
  return 1;
  file = file;
}


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

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

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

LLVM IR (-O2):
define i32 @_isatty(i32 %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ motorKontrol(int, int);
int geriGit(int deger) { motorKontrol(deger * -1, deger * -1); }


x86 assembly (clang, -O0):
<geriGit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
imul   $0xffffffff,-0x8(%rbp),%edi
imul   $0xffffffff,-0x8(%rbp),%esi
call   1030 <motorKontrol@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<geriGit>:
neg    %edi
mov    %edi,%esi
jmp    1030 <motorKontrol@plt>

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

LLVM IR (-O2):
define i32 @geriGit(i32 %0) {
%2 = sub nsw i32 0, %0
%3 = tail call i32 @motorKontrol(i32 %2, i32 %2)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ stdout;
void pfail(const char *msg) {
  fflush(stdout);
  perror(msg);
  exit(1);
}


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

x86 assembly (clang, -O2):
<pfail>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@stdout = global i32 0
define void @pfail(i8* nocapture %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
%4 = tail call i32 @perror(i8* %0)
%5 = tail call i32 @exit(i32 1)
unreachable
}
void wrfsbase(unsigned long fsbase) {
  asm volatile("wrfsbase %0" ::"r"(fsbase) : "memory");
}


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

x86 assembly (clang, -O2):
<wrfsbase>:
wrfsbase %rdi
ret

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

LLVM IR (-O2):
define void @wrfsbase(i64 %0) {
tail call void asm sideeffect "wrfsbase $0", "r,~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %0)
ret void
}
/* Variables and functions */
int __gesf2(float, float);
int _COM_CMPGEf(float a, float b) { return __gesf2(a, b) != -1; }


x86 assembly (clang, -O0):
<_COM_CMPGEf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <__gesf2@plt>
cmp    $0xffffffff,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_COM_CMPGEf>:
push   %rax
call   1030 <__gesf2@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @_COM_CMPGEf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call i32 @__gesf2(float %5, float %6)
%8 = icmp ne i32 %7, -1
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @_COM_CMPGEf(float %0, float %1) {
%3 = tail call i32 @__gesf2(float %0, float %1)
%4 = icmp ne i32 %3, -1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int /*<<< orphan*/ child();
scalar_t__ fork();
int /*<<< orphan*/ parent(scalar_t__);
void execute() {
  pid_t pid = fork();
  if (pid != 0) {
    parent(pid);
  } else {
    child();
  }
}


x86 assembly (clang, -O0):
<execute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <fork@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     115c <execute+0x2c>
mov    -0x8(%rbp),%rdi
call   1040 <parent@plt>
jmp    1163 <execute+0x33>
mov    $0x0,%al
call   1030 <child@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execute>:
push   %rax
xor    %eax,%eax
call   1050 <fork@plt>
test   %rax,%rax
je     1146 <execute+0x16>
mov    %rax,%rdi
pop    %rax
jmp    1040 <parent@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <child@plt>

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

LLVM IR (-O2):
define void @execute() {
%1 = tail call i64 (...) @fork()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @parent(i64 %1)
br label %7
5: ; preds = %0
%6 = tail call i32 (...) @child()
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
long long cos(long long);
long long sin(long long);
long long internal_cot_l(long long value) { return cos(value) / sin(value); }


x86 assembly (clang, -O0):
<internal_cot_l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <cos@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <sin@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cqto
idiv   %rcx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<internal_cot_l>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <cos@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <sin@plt>
mov    %rax,%rcx
mov    %r14,%rax
or     %rcx,%rax
shr    $0x20,%rax
je     1150 <internal_cot_l+0x30>
mov    %r14,%rax
cqto
idiv   %rcx
jmp    1157 <internal_cot_l+0x37>
mov    %r14d,%eax
xor    %edx,%edx
div    %ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @internal_cot_l(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @cos(i64 %3)
%5 = load i64, i64* %2
%6 = call i64 @sin(i64 %5)
%7 = sdiv i64 %4, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @internal_cot_l(i64 %0) {
%2 = tail call i64 @cos(i64 %0)
%3 = tail call i64 @sin(i64 %0)
%4 = sdiv i64 %2, %3
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ OPENSSL_free(char *);
void openssl_free(char *m) { OPENSSL_free(m); }


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

x86 assembly (clang, -O2):
<openssl_free>:
jmp    1030 <OPENSSL_free@plt>

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

LLVM IR (-O2):
define void @openssl_free(i8* %0) {
%2 = tail call i32 @OPENSSL_free(i8* %0)
ret void
}
void lua_api_commands_deinit() {}


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

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

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

LLVM IR (-O2):
define void @lua_api_commands_deinit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pthread_self();
int pthread_setname_np(int /*<<< orphan*/, char const *);
int ThreadSetName(const char *name) {
  return pthread_setname_np(pthread_self(), name);
}


x86 assembly (clang, -O0):
<ThreadSetName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <pthread_self@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
call   1030 <pthread_setname_np@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ThreadSetName>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <pthread_self@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <pthread_setname_np@plt>

LLVM IR (-O0):
define i32 @ThreadSetName(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @pthread_self()
%4 = load i8*, i8** %2
%5 = call i32 @pthread_setname_np(i32 %3, i8* %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @ThreadSetName(i8* %0) {
%2 = tail call i32 (...) @pthread_self()
%3 = tail call i32 @pthread_setname_np(i32 %2, i8* %0)
ret i32 %3
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
void put_u32(void *buf, uint32_t val) {
  uint8_t *p = buf;
  p[3] = val & 0xff;
  p[2] = (val >> 8) & 0xff;
  p[1] = (val >> 16) & 0xff;
  p[0] = (val >> 24) & 0xff;
}


x86 assembly (clang, -O0):
<put_u32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0xc(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x10,%ecx
and    $0xff,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x18,%ecx
and    $0xff,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_u32>:
mov    %esi,%eax
movzbl %al,%ecx
mov    %ecx,0xc(%rdi)
movzbl %ah,%ecx
mov    %ecx,0x8(%rdi)
mov    %esi,%ecx
shr    $0x10,%ecx
movzbl %cl,%ecx
mov    %ecx,0x4(%rdi)
shr    $0x18,%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @put_u32(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %5
%8 = load i32, i32* %4
%9 = and i32 %8, 255
%10 = load i32*, i32** %5
%11 = getelementptr inbounds i32, i32* %10, i64 3
store i32 %9, i32* %11
%12 = load i32, i32* %4
%13 = ashr i32 %12, 8
%14 = and i32 %13, 255
%15 = load i32*, i32** %5
%16 = getelementptr inbounds i32, i32* %15, i64 2
store i32 %14, i32* %16
%17 = load i32, i32* %4
%18 = ashr i32 %17, 16
%19 = and i32 %18, 255
%20 = load i32*, i32** %5
%21 = getelementptr inbounds i32, i32* %20, i64 1
store i32 %19, i32* %21
%22 = load i32, i32* %4
%23 = ashr i32 %22, 24
%24 = and i32 %23, 255
%25 = load i32*, i32** %5
%26 = getelementptr inbounds i32, i32* %25, i64 0
store i32 %24, i32* %26
ret void
}

LLVM IR (-O2):
define void @put_u32(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
%4 = and i32 %1, 255
%5 = getelementptr inbounds i8, i8* %0, i64 12
%6 = bitcast i8* %5 to i32*
store i32 %4, i32* %6
%7 = lshr i32 %1, 8
%8 = and i32 %7, 255
%9 = getelementptr inbounds i8, i8* %0, i64 8
%10 = bitcast i8* %9 to i32*
store i32 %8, i32* %10
%11 = lshr i32 %1, 16
%12 = and i32 %11, 255
%13 = getelementptr inbounds i8, i8* %0, i64 4
%14 = bitcast i8* %13 to i32*
store i32 %12, i32* %14
%15 = lshr i32 %1, 24
store i32 %15, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print(char *text) { printf("%s", text); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @print(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct soap {
  int dummy;
};

/* Variables and functions */
int soap_element_end_in(struct soap *, char *);
int soap_envelope_end_in(struct soap *soap) {
  return soap_element_end_in(soap, "SOAP-ENV:Envelope");
}


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

x86 assembly (clang, -O2):
<soap_envelope_end_in>:
lea    0xee9(%rip),%rsi
jmp    1030 <soap_element_end_in@plt>

LLVM IR (-O0):
%struct.soap = type { i32 }
@.str = [18 x i8] c"SOAP-ENV:Envelope\00"
define i32 @soap_envelope_end_in(%struct.soap* %0) {
%2 = alloca %struct.soap*
store %struct.soap* %0, %struct.soap** %2
%3 = load %struct.soap*, %struct.soap** %2
%4 = call i32 @soap_element_end_in(%struct.soap* %3, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}

LLVM IR (-O2):
%struct.soap = type { i32 }
@.str = [18 x i8] c"SOAP-ENV:Envelope\00"
define i32 @soap_envelope_end_in(%struct.soap* %0) {
%2 = tail call i32 @soap_element_end_in(%struct.soap* %0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
int test_imm_A1int16_reg(short val) {
  return ((val) & (0xA1 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_A1int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xa1,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_A1int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 161
%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_A1int16_reg(i16 signext %0) {
%2 = and i16 %0, 161
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int array_remove(int len, unsigned int *array, unsigned int elt) {
  for (int i = 0; i < len; i++) {
    if (array[i] == elt) {
      array[i] = -1;
      return i;
    }
  }
  return -1;
}


x86 assembly (clang, -O0):
<array_remove>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1162 <array_remove+0x62>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x14(%rbp),%eax
jne    114f <array_remove+0x4f>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movl   $0xffffffff,(%rax,%rcx,4)
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1169 <array_remove+0x69>
jmp    1154 <array_remove+0x54>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1115 <array_remove+0x15>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_remove>:
mov    $0xffffffff,%eax
test   %edi,%edi
jle    111e <array_remove+0x1e>
mov    %edi,%edi
xor    %ecx,%ecx
nopl   (%rax)
cmp    %edx,(%rsi,%rcx,4)
je     111f <array_remove+0x1f>
add    $0x1,%rcx
cmp    %rcx,%rdi
jne    1110 <array_remove+0x10>
ret
movl   $0xffffffff,(%rsi,%rcx,4)
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @array_remove(i32 %0, i32* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %19
5: ; preds = %3
%6 = zext i32 %0 to i64
br label %7
7: ; preds = %5, %16
%8 = phi i64 [ 0, %5 ], [ %17, %16 ]
%9 = getelementptr inbounds i32, i32* %1, i64 %8
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, %2
br i1 %11, label %12, label %16
12: ; preds = %7
%13 = trunc i64 %8 to i32
%14 = and i64 %8, 4294967295
%15 = getelementptr inbounds i32, i32* %1, i64 %14
store i32 -1, i32* %15
br label %19
16: ; preds = %7
%17 = add nuw nsw i64 %8, 1
%18 = icmp eq i64 %17, %6
br i1 %18, label %19, label %7
19: ; preds = %16, %3, %12
%20 = phi i32 [ %13, %12 ], [ -1, %3 ], [ -1, %16 ]
ret i32 %20
}
/* Variables and functions */
long get_request_dun_max_lev(int, int);
long get_request_dun_max_lev_normal(void) {
  return get_request_dun_max_lev(10, 50);
}


x86 assembly (clang, -O0):
<get_request_dun_max_lev_normal>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
mov    $0x32,%esi
call   1030 <get_request_dun_max_lev@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_request_dun_max_lev_normal>:
mov    $0xa,%edi
mov    $0x32,%esi
jmp    1030 <get_request_dun_max_lev@plt>

LLVM IR (-O0):
define i64 @get_request_dun_max_lev_normal() {
%1 = call i64 @get_request_dun_max_lev(i32 10, i32 50)
ret i64 %1
}

LLVM IR (-O2):
define i64 @get_request_dun_max_lev_normal() {
%1 = tail call i64 @get_request_dun_max_lev(i32 10, i32 50)
ret i64 %1
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int inb(int);
uint32_t fw_cfg_readw_be(void) {
  uint32_t val;
  val = inb(0x511);
  val = (val << 8) | inb(0x511);
  return val;
}


x86 assembly (clang, -O0):
<fw_cfg_readw_be>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x511,%edi
call   1030 <inb@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x8(%rbp)
mov    $0x511,%edi
call   1030 <inb@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fw_cfg_readw_be>:
push   %rbx
mov    $0x511,%edi
call   1030 <inb@plt>
mov    %eax,%ebx
shl    $0x8,%ebx
mov    $0x511,%edi
call   1030 <inb@plt>
or     %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @fw_cfg_readw_be() {
%1 = alloca i32
%2 = call i32 @inb(i32 1297)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = shl i32 %3, 8
%5 = call i32 @inb(i32 1297)
%6 = or i32 %4, %5
store i32 %6, i32* %1
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @fw_cfg_readw_be() {
%1 = tail call i32 @inb(i32 1297)
%2 = shl i32 %1, 8
%3 = tail call i32 @inb(i32 1297)
%4 = or i32 %2, %3
ret i32 %4
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int parity_naive(uint64_t x) {
  uint64_t par = 0;
  for (; x; x >>= 1) {
    par ^= x & 1;
  }
  return (int)par;
}


x86 assembly (clang, -O0):
<parity_naive>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1132 <parity_naive+0x32>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <parity_naive+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<parity_naive>:
xor    %eax,%eax
test   %edi,%edi
je     1120 <parity_naive+0x20>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
mov    %edi,%edx
and    $0x1,%edx
xor    %edx,%eax
sar    %ecx
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <parity_naive+0x10>
ret

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

LLVM IR (-O2):
define i32 @parity_naive(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = and i32 %5, 1
%7 = xor i32 %4, %6
%8 = ashr i32 %5, 1
%9 = icmp ult i32 %5, 2
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %11
}
/* Variables and functions */
int gOr(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ gOr4Way(int, int, int, int);
int gOr8Way(int a, int b, int c, int d, int e, int f, int g, int h) {
  return gOr(gOr4Way(a, b, c, d), gOr4Way(e, f, g, h));
}


x86 assembly (clang, -O0):
<gOr8Way>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1040 <gOr4Way@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    0x10(%rbp),%edx
mov    0x18(%rbp),%ecx
call   1040 <gOr4Way@plt>
mov    -0x1c(%rbp),%edi
mov    %eax,%esi
call   1030 <gOr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gOr8Way>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r9d,%r14d
mov    %r8d,%r15d
mov    0x30(%rsp),%r12d
mov    0x38(%rsp),%ebp
call   1040 <gOr4Way@plt>
mov    %eax,%ebx
mov    %r15d,%edi
mov    %r14d,%esi
mov    %r12d,%edx
mov    %ebp,%ecx
call   1040 <gOr4Way@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <gOr@plt>

LLVM IR (-O0):
define i32 @gOr8Way(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7) {
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
store i32 %0, i32* %9
store i32 %1, i32* %10
store i32 %2, i32* %11
store i32 %3, i32* %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store i32 %6, i32* %15
store i32 %7, i32* %16
%17 = load i32, i32* %9
%18 = load i32, i32* %10
%19 = load i32, i32* %11
%20 = load i32, i32* %12
%21 = call i32 @gOr4Way(i32 %17, i32 %18, i32 %19, i32 %20)
%22 = load i32, i32* %13
%23 = load i32, i32* %14
%24 = load i32, i32* %15
%25 = load i32, i32* %16
%26 = call i32 @gOr4Way(i32 %22, i32 %23, i32 %24, i32 %25)
%27 = call i32 @gOr(i32 %21, i32 %26)
ret i32 %27
}

LLVM IR (-O2):
define i32 @gOr8Way(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7) {
%9 = tail call i32 @gOr4Way(i32 %0, i32 %1, i32 %2, i32 %3)
%10 = tail call i32 @gOr4Way(i32 %4, i32 %5, i32 %6, i32 %7)
%11 = tail call i32 @gOr(i32 %9, i32 %10)
ret i32 %11
}
/* Variables and functions */
bool isTerminator(int pos, char chr) {
  switch (chr) {
  case '\n':
  case ';':
    return true;
  default:
    return false;
  }
}


x86 assembly (clang, -O0):
<isTerminator>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %edi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0xa,%eax
je     1133 <isTerminator+0x33>
jmp    1122 <isTerminator+0x22>
mov    -0x10(%rbp),%eax
sub    $0x3b,%eax
jne    113f <isTerminator+0x3f>
jmp    1133 <isTerminator+0x33>
movl   $0x1,-0x4(%rbp)
jmp    1146 <isTerminator+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isTerminator>:
cmp    $0xa,%sil
sete   %al
cmp    $0x3b,%sil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isTerminator(i32 %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8
store i32 %0, i32* %4
store i8 %1, i8* %5
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
switch i32 %7, label %9 [
i32 10, label %8
i32 59, label %8
]
8: ; preds = %2, %2
store i32 1, i32* %3
br label %10
9: ; preds = %2
store i32 0, i32* %3
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @isTerminator(i32 %0, i8 signext %1) {
%3 = icmp eq i8 %1, 10
%4 = icmp eq i8 %1, 59
%5 = or i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
struct event_signal_map {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ evmap_signal_initmap(struct event_signal_map *);
void evmap_io_initmap(struct event_signal_map *ctx) {
  evmap_signal_initmap(ctx);
}


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

x86 assembly (clang, -O2):
<evmap_io_initmap>:
jmp    1030 <evmap_signal_initmap@plt>

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

LLVM IR (-O2):
%struct.event_signal_map = type { i32 }
define void @evmap_io_initmap(%struct.event_signal_map* %0) {
%2 = tail call i32 @evmap_signal_initmap(%struct.event_signal_map* %0)
ret void
}
void INT_TM03(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_TM03() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
void ler_vetor(int vetor[], int N) {
  int i;
  int j;
  for (i = 0; i < N; i++) {
    scanf("%d", &j);
    vetor[i] = j;
  }
}


x86 assembly (clang, -O0):
<ler_vetor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115e <ler_vetor+0x4e>
lea    0xec7(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1030 <scanf@plt>
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <ler_vetor+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ler_vetor>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
test   %esi,%esi
jle    115c <ler_vetor+0x4c>
mov    %rdi,%r12
mov    %esi,%r13d
xor    %ebx,%ebx
lea    0xed0(%rip),%r14
lea    0xc(%rsp),%r15
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <scanf@plt>
mov    0xc(%rsp),%eax
mov    %eax,(%r12,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r13
jne    1140 <ler_vetor+0x30>
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @ler_vetor(i32* nocapture writeonly %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %15
6: ; preds = %2
%7 = zext i32 %1 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 0, %6 ], [ %13, %8 ]
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%11 = load i32, i32* %3
%12 = getelementptr inbounds i32, i32* %0, i64 %9
store i32 %11, i32* %12
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %7
br i1 %14, label %15, label %8
15: ; preds = %8, %2
ret void
}
/* Variables and functions */
int _rdrand16_step(unsigned short *);
int __attribute__((__target__("rdrnd"))) rdrand16_step_wrap(unsigned short *p) {
  return _rdrand16_step(p);
}


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

x86 assembly (clang, -O2):
<rdrand16_step_wrap>:
jmp    1030 <_rdrand16_step@plt>

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

LLVM IR (-O2):
define i32 @rdrand16_step_wrap(i16* %0) {
%2 = tail call i32 @_rdrand16_step(i16* %0)
ret i32 %2
}
int f_bun_rc2(float a1) { return !(__builtin_isunordered(a1, 100)); }


x86 assembly (clang, -O0):
<f_bun_rc2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeea(%rip),%xmm1
ucomiss %xmm1,%xmm0
setp   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_bun_rc2>:
xor    %eax,%eax
ucomiss %xmm0,%xmm0
setnp  %al
ret

LLVM IR (-O0):
define i32 @f_bun_rc2(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp uno float %3, 1.000000e+02
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @f_bun_rc2(float %0) {
%2 = fcmp ord float %0, 0.000000e+00
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int g_delete_object(int);
int g_get_object_id(char *);
int g_delete_object_byname(char *label) {
  int id;
  if ((id = g_get_object_id(label)) == -1)
    return -1;
  return g_delete_object(id);
}


x86 assembly (clang, -O0):
<g_delete_object_byname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <g_get_object_id@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
jne    114d <g_delete_object_byname+0x2d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1158 <g_delete_object_byname+0x38>
mov    -0x14(%rbp),%edi
call   1030 <g_delete_object@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_delete_object_byname>:
push   %rax
call   1040 <g_get_object_id@plt>
cmp    $0xffffffff,%eax
je     1133 <g_delete_object_byname+0x13>
mov    %eax,%edi
pop    %rax
jmp    1030 <g_delete_object@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @g_delete_object_byname(i8* %0) {
%2 = tail call i32 @g_get_object_id(i8* %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @g_delete_object(i32 %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ -1, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ _errorloop();
void BusFault_Handler() { _errorloop(); }


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

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

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

LLVM IR (-O2):
define void @BusFault_Handler() {
%1 = tail call i32 (...) @_errorloop()
ret void
}
int cinstr(const char *str, char c) {
  int i = 0;
  while (*str++ != '\0')
    if (*str == c)
      i++;
  return i;
}


x86 assembly (clang, -O0):
<cinstr>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1151 <cinstr+0x51>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    114c <cinstr+0x4c>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1115 <cinstr+0x15>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cinstr>:
cmpb   $0x0,(%rdi)
je     1126 <cinstr+0x26>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
movzbl (%rdi),%ecx
xor    %edx,%edx
cmp    %sil,%cl
sete   %dl
add    %edx,%eax
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <cinstr+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @cinstr(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %8, %5 ], [ %0, %2 ]
%7 = phi i32 [ %12, %5 ], [ 0, %2 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, %1
%11 = zext i1 %10 to i32
%12 = add nuw nsw i32 %7, %11
%13 = icmp eq i8 %9, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %2
%15 = phi i32 [ 0, %2 ], [ %12, %5 ]
ret i32 %15
}