xunge/DecIR huggingface dataset:
/* Variables and functions */
double floor(double);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, double *);
int main() {
  double a;
  printf("Input a real number:");
  scanf("%lf", &a);
  printf("\tInteger:%f\n", floor(a));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec1(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
call   1050 <floor@plt>
lea    0xeab(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm0
call   1050 <floor@plt>
lea    0xeba(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Input a real number:\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [13 x i8] c"\09Integer:%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%5 = load double, double* %2
%6 = call double @llvm.floor.f64(double %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), double %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"Input a real number:\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [13 x i8] c"\09Integer:%f\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%5 = load double, double* %1
%6 = call double @llvm.floor.f64(double %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), double %6)
ret i32 0
}
/* Variables and functions */
int strlen(char *);
char *strncsrch(char const *, char const *, int);
char *strcsrch(const char *s1, const char *s2) {
  int ls1;
  ls1 = strlen((char *)s1);
  return (strncsrch(s1, s2, ls1));
}


x86 assembly (clang, -O0):
<strcsrch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <strncsrch@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcsrch>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <strncsrch@plt>

LLVM IR (-O0):
define i8* @strcsrch(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %5
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = call i8* @strncsrch(i8* %8, i8* %9, i32 %10)
ret i8* %11
}

LLVM IR (-O2):
define i8* @strcsrch(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i8* @strncsrch(i8* %0, i8* %1, i32 %3)
ret i8* %4
}
int msm_fsusb_reset_phy(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @msm_fsusb_reset_phy() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr,
          "usage: unifdef [-cdeklst] [-o output]"
          " [-Dsym[=val]] [-Usym] [-iDsym[=val]] [-iUsym] ... [file]\n");
  exit(2);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [96 x i8] c"usage: unifdef [-cdeklst] [-o output] [-Dsym[=val]] [-Usym] [-iDsym[=val]] [-iUsym] ... [file]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([96 x i8], [96 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [96 x i8] c"usage: unifdef [-cdeklst] [-o output] [-Dsym[=val]] [-Usym] [-iDsym[=val]] [-iUsym] ... [file]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([96 x i8], [96 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 2)
unreachable
}
void testIndexOverflow64() {
  char arr[0x100000000];
  char *ptr = arr + (~0u) / 2;
  ptr += 2;
  *ptr = 42;
}


x86 assembly (clang, -O0):
<testIndexOverflow64>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffff90,%eax
sub    %rax,%rsp
mov    %rbp,%rax
add    $0x7fffffff,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x2a,(%rax)
add    $0x7fffffff,%rsp
add    $0x7fffff91,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @testIndexOverflow64() {
%1 = alloca [4294967296 x i8]
%2 = alloca i8*
%3 = getelementptr inbounds [4294967296 x i8], [4294967296 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds i8, i8* %3, i64 2147483647
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 2
store i8* %6, i8** %2
%7 = load i8*, i8** %2
store i8 42, i8* %7
ret void
}

LLVM IR (-O2):
define void @testIndexOverflow64() {
ret void
}
/* Variables and functions */
int EXIT_FAILURE;
int /*<<< orphan*/ free(int *);
int /*<<< orphan*/ printf(char *);
int arrayCleaner(int **arr) {
  if (*arr == NULL) {
    printf("Error: cannot free memory allocated for array entry. Array is "
           "either null or in incorrect format.\n");
    return EXIT_FAILURE;
  }
  free(*arr);
  return 1;
}


x86 assembly (clang, -O0):
<arrayCleaner>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1157 <arrayCleaner+0x37>
lea    0xebf(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    116a <arrayCleaner+0x4a>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arrayCleaner>:
push   %rax
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1135 <arrayCleaner+0x15>
call   1030 <free@plt>
mov    $0x1,%eax
pop    %rcx
ret
lea    0xec4(%rip),%rdi
call   1040 <puts@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [99 x i8] c"Error: cannot free memory allocated for array entry. Array is either null or in incorrect format.\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @arrayCleaner(i32** %0) {
%2 = alloca i32
%3 = alloca i32**
store i32** %0, i32*** %3
%4 = load i32**, i32*** %3
%5 = load i32*, i32** %4
%6 = icmp eq i32* %5, null
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = call i32 @printf(i8* getelementptr inbounds ([99 x i8], [99 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* @EXIT_FAILURE
store i32 %9, i32* %2
br label %14
10: ; preds = %1
%11 = load i32**, i32*** %3
%12 = load i32*, i32** %11
%13 = call i32 @free(i32* %12)
store i32 1, i32* %2
br label %14
14: ; preds = %10, %7
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@str = [98 x i8] c"Error: cannot free memory allocated for array entry. Array is either null or in incorrect format.\00"
define i32 @arrayCleaner(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([98 x i8], [98 x i8]* @str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
br label %9
7: ; preds = %1
%8 = tail call i32 @free(i32* %2)
br label %9
9: ; preds = %7, %4
%10 = phi i32 [ %6, %4 ], [ 1, %7 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ tlStringUnload(unsigned int);
void tlStringsUnload(unsigned int n, unsigned int *strings) {
  unsigned int i;
  for (i = 0; i < n; i++)
    tlStringUnload(strings[i]);
}


x86 assembly (clang, -O0):
<tlStringsUnload>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    114f <tlStringsUnload+0x3f>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    (%rax,%rcx,4),%edi
call   1030 <tlStringUnload@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <tlStringsUnload+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tlStringsUnload>:
push   %r15
push   %r14
push   %rbx
test   %edi,%edi
je     1142 <tlStringsUnload+0x32>
mov    %rsi,%r14
mov    %edi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,4),%edi
call   1030 <tlStringUnload@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <tlStringsUnload+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @tlStringsUnload(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
store i32 %0, i32* %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* %3
%9 = icmp ult i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %4
%12 = load i32, i32* %5
%13 = zext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 @tlStringUnload(i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @tlStringsUnload(i32 %0, i32* nocapture %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %13, label %4
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %1, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @tlStringUnload(i32 %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 void
}
void U_EMRREALIZEPALETTE_print(const char *contents) { (void)(contents); }


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

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

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

LLVM IR (-O2):
define void @U_EMRREALIZEPALETTE_print(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, char *);
int /*<<< orphan*/ stderr;
char *strerror(int);
void xAbort(int r, const char *function) {
  fprintf(stderr, "System error: %s failed (%s)\n", function, strerror(r));
  abort();
}


x86 assembly (clang, -O0):
<xAbort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <strerror@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rdx
mov    %rax,%rcx
lea    0xe94(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<xAbort>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    0x2ea3(%rip),%rax
mov    (%rax),%ebp
call   1050 <strerror@plt>
lea    0xeb5(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [30 x i8] c"System error: %s failed (%s)\0A\00"
define void @xAbort(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %4
%7 = load i32, i32* %3
%8 = call i8* @strerror(i32 %7)
%9 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %8)
%10 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [30 x i8] c"System error: %s failed (%s)\0A\00"
define void @xAbort(i32 %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i8* @strerror(i32 %0)
%5 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %4)
%6 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ link_failure_nexttowardl();
scalar_t__ nexttowardl(long double, long double);
void test_nexttowardl(long double ld, long double x) {
  if (nexttowardl(ld, x) != nexttowardl(ld, x))
    link_failure_nexttowardl();
}


x86 assembly (clang, -O0):
<test_nexttowardl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <nexttowardl@plt>
mov    %rax,-0x28(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <nexttowardl@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
cmp    %rcx,%rax
je     1175 <test_nexttowardl+0x55>
mov    $0x0,%al
call   1040 <link_failure_nexttowardl@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_nexttowardl>:
push   %rbx
sub    $0x40,%rsp
fldt   0x50(%rsp)
fld    %st(0)
fstpt  0x34(%rsp)
fldt   0x60(%rsp)
fld    %st(0)
fstpt  0x28(%rsp)
fstpt  0x10(%rsp)
fstpt  (%rsp)
call   1030 <nexttowardl@plt>
mov    %rax,%rbx
fldt   0x28(%rsp)
fstpt  0x10(%rsp)
fldt   0x34(%rsp)
fstpt  (%rsp)
call   1030 <nexttowardl@plt>
cmp    %rax,%rbx
jne    1167 <test_nexttowardl+0x47>
add    $0x40,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
jmp    1040 <link_failure_nexttowardl@plt>

LLVM IR (-O0):
define void @test_nexttowardl(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %4
%7 = call i64 @nexttowardl(x86_fp80 %5, x86_fp80 %6)
%8 = load x86_fp80, x86_fp80* %3
%9 = load x86_fp80, x86_fp80* %4
%10 = call i64 @nexttowardl(x86_fp80 %8, x86_fp80 %9)
%11 = icmp ne i64 %7, %10
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 (...) @link_failure_nexttowardl()
br label %14
14: ; preds = %12, %2
ret void
}

LLVM IR (-O2):
define void @test_nexttowardl(x86_fp80 %0, x86_fp80 %1) {
%3 = tail call i64 @nexttowardl(x86_fp80 %0, x86_fp80 %1)
%4 = tail call i64 @nexttowardl(x86_fp80 %0, x86_fp80 %1)
%5 = icmp eq i64 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 (...) @link_failure_nexttowardl()
br label %8
8: ; preds = %6, %2
ret void
}
/* Type definitions */
struct tree {
  int dummy;
};

/* Variables and functions */
double calc_tree(struct tree *);
double op_add(struct tree *left, struct tree *right) {
  return calc_tree(left) + calc_tree(right);
}


x86 assembly (clang, -O0):
<op_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <calc_tree@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <calc_tree@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_add>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
call   1030 <calc_tree@plt>
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
call   1030 <calc_tree@plt>
addsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tree = type { i32 }
define double @op_add(%struct.tree* %0, %struct.tree* %1) {
%3 = alloca %struct.tree*
%4 = alloca %struct.tree*
store %struct.tree* %0, %struct.tree** %3
store %struct.tree* %1, %struct.tree** %4
%5 = load %struct.tree*, %struct.tree** %3
%6 = call double @calc_tree(%struct.tree* %5)
%7 = load %struct.tree*, %struct.tree** %4
%8 = call double @calc_tree(%struct.tree* %7)
%9 = fadd double %6, %8
ret double %9
}

LLVM IR (-O2):
%struct.tree = type { i32 }
define double @op_add(%struct.tree* %0, %struct.tree* %1) {
%3 = tail call double @calc_tree(%struct.tree* %0)
%4 = tail call double @calc_tree(%struct.tree* %1)
%5 = fadd double %3, %4
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ put_quote_char(char, char);
void put_quote_str(char q, char *str) {
  char c;
  while ((c = *str++) != '\0')
    put_quote_char(q, c);
}


x86 assembly (clang, -O0):
<put_quote_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x11(%rbp)
movsbl %al,%eax
cmp    $0x0,%eax
je     1156 <put_quote_str+0x46>
mov    -0x1(%rbp),%al
movsbl %al,%edi
movsbl -0x11(%rbp),%esi
call   1030 <put_quote_char@plt>
jmp    1122 <put_quote_str+0x12>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_quote_str>:
push   %rbp
push   %rbx
push   %rax
mov    (%rsi),%al
test   %al,%al
je     1145 <put_quote_str+0x35>
mov    %rsi,%rbx
add    $0x1,%rbx
movsbl %dil,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl %al,%esi
mov    %ebp,%edi
call   1030 <put_quote_char@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <put_quote_str+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @put_quote_str(i8 signext %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %10, %5 ], [ %3, %2 ]
%7 = phi i8* [ %8, %5 ], [ %1, %2 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = tail call i32 @put_quote_char(i8 signext %0, i8 signext %6)
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint32_t;

/* Variables and functions */
uint32_t HostToLittleEndian32(const uint32_t In) { return In; }


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

x86 assembly (clang, -O2):
<HostToLittleEndian32>:
mov    %edi,%eax
ret

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

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

/* Variables and functions */
int /*<<< orphan*/ *fgets(unsigned char *, int, int /*<<< orphan*/ *);
int strlen(unsigned char *);
int get_line(unsigned char line[1000], int max, FILE *infile) {
  if (fgets(line, max, infile) == NULL)
    return 0;
  else
    return strlen(line);
}


x86 assembly (clang, -O0):
<get_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
call   1040 <fgets@plt>
cmp    $0x0,%rax
jne    1159 <get_line+0x39>
movl   $0x0,-0x4(%rbp)
jmp    1165 <get_line+0x45>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_line>:
push   %rbx
mov    %rdi,%rbx
call   1040 <fgets@plt>
test   %rax,%rax
je     1137 <get_line+0x17>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <strlen@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @get_line(i8* %0, i32 %1, i32* nocapture %2) {
%4 = tail call i32* @fgets(i8* %0, i32 %1, i32* %2)
%5 = icmp eq i32* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @strlen(i8* %0)
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ %7, %6 ], [ 0, %3 ]
ret i32 %9
}
/* Type definitions */
struct fopen_obj {
  int dummy;
};

/* Variables and functions */
int fopen__setup(struct fopen_obj *, char *, char);
int setup(struct fopen_obj *f, char *file_path, char mode) {
  return fopen__setup(f, file_path, mode);
}


x86 assembly (clang, -O0):
<setup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movsbl -0x11(%rbp),%edx
call   1030 <fopen__setup@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup>:
jmp    1030 <fopen__setup@plt>

LLVM IR (-O0):
%struct.fopen_obj = type { i32 }
define i32 @setup(%struct.fopen_obj* %0, i8* %1, i8 signext %2) {
%4 = alloca %struct.fopen_obj*
%5 = alloca i8*
%6 = alloca i8
store %struct.fopen_obj* %0, %struct.fopen_obj** %4
store i8* %1, i8** %5
store i8 %2, i8* %6
%7 = load %struct.fopen_obj*, %struct.fopen_obj** %4
%8 = load i8*, i8** %5
%9 = load i8, i8* %6
%10 = call i32 @fopen__setup(%struct.fopen_obj* %7, i8* %8, i8 signext %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.fopen_obj = type { i32 }
define i32 @setup(%struct.fopen_obj* %0, i8* %1, i8 signext %2) {
%4 = tail call i32 @fopen__setup(%struct.fopen_obj* %0, i8* %1, i8 signext %2)
ret i32 %4
}
unsigned long cp_hash_double(void *d) {
  unsigned long *p = (unsigned long *)d;
  if (sizeof(unsigned long) < sizeof(double))
    return p[0] ^ p[1];
  return *p;
}


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

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

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

LLVM IR (-O2):
define i64 @cp_hash_double(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ sleeping_fn(int);
void fn() {
  do {
    int i, j, sum = 0;
    for (i = 0; i < (1) * 40000; i++)
      for (j = 1; j < 1000; j++)
        sum += (i * j) | (i / j);
  } while (0);
  sleeping_fn(80000);
}


x86 assembly (clang, -O0):
<fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x9c40,-0x4(%rbp)
jge    1186 <fn+0x76>
movl   $0x1,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jge    1173 <fn+0x63>
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
or     %ecx,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113a <fn+0x2a>
jmp    1178 <fn+0x68>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1126 <fn+0x16>
jmp    118b <fn+0x7b>
mov    $0x13880,%edi
call   1030 <sleeping_fn@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn>:
mov    $0x13880,%edi
jmp    1030 <sleeping_fn@plt>

LLVM IR (-O0):
define void @fn() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
br label %4
4: ; preds = %0
store i32 0, i32* %3
store i32 0, i32* %1
br label %5
5: ; preds = %26, %4
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 40000
br i1 %7, label %8, label %29
8: ; preds = %5
store i32 1, i32* %2
br label %9
9: ; preds = %22, %8
%10 = load i32, i32* %2
%11 = icmp slt i32 %10, 1000
br i1 %11, label %12, label %25
12: ; preds = %9
%13 = load i32, i32* %1
%14 = load i32, i32* %2
%15 = mul nsw i32 %13, %14
%16 = load i32, i32* %1
%17 = load i32, i32* %2
%18 = sdiv i32 %16, %17
%19 = or i32 %15, %18
%20 = load i32, i32* %3
%21 = add nsw i32 %20, %19
store i32 %21, i32* %3
br label %22
22: ; preds = %12
%23 = load i32, i32* %2
%24 = add nsw i32 %23, 1
store i32 %24, i32* %2
br label %9
25: ; preds = %9
br label %26
26: ; preds = %25
%27 = load i32, i32* %1
%28 = add nsw i32 %27, 1
store i32 %28, i32* %1
br label %5
29: ; preds = %5
br label %30
30: ; preds = %29
%31 = call i32 @sleeping_fn(i32 80000)
ret void
}

LLVM IR (-O2):
define void @fn() {
%1 = tail call i32 @sleeping_fn(i32 80000)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *info) {
  printf("Usage: %s <srv IPl> <srv PORT>\n", info);
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"Usage: %s <srv IPl> <srv PORT>\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [32 x i8] c"Usage: %s <srv IPl> <srv PORT>\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("hello Makefile\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [15 x i8] c"hello Makefile\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret i32 0
}
float myfabs(float f) {
  if (f < 0.0)
    return (-f);
  else
    return (f);
}


x86 assembly (clang, -O0):
<myfabs>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    113b <myfabs+0x3b>
movss  -0x8(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1145 <myfabs+0x45>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<myfabs>:
movaps 0xef9(%rip),%xmm2
xorps  %xmm0,%xmm2
xorps  %xmm3,%xmm3
movaps %xmm0,%xmm1
cmpltss %xmm3,%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @myfabs(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fpext float %4 to double
%6 = fcmp olt double %5, 0.000000e+00
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load float, float* %3
%9 = fneg float %8
store float %9, float* %2
br label %12
10: ; preds = %1
%11 = load float, float* %3
store float %11, float* %2
br label %12
12: ; preds = %10, %7
%13 = load float, float* %2
ret float %13
}

LLVM IR (-O2):
define float @myfabs(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fneg float %0
%4 = select i1 %2, float %3, float %0
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int controllerTimeReleaseResources() {
  printf("'controllerTimeReleaseResources()': Nothing to do.\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [52 x i8] c"'controllerTimeReleaseResources()': Nothing to do.\0A\00"
define i32 @controllerTimeReleaseResources() {
%1 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [51 x i8] c"'controllerTimeReleaseResources()': Nothing to do.\00"
define i32 @controllerTimeReleaseResources() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ std_err(char *);
badcomm() {
  std_err("Usage: mknod name b/c major minor [size_in_blocks]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<badcomm>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <std_err@plt>
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<badcomm>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <std_err@plt>
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@.str = [52 x i8] c"Usage: mknod name b/c major minor [size_in_blocks]\0A\00"
define i32 @badcomm() {
%1 = call i32 @std_err(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [52 x i8] c"Usage: mknod name b/c major minor [size_in_blocks]\0A\00"
define i32 @badcomm() {
%1 = tail call i32 @std_err(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printAll();
int main(int argc, char *argv[]) {
  printAll();
  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   1030 <printAll@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @printAll()
ret i32 0
}
int f(char *x) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @f(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ load_font();
int /*<<< orphan*/ srandom(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  srandom(time(NULL));
  load_font();
  while (0) {
  }
  exit(EXIT_SUCCESS);
}


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)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srandom@plt>
mov    $0x0,%al
call   1060 <load_font@plt>
xor    %eax,%eax
test   $0x1,%al
jne    117c <main+0x3c>
jmp    1181 <main+0x41>
jmp    116d <main+0x2d>
mov    0x2e58(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srandom@plt>
xor    %eax,%eax
call   1060 <load_font@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
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 @time(i32* null)
%7 = call i32 @srandom(i32 %6)
%8 = call i32 (...) @load_font()
br label %9
9: ; preds = %10, %2
br i1 false, label %10, label %11
10: ; preds = %9
br label %9
11: ; preds = %9
%12 = load i32, i32* @EXIT_SUCCESS
%13 = call i32 @exit(i32 %12)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @time(i32* null)
%4 = tail call i32 @srandom(i32 %3)
%5 = tail call i32 (...) @load_font()
%6 = load i32, i32* @EXIT_SUCCESS
%7 = tail call i32 @exit(i32 %6)
unreachable
}
/* Variables and functions */
char *tigetstr(char const *);
char *ti(const char *name) {
  char *buf_ptr;
  if ((buf_ptr = tigetstr(name)) == (char *)-1) {
    buf_ptr = NULL;
  }
  return buf_ptr;
}


x86 assembly (clang, -O0):
<ti>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <tigetstr@plt>
mov    %rax,-0x10(%rbp)
mov    $0xffffffffffffffff,%rcx
cmp    %rcx,%rax
jne    1141 <ti+0x31>
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ti>:
push   %rax
call   1030 <tigetstr@plt>
xor    %ecx,%ecx
cmp    $0xffffffffffffffff,%rax
cmove  %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @ti(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @tigetstr(i8* %4)
store i8* %5, i8** %3
%6 = icmp eq i8* %5, inttoptr (i64 -1 to i8*)
br i1 %6, label %7, label %8
7: ; preds = %1
store i8* null, i8** %3
br label %8
8: ; preds = %7, %1
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
define i8* @ti(i8* %0) {
%2 = tail call i8* @tigetstr(i8* %0)
%3 = icmp eq i8* %2, inttoptr (i64 -1 to i8*)
%4 = select i1 %3, i8* null, i8* %2
ret i8* %4
}
const char *Start_Definition(void) {
  return "struct Start {\n"
         "  void (*start)(var);\n"
         "  void (*stop)(var);\n"
         "  void (*join)(var);\n"
         "  bool (*running)(var);\n"
         "};\n";
}


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

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

LLVM IR (-O0):
@.str = [107 x i8] c"struct Start {\0A void (*start)(var);\0A void (*stop)(var);\0A void (*join)(var);\0A bool (*running)(var);\0A};\0A\00"
define i8* @Start_Definition() {
ret i8* getelementptr inbounds ([107 x i8], [107 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [107 x i8] c"struct Start {\0A void (*start)(var);\0A void (*stop)(var);\0A void (*join)(var);\0A bool (*running)(var);\0A};\0A\00"
define i8* @Start_Definition() {
ret i8* getelementptr inbounds ([107 x i8], [107 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
int section(char *section, void *data) {
  fprintf((FILE *)data, "[%s]\n", section);
  return 0;
}


x86 assembly (clang, -O0):
<section>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xed1(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<section>:
push   %rax
mov    %rsi,%rax
mov    %rdi,%rdx
lea    0xee2(%rip),%rsi
mov    %rax,%rdi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"[%s]\0A\00"
define i32 @section(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to i32*
%7 = load i8*, i8** %3
%8 = call i32 @fprintf(i32* %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"[%s]\0A\00"
define i32 @section(i8* %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = tail call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int const, int const, int const);
void add_numbers(const int a, const int b) {
  ((void)0);
  if ((a + b) == 777) {
    ((void)0);
  }
  printf("%d + %d = %d\n", a, b, a + b);
}


x86 assembly (clang, -O0):
<add_numbers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
cmp    $0x309,%eax
jne    1134 <add_numbers+0x24>
jmp    1134 <add_numbers+0x24>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x4(%rbp),%ecx
add    -0x8(%rbp),%ecx
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_numbers>:
mov    %esi,%edx
mov    %edi,%esi
lea    (%rdx,%rsi,1),%ecx
lea    0xee2(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"%d + %d = %d\0A\00"
define void @add_numbers(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
%8 = icmp eq i32 %7, 777
br i1 %8, label %9, label %10
9: ; preds = %2
br label %10
10: ; preds = %9, %2
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = add nsw i32 %13, %14
%16 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12, i32 %15)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"%d + %d = %d\0A\00"
define void @add_numbers(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t nva_grd32(void *base, uint32_t addr) {
  return *((volatile uint32_t *)(((volatile uint8_t *)base) + addr));
}


x86 assembly (clang, -O0):
<nva_grd32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nva_grd32>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @nva_grd32(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %6, i64 %8
%10 = load volatile i32, i32* %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @nva_grd32(i8* %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %3, i64 %4
%6 = load volatile i32, i32* %5
ret i32 %6
}
/* Variables and functions */
int rand();
int main(int argc, char **argv) {
  int x = rand() - 61;
  return x;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
sub    $0x3d,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @rand()
%4 = add nsw i32 %3, -61
ret i32 %4
}
void nabi_session_open(char *previos_id) {}


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

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

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

LLVM IR (-O2):
define void @nabi_session_open(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int tolower(int);
scalar_t__ vowel(int);
int not_usually_after_n(int c0) {
  int c;
  c = tolower(c0);
  return (!(vowel(c) || c == 'g'));
}


x86 assembly (clang, -O0):
<not_usually_after_n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <tolower@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <vowel@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jne    115a <not_usually_after_n+0x3a>
cmpl   $0x67,-0x8(%rbp)
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<not_usually_after_n>:
push   %rbx
call   1030 <tolower@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1040 <vowel@plt>
test   %rax,%rax
sete   %al
cmp    $0x67,%ebx
setne  %cl
and    %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @not_usually_after_n(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @tolower(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i64 @vowel(i32 %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %1
%10 = load i32, i32* %3
%11 = icmp eq i32 %10, 103
br label %12
12: ; preds = %9, %1
%13 = phi i1 [ true, %1 ], [ %11, %9 ]
%14 = xor i1 %13, true
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @not_usually_after_n(i32 %0) {
%2 = tail call i32 @tolower(i32 %0)
%3 = tail call i64 @vowel(i32 %2)
%4 = icmp eq i64 %3, 0
%5 = icmp ne i32 %2, 103
%6 = and i1 %5, %4
%7 = zext i1 %6 to i32
ret i32 %7
}
OP(dd, c4) {
  illegal_1();
  op_c4();
}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_1@plt>
mov    $0x0,%al
call   1040 <op_c4@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_c4()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ LCD_CLR_E();
int /*<<< orphan*/ LCD_CLR_RESET();
int /*<<< orphan*/ LCD_SET_A0();
int /*<<< orphan*/ LCD_SET_RESET();
void LCD_X_Init(void) {
  LCD_CLR_RESET();
  ;
  LCD_CLR_E();
  ;
  LCD_SET_A0();
  ;
  ;
  ;
  LCD_SET_RESET();
}


x86 assembly (clang, -O0):
<LCD_X_Init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <LCD_CLR_RESET@plt>
mov    $0x0,%al
call   1060 <LCD_CLR_E@plt>
mov    $0x0,%al
call   1040 <LCD_SET_A0@plt>
mov    $0x0,%al
call   1030 <LCD_SET_RESET@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCD_X_Init>:
push   %rax
xor    %eax,%eax
call   1050 <LCD_CLR_RESET@plt>
xor    %eax,%eax
call   1060 <LCD_CLR_E@plt>
xor    %eax,%eax
call   1040 <LCD_SET_A0@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <LCD_SET_RESET@plt>

LLVM IR (-O0):
define void @LCD_X_Init() {
%1 = call i32 (...) @LCD_CLR_RESET()
%2 = call i32 (...) @LCD_CLR_E()
%3 = call i32 (...) @LCD_SET_A0()
%4 = call i32 (...) @LCD_SET_RESET()
ret void
}

LLVM IR (-O2):
define void @LCD_X_Init() {
%1 = tail call i32 (...) @LCD_CLR_RESET()
%2 = tail call i32 (...) @LCD_CLR_E()
%3 = tail call i32 (...) @LCD_SET_A0()
%4 = tail call i32 (...) @LCD_SET_RESET()
ret void
}
int msm_cpr_pm_suspend(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @msm_cpr_pm_suspend() {
ret i32 0
}
/* Variables and functions */
int rand();
void foo(int b) {
  int a;
  int i;
  a = rand();
  for (i = 0; i < b; i++)
    a += b;
  i = a;
  return;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    114f <foo+0x3f>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112c <foo+0x1c>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @foo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = call i32 (...) @rand()
store i32 %5, i32* %3
store i32 0, i32* %4
br label %6
6: ; preds = %14, %1
%7 = load i32, i32* %4
%8 = load i32, i32* %2
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %17
10: ; preds = %6
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = add nsw i32 %12, %11
store i32 %13, i32* %3
br label %14
14: ; preds = %10
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 1
store i32 %16, i32* %4
br label %6
17: ; preds = %6
%18 = load i32, i32* %3
store i32 %18, i32* %4
ret void
}

LLVM IR (-O2):
define void @foo(i32 %0) {
%2 = tail call i32 (...) @rand()
ret void
}