xunge/DecIR huggingface dataset:
/* Type definitions */
struct dirent {
  int /*<<< orphan*/ *d_name;
};

/* Variables and functions */
int isalpha(int /*<<< orphan*/);
int is_lv(const struct dirent *dir) { return isalpha(dir->d_name[0]); }


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

x86 assembly (clang, -O2):
<is_lv>:
mov    (%rdi),%rax
mov    (%rax),%edi
jmp    1030 <isalpha@plt>

LLVM IR (-O0):
%struct.dirent = type { i32* }
define i32 @is_lv(%struct.dirent* %0) {
%2 = alloca %struct.dirent*
store %struct.dirent* %0, %struct.dirent** %2
%3 = load %struct.dirent*, %struct.dirent** %2
%4 = getelementptr inbounds %struct.dirent, %struct.dirent* %3, i32 0, i32 0
%5 = load i32*, i32** %4
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = call i32 @isalpha(i32 %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.dirent = type { i32* }
define i32 @is_lv(%struct.dirent* nocapture %0) {
%2 = getelementptr inbounds %struct.dirent, %struct.dirent* %0, i64 0, i32 0
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = tail call i32 @isalpha(i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ stdout;
void pdie(char *msg) {
  fflush(stdout);
  perror(msg);
  exit(1);
}


x86 assembly (clang, -O0):
<pdie>:
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):
<pdie>:
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 @pdie(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 @pdie(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 foo(void) {
  unsigned int a[2];
#pragma acc kernels
  { a[0]++; }
}


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

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

LLVM IR (-O0):
define void @foo() {
%1 = alloca [2 x i32]
%2 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%3 = load i32, i32* %2
%4 = add i32 %3, 1
store i32 %4, i32* %2
ret void
}

LLVM IR (-O2):
define void @foo() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ be64toh(int /*<<< orphan*/);
uint64_t be64_to_cpu(uint64_t x) { return be64toh(x); }


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

x86 assembly (clang, -O2):
<be64_to_cpu>:
jmp    1030 <be64toh@plt>

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

LLVM IR (-O2):
define i32 @be64_to_cpu(i32 %0) {
%2 = tail call i32 @be64toh(i32 %0)
ret i32 %2
}
__attribute__((always_, unused)) int
ips___test_and_set_bit(int nr, volatile unsigned long *addr) {
  int oldbit;
  asm volatile("btsl %2,%1\n\tsbbl %0,%0"
               : "=r"(oldbit), "=m"(*addr)
               : "dIr"(nr)
               : "memory");
  return oldbit;
}


x86 assembly (clang, -O0):
<ips___test_and_set_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
bts    %ecx,(%rax)
sbb    %eax,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ips___test_and_set_bit>:
bts    %edi,(%rsi)
sbb    %eax,%eax
ret

LLVM IR (-O0):
define i32 @ips___test_and_set_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i32
store i32 %0, i32* %3
store i64* %1, i64** %4
%6 = load i64*, i64** %4
%7 = load i32, i32* %3
%8 = call i32 asm sideeffect "btsl $2,$1\0A\09sbbl $0,$0", "=r,=*m,{dx}Ir,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @ips___test_and_set_bit(i32 %0, i64* %1) {
%3 = tail call i32 asm sideeffect "btsl $2,$1\0A\09sbbl $0,$0", "=r,=*m,{dx}Ir,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %1, i32 %0)
ret i32 %3
}
void a8bcdefghijklmnopqrstuvwxzy() {}


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

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

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

LLVM IR (-O2):
define void @a8bcdefghijklmnopqrstuvwxzy() {
ret void
}
/* Type definitions */
struct colprintTable {
  int dummy;
};

/* Variables and functions */
struct colprintTable *colprintTableNew(char *, char *, char *,
                                       int /*<<< orphan*/ *);
extern struct colprintTable *flagsColprintTableNew(void) {
  return colprintTableNew("L:LETTER", "L:NAME", "L:DESCRIPTION", NULL);
}


x86 assembly (clang, -O0):
<flagsColprintTableNew>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee7(%rip),%rsi
lea    0xee7(%rip),%rdx
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <colprintTableNew@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<flagsColprintTableNew>:
lea    0xee9(%rip),%rdi
lea    0xeeb(%rip),%rsi
lea    0xeeb(%rip),%rdx
xor    %ecx,%ecx
jmp    1030 <colprintTableNew@plt>

LLVM IR (-O0):
%struct.colprintTable = type { i32 }
@.str = [9 x i8] c"L:LETTER\00"
@.str.1 = [7 x i8] c"L:NAME\00"
@.str.2 = [14 x i8] c"L:DESCRIPTION\00"
define %struct.colprintTable* @flagsColprintTableNew() {
%1 = call %struct.colprintTable* @colprintTableNew(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32* null)
ret %struct.colprintTable* %1
}

LLVM IR (-O2):
%struct.colprintTable = type { i32 }
@.str = [9 x i8] c"L:LETTER\00"
@.str.1 = [7 x i8] c"L:NAME\00"
@.str.2 = [14 x i8] c"L:DESCRIPTION\00"
define %struct.colprintTable* @flagsColprintTableNew() {
%1 = tail call %struct.colprintTable* @colprintTableNew(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32* null)
ret %struct.colprintTable* %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_std_line() { printf("\n  ======================================"); }


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

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

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

LLVM IR (-O2):
@.str = [42 x i8] c"\0A ======================================\00"
define void @print_std_line() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int system(char *);
int do_tests(void) {
  int ret;
  ret = system("date");
  ret = system("./inconsistency-check -c 0 -t 20");
  ret |= system("./nanosleep");
  ret |= system("./nsleep-lat");
  return ret;
}


x86 assembly (clang, -O0):
<do_tests>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <system@plt>
mov    %eax,-0x4(%rbp)
lea    0xed7(%rip),%rdi
call   1030 <system@plt>
mov    %eax,-0x4(%rbp)
lea    0xee9(%rip),%rdi
call   1030 <system@plt>
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
lea    0xee3(%rip),%rdi
call   1030 <system@plt>
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_tests>:
push   %rbp
push   %rbx
push   %rax
lea    0xee6(%rip),%rdi
call   1030 <system@plt>
lea    0xedf(%rip),%rdi
call   1030 <system@plt>
mov    %eax,%ebx
lea    0xef2(%rip),%rdi
call   1030 <system@plt>
mov    %eax,%ebp
or     %ebx,%ebp
lea    0xeee(%rip),%rdi
call   1030 <system@plt>
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"date\00"
@.str.1 = [33 x i8] c"./inconsistency-check -c 0 -t 20\00"
@.str.2 = [12 x i8] c"./nanosleep\00"
@.str.3 = [13 x i8] c"./nsleep-lat\00"
define i32 @do_tests() {
%1 = alloca i32
%2 = call i32 @system(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i32 %2, i32* %1
%3 = call i32 @system(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
store i32 %3, i32* %1
%4 = call i32 @system(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%5 = load i32, i32* %1
%6 = or i32 %5, %4
store i32 %6, i32* %1
%7 = call i32 @system(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%8 = load i32, i32* %1
%9 = or i32 %8, %7
store i32 %9, i32* %1
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@.str = [5 x i8] c"date\00"
@.str.1 = [33 x i8] c"./inconsistency-check -c 0 -t 20\00"
@.str.2 = [12 x i8] c"./nanosleep\00"
@.str.3 = [13 x i8] c"./nsleep-lat\00"
define i32 @do_tests() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @system(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%4 = or i32 %3, %2
%5 = tail call i32 @system(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%6 = or i32 %4, %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ addstr(char *);
int /*<<< orphan*/ endwin();
char getch();
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ refresh();
int main(void) {
  char ch;
  initscr();
  addstr("Type a few lines of text\n");
  addstr("Press ~ to quit\n");
  refresh();
  while ((ch = getch()) != '~')
    ;
  endwin();
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <initscr@plt>
lea    0xe93(%rip),%rdi
call   1070 <addstr@plt>
lea    0xea1(%rip),%rdi
call   1070 <addstr@plt>
mov    $0x0,%al
call   1040 <refresh@plt>
mov    $0x0,%al
call   1050 <getch@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%eax
cmp    $0x7e,%eax
je     11a0 <main+0x50>
jmp    1185 <main+0x35>
mov    $0x0,%al
call   1060 <endwin@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <initscr@plt>
lea    0xea1(%rip),%rdi
call   1070 <addstr@plt>
lea    0xeaf(%rip),%rdi
call   1070 <addstr@plt>
xor    %eax,%eax
call   1040 <refresh@plt>
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <getch@plt>
cmp    $0x7e,%al
jne    1180 <main+0x30>
xor    %eax,%eax
call   1060 <endwin@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Type a few lines of text\0A\00"
@.str.1 = [17 x i8] c"Press ~ to quit\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 (...) @initscr()
%4 = call i32 @addstr(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @addstr(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (...) @refresh()
br label %7
7: ; preds = %11, %0
%8 = call signext i8 (...) @getch()
store i8 %8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 126
br i1 %10, label %11, label %12
11: ; preds = %7
br label %7
12: ; preds = %7
%13 = call i32 (...) @endwin()
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"Type a few lines of text\0A\00"
@.str.1 = [17 x i8] c"Press ~ to quit\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 @addstr(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @addstr(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (...) @refresh()
br label %5
5: ; preds = %5, %0
%6 = tail call signext i8 (...) @getch()
%7 = icmp eq i8 %6, 126
br i1 %7, label %8, label %5
8: ; preds = %5
%9 = tail call i32 (...) @endwin()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
int /*<<< orphan*/ mu_final();
scalar_t__ mu_ismain();
void mu_exit(void) {
  if (mu_ismain()) {
    _exit(mu_final());
  }
}


x86 assembly (clang, -O0):
<mu_exit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <mu_ismain@plt>
cmp    $0x0,%rax
je     1153 <mu_exit+0x23>
mov    $0x0,%al
call   1050 <mu_final@plt>
mov    %eax,%edi
call   1040 <_exit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mu_exit>:
push   %rax
xor    %eax,%eax
call   1030 <mu_ismain@plt>
test   %rax,%rax
jne    113f <mu_exit+0xf>
pop    %rax
ret
xor    %eax,%eax
call   1050 <mu_final@plt>
mov    %eax,%edi
call   1040 <_exit@plt>

LLVM IR (-O0):
define void @mu_exit() {
%1 = call i64 (...) @mu_ismain()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = call i32 (...) @mu_final()
%5 = call i32 @_exit(i32 %4)
unreachable
6: ; preds = %0
ret void
}

LLVM IR (-O2):
define void @mu_exit() {
%1 = tail call i64 (...) @mu_ismain()
%2 = icmp eq i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i32 (...) @mu_final()
%5 = tail call i32 @_exit(i32 %4)
unreachable
6: ; preds = %0
ret void
}
int gt(double a, double b) {
  if (a > b)
    return 4;
  return 0;
}


x86 assembly (clang, -O0):
<gt>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    112a <gt+0x2a>
movl   $0x4,-0x4(%rbp)
jmp    1131 <gt+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gt>:
xor    %eax,%eax
ucomisd %xmm1,%xmm0
seta   %al
shl    $0x2,%eax
ret

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

LLVM IR (-O2):
define i32 @gt(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = select i1 %3, i32 4, i32 0
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
scalar_t__ SYS_write;
int /*<<< orphan*/ syscall(long, long, long, long);
ssize_t write(int fd, const void *buf, size_t count) {
  return syscall((long)SYS_write, (long)fd, (long)buf, (long)count);
}


x86 assembly (clang, -O0):
<write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%rdi
movslq -0x4(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    0x2ecb(%rip),%rax
mov    (%rax),%rax
movslq %edi,%rsi
mov    %rax,%rdi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@SYS_write = global i64 0
define i32 @write(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i64, i64* @SYS_write
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = load i8*, i8** %5
%11 = ptrtoint i8* %10 to i64
%12 = load i64, i64* %6
%13 = call i32 @syscall(i64 %7, i64 %9, i64 %11, i64 %12)
ret i32 %13
}

LLVM IR (-O2):
@SYS_write = global i64 0
define i32 @write(i32 %0, i8* %1, i64 %2) {
%4 = load i64, i64* @SYS_write
%5 = sext i32 %0 to i64
%6 = ptrtoint i8* %1 to i64
%7 = tail call i32 @syscall(i64 %4, i64 %5, i64 %6, i64 %2)
ret i32 %7
}
void gtk_text_iter_has_tag() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_iter_has_tag() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int lib_func(void) {
  printf("hello world from RTT::dynamic library!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [40 x i8] c"hello world from RTT::dynamic library!\0A\00"
define i32 @lib_func() {
%1 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [39 x i8] c"hello world from RTT::dynamic library!\00"
define i32 @lib_func() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ __printerr(int /*<<< orphan*/, char const *,
                              int /*<<< orphan*/);
void vwarnx(const char *fmt, va_list ap) { __printerr(0, fmt, ap); }


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

x86 assembly (clang, -O2):
<vwarnx>:
mov    %esi,%edx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <__printerr@plt>

LLVM IR (-O0):
define void @vwarnx(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 i32 @__printerr(i32 0, i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @vwarnx(i8* %0, i32 %1) {
%3 = tail call i32 @__printerr(i32 0, i8* %0, i32 %1)
ret void
}
int compare(const void *elem1, const void *elem2) {
  unsigned char *card1 = (unsigned char *)elem1;
  unsigned char *card2 = (unsigned char *)elem2;
  if (*card1 < *card2) {
    return -1;
  }
  if (*card2 < *card1) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movzbl (%rax),%eax
mov    -0x28(%rbp),%rcx
movzbl (%rcx),%ecx
cmp    %ecx,%eax
jge    113e <compare+0x3e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1167 <compare+0x67>
mov    -0x28(%rbp),%rax
movzbl (%rax),%eax
mov    -0x20(%rbp),%rcx
movzbl (%rcx),%ecx
cmp    %ecx,%eax
jge    1160 <compare+0x60>
movl   $0x1,-0x4(%rbp)
jmp    1167 <compare+0x67>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
mov    (%rdi),%al
mov    (%rsi),%cl
xor    %edx,%edx
cmp    %al,%cl
setb   %dl
mov    $0xffffffff,%eax
cmovbe %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp ult i8 %3, %4
%6 = icmp ult i8 %4, %3
%7 = zext i1 %6 to i32
%8 = select i1 %5, i32 -1, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ getRootWindowSize(unsigned int *, unsigned int *);
int get_screen_size_y() {
  unsigned int w, h;
  getRootWindowSize(&w, &h);
  return h;
}


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

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

LLVM IR (-O0):
define i32 @get_screen_size_y() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @getRootWindowSize(i32* %1, i32* %2)
%4 = load i32, i32* %2
ret i32 %4
}

LLVM IR (-O2):
define i32 @get_screen_size_y() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @getRootWindowSize(i32* %1, i32* %2)
%6 = load i32, i32* %2
ret i32 %6
}
/* Variables and functions */
unsigned long CANIntNumberGet(unsigned long);
int /*<<< orphan*/ IntDisable(unsigned long);
int /*<<< orphan*/ IntUnregister(unsigned long);
void CANIntUnregister(unsigned long ulBase) {
  unsigned long ulIntNumber;
  ;
  ulIntNumber = CANIntNumberGet(ulBase);
  IntDisable(ulIntNumber);
  IntUnregister(ulIntNumber);
}


x86 assembly (clang, -O0):
<CANIntUnregister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <CANIntNumberGet@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <IntDisable@plt>
mov    -0x10(%rbp),%rdi
call   1050 <IntUnregister@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CANIntUnregister>:
push   %rbx
call   1040 <CANIntNumberGet@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <IntDisable@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <IntUnregister@plt>

LLVM IR (-O0):
define void @CANIntUnregister(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i64 @CANIntNumberGet(i64 %4)
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = call i32 @IntDisable(i64 %6)
%8 = load i64, i64* %3
%9 = call i32 @IntUnregister(i64 %8)
ret void
}

LLVM IR (-O2):
define void @CANIntUnregister(i64 %0) {
%2 = tail call i64 @CANIntNumberGet(i64 %0)
%3 = tail call i32 @IntDisable(i64 %2)
%4 = tail call i32 @IntUnregister(i64 %2)
ret void
}
/* Variables and functions */
char *os_readfile(const char *name, size_t *len) { return (0); }


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

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

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

LLVM IR (-O2):
define noalias i8* @os_readfile(i8* nocapture readnone %0, i64* nocapture readnone %1) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
scalar_t__ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ stderr;
void die(const char *inform) {
  if (errno) {
    perror(inform);
  } else {
    fprintf(stderr, "%s\n", inform);
  }
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e95(%rip),%rax
cmpq   $0x0,(%rax)
je     115b <die+0x2b>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
jmp    1174 <die+0x44>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe91(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e55(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
mov    %rdi,%rdx
mov    0x2e9d(%rip),%rax
cmpq   $0x0,(%rax)
je     1157 <die+0x27>
mov    %rdx,%rdi
call   1040 <perror@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
lea    0xe99(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1149 <die+0x19>

LLVM IR (-O0):
@errno = global i64 0
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@EXIT_FAILURE = global i32 0
define void @die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i64, i64* @errno
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @perror(i8* %6)
br label %12
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %2
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %12
12: ; preds = %8, %5
%13 = load i32, i32* @EXIT_FAILURE
%14 = call i32 @exit(i32 %13)
unreachable
}

LLVM IR (-O2):
@errno = global i64 0
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@EXIT_FAILURE = global i32 0
define void @die(i8* %0) {
%2 = load i64, i64* @errno
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @perror(i8* %0)
br label %9
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %9
9: ; preds = %6, %4
%10 = load i32, i32* @EXIT_FAILURE
%11 = tail call i32 @exit(i32 %10)
unreachable
}
double celsius(double fahrenheit) { return 5.0 / 9.0 * (fahrenheit - 32); }


x86 assembly (clang, -O0):
<celsius>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  0xef2(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xede(%rip),%xmm0
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<celsius>:
addsd  0xef8(%rip),%xmm0
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @celsius(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double %3, 3.200000e+01
%5 = fmul double 0x3FE1C71C71C71C72, %4
ret double %5
}

LLVM IR (-O2):
define double @celsius(double %0) {
%2 = fadd double %0, -3.200000e+01
%3 = fmul double %2, 0x3FE1C71C71C71C72
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void banner(void) {
  fprintf(stdout, "=====================================\n"
                  "=                                   =\n"
                  "=    A simple console framework     =\n"
                  "=                                   =\n"
                  "=====================================\n");
}


x86 assembly (clang, -O0):
<banner>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<banner>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [191 x i8] c"=====================================\0A= =\0A= A simple console framework =\0A= =\0A=====================================\0A\00"
define void @banner() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([191 x i8], [191 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [191 x i8] c"=====================================\0A= =\0A= A simple console framework =\0A= =\0A=====================================\0A\00"
define void @banner() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([191 x i8], [191 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *getenv(char const *);
char *globus_libc_getenv(const char *name) { return getenv(name); }


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

x86 assembly (clang, -O2):
<globus_libc_getenv>:
jmp    1030 <getenv@plt>

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

LLVM IR (-O2):
define i8* @globus_libc_getenv(i8* nocapture %0) {
%2 = tail call i8* @getenv(i8* %0)
ret i8* %2
}
/* Variables and functions */
int M_PI;
scalar_t__ lroundf(float);
int kinematicsRadToStep(float rad) {
  return (int)lroundf(rad / (2. * M_PI) * 64. * (25792. / 405.));
}


x86 assembly (clang, -O0):
<kinematicsRadToStep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    0x2ebb(%rip),%rax
cvtsi2sdl (%rax),%xmm2
movsd  0xed7(%rip),%xmm1
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  0xebf(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeab(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <lroundf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kinematicsRadToStep>:
cvtss2sd %xmm0,%xmm0
mov    0x2ecd(%rip),%rax
cvtsi2sdl (%rax),%xmm1
addsd  %xmm1,%xmm1
divsd  %xmm1,%xmm0
mulsd  0xed1(%rip),%xmm0
mulsd  0xed1(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
jmp    1030 <lroundf@plt>

LLVM IR (-O0):
@M_PI = global i32 0
define i32 @kinematicsRadToStep(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = load i32, i32* @M_PI
%6 = sitofp i32 %5 to double
%7 = fmul double 2.000000e+00, %6
%8 = fdiv double %4, %7
%9 = fmul double %8, 6.400000e+01
%10 = fmul double %9, 0x404FD78BB19EA823
%11 = fptrunc double %10 to float
%12 = call i64 @lroundf(float %11)
%13 = trunc i64 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
@M_PI = global i32 0
define i32 @kinematicsRadToStep(float %0) {
%2 = fpext float %0 to double
%3 = load i32, i32* @M_PI
%4 = sitofp i32 %3 to double
%5 = fmul double %4, 2.000000e+00
%6 = fdiv double %2, %5
%7 = fmul double %6, 6.400000e+01
%8 = fmul double %7, 0x404FD78BB19EA823
%9 = fptrunc double %8 to float
%10 = tail call i64 @lroundf(float %9)
%11 = trunc i64 %10 to i32
ret i32 %11
}
/* Type definitions */
struct vtable {
  int dummy;
};

/* Variables and functions */
scalar_t__ calloc(int, int);
extern void *alloc(size_t size) {
  struct vtable **ppvt =
      (struct vtable **)calloc(1, sizeof(struct vtable *) + size);
  return (void *)(ppvt + 1);
}


x86 assembly (clang, -O0):
<alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %eax,%esi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc>:
push   %rax
lea    0x8(%rdi),%esi
mov    $0x1,%edi
call   1030 <calloc@plt>
add    $0x8,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.vtable = type { i32 }
define i8* @alloc(i64 %0) {
%2 = alloca i64
%3 = alloca %struct.vtable**
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = add i64 8, %4
%6 = trunc i64 %5 to i32
%7 = call i64 @calloc(i32 1, i32 %6)
%8 = inttoptr i64 %7 to %struct.vtable**
store %struct.vtable** %8, %struct.vtable*** %3
%9 = load %struct.vtable**, %struct.vtable*** %3
%10 = getelementptr inbounds %struct.vtable*, %struct.vtable** %9, i64 1
%11 = bitcast %struct.vtable** %10 to i8*
ret i8* %11
}

LLVM IR (-O2):
%struct.vtable = type { i32 }
define i8* @alloc(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = add i32 %2, 8
%4 = tail call i64 @calloc(i32 1, i32 %3)
%5 = inttoptr i64 %4 to %struct.vtable**
%6 = getelementptr inbounds %struct.vtable*, %struct.vtable** %5, i64 1
%7 = bitcast %struct.vtable** %6 to i8*
ret i8* %7
}
int ntohlp(unsigned char *ptr) {
  return (ptr[0] << 24) | (ptr[1] << 16) | (ptr[2] << 8) | ptr[3];
}


x86 assembly (clang, -O0):
<ntohlp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ntohlp>:
mov    (%rdi),%eax
bswap  %eax
ret

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

LLVM IR (-O2):
define i32 @ntohlp(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
uint64_t psector_Read_CustomerId(void) {
  uint64_t (*p_psector_Read_CustomerId)(void);
  p_psector_Read_CustomerId = (uint64_t(*)(void))0x030051ddU;
  return p_psector_Read_CustomerId();
}


x86 assembly (clang, -O0):
<psector_Read_CustomerId>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x30051dd,%eax
mov    %rax,-0x8(%rbp)
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psector_Read_CustomerId>:
mov    $0x30051dd,%eax
jmp    *%rax

LLVM IR (-O0):
define i32 @psector_Read_CustomerId() {
%1 = alloca i32 ()*
store i32 ()* inttoptr (i64 50352605 to i32 ()*), i32 ()** %1
%2 = load i32 ()*, i32 ()** %1
%3 = call i32 %2()
ret i32 %3
}

LLVM IR (-O2):
define i32 @psector_Read_CustomerId() {
%1 = tail call i32 inttoptr (i64 50352605 to i32 ()*)()
ret i32 %1
}
/* Variables and functions */
void *_xmalloc_xmalloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *xmalloc0(size_t size) {
  void *p;
  p = _xmalloc_xmalloc(size);
  if (p)
    memset(p, 0, size);
  return p;
}


x86 assembly (clang, -O0):
<xmalloc0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <_xmalloc_xmalloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1153 <xmalloc0+0x33>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc0>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <_xmalloc_xmalloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1141 <xmalloc0+0x21>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @xmalloc0(i64 %0) {
%2 = tail call i8* @_xmalloc_xmalloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
int /*<<< orphan*/ puts(char *);
int main(void) {
  char *p_error;
  int ndx;
  p_error = malloc(10);
  for (ndx = 0; ndx <= 10; ndx++) {
    p_error[ndx] = 'a';
  }
  p_error[10] = '\0';
  puts(p_error);
  free(p_error);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jg     1178 <main+0x48>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x61,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1154 <main+0x24>
mov    -0x10(%rbp),%rax
movb   $0x0,0xa(%rax)
mov    -0x10(%rbp),%rdi
call   1040 <puts@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xa,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
movabs $0x6161616161616161,%rax
61 61 61
mov    %rax,(%rbx)
movw   $0x6161,0x8(%rbx)
movb   $0x0,0xa(%rbx)
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call dereferenceable_or_null(10) i8* @malloc(i32 10)
%2 = getelementptr inbounds i8, i8* %1, i64 10
store i8 0, i8* %2
%3 = tail call i32 @puts(i8* dereferenceable(1) %1)
%4 = tail call i32 @free(i8* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int n, i;
  scanf("%d", &n);
  for (i = 1; i <= n; i++)
    printf("%d. I don't say swear words!\n", i);
  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>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     116f <main+0x4f>
mov    -0xc(%rbp),%esi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1146 <main+0x26>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
jle    1163 <main+0x43>
xor    %ebx,%ebx
lea    0xebe(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
cmp    0x4(%rsp),%ebx
jl     1150 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [30 x i8] c"%d. I don't say swear words!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
store i32 1, i32* %3
br label %5
5: ; preds = %12, %0
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = icmp sle i32 %6, %7
br i1 %8, label %9, label %15
9: ; preds = %5
%10 = load i32, i32* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %9
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %5
15: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [30 x i8] c"%d. I don't say swear words!\0A\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 = icmp slt i32 %4, 1
br i1 %5, label %12, label %6
6: ; preds = %0, %6
%7 = phi i32 [ %9, %6 ], [ 1, %0 ]
%8 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = add nuw nsw i32 %7, 1
%10 = load i32, i32* %1
%11 = icmp slt i32 %7, %10
br i1 %11, label %6, label %12
12: ; preds = %6, %0
ret i32 0
}
void process_drum_event(unsigned int pad_num) {}


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

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

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

LLVM IR (-O2):
define void @process_drum_event(i32 %0) {
ret void
}
/* Type definitions */
struct epoll_event {
  int dummy;
};
struct __kernel_timespec {
  int dummy;
};
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int syscall(int, int, struct epoll_event *, int,
            struct __kernel_timespec const *, int /*<<< orphan*/ const *,
            size_t);
int sys_epoll_pwait2(int fd, struct epoll_event *events, int maxevents,
                     const struct __kernel_timespec *timeout,
                     const sigset_t *sigset, size_t sigsetsize) {
  return syscall(-1, fd, events, maxevents, timeout, sigset, sigsetsize);
}


x86 assembly (clang, -O0):
<sys_epoll_pwait2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    -0x30(%rbp),%rax
mov    $0xffffffff,%edi
mov    %rax,(%rsp)
call   1030 <syscall@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_epoll_pwait2>:
push   %rax
mov    %r8,%rax
mov    %rcx,%r8
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    %r9,(%rsp)
mov    $0xffffffff,%edi
mov    %rax,%r9
call   1030 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.epoll_event = type { i32 }
%struct.__kernel_timespec = type { i32 }
define i32 @sys_epoll_pwait2(i32 %0, %struct.epoll_event* %1, i32 %2, %struct.__kernel_timespec* %3, i32* %4, i64 %5) {
%7 = alloca i32
%8 = alloca %struct.epoll_event*
%9 = alloca i32
%10 = alloca %struct.__kernel_timespec*
%11 = alloca i32*
%12 = alloca i64
store i32 %0, i32* %7
store %struct.epoll_event* %1, %struct.epoll_event** %8
store i32 %2, i32* %9
store %struct.__kernel_timespec* %3, %struct.__kernel_timespec** %10
store i32* %4, i32** %11
store i64 %5, i64* %12
%13 = load i32, i32* %7
%14 = load %struct.epoll_event*, %struct.epoll_event** %8
%15 = load i32, i32* %9
%16 = load %struct.__kernel_timespec*, %struct.__kernel_timespec** %10
%17 = load i32*, i32** %11
%18 = load i64, i64* %12
%19 = call i32 @syscall(i32 -1, i32 %13, %struct.epoll_event* %14, i32 %15, %struct.__kernel_timespec* %16, i32* %17, i64 %18)
ret i32 %19
}

LLVM IR (-O2):
%struct.epoll_event = type { i32 }
%struct.__kernel_timespec = type { i32 }
define i32 @sys_epoll_pwait2(i32 %0, %struct.epoll_event* %1, i32 %2, %struct.__kernel_timespec* %3, i32* %4, i64 %5) {
%7 = tail call i32 @syscall(i32 -1, i32 %0, %struct.epoll_event* %1, i32 %2, %struct.__kernel_timespec* %3, i32* %4, i64 %5)
ret i32 %7
}
/* Variables and functions */
void *get_object(char const *);
int /*<<< orphan*/ pd_bang(void *);
int libpd_bang(const char *recv) {
  void *obj = get_object(recv);
  if (obj == NULL)
    return -1;
  pd_bang(obj);
  return 0;
}


x86 assembly (clang, -O0):
<libpd_bang>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <get_object@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1150 <libpd_bang+0x30>
movl   $0xffffffff,-0x4(%rbp)
jmp    1160 <libpd_bang+0x40>
mov    -0x18(%rbp),%rdi
call   1030 <pd_bang@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libpd_bang>:
push   %rax
call   1040 <get_object@plt>
test   %rax,%rax
je     1137 <libpd_bang+0x17>
mov    %rax,%rdi
call   1030 <pd_bang@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @libpd_bang(i8* %0) {
%2 = tail call i8* @get_object(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @pd_bang(i8* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 0, %4 ], [ -1, %1 ]
ret i32 %7
}
char dj_start_mod(void) { return 0; }


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

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

LLVM IR (-O0):
define signext i8 @dj_start_mod() {
ret i8 0
}

LLVM IR (-O2):
define signext i8 @dj_start_mod() {
ret i8 0
}