xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ _write_uart(char const);
int write_console(const char *str, int length) {
  int i;
  for (i = 0; i < length; i++)
    _write_uart(str[i]);
  return 0;
}


x86 assembly (clang, -O0):
<write_console>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <write_console+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <_write_uart@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <write_console+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_console>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1143 <write_console+0x33>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%edi
call   1030 <_write_uart@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <write_console+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @write_console(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call i32 @_write_uart(i8 signext %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ TCIOFLUSH;
int tcflush(int, int /*<<< orphan*/);
int discard_fd(int fd) { return tcflush(fd, TCIOFLUSH); }


x86 assembly (clang, -O0):
<discard_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
call   1030 <tcflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<discard_fd>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <tcflush@plt>

LLVM IR (-O0):
@TCIOFLUSH = global i32 0
define i32 @discard_fd(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @TCIOFLUSH
%5 = call i32 @tcflush(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@TCIOFLUSH = global i32 0
define i32 @discard_fd(i32 %0) {
%2 = load i32, i32* @TCIOFLUSH
%3 = tail call i32 @tcflush(i32 %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
char *_utoa_n(int, char *, size_t, int);
char *_itoa_n(int value, char *str, size_t size, int base) {
  if (value < 0) {
    str = _utoa_n(-value, str, size, base);
    (*--str) = '-';
  } else {
    str = _utoa_n(value, str, size, base);
  }
  return str;
}


x86 assembly (clang, -O0):
<_itoa_n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1161 <_itoa_n+0x51>
xor    %edi,%edi
sub    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <_utoa_n@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x2d,-0x1(%rax)
jmp    1178 <_itoa_n+0x68>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <_utoa_n@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_itoa_n>:
test   %edi,%edi
js     1119 <_itoa_n+0x9>
jmp    1030 <_utoa_n@plt>
push   %rax
neg    %edi
call   1030 <_utoa_n@plt>
movb   $0x2d,-0x1(%rax)
add    $0xffffffffffffffff,%rax
pop    %rcx
ret

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

LLVM IR (-O2):
define i8* @_itoa_n(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = icmp slt i32 %0, 0
br i1 %5, label %6, label %10
6: ; preds = %4
%7 = sub nsw i32 0, %0
%8 = tail call i8* @_utoa_n(i32 %7, i8* %1, i64 %2, i32 %3)
%9 = getelementptr inbounds i8, i8* %8, i64 -1
store i8 45, i8* %9
br label %12
10: ; preds = %4
%11 = tail call i8* @_utoa_n(i32 %0, i8* %1, i64 %2, i32 %3)
br label %12
12: ; preds = %10, %6
%13 = phi i8* [ %9, %6 ], [ %11, %10 ]
ret i8* %13
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ _fail(char const *const, int const);
int /*<<< orphan*/ integer_not_in_range_display_error(int /*<<< orphan*/ const,
                                                      int /*<<< orphan*/ const,
                                                      int /*<<< orphan*/ const);
void _assert_not_in_range(const uint64_t value, const uint64_t minimum,
                          const uint64_t maximum, const char *const file,
                          const int line) {
  if (!integer_not_in_range_display_error(value, minimum, maximum)) {
    _fail(file, line);
  }
}


x86 assembly (clang, -O0):
<_assert_not_in_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <integer_not_in_range_display_error@plt>
cmp    $0x0,%eax
jne    115c <_assert_not_in_range+0x3c>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1040 <_fail@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_assert_not_in_range>:
push   %rbp
push   %rbx
push   %rax
mov    %r8d,%ebp
mov    %rcx,%rbx
call   1030 <integer_not_in_range_display_error@plt>
test   %eax,%eax
je     1139 <_assert_not_in_range+0x19>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <_fail@plt>

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

LLVM IR (-O2):
define void @_assert_not_in_range(i32 %0, i32 %1, i32 %2, i8* %3, i32 %4) {
%6 = tail call i32 @integer_not_in_range_display_error(i32 %0, i32 %1, i32 %2)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 @_fail(i8* %3, i32 %4)
br label %10
10: ; preds = %8, %5
ret void
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ lldb_enable_attach();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sleep(int);
int main(int argc, char const *argv[]) {
  lldb_enable_attach();
  printf("pid = %i\n", getpid());
  sleep(10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <lldb_enable_attach@plt>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xe93(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1060 <sleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <lldb_enable_attach@plt>
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xeaa(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1060 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"pid = %i\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @lldb_enable_attach()
%7 = call i32 (...) @getpid()
%8 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 @sleep(i32 10)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"pid = %i\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @lldb_enable_attach()
%4 = tail call i32 (...) @getpid()
%5 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = tail call i32 @sleep(i32 10)
ret i32 0
}
int transition_step(double n) {
  if (n < 0.5)
    return 0.0;
  else
    return 1.0;
}


x86 assembly (clang, -O0):
<transition_step>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  0xeef(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1128 <transition_step+0x28>
movl   $0x0,-0x4(%rbp)
jmp    112f <transition_step+0x2f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<transition_step>:
movsd  0xef8(%rip),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
setbe  %al
ret

LLVM IR (-O0):
define i32 @transition_step(double %0) {
%2 = alloca i32
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 5.000000e-01
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %8
7: ; preds = %1
store i32 1, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @transition_step(double %0) {
%2 = fcmp uge double %0, 5.000000e-01
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ quux();
void bar() { quux(); }


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

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

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

LLVM IR (-O2):
define void @bar() {
%1 = tail call i32 (...) @quux()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, char *);
void scan_data(char *c) { scanf("%c", c); }


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define void @scan_data(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @scanf(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"%c\00"
define void @scan_data(i8* %0) {
%2 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void main() {
  system("make -j8 -s");
  system("make modules_install -j8 ");
  system("make install -j8");
  system("shutdown -P now");
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <system@plt>
lea    0xee8(%rip),%rdi
call   1030 <system@plt>
lea    0xef6(%rip),%rdi
call   1030 <system@plt>
lea    0xefb(%rip),%rdi
pop    %rax
jmp    1030 <system@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"make -j8 -s\00"
@.str.1 = [26 x i8] c"make modules_install -j8 \00"
@.str.2 = [17 x i8] c"make install -j8\00"
@.str.3 = [16 x i8] c"shutdown -P now\00"
define void @main() {
%1 = call i32 @system(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @system(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @system(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @system(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"make -j8 -s\00"
@.str.1 = [26 x i8] c"make modules_install -j8 \00"
@.str.2 = [17 x i8] c"make install -j8\00"
@.str.3 = [16 x i8] c"shutdown -P now\00"
define void @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @system(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @system(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int do_mknod(char *, char *, char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  if (argc != 4) {
    printf("usage: mknod path modes devs\n");
    return 1;
  }
  return do_mknod(argv[1], argv[2], argv[3]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x4,-0x8(%rbp)
je     1158 <main+0x38>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1178 <main+0x58>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdx
call   1040 <do_mknod@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x4,%edi
jne    113b <main+0x1b>
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rax
mov    0x18(%rsi),%rdx
mov    %rax,%rsi
pop    %rax
jmp    1040 <do_mknod@plt>
lea    0xebe(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"usage: mknod path modes devs\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 4
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %21
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 2
%16 = load i8*, i8** %15
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 3
%19 = load i8*, i8** %18
%20 = call i32 @do_mknod(i8* %13, i8* %16, i8* %19)
store i32 %20, i32* %3
br label %21
21: ; preds = %10, %8
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
@str = [29 x i8] c"usage: mknod path modes devs\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 4
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
br label %14
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = getelementptr inbounds i8*, i8** %1, i64 2
%10 = load i8*, i8** %9
%11 = getelementptr inbounds i8*, i8** %1, i64 3
%12 = load i8*, i8** %11
%13 = tail call i32 @do_mknod(i8* %8, i8* %10, i8* %12)
br label %14
14: ; preds = %6, %4
%15 = phi i32 [ 1, %4 ], [ %13, %6 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ begin_scan();
int /*<<< orphan*/ gc();
void primitive_begin_scan_impl(void) {
  gc();
  begin_scan();
}


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

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

LLVM IR (-O0):
define void @primitive_begin_scan_impl() {
%1 = call i32 (...) @gc()
%2 = call i32 (...) @begin_scan()
ret void
}

LLVM IR (-O2):
define void @primitive_begin_scan_impl() {
%1 = tail call i32 (...) @gc()
%2 = tail call i32 (...) @begin_scan()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int sum(int, int, int, int, int, int);
int main(int argc, char *argv[]) { printf("%d\n", sum(5, 1, 2, 3, 4, 5)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x5,%r9d
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x4,%r8d
mov    %r9d,%edi
call   1040 <sum@plt>
mov    %eax,%esi
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x4,%r8d
mov    $0x5,%r9d
call   1040 <sum@plt>
lea    0xeb3(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @sum(i32 5, i32 1, i32 2, i32 3, i32 4, i32 5)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @sum(i32 5, i32 1, i32 2, i32 3, i32 4, i32 5)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ pound(float);
int main(void) {
  int times = 5;
  char ch = '!';
  float f = 6.0f;
  pound(times);
  pound(ch);
  pound(f);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movb   $0x21,-0x9(%rbp)
movl   $0x40c00000,-0x10(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
call   1030 <pound@plt>
movsbl -0x9(%rbp),%eax
cvtsi2ss %eax,%xmm0
call   1030 <pound@plt>
movss  -0x10(%rbp),%xmm0
call   1030 <pound@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movss  0xee7(%rip),%xmm0
call   1030 <pound@plt>
movss  0xede(%rip),%xmm0
call   1030 <pound@plt>
movss  0xed5(%rip),%xmm0
call   1030 <pound@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
%4 = alloca float
store i32 0, i32* %1
store i32 5, i32* %2
store i8 33, i8* %3
store float 6.000000e+00, float* %4
%5 = load i32, i32* %2
%6 = sitofp i32 %5 to float
%7 = call i32 @pound(float %6)
%8 = load i8, i8* %3
%9 = sitofp i8 %8 to float
%10 = call i32 @pound(float %9)
%11 = load float, float* %4
%12 = call i32 @pound(float %11)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @pound(float 5.000000e+00)
%2 = tail call i32 @pound(float 3.300000e+01)
%3 = tail call i32 @pound(float 6.000000e+00)
ret i32 0
}
void perform_task(int task_number) {}


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

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

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

LLVM IR (-O2):
define void @perform_task(i32 %0) {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void SSIEnable(uint32_t ui32Base) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000004))) |= 0x00000002;
}


x86 assembly (clang, -O0):
<SSIEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x4,%eax
cltq
mov    (%rax),%ecx
or     $0x2,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SSIEnable>:
movslq %edi,%rax
orl    $0x2,0x4(%rax)
ret

LLVM IR (-O0):
define void @SSIEnable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 4
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = or i32 %7, 2
store volatile i32 %8, i32* %6
ret void
}

LLVM IR (-O2):
define void @SSIEnable(i32 %0) {
%2 = add nsw i32 %0, 4
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = or i32 %5, 2
store volatile i32 %6, i32* %4
ret void
}
/* Variables and functions */
unsigned int exynos_5410_gpio_read(unsigned int);
int /*<<< orphan*/ exynos_5410_gpio_write_mask(unsigned int, unsigned int,
                                               unsigned int);
void odroid_xu_gpio_toggle_21() {
  unsigned int bank_offset = 0x0C40;
  unsigned int bit_index = 5;
  unsigned int d = exynos_5410_gpio_read(bank_offset);
  d ^= (1U << bit_index);
  exynos_5410_gpio_write_mask(bank_offset, d, (1U << bit_index));
}


x86 assembly (clang, -O0):
<odroid_xu_gpio_toggle_21>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xc40,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <exynos_5410_gpio_read@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
call   1030 <exynos_5410_gpio_write_mask@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<odroid_xu_gpio_toggle_21>:
push   %rax
mov    $0xc40,%edi
call   1040 <exynos_5410_gpio_read@plt>
xor    $0x20,%eax
mov    $0xc40,%edi
mov    %eax,%esi
mov    $0x20,%edx
pop    %rax
jmp    1030 <exynos_5410_gpio_write_mask@plt>

LLVM IR (-O0):
define void @odroid_xu_gpio_toggle_21() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 3136, i32* %1
store i32 5, i32* %2
%4 = load i32, i32* %1
%5 = call i32 @exynos_5410_gpio_read(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = shl i32 1, %6
%8 = load i32, i32* %3
%9 = xor i32 %8, %7
store i32 %9, i32* %3
%10 = load i32, i32* %1
%11 = load i32, i32* %3
%12 = load i32, i32* %2
%13 = shl i32 1, %12
%14 = call i32 @exynos_5410_gpio_write_mask(i32 %10, i32 %11, i32 %13)
ret void
}

LLVM IR (-O2):
define void @odroid_xu_gpio_toggle_21() {
%1 = tail call i32 @exynos_5410_gpio_read(i32 3136)
%2 = xor i32 %1, 32
%3 = tail call i32 @exynos_5410_gpio_write_mask(i32 3136, i32 %2, i32 32)
ret void
}
unsigned char crc_calc(const unsigned char *b) {
  unsigned char sum = 0;
  int i;
  for (i = 0; i < 127; i++)
    sum += b[i];
  return 256 - sum;
}


x86 assembly (clang, -O0):
<crc_calc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movb   $0x0,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x7f,-0x10(%rbp)
jge    1140 <crc_calc+0x40>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movzbl (%rax,%rcx,1),%ecx
movzbl -0x9(%rbp),%eax
add    %ecx,%eax
mov    %al,-0x9(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1113 <crc_calc+0x13>
movzbl -0x9(%rbp),%ecx
mov    $0x100,%eax
sub    %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc_calc>:
xor    %eax,%eax
mov    $0x3,%ecx
nopw   0x0(%rax,%rax,1)
movzbl -0x3(%rdi,%rcx,1),%edx
add    %eax,%edx
movzbl -0x2(%rdi,%rcx,1),%eax
add    %edx,%eax
movzbl %al,%edx
movzbl -0x1(%rdi,%rcx,1),%eax
add    %edx,%eax
cmp    $0x7f,%rcx
je     113d <crc_calc+0x3d>
movzbl (%rdi,%rcx,1),%edx
add    %edx,%eax
movzbl %al,%eax
add    $0x4,%rcx
jmp    1110 <crc_calc+0x10>
neg    %al
ret

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

LLVM IR (-O2):
define zeroext i8 @crc_calc(i8* nocapture %0) {
br label %2
2: ; preds = %22, %1
%3 = phi i64 [ 0, %1 ], [ %27, %22 ]
%4 = phi i32 [ 0, %1 ], [ %28, %22 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %3
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = add nuw nsw i32 %4, %7
%9 = or i64 %3, 1
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = add nuw nsw i32 %8, %12
%14 = or i64 %3, 2
%15 = and i32 %13, 255
%16 = getelementptr inbounds i8, i8* %0, i64 %14
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = add nuw nsw i32 %15, %18
%20 = or i64 %3, 3
%21 = icmp eq i64 %20, 127
br i1 %21, label %29, label %22
22: ; preds = %2
%23 = getelementptr inbounds i8, i8* %0, i64 %20
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = add nuw nsw i32 %19, %25
%27 = add nuw nsw i64 %3, 4
%28 = and i32 %26, 255
br label %2
29: ; preds = %2
%30 = trunc i32 %19 to i8
%31 = sub i8 0, %30
ret i8 %31
}
/* Variables and functions */
scalar_t__ MAP_FAILED;
int /*<<< orphan*/ MAP_SHARED;
int /*<<< orphan*/ PROT_READ;
scalar_t__ mmap(int /*<<< orphan*/ *, int, int /*<<< orphan*/,
                int /*<<< orphan*/, int, int /*<<< orphan*/);
int main(void) {
  return mmap(NULL, 1, PROT_READ, MAP_SHARED, -1, 0) != MAP_FAILED;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ed2(%rip),%rax
mov    (%rax),%edx
mov    0x2eb9(%rip),%rax
mov    (%rax),%ecx
xor    %eax,%eax
mov    %eax,%edi
mov    $0x1,%esi
mov    $0xffffffff,%r8d
xor    %r9d,%r9d
call   1030 <mmap@plt>
mov    0x2e81(%rip),%rcx
cmp    (%rcx),%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ee0(%rip),%rax
mov    (%rax),%edx
mov    0x2ec7(%rip),%rax
mov    (%rax),%ecx
xor    %edi,%edi
mov    $0x1,%esi
mov    $0xffffffff,%r8d
xor    %r9d,%r9d
call   1030 <mmap@plt>
mov    0x2e91(%rip),%rdx
xor    %ecx,%ecx
cmp    (%rdx),%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@PROT_READ = global i32 0
@MAP_SHARED = global i32 0
@MAP_FAILED = global i64 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @PROT_READ
%3 = load i32, i32* @MAP_SHARED
%4 = call i64 @mmap(i32* null, i32 1, i32 %2, i32 %3, i32 -1, i32 0)
%5 = load i64, i64* @MAP_FAILED
%6 = icmp ne i64 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
@PROT_READ = global i32 0
@MAP_SHARED = global i32 0
@MAP_FAILED = global i64 0
define i32 @main() {
%1 = load i32, i32* @PROT_READ
%2 = load i32, i32* @MAP_SHARED
%3 = tail call i64 @mmap(i32* null, i32 1, i32 %1, i32 %2, i32 -1, i32 0)
%4 = load i64, i64* @MAP_FAILED
%5 = icmp ne i64 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
const char *TF(int bit) { return bit ? "true" : "false"; }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"true\00"
@.str.1 = [6 x i8] c"false\00"
define i8* @TF(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 ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0)
ret i8* %6
}

LLVM IR (-O2):
@.str = [5 x i8] c"true\00"
@.str.1 = [6 x i8] c"false\00"
define i8* @TF(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
int((facility_ind_receive))(struct ss7 *ss7, struct isup_call *c,
                            int messagetype, unsigned char *parm, int len) {
  return 1;
}


x86 assembly (clang, -O0):
<facility_ind_receive>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.ss7 = type opaque
%struct.isup_call = type opaque
define i32 @facility_ind_receive(%struct.ss7* %0, %struct.isup_call* %1, i32 %2, i8* %3, i32 %4) {
%6 = alloca %struct.ss7*
%7 = alloca %struct.isup_call*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
store %struct.ss7* %0, %struct.ss7** %6
store %struct.isup_call* %1, %struct.isup_call** %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i32 %4, i32* %10
ret i32 1
}

LLVM IR (-O2):
%struct.ss7 = type opaque
%struct.isup_call = type opaque
define i32 @facility_ind_receive(%struct.ss7* nocapture readnone %0, %struct.isup_call* nocapture readnone %1, i32 %2, i8* nocapture readnone %3, i32 %4) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ deal_card(int /*<<< orphan*/);
scalar_t__ dealer_needs_more_points();
int /*<<< orphan*/ getDealer();
void playDealersTurn() {
  while (dealer_needs_more_points()) {
    deal_card(getDealer());
  }
}


x86 assembly (clang, -O0):
<playDealersTurn>:
push   %rbp
mov    %rsp,%rbp
jmp    1139 <playDealersTurn+0x9>
mov    $0x0,%al
call   1040 <dealer_needs_more_points@plt>
cmp    $0x0,%rax
je     115d <playDealersTurn+0x2d>
mov    $0x0,%al
call   1030 <getDealer@plt>
mov    %eax,%edi
call   1050 <deal_card@plt>
jmp    1139 <playDealersTurn+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<playDealersTurn>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <dealer_needs_more_points@plt>
test   %rax,%rax
je     115c <playDealersTurn+0x2c>
xor    %eax,%eax
call   1030 <getDealer@plt>
mov    %eax,%edi
call   1050 <deal_card@plt>
jmp    1140 <playDealersTurn+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @playDealersTurn() {
br label %1
1: ; preds = %4, %0
%2 = call i64 (...) @dealer_needs_more_points()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = call i32 (...) @getDealer()
%6 = call i32 @deal_card(i32 %5)
br label %1
7: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @playDealersTurn() {
%1 = tail call i64 (...) @dealer_needs_more_points()
%2 = icmp eq i64 %1, 0
br i1 %2, label %8, label %3
3: ; preds = %0, %3
%4 = tail call i32 (...) @getDealer()
%5 = tail call i32 @deal_card(i32 %4)
%6 = tail call i64 (...) @dealer_needs_more_points()
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_num(int n) { printf("%d\n", n); }


x86 assembly (clang, -O0):
<print_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_num>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @print_num(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
int is_kernel(x)
int x;
{
  if ((x / 20000000) == 10)
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<is_kernel>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x1312d00,%ecx
cltd
idiv   %ecx
cmp    $0xa,%eax
jne    1127 <is_kernel+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <is_kernel+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_kernel>:
add    $0xf4143e00,%edi
xor    %eax,%eax
cmp    $0x1312d00,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @is_kernel(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = sdiv i32 %4, 20000000
%6 = icmp eq i32 %5, 10
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @is_kernel(i32 %0) {
%2 = add i32 %0, -200000000
%3 = icmp ult i32 %2, 20000000
%4 = zext i1 %3 to i32
ret i32 %4
}
unsigned xrop3_200_0_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D | T;
  stk1 = S & stk2;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
or     $0xff,%eax
xor    %esi,%eax
and    %ecx,%eax
xor    %esi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_200_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %7
%24 = or i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %6
%26 = load i32, i32* %9
%27 = and i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = load i32, i32* %6
%30 = and i32 %28, %29
%31 = load i32, i32* %8
%32 = load i32, i32* %7
%33 = xor i32 %32, -1
%34 = and i32 %31, %33
%35 = or i32 %30, %34
%36 = load i32, i32* %7
%37 = load i32, i32* %6
%38 = xor i32 %37, -1
%39 = and i32 %36, %38
%40 = load i32, i32* %5
%41 = and i32 %39, %40
%42 = or i32 %35, %41
ret i32 %42
}

LLVM IR (-O2):
define i32 @xrop3_200_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = shl nuw nsw i32 %5, 8
%7 = or i32 %6, 255
%8 = and i32 %7, %4
%9 = xor i32 %4, -1
%10 = and i32 %9, %5
%11 = or i32 %8, %10
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int /*<<< orphan*/ umask(int /*<<< orphan*/);
mode_t posix_umask(mode_t mask) { return umask(mask); }


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

x86 assembly (clang, -O2):
<posix_umask>:
jmp    1030 <umask@plt>

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

LLVM IR (-O2):
define i32 @posix_umask(i32 %0) {
%2 = tail call i32 @umask(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
void *malloc(int);
void *xmalloc(size_t size) {
  void *ret = malloc(size);
  if (!ret && !size)
    ret = malloc(1);
  if (!ret)
    die("Out of memory");
  return ret;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115f <xmalloc+0x3f>
cmpq   $0x0,-0x8(%rbp)
jne    115f <xmalloc+0x3f>
mov    $0x1,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1176 <xmalloc+0x56>
lea    0xe8f(%rip),%rdi
call   1040 <die@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <malloc@plt>
mov    %rax,%r14
test   %rbx,%rbx
jne    1146 <xmalloc+0x26>
test   %r14,%r14
jne    1146 <xmalloc+0x26>
mov    $0x1,%edi
call   1030 <malloc@plt>
mov    %rax,%r14
test   %r14,%r14
jne    1157 <xmalloc+0x37>
lea    0xeae(%rip),%rdi
call   1040 <die@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Out of memory\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = trunc i64 %4 to i32
%6 = call i8* @malloc(i32 %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %14, label %9
9: ; preds = %1
%10 = load i64, i64* %2
%11 = icmp ne i64 %10, 0
br i1 %11, label %14, label %12
12: ; preds = %9
%13 = call i8* @malloc(i32 1)
store i8* %13, i8** %3
br label %14
14: ; preds = %12, %9, %1
%15 = load i8*, i8** %3
%16 = icmp ne i8* %15, null
br i1 %16, label %19, label %17
17: ; preds = %14
%18 = call i32 @die(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %19
19: ; preds = %17, %14
%20 = load i8*, i8** %3
ret i8* %20
}

LLVM IR (-O2):
@.str = [14 x i8] c"Out of memory\00"
define i8* @xmalloc(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = tail call i8* @malloc(i32 %2)
%4 = icmp ne i8* %3, null
%5 = icmp ne i64 %0, 0
%6 = or i1 %5, %4
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call dereferenceable_or_null(1) i8* @malloc(i32 1)
br label %9
9: ; preds = %7, %1
%10 = phi i8* [ %3, %1 ], [ %8, %7 ]
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = tail call i32 @die(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %12, %9
ret i8* %10
}
int fftss_init_threads(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @fftss_init_threads() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ srand(int);
void bpnn_initialize(int seed) {
  printf("Random number generator seed: %d\n", seed);
  srand(seed);
}


x86 assembly (clang, -O0):
<bpnn_initialize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <srand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bpnn_initialize>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <srand@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"Random number generator seed: %d\0A\00"
define void @bpnn_initialize(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @srand(i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"Random number generator seed: %d\0A\00"
define void @bpnn_initialize(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @srand(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int getpagesize();
int /*<<< orphan*/ stderr;
void check_pagesize(void) {
  if (getpagesize() != 4096)
    fprintf(stderr, "The page size is %d.  Must be 4096.", getpagesize());
}


x86 assembly (clang, -O0):
<check_pagesize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getpagesize@plt>
cmp    $0x1000,%eax
je     115e <check_pagesize+0x3e>
mov    0x2e9f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getpagesize@plt>
mov    -0x4(%rbp),%edi
mov    %eax,%edx
lea    0xea7(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_pagesize>:
push   %rbx
xor    %eax,%eax
call   1040 <getpagesize@plt>
cmp    $0x1000,%eax
jne    1131 <check_pagesize+0x11>
pop    %rbx
ret
mov    0x2ea8(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1040 <getpagesize@plt>
lea    0xeb8(%rip),%rsi
mov    %ebx,%edi
mov    %eax,%edx
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [36 x i8] c"The page size is %d. Must be 4096.\00"
define void @check_pagesize() {
%1 = call i32 (...) @getpagesize()
%2 = icmp ne i32 %1, 4096
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = load i32, i32* @stderr
%5 = call i32 (...) @getpagesize()
%6 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %5)
br label %7
7: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [36 x i8] c"The page size is %d. Must be 4096.\00"
define void @check_pagesize() {
%1 = tail call i32 (...) @getpagesize()
%2 = icmp eq i32 %1, 4096
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = load i32, i32* @stderr
%5 = tail call i32 (...) @getpagesize()
%6 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %5)
br label %7
7: ; preds = %3, %0
ret void
}
double dAUX2bp0b(double x) { return 0.0; }


x86 assembly (clang, -O0):
<dAUX2bp0b>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dAUX2bp0b>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @dAUX2bp0b(double %0) {
%2 = alloca double
store double %0, double* %2
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @dAUX2bp0b(double %0) {
ret double 0.000000e+00
}
/* Type definitions */
struct termios {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fileno(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ tcgetattr(int /*<<< orphan*/, struct termios *);
void BarTermSave(struct termios *termOrig) {
  tcgetattr(fileno(stdin), termOrig);
}


x86 assembly (clang, -O0):
<BarTermSave>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1030 <fileno@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
call   1040 <tcgetattr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BarTermSave>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
call   1030 <fileno@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <tcgetattr@plt>

LLVM IR (-O0):
%struct.termios = type { i32 }
@stdin = global i32 0
define void @BarTermSave(%struct.termios* %0) {
%2 = alloca %struct.termios*
store %struct.termios* %0, %struct.termios** %2
%3 = load i32, i32* @stdin
%4 = call i32 @fileno(i32 %3)
%5 = load %struct.termios*, %struct.termios** %2
%6 = call i32 @tcgetattr(i32 %4, %struct.termios* %5)
ret void
}

LLVM IR (-O2):
%struct.termios = type { i32 }
@stdin = global i32 0
define void @BarTermSave(%struct.termios* %0) {
%2 = load i32, i32* @stdin
%3 = tail call i32 @fileno(i32 %2)
%4 = tail call i32 @tcgetattr(i32 %3, %struct.termios* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ p();
int /*<<< orphan*/ printf(char *);
int main(void) {
  int input = 0;
  printf(
      "Input an integer=================================================:\n");
  p();
  printf(
      "helloworld==========================================================\n");
  p();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xec3(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <p@plt>
lea    0xef4(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <p@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [68 x i8] c"Input an integer=================================================:\0A\00"
@.str.1 = [70 x i8] c"helloworld==========================================================\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @p()
%5 = call i32 @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (...) @p()
ret i32 0
}

LLVM IR (-O2):
@str = [67 x i8] c"Input an integer=================================================:\00"
@str.2 = [69 x i8] c"helloworld==========================================================\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([67 x i8], [67 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @p()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([69 x i8], [69 x i8]* @str.2, i64 0, i64 0))
%4 = tail call i32 (...) @p()
ret i32 0
}