xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int help() {
  printf("========================== \n");
  printf("           MINT            \n");
  printf("========================== \n");
  printf("syntaxe : mint -i <file.m++> \n");
  return -1;
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xef6(%rip),%rdi
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
lea    0xefb(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
push   %rbx
lea    0xf04(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xed9(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xefd(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"========================== \0A\00"
@.str.1 = [29 x i8] c" MINT \0A\00"
@.str.2 = [31 x i8] c"syntaxe : mint -i <file.m++> \0A\00"
define i32 @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@str.3 = [28 x i8] c" MINT \00"
@str.4 = [28 x i8] c"========================== \00"
@str.5 = [30 x i8] c"syntaxe : mint -i <file.m++> \00"
define i32 @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.4, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.4, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.5, i64 0, i64 0))
ret i32 -1
}
void g_strdelimit() {}


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

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

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

LLVM IR (-O2):
define void @g_strdelimit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *p) {
  fprintf(stderr,
          "Usage: %s -s saddr -S sport -d daddr -D dport -p proto -l <listen> "
          "-L packet_limit -b size -e eth_dst_addr -i eth_out_index -h\n",
          p);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [128 x i8] c"Usage: %s -s saddr -S sport -d daddr -D dport -p proto -l <listen> -L packet_limit -b size -e eth_dst_addr -i eth_out_index -h\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([128 x i8], [128 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [128 x i8] c"Usage: %s -s saddr -S sport -d daddr -D dport -p proto -l <listen> -L packet_limit -b size -e eth_dst_addr -i eth_out_index -h\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([128 x i8], [128 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int sg_sense_print(char const *, int, int, int, unsigned char const *, int);
int sg_chk_n_print(const char *leadin, int masked_status, int host_status,
                   int driver_status, const unsigned char *sense_buffer,
                   int sb_len) {
  int scsi_status = (masked_status << 1) & 0x7e;
  return sg_sense_print(leadin, scsi_status, host_status, driver_status,
                        sense_buffer, sb_len);
}


x86 assembly (clang, -O0):
<sg_chk_n_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
and    $0x7e,%eax
mov    %eax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    -0x24(%rbp),%r9d
call   1030 <sg_sense_print@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sg_chk_n_print>:
add    %esi,%esi
and    $0x7e,%esi
jmp    1030 <sg_sense_print@plt>

LLVM IR (-O0):
define i32 @sg_chk_n_print(i8* %0, i32 %1, i32 %2, i32 %3, i8* %4, i32 %5) {
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i32
store i8* %0, i8** %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i8* %4, i8** %11
store i32 %5, i32* %12
%14 = load i32, i32* %8
%15 = shl i32 %14, 1
%16 = and i32 %15, 126
store i32 %16, i32* %13
%17 = load i8*, i8** %7
%18 = load i32, i32* %13
%19 = load i32, i32* %9
%20 = load i32, i32* %10
%21 = load i8*, i8** %11
%22 = load i32, i32* %12
%23 = call i32 @sg_sense_print(i8* %17, i32 %18, i32 %19, i32 %20, i8* %21, i32 %22)
ret i32 %23
}

LLVM IR (-O2):
define i32 @sg_chk_n_print(i8* %0, i32 %1, i32 %2, i32 %3, i8* %4, i32 %5) {
%7 = shl i32 %1, 1
%8 = and i32 %7, 126
%9 = tail call i32 @sg_sense_print(i8* %0, i32 %8, i32 %2, i32 %3, i8* %4, i32 %5)
ret i32 %9
}
/* Variables and functions */
unsigned long long _readfsbase_u64();
unsigned long long read_fs_base64(void) { return _readfsbase_u64(); }


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

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

LLVM IR (-O0):
define i64 @read_fs_base64() {
%1 = call i64 (...) @_readfsbase_u64()
ret i64 %1
}

LLVM IR (-O2):
define i64 @read_fs_base64() {
%1 = tail call i64 (...) @_readfsbase_u64()
ret i64 %1
}
void gtk_notebook_set_tab_label_text() {}


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

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

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

LLVM IR (-O2):
define void @gtk_notebook_set_tab_label_text() {
ret void
}
int dd_leq_d_dd(double a, const double *b) {
  return (a < b[0] || (a == b[0] && b[1] >= 0.0)) ? 1 : 0;
}


x86 assembly (clang, -O0):
<dd_leq_d_dd>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    $0x1,%al
ucomisd %xmm1,%xmm0
mov    %al,-0x11(%rbp)
ja     1163 <dd_leq_d_dd+0x63>
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
ucomisd (%rcx),%xmm0
mov    %al,-0x12(%rbp)
jne    115d <dd_leq_d_dd+0x5d>
jp     115d <dd_leq_d_dd+0x5d>
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
setae  %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dd_leq_d_dd>:
movsd  (%rdi),%xmm1
mov    $0x1,%eax
ucomisd %xmm0,%xmm1
ja     1129 <dd_leq_d_dd+0x29>
ucomisd %xmm0,%xmm1
jne    112a <dd_leq_d_dd+0x2a>
jp     112a <dd_leq_d_dd+0x2a>
movsd  0x8(%rdi),%xmm0
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
setae  %al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @dd_leq_d_dd(double %0, double* %1) {
%3 = alloca double
%4 = alloca double*
store double %0, double* %3
store double* %1, double** %4
%5 = load double, double* %3
%6 = load double*, double** %4
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = fcmp olt double %5, %8
br i1 %9, label %23, label %10
10: ; preds = %2
%11 = load double, double* %3
%12 = load double*, double** %4
%13 = getelementptr inbounds double, double* %12, i64 0
%14 = load double, double* %13
%15 = fcmp oeq double %11, %14
br i1 %15, label %16, label %21
16: ; preds = %10
%17 = load double*, double** %4
%18 = getelementptr inbounds double, double* %17, i64 1
%19 = load double, double* %18
%20 = fcmp oge double %19, 0.000000e+00
br label %21
21: ; preds = %16, %10
%22 = phi i1 [ false, %10 ], [ %20, %16 ]
br label %23
23: ; preds = %21, %2
%24 = phi i1 [ true, %2 ], [ %22, %21 ]
%25 = zext i1 %24 to i64
%26 = select i1 %24, i32 1, i32 0
ret i32 %26
}

LLVM IR (-O2):
define i32 @dd_leq_d_dd(double %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = fcmp ogt double %3, %0
br i1 %4, label %12, label %5
5: ; preds = %2
%6 = fcmp oeq double %3, %0
br i1 %6, label %7, label %12
7: ; preds = %5
%8 = getelementptr inbounds double, double* %1, i64 1
%9 = load double, double* %8
%10 = fcmp oge double %9, 0.000000e+00
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %5, %7, %2
%13 = phi i32 [ 1, %2 ], [ 0, %5 ], [ %11, %7 ]
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ test_str;

/* Variables and functions */
scalar_t__ EINVAL;
scalar_t__ errno;
int write(int, char const *, int);
int check_multiline(int change_fd) {
  static const char test_str[] = "^ ^ - -\n-";
  int ret;
  ret = write(change_fd, test_str, sizeof(test_str) - 1);
  if (ret == -1 && errno == EINVAL)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<check_multiline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    0xedb(%rip),%rsi
mov    $0x9,%edx
call   1030 <write@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    1162 <check_multiline+0x52>
mov    0x2e9d(%rip),%rax
mov    (%rax),%rax
mov    0x2e8b(%rip),%rcx
cmp    (%rcx),%rax
jne    1162 <check_multiline+0x52>
movl   $0x1,-0x4(%rbp)
jmp    1169 <check_multiline+0x59>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_multiline>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x9,%edx
call   1030 <write@plt>
cmp    $0xffffffff,%eax
jne    1142 <check_multiline+0x32>
mov    0x2eb2(%rip),%rax
mov    (%rax),%rcx
mov    0x2ea0(%rip),%rdx
mov    $0x1,%eax
cmp    (%rdx),%rcx
je     1144 <check_multiline+0x34>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@check_multiline.test_str = internal constant [10 x i8] c"^ ^ - -\0A-\00"
@errno = global i64 0
@EINVAL = global i64 0
define i32 @check_multiline(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @write(i32 %5, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @check_multiline.test_str, i64 0, i64 0), i32 9)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %14
9: ; preds = %1
%10 = load i64, i64* @errno
%11 = load i64, i64* @EINVAL
%12 = icmp eq i64 %10, %11
br i1 %12, label %13, label %14
13: ; preds = %9
store i32 1, i32* %2
br label %15
14: ; preds = %9, %1
store i32 0, i32* %2
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@check_multiline.test_str = internal constant [10 x i8] c"^ ^ - -\0A-\00"
@errno = global i64 0
@EINVAL = global i64 0
define i32 @check_multiline(i32 %0) {
%2 = tail call i32 @write(i32 %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @check_multiline.test_str, i64 0, i64 0), i32 9)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i64, i64* @errno
%6 = load i64, i64* @EINVAL
%7 = icmp eq i64 %5, %6
br i1 %7, label %9, label %8
8: ; preds = %4, %1
br label %9
9: ; preds = %4, %8
%10 = phi i32 [ 0, %8 ], [ 1, %4 ]
ret i32 %10
}
int execute_sched_getparam() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_sched_getparam() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
char *sfm_malloc(size_t);
int strlen(char const *);
char *sfm_strdup(const char *str) {
  char *dst;
  size_t siz;
  siz = strlen(str) + 1;
  dst = sfm_malloc(siz);
  memcpy(dst, str, siz);
  return dst;
}


x86 assembly (clang, -O0):
<sfm_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <sfm_malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1050 <memcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sfm_strdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1040 <sfm_malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1050 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @sfm_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 1
%8 = sext i32 %7 to i64
store i64 %8, i64* %4
%9 = load i64, i64* %4
%10 = call i8* @sfm_malloc(i64 %9)
store i8* %10, i8** %3
%11 = load i8*, i8** %3
%12 = load i8*, i8** %2
%13 = load i64, i64* %4
%14 = call i32 @memcpy(i8* %11, i8* %12, i64 %13)
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
define i8* @sfm_strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i8* @sfm_malloc(i64 %4)
%6 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %4)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ free(int *);
int *x_malloc(int);
void malloc_test(void) {
  int *p = x_malloc(100 * sizeof(int));
  assert(p != NULL);
  free(p);
}


x86 assembly (clang, -O0):
<malloc_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x190,%edi
call   1050 <x_malloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_test>:
push   %rbx
mov    $0x190,%edi
call   1050 <x_malloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @malloc_test() {
%1 = alloca i32*
%2 = call i32* @x_malloc(i32 400)
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = icmp ne i32* %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i32*, i32** %1
%8 = call i32 @free(i32* %7)
ret void
}

LLVM IR (-O2):
define void @malloc_test() {
%1 = tail call i32* @x_malloc(i32 400)
%2 = icmp ne i32* %1, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @free(i32* %1)
ret void
}
/* Variables and functions */
int INT_MAX;
int /*<<< orphan*/ itob(int, char *, int);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  char result[1024];
  itob(INT_MAX, result, 37);
  printf("%d\n", INT_MAX);
  printf("%s\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
lea    -0x410(%rbp),%rsi
mov    $0x25,%edx
call   1040 <itob@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%esi
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x410(%rbp),%rsi
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x408,%rsp
mov    0x2ea7(%rip),%rbx
mov    (%rbx),%edi
mov    %rsp,%r14
mov    %r14,%rsi
mov    $0x25,%edx
call   1050 <itob@plt>
mov    (%rbx),%esi
lea    0xea4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x408,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@INT_MAX = global i32 0
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @INT_MAX
%4 = call i32 @itob(i32 %3, i8* %2, i32 37)
%5 = load i32, i32* @INT_MAX
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 @puts(i8* %2)
ret i32 0
}
/* Type definitions */
struct rq_asset_irdiscount {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ rq_asset_irdiscount_free(struct rq_asset_irdiscount *);
void rq_asset_irdiscount_freefunc(void *asset_data) {
  rq_asset_irdiscount_free((struct rq_asset_irdiscount *)asset_data);
}


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

x86 assembly (clang, -O2):
<rq_asset_irdiscount_freefunc>:
jmp    1030 <rq_asset_irdiscount_free@plt>

LLVM IR (-O0):
%struct.rq_asset_irdiscount = type { i32 }
define void @rq_asset_irdiscount_freefunc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.rq_asset_irdiscount*
%5 = call i32 @rq_asset_irdiscount_free(%struct.rq_asset_irdiscount* %4)
ret void
}

LLVM IR (-O2):
%struct.rq_asset_irdiscount = type { i32 }
define void @rq_asset_irdiscount_freefunc(i8* %0) {
%2 = bitcast i8* %0 to %struct.rq_asset_irdiscount*
%3 = tail call i32 @rq_asset_irdiscount_free(%struct.rq_asset_irdiscount* %2)
ret void
}
/* Type definitions */
struct RNAheat_args_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ clear_args(struct RNAheat_args_info *);
int /*<<< orphan*/ clear_given(struct RNAheat_args_info *);
int /*<<< orphan*/ init_args_info(struct RNAheat_args_info *);
void RNAheat_cmdline_parser_init(struct RNAheat_args_info *args_info) {
  clear_given(args_info);
  clear_args(args_info);
  init_args_info(args_info);
}


x86 assembly (clang, -O0):
<RNAheat_cmdline_parser_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <clear_given@plt>
mov    -0x8(%rbp),%rdi
call   1030 <clear_args@plt>
mov    -0x8(%rbp),%rdi
call   1050 <init_args_info@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RNAheat_cmdline_parser_init>:
push   %rbx
mov    %rdi,%rbx
call   1040 <clear_given@plt>
mov    %rbx,%rdi
call   1030 <clear_args@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <init_args_info@plt>

LLVM IR (-O0):
%struct.RNAheat_args_info = type { i32 }
define void @RNAheat_cmdline_parser_init(%struct.RNAheat_args_info* %0) {
%2 = alloca %struct.RNAheat_args_info*
store %struct.RNAheat_args_info* %0, %struct.RNAheat_args_info** %2
%3 = load %struct.RNAheat_args_info*, %struct.RNAheat_args_info** %2
%4 = call i32 @clear_given(%struct.RNAheat_args_info* %3)
%5 = load %struct.RNAheat_args_info*, %struct.RNAheat_args_info** %2
%6 = call i32 @clear_args(%struct.RNAheat_args_info* %5)
%7 = load %struct.RNAheat_args_info*, %struct.RNAheat_args_info** %2
%8 = call i32 @init_args_info(%struct.RNAheat_args_info* %7)
ret void
}

LLVM IR (-O2):
%struct.RNAheat_args_info = type { i32 }
define void @RNAheat_cmdline_parser_init(%struct.RNAheat_args_info* %0) {
%2 = tail call i32 @clear_given(%struct.RNAheat_args_info* %0)
%3 = tail call i32 @clear_args(%struct.RNAheat_args_info* %0)
%4 = tail call i32 @init_args_info(%struct.RNAheat_args_info* %0)
ret void
}
/* Type definitions */
struct game_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ move_left(struct game_t *);
int /*<<< orphan*/ rotate_clockwise(struct game_t *);
void move_up(struct game_t *game) {
  rotate_clockwise(game);
  rotate_clockwise(game);
  rotate_clockwise(game);
  move_left(game);
  rotate_clockwise(game);
}


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

x86 assembly (clang, -O2):
<move_up>:
push   %rbx
mov    %rdi,%rbx
call   1040 <rotate_clockwise@plt>
mov    %rbx,%rdi
call   1040 <rotate_clockwise@plt>
mov    %rbx,%rdi
call   1040 <rotate_clockwise@plt>
mov    %rbx,%rdi
call   1030 <move_left@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <rotate_clockwise@plt>

LLVM IR (-O0):
%struct.game_t = type { i32 }
define void @move_up(%struct.game_t* %0) {
%2 = alloca %struct.game_t*
store %struct.game_t* %0, %struct.game_t** %2
%3 = load %struct.game_t*, %struct.game_t** %2
%4 = call i32 @rotate_clockwise(%struct.game_t* %3)
%5 = load %struct.game_t*, %struct.game_t** %2
%6 = call i32 @rotate_clockwise(%struct.game_t* %5)
%7 = load %struct.game_t*, %struct.game_t** %2
%8 = call i32 @rotate_clockwise(%struct.game_t* %7)
%9 = load %struct.game_t*, %struct.game_t** %2
%10 = call i32 @move_left(%struct.game_t* %9)
%11 = load %struct.game_t*, %struct.game_t** %2
%12 = call i32 @rotate_clockwise(%struct.game_t* %11)
ret void
}

LLVM IR (-O2):
%struct.game_t = type { i32 }
define void @move_up(%struct.game_t* %0) {
%2 = tail call i32 @rotate_clockwise(%struct.game_t* %0)
%3 = tail call i32 @rotate_clockwise(%struct.game_t* %0)
%4 = tail call i32 @rotate_clockwise(%struct.game_t* %0)
%5 = tail call i32 @move_left(%struct.game_t* %0)
%6 = tail call i32 @rotate_clockwise(%struct.game_t* %0)
ret void
}
/* Variables and functions */
scalar_t__ RAND_MAX;
double rand();
double Rnd(double v) { return v * rand() / (double)(RAND_MAX + 1.0); }


x86 assembly (clang, -O0):
<Rnd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
mulsd  %xmm1,%xmm0
mov    0x2ea7(%rip),%rax
cvtsi2sdq (%rax),%xmm1
movsd  0xeb2(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Rnd>:
push   %rax
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2ec4(%rip),%rax
cvtsi2sdq (%rax),%xmm1
mulsd  (%rsp),%xmm0
addsd  0xeca(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define double @Rnd(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double (...) @rand()
%5 = fmul double %3, %4
%6 = load i64, i64* @RAND_MAX
%7 = sitofp i64 %6 to double
%8 = fadd double %7, 1.000000e+00
%9 = fdiv double %5, %8
ret double %9
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define double @Rnd(double %0) {
%2 = tail call double (...) @rand()
%3 = fmul double %2, %0
%4 = load i64, i64* @RAND_MAX
%5 = sitofp i64 %4 to double
%6 = fadd double %5, 1.000000e+00
%7 = fdiv double %3, %6
ret double %7
}
/* Variables and functions */
char *calloc(int, size_t);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
char *getStr(char *x, char *y) {
  size_t len = strlen(x) + strlen(y) + 1;
  char *result = calloc(1, len);
  strcpy(result, x);
  strcat(result, y);
  return result;
}


x86 assembly (clang, -O0):
<getStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x24(%rbp),%eax
add    %ecx,%eax
add    $0x1,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
mov    $0x1,%edi
call   1050 <calloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <strcat@plt>
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getStr>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r12
call   1040 <strlen@plt>
mov    %eax,%r15d
mov    %r14,%rdi
call   1040 <strlen@plt>
add    %r15d,%eax
add    $0x1,%eax
movslq %eax,%rsi
mov    $0x1,%edi
call   1050 <calloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r12,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <strcat@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @getStr(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
%9 = load i8*, i8** %4
%10 = call i32 @strlen(i8* %9)
%11 = add nsw i32 %8, %10
%12 = add nsw i32 %11, 1
%13 = sext i32 %12 to i64
store i64 %13, i64* %5
%14 = load i64, i64* %5
%15 = call i8* @calloc(i32 1, i64 %14)
store i8* %15, i8** %6
%16 = load i8*, i8** %6
%17 = load i8*, i8** %3
%18 = call i32 @strcpy(i8* %16, i8* %17)
%19 = load i8*, i8** %6
%20 = load i8*, i8** %4
%21 = call i32 @strcat(i8* %19, i8* %20)
%22 = load i8*, i8** %6
ret i8* %22
}

LLVM IR (-O2):
define i8* @getStr(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @strlen(i8* %1)
%5 = add i32 %3, 1
%6 = add i32 %5, %4
%7 = sext i32 %6 to i64
%8 = tail call i8* @calloc(i32 1, i64 %7)
%9 = tail call i32 @strcpy(i8* %8, i8* %0)
%10 = tail call i32 @strcat(i8* %8, i8* %1)
ret i8* %8
}
/* Type definitions */
struct tokenizer {
  int dummy;
};
struct rqlParse {
  int dummy;
};

/* Variables and functions */
struct rqlParse *rqlParseOr(struct tokenizer *);
struct rqlParse *rqlParseExpression(struct tokenizer *tkz) {
  return rqlParseOr(tkz);
}


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

x86 assembly (clang, -O2):
<rqlParseExpression>:
jmp    1030 <rqlParseOr@plt>

LLVM IR (-O0):
%struct.rqlParse = type { i32 }
%struct.tokenizer = type { i32 }
define %struct.rqlParse* @rqlParseExpression(%struct.tokenizer* %0) {
%2 = alloca %struct.tokenizer*
store %struct.tokenizer* %0, %struct.tokenizer** %2
%3 = load %struct.tokenizer*, %struct.tokenizer** %2
%4 = call %struct.rqlParse* @rqlParseOr(%struct.tokenizer* %3)
ret %struct.rqlParse* %4
}

LLVM IR (-O2):
%struct.rqlParse = type { i32 }
%struct.tokenizer = type { i32 }
define %struct.rqlParse* @rqlParseExpression(%struct.tokenizer* %0) {
%2 = tail call %struct.rqlParse* @rqlParseOr(%struct.tokenizer* %0)
ret %struct.rqlParse* %2
}
/* Variables and functions */
int PMPI_Finalized(int *);
int MPI_Finalized(int *flag) {
  ;
  return PMPI_Finalized(flag);
}


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

x86 assembly (clang, -O2):
<MPI_Finalized>:
jmp    1030 <PMPI_Finalized@plt>

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

LLVM IR (-O2):
define i32 @MPI_Finalized(i32* %0) {
%2 = tail call i32 @PMPI_Finalized(i32* %0)
ret i32 %2
}
/* Type definitions */
struct rusage {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
scalar_t__ wait3(int *, int /*<<< orphan*/, struct rusage *);
void reaper(int signum) {
  int status;
  while (wait3(&status, WNOHANG, (struct rusage *)0) >= 0)
    ;
}


x86 assembly (clang, -O0):
<reaper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <wait3@plt>
cmp    $0x0,%rax
jl     1140 <reaper+0x30>
jmp    111b <reaper+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reaper>:
push   %r14
push   %rbx
push   %rax
mov    0x2ecd(%rip),%r14
lea    0x4(%rsp),%rbx
mov    (%r14),%esi
mov    %rbx,%rdi
xor    %edx,%edx
call   1030 <wait3@plt>
test   %rax,%rax
jns    1120 <reaper+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.rusage = type { i32 }
@WNOHANG = global i32 0
define void @reaper(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
br label %4
4: ; preds = %8, %1
%5 = load i32, i32* @WNOHANG
%6 = call i64 @wait3(i32* %3, i32 %5, %struct.rusage* null)
%7 = icmp sge i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %4
br label %4
9: ; preds = %4
ret void
}

LLVM IR (-O2):
%struct.rusage = type { i32 }
@WNOHANG = global i32 0
define void @reaper(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
br label %4
4: ; preds = %4, %1
%5 = load i32, i32* @WNOHANG
%6 = call i64 @wait3(i32* %2, i32 %5, %struct.rusage* null)
%7 = icmp sgt i64 %6, -1
br i1 %7, label %4, label %8
8: ; preds = %4
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void led_set(uint32_t val) { *(volatile uint32_t *)(0xfffbb154) = val; }


x86 assembly (clang, -O0):
<led_set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0xfffbb154,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<led_set>:
mov    $0xfffbb154,%eax
mov    %edi,(%rax)
ret

LLVM IR (-O0):
define void @led_set(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
store volatile i32 %3, i32* inttoptr (i64 4294685012 to i32*)
ret void
}

LLVM IR (-O2):
define void @led_set(i32 %0) {
store volatile i32 %0, i32* inttoptr (i64 4294685012 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ report(int);
void fail(char *msg) {
  printf("Test failed: %s\n", msg);
  report(0xeeeeeeee);
  exit(1);
}


x86 assembly (clang, -O0):
<fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    $0xeeeeeeee,%edi
call   1050 <report@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fail>:
push   %rax
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xeeeeeeee,%edi
call   1050 <report@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Test failed: %s\0A\00"
define void @fail(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @report(i32 -286331154)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [17 x i8] c"Test failed: %s\0A\00"
define void @fail(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @report(i32 -286331154)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ PR_GET_DUMPABLE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int prctl(int /*<<< orphan*/, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
          int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int getdumpable(void) {
  int ret;
  ret = prctl(PR_GET_DUMPABLE, NULL, NULL, NULL, NULL);
  if (ret == -1)
    exit(EXIT_FAILURE);
  return ret;
}


x86 assembly (clang, -O0):
<getdumpable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%r8d
mov    %r8,%rsi
mov    %r8,%rdx
mov    %r8,%rcx
call   1030 <prctl@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    115f <getdumpable+0x3f>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getdumpable>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <prctl@plt>
cmp    $0xffffffff,%eax
je     113f <getdumpable+0x1f>
pop    %rcx
ret
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@PR_GET_DUMPABLE = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @getdumpable() {
%1 = alloca i32
%2 = load i32, i32* @PR_GET_DUMPABLE
%3 = call i32 @prctl(i32 %2, i32* null, i32* null, i32* null, i32* null)
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load i32, i32* @EXIT_FAILURE
%8 = call i32 @exit(i32 %7)
unreachable
9: ; preds = %0
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@PR_GET_DUMPABLE = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @getdumpable() {
%1 = load i32, i32* @PR_GET_DUMPABLE
%2 = tail call i32 @prctl(i32 %1, i32* null, i32* null, i32* null, i32* null)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
7: ; preds = %0
ret i32 %2
}
/* Type definitions */
struct hash_table {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ hash_insert(struct hash_table *, char *);
void hash_load(struct hash_table *ht, void *item_table,
               unsigned long cardinality, unsigned long size) {
  char *items = (char *)item_table;
  while (cardinality--) {
    hash_insert(ht, items);
    items += size;
  }
}


x86 assembly (clang, -O0):
<hash_load>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x18(%rbp)
cmp    $0x0,%rax
je     1167 <hash_load+0x57>
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <hash_insert@plt>
mov    -0x20(%rbp),%rax
add    -0x28(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    1130 <hash_load+0x20>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_load>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rdx,%rdx
je     1144 <hash_load+0x34>
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %rdi,%r12
nopl   0x0(%rax)
mov    %r12,%rdi
mov    %rbx,%rsi
call   1030 <hash_insert@plt>
add    %r14,%rbx
add    $0xffffffffffffffff,%r15
jne    1130 <hash_load+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.hash_table = type { i32 }
define void @hash_load(%struct.hash_table* %0, i8* %1, i64 %2, i64 %3) {
%5 = alloca %struct.hash_table*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i8*
store %struct.hash_table* %0, %struct.hash_table** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%10 = load i8*, i8** %6
store i8* %10, i8** %9
br label %11
11: ; preds = %15, %4
%12 = load i64, i64* %7
%13 = add i64 %12, -1
store i64 %13, i64* %7
%14 = icmp ne i64 %12, 0
br i1 %14, label %15, label %22
15: ; preds = %11
%16 = load %struct.hash_table*, %struct.hash_table** %5
%17 = load i8*, i8** %9
%18 = call i32 @hash_insert(%struct.hash_table* %16, i8* %17)
%19 = load i64, i64* %8
%20 = load i8*, i8** %9
%21 = getelementptr inbounds i8, i8* %20, i64 %19
store i8* %21, i8** %9
br label %11
22: ; preds = %11
ret void
}

LLVM IR (-O2):
%struct.hash_table = type { i32 }
define void @hash_load(%struct.hash_table* %0, i8* %1, i64 %2, i64 %3) {
%5 = icmp eq i64 %2, 0
br i1 %5, label %13, label %6
6: ; preds = %4, %6
%7 = phi i8* [ %11, %6 ], [ %1, %4 ]
%8 = phi i64 [ %9, %6 ], [ %2, %4 ]
%9 = add i64 %8, -1
%10 = tail call i32 @hash_insert(%struct.hash_table* %0, i8* %7)
%11 = getelementptr inbounds i8, i8* %7, i64 %3
%12 = icmp eq i64 %9, 0
br i1 %12, label %13, label %6
13: ; preds = %6, %4
ret void
}
/* Type definitions */
typedef int u_int32_t;

/* Variables and functions */
u_int32_t shl32(u_int32_t i, int count) {
  if (count == 32)
    return 0;
  return i << count;
}


x86 assembly (clang, -O0):
<shl32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x20,-0xc(%rbp)
jne    1120 <shl32+0x20>
movl   $0x0,-0x4(%rbp)
jmp    112b <shl32+0x2b>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    %cl,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<shl32>:
mov    %esi,%ecx
shl    %cl,%edi
xor    %eax,%eax
cmp    $0x20,%esi
cmovne %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @shl32(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 32
%4 = shl i32 %0, %1
%5 = select i1 %3, i32 0, i32 %4
ret i32 %5
}
void F1(int **X) { *X = (int *)0; }


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

x86 assembly (clang, -O2):
<F1>:
movq   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @F1(i32** nocapture writeonly %0) {
store i32* null, i32** %0
ret void
}
void g_value_copy() {}


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

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

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

LLVM IR (-O2):
define void @g_value_copy() {
ret void
}
char IsInsideObject(unsigned int X, unsigned int Y, unsigned int Left,
                    unsigned int Top, unsigned int Width, unsigned int Height) {
  if ((Left <= X) && (Left + Width - 1 >= X) && (Top <= Y) &&
      (Top + Height - 1 >= Y))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<IsInsideObject>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
ja     115d <IsInsideObject+0x5d>
mov    -0x10(%rbp),%eax
add    -0x18(%rbp),%eax
sub    $0x1,%eax
cmp    -0x8(%rbp),%eax
jb     115d <IsInsideObject+0x5d>
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
ja     115d <IsInsideObject+0x5d>
mov    -0x14(%rbp),%eax
add    -0x1c(%rbp),%eax
sub    $0x1,%eax
cmp    -0xc(%rbp),%eax
jb     115d <IsInsideObject+0x5d>
movb   $0x1,-0x1(%rbp)
jmp    1161 <IsInsideObject+0x61>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsInsideObject>:
cmp    %edi,%edx
ja     111f <IsInsideObject+0x1f>
cmp    %esi,%ecx
ja     111f <IsInsideObject+0x1f>
lea    (%rdx,%r8,1),%eax
add    $0xffffffff,%eax
cmp    %edi,%eax
jb     111f <IsInsideObject+0x1f>
add    %r9d,%ecx
add    $0xffffffff,%ecx
mov    $0x1,%al
cmp    %esi,%ecx
jae    1121 <IsInsideObject+0x21>
xor    %eax,%eax
ret

LLVM IR (-O0):
define signext i8 @IsInsideObject(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i8
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
%14 = load i32, i32* %10
%15 = load i32, i32* %8
%16 = icmp ule i32 %14, %15
br i1 %16, label %17, label %36
17: ; preds = %6
%18 = load i32, i32* %10
%19 = load i32, i32* %12
%20 = add i32 %18, %19
%21 = sub i32 %20, 1
%22 = load i32, i32* %8
%23 = icmp uge i32 %21, %22
br i1 %23, label %24, label %36
24: ; preds = %17
%25 = load i32, i32* %11
%26 = load i32, i32* %9
%27 = icmp ule i32 %25, %26
br i1 %27, label %28, label %36
28: ; preds = %24
%29 = load i32, i32* %11
%30 = load i32, i32* %13
%31 = add i32 %29, %30
%32 = sub i32 %31, 1
%33 = load i32, i32* %9
%34 = icmp uge i32 %32, %33
br i1 %34, label %35, label %36
35: ; preds = %28
store i8 1, i8* %7
br label %37
36: ; preds = %28, %24, %17, %6
store i8 0, i8* %7
br label %37
37: ; preds = %36, %35
%38 = load i8, i8* %7
ret i8 %38
}

LLVM IR (-O2):
define signext i8 @IsInsideObject(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = icmp ugt i32 %2, %0
br i1 %7, label %18, label %8
8: ; preds = %6
%9 = add i32 %2, -1
%10 = add i32 %9, %4
%11 = icmp ult i32 %10, %0
%12 = icmp ugt i32 %3, %1
%13 = or i1 %12, %11
br i1 %13, label %18, label %14
14: ; preds = %8
%15 = add i32 %3, -1
%16 = add i32 %15, %5
%17 = icmp ult i32 %16, %1
br i1 %17, label %18, label %19
18: ; preds = %14, %8, %6
br label %19
19: ; preds = %14, %18
%20 = phi i8 [ 0, %18 ], [ 1, %14 ]
ret i8 %20
}
/* Variables and functions */
int day_of_year(int, int, int);
int month_day(int, int, int *, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int a;
  if (month_day(2013, 54, &a, NULL) == -1)
    printf("month_day() reported error.\n");
  printf("%d\n", day_of_year(2013, 07, 26));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x7dd,%edi
mov    $0x36,%esi
lea    -0x8(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <month_day@plt>
cmp    $0xffffffff,%eax
jne    116d <main+0x3d>
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x7dd,%edi
mov    $0x7,%esi
mov    $0x1a,%edx
call   1050 <day_of_year@plt>
mov    %eax,%esi
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x4(%rsp),%rdx
mov    $0x7dd,%edi
mov    $0x36,%esi
xor    %ecx,%ecx
call   1040 <month_day@plt>
cmp    $0xffffffff,%eax
jne    1168 <main+0x28>
lea    0xea1(%rip),%rdi
call   1030 <puts@plt>
mov    $0x7dd,%edi
mov    $0x7,%esi
mov    $0x1a,%edx
call   1060 <day_of_year@plt>
lea    0xe7d(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"month_day() reported error.\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @month_day(i32 2013, i32 54, i32* %2, i32* null)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
%8 = call i32 @day_of_year(i32 2013, i32 7, i32 26)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%d\0A\00"
@str = [28 x i8] c"month_day() reported error.\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @month_day(i32 2013, i32 54, i32* %1, i32* null)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
%8 = call i32 @day_of_year(i32 2013, i32 7, i32 26)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int dev_read() {
  int k;
  printf("reading the data from memory");
  scanf(" %d", &k);
  return k;
}


x86 assembly (clang, -O0):
<dev_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dev_read>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xee9(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"reading the data from memory\00"
@.str.1 = [4 x i8] c" %d\00"
define i32 @dev_read() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [29 x i8] c"reading the data from memory\00"
@.str.1 = [4 x i8] c" %d\00"
define i32 @dev_read() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 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), i32* %1)
%5 = load i32, i32* %1
ret i32 %5
}
/* Variables and functions */
float M_PI;
float deg_to_rad(float degrees) { return degrees * M_PI / 180; }


x86 assembly (clang, -O0):
<deg_to_rad>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mov    0x2ed3(%rip),%rax
mulss  (%rax),%xmm0
movss  0xedf(%rip),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<deg_to_rad>:
mov    0x2ee1(%rip),%rax
mulss  (%rax),%xmm0
divss  0xeed(%rip),%xmm0
ret

LLVM IR (-O0):
@M_PI = global float 0.000000e+00
define float @deg_to_rad(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* @M_PI
%5 = fmul float %3, %4
%6 = fdiv float %5, 1.800000e+02
ret float %6
}

LLVM IR (-O2):
@M_PI = global float 0.000000e+00
define float @deg_to_rad(float %0) {
%2 = load float, float* @M_PI
%3 = fmul float %2, %0
%4 = fdiv float %3, 1.800000e+02
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ realmain();
int main() {
  realmain();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @realmain()
ret i32 0
}