xunge/DecIR huggingface dataset:
int CTAI_util_sqlite3_count_columns(void *vout, int argc, char **argv,
                                    char **azColName) {
  int *out = (int *)vout;
  *out = argc;
  return -1;
}


x86 assembly (clang, -O0):
<CTAI_util_sqlite3_count_columns>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CTAI_util_sqlite3_count_columns>:
mov    %esi,(%rdi)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @CTAI_util_sqlite3_count_columns(i8* %0, i32 %1, i8** %2, i8** %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i8**
%9 = alloca i32*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8** %2, i8*** %7
store i8** %3, i8*** %8
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to i32*
store i32* %11, i32** %9
%12 = load i32, i32* %6
%13 = load i32*, i32** %9
store i32 %12, i32* %13
ret i32 -1
}

LLVM IR (-O2):
define i32 @CTAI_util_sqlite3_count_columns(i8* nocapture writeonly %0, i32 %1, i8** nocapture readnone %2, i8** nocapture readnone %3) {
%5 = bitcast i8* %0 to i32*
store i32 %1, i32* %5
ret i32 -1
}
main() { return (unsigned long)-1 >> 1 == -1; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int do_653() { return 653; }


x86 assembly (clang, -O0):
<do_653>:
push   %rbp
mov    %rsp,%rbp
mov    $0x28d,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @do_653() {
ret i32 653
}

LLVM IR (-O2):
define i32 @do_653() {
ret i32 653
}
/* Variables and functions */
void *memset(int /*<<< orphan*/, int /*<<< orphan*/, size_t);
int /*<<< orphan*/ xmalloc(size_t);
void *xzalloc(size_t s) { return memset(xmalloc(s), 0, s); }


x86 assembly (clang, -O0):
<xzalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <xmalloc@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xzalloc>:
push   %rbx
mov    %rdi,%rbx
call   1040 <xmalloc@plt>
mov    %eax,%edi
xor    %esi,%esi
mov    %rbx,%rdx
pop    %rbx
jmp    1030 <memset@plt>

LLVM IR (-O0):
define i8* @xzalloc(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @xmalloc(i64 %3)
%5 = load i64, i64* %2
%6 = call i8* @memset(i32 %4, i32 0, i64 %5)
ret i8* %6
}

LLVM IR (-O2):
define i8* @xzalloc(i64 %0) {
%2 = tail call i32 @xmalloc(i64 %0)
%3 = tail call i8* @memset(i32 %2, i32 0, i64 %0)
ret i8* %3
}
/* Type definitions */
struct tms {
  int dummy;
};
typedef int /*<<< orphan*/ clock_t;

/* Variables and functions */
clock_t times(struct tms *buf) {}


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

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

LLVM IR (-O0):
%struct.tms = type { i32 }
define i32 @times(%struct.tms* %0) {
%2 = alloca i32
%3 = alloca %struct.tms*
store %struct.tms* %0, %struct.tms** %3
%4 = load i32, i32* %2
ret i32 %4
}

LLVM IR (-O2):
%struct.tms = type { i32 }
define i32 @times(%struct.tms* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, const char *argv[]) {
  printf("this output is good\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 = [21 x i8] c"this output is good\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 ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [20 x i8] c"this output is good\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int test_imm_82uint32_reg(unsigned int val) {
  return ((val) & (0x82 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_82uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x82,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_82uint32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 130
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 -20, i32 -40
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_imm_82uint32_reg(i32 %0) {
%2 = and i32 %0, 130
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ F_OK;
scalar_t__ access(char *, int /*<<< orphan*/);
int fileExist(char *fileName) {
  if ((access(fileName, F_OK)) == 0) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<fileExist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
cmp    $0x0,%rax
jne    1144 <fileExist+0x34>
movl   $0x1,-0x4(%rbp)
jmp    114b <fileExist+0x3b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fileExist>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@F_OK = global i32 0
define i32 @fileExist(i8* nocapture %0) {
%2 = load i32, i32* @F_OK
%3 = tail call i64 @access(i8* %0, i32 %2)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
int max(x, y)
int x, y;
{
  int z;
  z = x > y ? x : y;
  return z;
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <max+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1127 <max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void random_int_init(void) {
  static int already_run = 0;
  if (!already_run) {
    already_run = 1;
    srand(time(NULL));
  }
}


x86 assembly (clang, -O0):
<random_int_init>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f09(%rip)
jne    114b <random_int_init+0x2b>
movl   $0x1,0x2ef9(%rip)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_int_init>:
push   %rax
cmpb   $0x0,0x2f0c(%rip)
je     112c <random_int_init+0xc>
pop    %rax
ret
movb   $0x1,0x2f01(%rip)
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <srand@plt>

LLVM IR (-O0):
@random_int_init.already_run = internal global i32 0
define void @random_int_init() {
%1 = load i32, i32* @random_int_init.already_run
%2 = icmp ne i32 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
store i32 1, i32* @random_int_init.already_run
%4 = call i32 @time(i32* null)
%5 = call i32 @srand(i32 %4)
br label %6
6: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
@random_int_init.already_run = internal unnamed_addr global i1 false
define void @random_int_init() {
%1 = load i1, i1* @random_int_init.already_run
br i1 %1, label %5, label %2
2: ; preds = %0
store i1 true, i1* @random_int_init.already_run
%3 = tail call i32 @time(i32* null)
%4 = tail call i32 @srand(i32 %3)
br label %5
5: ; preds = %2, %0
ret void
}
void left(void) {}


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

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

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

LLVM IR (-O2):
define void @left() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ mp_free(void *);
int mp_free_ptr(void *addr) {
  void *p;
  assert(addr != NULL);
  p = *(void **)addr;
  *(void **)addr = NULL;
  mp_free(p);
  return (0);
}


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

x86 assembly (clang, -O2):
<mp_free_ptr>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
mov    (%rbx),%rdi
movq   $0x0,(%rbx)
call   1040 <mp_free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @mp_free_ptr(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load i8*, i8** %2
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
store i8* %10, i8** %3
%11 = load i8*, i8** %2
%12 = bitcast i8* %11 to i8**
store i8* null, i8** %12
%13 = load i8*, i8** %3
%14 = call i32 @mp_free(i8* %13)
ret i32 0
}

LLVM IR (-O2):
define i32 @mp_free_ptr(i8* %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = bitcast i8* %0 to i8**
%6 = load i8*, i8** %5
store i8* null, i8** %5
%7 = tail call i32 @mp_free(i8* %6)
ret i32 0
}
void bootloader_check_and_update(void) {}


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

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

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

LLVM IR (-O2):
define void @bootloader_check_and_update() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ eol_convention(int /*<<< orphan*/);
int /*<<< orphan*/ restore_tty_flags();
void restore_defaults(void) {
  eol_convention(0);
  restore_tty_flags();
}


x86 assembly (clang, -O0):
<restore_defaults>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <eol_convention@plt>
mov    $0x0,%al
call   1030 <restore_tty_flags@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<restore_defaults>:
push   %rax
xor    %edi,%edi
call   1040 <eol_convention@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <restore_tty_flags@plt>

LLVM IR (-O0):
define void @restore_defaults() {
%1 = call i32 @eol_convention(i32 0)
%2 = call i32 (...) @restore_tty_flags()
ret void
}

LLVM IR (-O2):
define void @restore_defaults() {
%1 = tail call i32 @eol_convention(i32 0)
%2 = tail call i32 (...) @restore_tty_flags()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ putchar(char);
void print_array(int a[], int n) {
  int i;
  for (i = 0; i < n; ++i)
    printf("%d ", a[i]);
  putchar('\n');
}


x86 assembly (clang, -O0):
<print_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1167 <print_array+0x47>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <print_array+0x16>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_array>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1155 <print_array+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xec5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print_array+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @print_array(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), 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
%14 = tail call i32 @putchar(i8 signext 10)
ret void
}
/* Variables and functions */
scalar_t__ memory_Malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *string_StringCopy(const char *String) {
  char *copy;
  copy = (char *)memory_Malloc(strlen(String) + 1);
  strcpy(copy, String);
  return copy;
}


x86 assembly (clang, -O0):
<string_StringCopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1030 <memory_Malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_StringCopy>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1050 <strlen@plt>
lea    0x1(%rax),%rdi
call   1030 <memory_Malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1040 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @string_StringCopy(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i64 @memory_Malloc(i64 %6)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = load i8*, i8** %2
%11 = call i32 @strcpy(i8* %9, i8* %10)
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define i8* @string_StringCopy(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @memory_Malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @strcpy(i8* %5, i8* %0)
ret i8* %5
}
/* Variables and functions */
char lowercase(int);
bool is_decsym(int c) {
  if (lowercase(c) == 'd') {
    return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<is_decsym>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <lowercase@plt>
movsbl %al,%eax
cmp    $0x64,%eax
jne    113b <is_decsym+0x2b>
movl   $0x1,-0x4(%rbp)
jmp    1142 <is_decsym+0x32>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_decsym>:
push   %rax
call   1030 <lowercase@plt>
xor    %ecx,%ecx
cmp    $0x64,%al
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_decsym(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call signext i8 @lowercase(i32 %4)
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 100
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 1, i32* %2
br label %10
9: ; preds = %1
store i32 0, i32* %2
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @is_decsym(i32 %0) {
%2 = tail call signext i8 @lowercase(i32 %0)
%3 = icmp eq i8 %2, 100
%4 = zext i1 %3 to i32
ret i32 %4
}
void ff_hevc_put_hevc_uni_w_qpel_hv64_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_qpel_hv64_12_sse4() {
ret void
}
void foo439(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo439(i32 %0) {
ret void
}
/* Variables and functions */
int system(char *);
int main() {
  int ret;
  ret = system("ls -l /");
  return ret;
}


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"ls -l /\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
store i32 %3, i32* %2
%4 = load i32, i32* %2
ret i32 %4
}

LLVM IR (-O2):
@.str = [8 x i8] c"ls -l /\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ stack_mode;
};
typedef TYPE_1__ XWindowChanges;

/* Variables and functions */
int get_XWindowChanges_stack_mode(void *_p) {
  return (int)((XWindowChanges *)_p)->stack_mode;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XWindowChanges_stack_mode(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XWindowChanges_stack_mode(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, size_t);
void *memmalloc(size_t);
void *memdup(const void *base, size_t size) {
  void *mem;
  if (size == 0)
    return NULL;
  mem = memmalloc(size);
  memcpy(mem, base, size);
  return mem;
}


x86 assembly (clang, -O0):
<memdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1148 <memdup+0x28>
movq   $0x0,-0x8(%rbp)
jmp    116e <memdup+0x4e>
mov    -0x18(%rbp),%rdi
call   1040 <memmalloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memdup>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
je     114b <memdup+0x2b>
mov    %rsi,%rbx
mov    %rdi,%r15
mov    %rsi,%rdi
call   1040 <memmalloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1030 <memcpy@plt>
jmp    114e <memdup+0x2e>
xor    %r14d,%r14d
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @memdup(i8* %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i8* @memmalloc(i64 %1)
%6 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %1)
br label %7
7: ; preds = %2, %4
%8 = phi i8* [ %5, %4 ], [ null, %2 ]
ret i8* %8
}
void _Jv_Malloc(void) {}


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

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

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

LLVM IR (-O2):
define void @_Jv_Malloc() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(int argc, char **argv) {
  (void)argc;
  fprintf(stderr,
          "USAGE: `%s' <first lhalotree file> <second lhalotree file> <check "
          "mergertree indices>\n",
          argv[0]);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [87 x i8] c"USAGE: `%s' <first lhalotree file> <second lhalotree file> <check mergertree indices>\0A\00"
define void @usage(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = load i32, i32* @stderr
%7 = load i8**, i8*** %4
%8 = getelementptr inbounds i8*, i8** %7, i64 0
%9 = load i8*, i8** %8
%10 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str, i64 0, i64 0), i8* %9)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [87 x i8] c"USAGE: `%s' <first lhalotree file> <second lhalotree file> <check mergertree indices>\0A\00"
define void @usage(i32 %0, i8** nocapture %1) {
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %1
%5 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ NFDi_SetError(char *);
void *malloc(size_t);
void *NFDi_Malloc(size_t bytes) {
  void *ptr = malloc(bytes);
  if (!ptr)
    NFDi_SetError("NFDi_Malloc failed.");
  return ptr;
}


x86 assembly (clang, -O0):
<NFDi_Malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <NFDi_Malloc+0x30>
lea    0xeb5(%rip),%rdi
call   1040 <NFDi_SetError@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NFDi_Malloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <NFDi_Malloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <NFDi_SetError@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"NFDi_Malloc failed.\00"
define i8* @NFDi_Malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 @NFDi_SetError(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [20 x i8] c"NFDi_Malloc failed.\00"
define noalias i8* @NFDi_Malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @NFDi_SetError(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
void v9fs_cache_inode_get_cookie(struct inode *inode) {}


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

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

LLVM IR (-O0):
%struct.inode = type opaque
define void @v9fs_cache_inode_get_cookie(%struct.inode* %0) {
%2 = alloca %struct.inode*
store %struct.inode* %0, %struct.inode** %2
ret void
}

LLVM IR (-O2):
%struct.inode = type opaque
define void @v9fs_cache_inode_get_cookie(%struct.inode* nocapture %0) {
ret void
}
/* Variables and functions */
char atan(char);
char internal_atan_b(char value) { return atan(value); }


x86 assembly (clang, -O0):
<internal_atan_b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <atan@plt>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<internal_atan_b>:
jmp    1030 <atan@plt>

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

LLVM IR (-O2):
define signext i8 @internal_atan_b(i8 signext %0) {
%2 = tail call signext i8 @atan(i8 signext %0)
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ unlink(char *);
void closeConnection(int fd, char *pipePath) {
  close(fd);
  unlink(pipePath);
  printf("\n[SUCCESS] Sessione terminata per %s ", pipePath);
}


x86 assembly (clang, -O0):
<closeConnection>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <close@plt>
mov    -0x10(%rbp),%rdi
call   1030 <unlink@plt>
mov    -0x10(%rbp),%rsi
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<closeConnection>:
push   %rbx
mov    %rsi,%rbx
call   1050 <close@plt>
mov    %rbx,%rdi
call   1030 <unlink@plt>
lea    0xeb8(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"\0A[SUCCESS] Sessione terminata per %s \00"
define void @closeConnection(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = call i32 @close(i32 %5)
%7 = load i8*, i8** %4
%8 = call i32 @unlink(i8* %7)
%9 = load i8*, i8** %4
%10 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"\0A[SUCCESS] Sessione terminata per %s \00"
define void @closeConnection(i32 %0, i8* %1) {
%3 = tail call i32 @close(i32 %0)
%4 = tail call i32 @unlink(i8* %1)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DeinitFields();
void SwitchFrom_M16C(void) { DeinitFields(); }


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

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

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

LLVM IR (-O2):
define void @SwitchFrom_M16C() {
%1 = tail call i32 (...) @DeinitFields()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void MemFree(void *p) { free(p); }


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

x86 assembly (clang, -O2):
<MemFree>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @MemFree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
bool is_option(char *arg) { return arg[0] == '-'; }


x86 assembly (clang, -O0):
<is_option>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_option>:
xor    %eax,%eax
cmpb   $0x2d,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @is_option(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 45
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @is_option(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 45
%4 = zext i1 %3 to i32
ret i32 %4
}
int SN_get_max_iters(int *iparam) { return iparam[1]; }


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

x86 assembly (clang, -O2):
<SN_get_max_iters>:
mov    0x4(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @SN_get_max_iters(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 1
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @SN_get_max_iters(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
void *mmap(void *, size_t, int, int, int, int /*<<< orphan*/);
void *__softboundcets_safe_mmap(void *addr, size_t length, int prot, int flags,
                                int fd, off_t offset) {
  return mmap(addr, length, prot, flags, fd, offset);
}


x86 assembly (clang, -O0):
<__softboundcets_safe_mmap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
mov    -0x20(%rbp),%r9d
call   1030 <mmap@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__softboundcets_safe_mmap>:
jmp    1030 <mmap@plt>

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

LLVM IR (-O2):
define i8* @__softboundcets_safe_mmap(i8* %0, i64 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = tail call i8* @mmap(i8* %0, i64 %1, i32 %2, i32 %3, i32 %4, i32 %5)
ret i8* %7
}
char *xmalloc(n)
long n;
{
  extern char *calloc();
  char *str;
  long nelm = 1, siz = n;
  if (sizeof(unsigned) <= 2) {
    while (siz > 32000) {
      siz = (siz + 1) / 2;
      nelm *= 2;
    }
    if (nelm > 32000)
      xabort("xmalloc: chunk too large for 16 bit machine");
  }
  str = calloc((unsigned)nelm, (unsigned)siz);
  if (!str) {
    xabort("xmalloc: Oops - Out Of Mem");
  }
  return str;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x1,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %eax,%edi
mov    -0x20(%rbp),%rax
mov    %eax,%esi
mov    $0x0,%al
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116c <xmalloc+0x4c>
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1040 <xabort@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
mov    %rdi,%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1146 <xmalloc+0x26>
lea    0xec1(%rip),%rdi
xor    %eax,%eax
call   1040 <xabort@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [27 x i8] c"xmalloc: Oops - Out Of Mem\00"
define i8* @xmalloc(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = tail call i8* (i32, i32, ...) bitcast (i8* (...)* @calloc to i8* (i32, i32, ...)*)(i32 1, i32 %2)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @xabort to i32 (i8*, ...)*)(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ __NR_waitid;
int syscall(int /*<<< orphan*/, int, int /*<<< orphan*/, int /*<<< orphan*/ *,
            int, int /*<<< orphan*/ *);
int sys_waitid(int which, pid_t pid, int options) {
  return syscall(__NR_waitid, which, pid, NULL, options, NULL);
}


x86 assembly (clang, -O0):
<sys_waitid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%r8d
xor    %eax,%eax
mov    %eax,%r9d
mov    %r9,%rcx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_waitid>:
mov    %edx,%r8d
mov    %esi,%edx
mov    %edi,%esi
mov    0x2eca(%rip),%rax
mov    (%rax),%edi
xor    %ecx,%ecx
xor    %r9d,%r9d
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@__NR_waitid = global i32 0
define i32 @sys_waitid(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* @__NR_waitid
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @syscall(i32 %7, i32 %8, i32 %9, i32* null, i32 %10, i32* null)
ret i32 %11
}

LLVM IR (-O2):
@__NR_waitid = global i32 0
define i32 @sys_waitid(i32 %0, i32 %1, i32 %2) {
%4 = load i32, i32* @__NR_waitid
%5 = tail call i32 @syscall(i32 %4, i32 %0, i32 %1, i32* null, i32 %2, i32* null)
ret i32 %5
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int S_ISREG(int /*<<< orphan*/);
int stat(char *, struct stat *);
int file_exists(char *path) {
  struct stat s;
  int rv;
  rv = stat(path, &s);
  return rv ? 0 : S_ISREG(s.st_mode);
}


x86 assembly (clang, -O0):
<file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1150 <file_exists+0x30>
xor    %eax,%eax
mov    %eax,-0x18(%rbp)
jmp    115b <file_exists+0x3b>
mov    -0x10(%rbp),%edi
call   1040 <S_ISREG@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exists>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
test   %eax,%eax
je     1131 <file_exists+0x11>
xor    %eax,%eax
pop    %rcx
ret
mov    (%rsp),%edi
pop    %rax
jmp    1040 <S_ISREG@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @file_exists(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @stat(i8* %5, %struct.stat* %3)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
br label %14
10: ; preds = %1
%11 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%12 = load i32, i32* %11
%13 = call i32 @S_ISREG(i32 %12)
br label %14
14: ; preds = %10, %9
%15 = phi i32 [ 0, %9 ], [ %13, %10 ]
ret i32 %15
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @file_exists(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i32 @S_ISREG(i32 %8)
br label %10
10: ; preds = %1, %6
%11 = phi i32 [ %9, %6 ], [ 0, %1 ]
ret i32 %11
}
void mmc_pwrseq_free(struct mmc_host *host) {}


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

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

LLVM IR (-O0):
%struct.mmc_host = type opaque
define void @mmc_pwrseq_free(%struct.mmc_host* %0) {
%2 = alloca %struct.mmc_host*
store %struct.mmc_host* %0, %struct.mmc_host** %2
ret void
}

LLVM IR (-O2):
%struct.mmc_host = type opaque
define void @mmc_pwrseq_free(%struct.mmc_host* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void caml_regexp_replace_fun() { exit(1); }


x86 assembly (clang, -O0):
<caml_regexp_replace_fun>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<caml_regexp_replace_fun>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @caml_regexp_replace_fun() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @caml_regexp_replace_fun() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
__attribute__((noipa, optimize("Ofast"))) int f4(float x) {
  return __builtin_sqrtf(x) >= 0x1.5642e6p+54f;
}


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sqrtf@plt>
movss  0xed1(%rip),%xmm1
ucomiss %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4>:
push   %rax
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     111f <f4+0xf>
sqrtss %xmm0,%xmm0
jmp    1124 <f4+0x14>
call   1030 <sqrtf@plt>
xor    %eax,%eax
ucomiss 0xed3(%rip),%xmm0
setae  %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @f4(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @sqrtf(float %3)
%5 = fcmp oge float %4, 0x4355642E60000000
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @f4(float %0) {
%2 = tail call float @sqrtf(float %0)
%3 = fcmp oge float %2, 0x4355642E60000000
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct watch_list {
  int dummy;
};

/* Variables and functions */
int watch_list_put(struct watch_list *, int, int /*<<< orphan*/ *);
int watch_list_remove(struct watch_list *self, int wd) {
  return watch_list_put(self, wd, NULL);
}


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

x86 assembly (clang, -O2):
<watch_list_remove>:
xor    %edx,%edx
jmp    1030 <watch_list_put@plt>

LLVM IR (-O0):
%struct.watch_list = type { i32 }
define i32 @watch_list_remove(%struct.watch_list* %0, i32 %1) {
%3 = alloca %struct.watch_list*
%4 = alloca i32
store %struct.watch_list* %0, %struct.watch_list** %3
store i32 %1, i32* %4
%5 = load %struct.watch_list*, %struct.watch_list** %3
%6 = load i32, i32* %4
%7 = call i32 @watch_list_put(%struct.watch_list* %5, i32 %6, i32* null)
ret i32 %7
}

LLVM IR (-O2):
%struct.watch_list = type { i32 }
define i32 @watch_list_remove(%struct.watch_list* %0, i32 %1) {
%3 = tail call i32 @watch_list_put(%struct.watch_list* %0, i32 %1, i32* null)
ret i32 %3
}
void DoDebug(char *fmt, ...) { fmt = fmt; }


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

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

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

LLVM IR (-O2):
define void @DoDebug(i8* nocapture %0, ...) {
ret void
}
/* Type definitions */
struct sockaddr_in {
  int dummy;
};
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ cli_addr;

/* Variables and functions */
int accept(int, struct sockaddr *, int *);
int /*<<< orphan*/ error(char *);
int accept_connection(int sockfd) {
  struct sockaddr_in cli_addr;
  int clilen;
  clilen = sizeof(cli_addr);
  int newsockfd = accept(sockfd, (struct sockaddr *)&cli_addr, &clilen);
  if (newsockfd < 0)
    error("ERROR accepting connection");
  return newsockfd;
}


x86 assembly (clang, -O0):
<accept_connection>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x4,-0xc(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <accept@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    115b <accept_connection+0x3b>
lea    0xeaa(%rip),%rdi
call   1030 <error@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<accept_connection>:
push   %rbx
sub    $0x10,%rsp
movl   $0x4,0x4(%rsp)
lea    0x8(%rsp),%rsi
lea    0x4(%rsp),%rdx
call   1040 <accept@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    114e <accept_connection+0x2e>
lea    0xeb7(%rip),%rdi
call   1030 <error@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [27 x i8] c"ERROR accepting connection\00"
define i32 @accept_connection(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.sockaddr_in
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
store i32 4, i32* %4
%6 = load i32, i32* %2
%7 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
%8 = call i32 @accept(i32 %6, %struct.sockaddr* %7, i32* %4)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %1
%12 = call i32 @error(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %1
%14 = load i32, i32* %5
ret i32 %14
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [27 x i8] c"ERROR accepting connection\00"
define i32 @accept_connection(i32 %0) {
%2 = alloca %struct.sockaddr_in
%3 = alloca i32
%4 = bitcast %struct.sockaddr_in* %2 to i8*
%5 = bitcast i32* %3 to i8*
store i32 4, i32* %3
%6 = bitcast %struct.sockaddr_in* %2 to %struct.sockaddr*
%7 = call i32 @accept(i32 %0, %struct.sockaddr* %6, i32* %3)
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @error(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int _SIDD_BIT_MASK;
int _SIDD_CMP_EQUAL_EACH;
int _SIDD_UWORD_OPS;
int /*<<< orphan*/ _mm_cmpistrm(int /*<<< orphan*/, int /*<<< orphan*/,
                                int const);
__m128i cmp_mask(__m128i a, __m128i b) {
  const int mode = _SIDD_UWORD_OPS | _SIDD_CMP_EQUAL_EACH | _SIDD_BIT_MASK;
  return _mm_cmpistrm(a, b, mode);
}


x86 assembly (clang, -O0):
<cmp_mask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2eb3(%rip),%rax
mov    (%rax),%eax
mov    0x2eba(%rip),%rcx
or     (%rcx),%eax
mov    0x2e91(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <_mm_cmpistrm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_mask>:
mov    0x2ec1(%rip),%rax
mov    0x2eca(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
mov    0x2e9f(%rip),%rax
or     (%rax),%edx
jmp    1030 <_mm_cmpistrm@plt>

LLVM IR (-O0):
@_SIDD_UWORD_OPS = global i32 0
@_SIDD_CMP_EQUAL_EACH = global i32 0
@_SIDD_BIT_MASK = global i32 0
define i32 @cmp_mask(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* @_SIDD_UWORD_OPS
%7 = load i32, i32* @_SIDD_CMP_EQUAL_EACH
%8 = or i32 %6, %7
%9 = load i32, i32* @_SIDD_BIT_MASK
%10 = or i32 %8, %9
store i32 %10, i32* %5
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = call i32 @_mm_cmpistrm(i32 %11, i32 %12, i32 %13)
ret i32 %14
}

LLVM IR (-O2):
@_SIDD_UWORD_OPS = global i32 0
@_SIDD_CMP_EQUAL_EACH = global i32 0
@_SIDD_BIT_MASK = global i32 0
define i32 @cmp_mask(i32 %0, i32 %1) {
%3 = load i32, i32* @_SIDD_UWORD_OPS
%4 = load i32, i32* @_SIDD_CMP_EQUAL_EACH
%5 = or i32 %4, %3
%6 = load i32, i32* @_SIDD_BIT_MASK
%7 = or i32 %5, %6
%8 = tail call i32 @_mm_cmpistrm(i32 %0, i32 %1, i32 %7)
ret i32 %8
}