xunge/DecIR huggingface dataset:
/* Type definitions */
struct t_hashtable {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ hashtable_set(struct t_hashtable *, void const *,
                                 void const *);
void hashtable_duplicate_map_cb(void *data, struct t_hashtable *hashtable,
                                const void *key, const void *value) {
  struct t_hashtable *hashtable2;
  (void)hashtable;
  hashtable2 = (struct t_hashtable *)data;
  if (hashtable2)
    hashtable_set(hashtable2, key, value);
}


x86 assembly (clang, -O0):
<hashtable_duplicate_map_cb>:
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    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     114c <hashtable_duplicate_map_cb+0x3c>
mov    -0x28(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <hashtable_set@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashtable_duplicate_map_cb>:
test   %rdi,%rdi
je     1120 <hashtable_duplicate_map_cb+0x10>
mov    %rdx,%rsi
mov    %rcx,%rdx
jmp    1030 <hashtable_set@plt>
ret

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

LLVM IR (-O2):
%struct.t_hashtable = type { i32 }
define void @hashtable_duplicate_map_cb(i8* %0, %struct.t_hashtable* nocapture readnone %1, i8* %2, i8* %3) {
%5 = icmp eq i8* %0, null
br i1 %5, label %9, label %6
6: ; preds = %4
%7 = bitcast i8* %0 to %struct.t_hashtable*
%8 = tail call i32 @hashtable_set(%struct.t_hashtable* %7, i8* %2, i8* %3)
br label %9
9: ; preds = %6, %4
ret void
}
int test_imm_D0uint32_reg(unsigned int val) {
  return ((val) & (0xD0 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_D0uint32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 208
%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_D0uint32_reg(i32 %0) {
%2 = and i32 %0, 208
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int LOCK_EX;
int LOCK_NB;
int LOCK_UN;
int /*<<< orphan*/ flock(int /*<<< orphan*/, int);
void main() { flock(0, LOCK_EX | LOCK_UN | LOCK_NB); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%esi
mov    0x2eb4(%rip),%rax
or     (%rax),%esi
mov    0x2e9b(%rip),%rax
or     (%rax),%esi
xor    %edi,%edi
call   1030 <flock@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    0x2ed1(%rip),%rax
mov    0x2eba(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2e9f(%rip),%rax
or     (%rax),%esi
xor    %edi,%edi
jmp    1030 <flock@plt>

LLVM IR (-O0):
@LOCK_EX = global i32 0
@LOCK_UN = global i32 0
@LOCK_NB = global i32 0
define void @main() {
%1 = load i32, i32* @LOCK_EX
%2 = load i32, i32* @LOCK_UN
%3 = or i32 %1, %2
%4 = load i32, i32* @LOCK_NB
%5 = or i32 %3, %4
%6 = call i32 @flock(i32 0, i32 %5)
ret void
}

LLVM IR (-O2):
@LOCK_EX = global i32 0
@LOCK_UN = global i32 0
@LOCK_NB = global i32 0
define void @main() {
%1 = load i32, i32* @LOCK_EX
%2 = load i32, i32* @LOCK_UN
%3 = or i32 %2, %1
%4 = load i32, i32* @LOCK_NB
%5 = or i32 %3, %4
%6 = tail call i32 @flock(i32 0, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ heapSort(int *, int);
int /*<<< orphan*/ printArray(int *, int);
int main() {
  int a[] = {20, 5, 10, 12, 15, 8, 2, 6, 2, 9};
  printArray(a, 10);
  heapSort(a, 10);
  printArray(a, 10);
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xead(%rip),%rsi
mov    $0x28,%edx
call   1050 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1060 <printArray@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1030 <heapSort@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1060 <printArray@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
mov    0xee4(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeac(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1050 <printArray@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <heapSort@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1050 <printArray@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.a = [10 x i32] [i32 20, i32 5, i32 10, i32 12, i32 15, i32 8, i32 2, i32 6, i32 2, i32 9]
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @printArray(i32* %3, i32 10)
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%6 = call i32 @heapSort(i32* %5, i32 10)
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%8 = call i32 @printArray(i32* %7, i32 10)
%9 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [10 x i32] [i32 20, i32 5, i32 10, i32 12, i32 15, i32 8, i32 2, i32 6, i32 2, i32 9]
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @printArray(i32* %3, i32 10)
%5 = call i32 @heapSort(i32* %3, i32 10)
%6 = call i32 @printArray(i32* %3, i32 10)
%7 = call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ lobatto_nodes_fix(double *, int);
int /*<<< orphan*/ lobatto_nodes_n(double *, int);
void lobatto_nodes(double *restrict z, int n) {
  if (n > 24)
    lobatto_nodes_n(z, n);
  else if (n >= 2)
    lobatto_nodes_fix(z, n);
}


x86 assembly (clang, -O0):
<lobatto_nodes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x18,-0xc(%rbp)
jle    114a <lobatto_nodes+0x2a>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <lobatto_nodes_n@plt>
jmp    1165 <lobatto_nodes+0x45>
cmpl   $0x2,-0xc(%rbp)
jl     1160 <lobatto_nodes+0x40>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <lobatto_nodes_fix@plt>
jmp    1165 <lobatto_nodes+0x45>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lobatto_nodes>:
cmp    $0x19,%esi
jl     112a <lobatto_nodes+0xa>
jmp    1040 <lobatto_nodes_n@plt>
cmp    $0x2,%esi
jl     1134 <lobatto_nodes+0x14>
jmp    1030 <lobatto_nodes_fix@plt>
ret

LLVM IR (-O0):
define void @lobatto_nodes(double* noalias %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp sgt i32 %5, 24
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load double*, double** %3
%9 = load i32, i32* %4
%10 = call i32 @lobatto_nodes_n(double* %8, i32 %9)
br label %19
11: ; preds = %2
%12 = load i32, i32* %4
%13 = icmp sge i32 %12, 2
br i1 %13, label %14, label %18
14: ; preds = %11
%15 = load double*, double** %3
%16 = load i32, i32* %4
%17 = call i32 @lobatto_nodes_fix(double* %15, i32 %16)
br label %18
18: ; preds = %14, %11
br label %19
19: ; preds = %18, %7
ret void
}

LLVM IR (-O2):
define void @lobatto_nodes(double* noalias %0, i32 %1) {
%3 = icmp sgt i32 %1, 24
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @lobatto_nodes_n(double* %0, i32 %1)
br label %10
6: ; preds = %2
%7 = icmp sgt i32 %1, 1
br i1 %7, label %8, label %10
8: ; preds = %6
%9 = tail call i32 @lobatto_nodes_fix(double* %0, i32 %1)
br label %10
10: ; preds = %6, %8, %4
ret void
}
const char *safe_str(const char *str) { return str ? str : ""; }


x86 assembly (clang, -O0):
<safe_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1120 <safe_str+0x20>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1130 <safe_str+0x30>
lea    0xed9(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1130 <safe_str+0x30>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_str>:
test   %rdi,%rdi
lea    0xef6(%rip),%rax
cmovne %rdi,%rax
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @safe_str(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i8*, i8** %2
br label %8
7: ; preds = %1
br label %8
8: ; preds = %7, %5
%9 = phi i8* [ %6, %5 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %7 ]
ret i8* %9
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @safe_str(i8* readnone %0) {
%2 = icmp eq i8* %0, null
%3 = select i1 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %0
ret i8* %3
}
/* Type definitions */
struct vrml_vector {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct vrml_vector *);
void vrml_vector_free(struct vrml_vector *v) { free(v); }


x86 assembly (clang, -O0):
<vrml_vector_free>:
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):
<vrml_vector_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.vrml_vector = type { i32 }
define void @vrml_vector_free(%struct.vrml_vector* %0) {
%2 = alloca %struct.vrml_vector*
store %struct.vrml_vector* %0, %struct.vrml_vector** %2
%3 = load %struct.vrml_vector*, %struct.vrml_vector** %2
%4 = call i32 @free(%struct.vrml_vector* %3)
ret void
}

LLVM IR (-O2):
%struct.vrml_vector = type { i32 }
define void @vrml_vector_free(%struct.vrml_vector* nocapture %0) {
%2 = tail call i32 @free(%struct.vrml_vector* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_usage(void) {
  printf("Usage: %s -hv | -f file [-o -m -k -x -d -e -s]\n\n"
         "Options:\n"
         "    -f, --file      backup stream file\n"
         "    -o, --obj       print object headers, including headers for\n"
         "                    deleted objects\n"
         "    -m, --meta      print object metadata\n"
         "    -k, --key       print object key\n"
         "    -x, --hexkey    print object key in hex\n"
         "    -d, --data      print object data\n"
         "    -e, --hexdata   print object data in hex\n"
         "    -v, --version   displays program version\n"
         "    -s, --short     only process first 10000 objects\n"
         "    -h, --help      displays help\n\n",
         "read_backup_stream");
  return;
}


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

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

LLVM IR (-O0):
@.str = [536 x i8] c"Usage: %s -hv | -f file [-o -m -k -x -d -e -s]\0A\0AOptions:\0A -f, --file backup stream file\0A -o, --obj print object headers, including headers for\0A deleted objects\0A -m, --meta print object metadata\0A -k, --key print object key\0A -x, --hexkey print object key in hex\0A -d, --data print object data\0A -e, --hexdata print object data in hex\0A -v, --version displays program version\0A -s, --short only process first 10000 objects\0A -h, --help displays help\0A\0A\00"
@.str.1 = [19 x i8] c"read_backup_stream\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([536 x i8], [536 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [536 x i8] c"Usage: %s -hv | -f file [-o -m -k -x -d -e -s]\0A\0AOptions:\0A -f, --file backup stream file\0A -o, --obj print object headers, including headers for\0A deleted objects\0A -m, --meta print object metadata\0A -k, --key print object key\0A -x, --hexkey print object key in hex\0A -d, --data print object data\0A -e, --hexdata print object data in hex\0A -v, --version displays program version\0A -s, --short only process first 10000 objects\0A -h, --help displays help\0A\0A\00"
@.str.1 = [19 x i8] c"read_backup_stream\00"
define void @print_usage() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([536 x i8], [536 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct fio_ctx {
  int dummy;
};
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ sendfile(int const, int const, int /*<<< orphan*/ *,
                            size_t const);
ssize_t file_sendfile(const int fd_in, const int fd_out,
                      struct fio_ctx *ctx __attribute__((unused)),
                      const size_t nbytes) {
  assert(nbytes > 0);
  return sendfile(fd_out, fd_in, NULL, nbytes);
}


x86 assembly (clang, -O0):
<file_sendfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
seta   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0x18(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%edx
call   1040 <sendfile@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_sendfile>:
push   %rbp
push   %r14
push   %rbx
mov    %rcx,%rbx
mov    %esi,%ebp
mov    %edi,%r14d
xor    %edi,%edi
test   %rcx,%rcx
setne  %dil
call   1030 <assert@plt>
mov    %ebp,%edi
mov    %r14d,%esi
xor    %edx,%edx
mov    %rbx,%rcx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <sendfile@plt>

LLVM IR (-O0):
%struct.fio_ctx = type { i32 }
define i32 @file_sendfile(i32 %0, i32 %1, %struct.fio_ctx* %2, i64 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.fio_ctx*
%8 = alloca i64
store i32 %0, i32* %5
store i32 %1, i32* %6
store %struct.fio_ctx* %2, %struct.fio_ctx** %7
store i64 %3, i64* %8
%9 = load i64, i64* %8
%10 = icmp ugt i64 %9, 0
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i32, i32* %6
%14 = load i32, i32* %5
%15 = load i64, i64* %8
%16 = call i32 @sendfile(i32 %13, i32 %14, i32* null, i64 %15)
ret i32 %16
}

LLVM IR (-O2):
%struct.fio_ctx = type { i32 }
define i32 @file_sendfile(i32 %0, i32 %1, %struct.fio_ctx* nocapture readnone %2, i64 %3) {
%5 = icmp ne i64 %3, 0
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = tail call i32 @sendfile(i32 %1, i32 %0, i32* null, i64 %3)
ret i32 %8
}
int _hclib_atomic_load_relaxed(volatile int *target) { return *target; }


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

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

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

LLVM IR (-O2):
define i32 @_hclib_atomic_load_relaxed(i32* %0) {
%2 = load volatile i32, i32* %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ signify_bzero(void *, size_t);
void explicit_bzero(void *p, size_t n) { signify_bzero(p, n); }


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

x86 assembly (clang, -O2):
<explicit_bzero>:
jmp    1030 <signify_bzero@plt>

LLVM IR (-O0):
define void @explicit_bzero(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i32 @signify_bzero(i8* %5, i64 %6)
ret void
}

LLVM IR (-O2):
define void @explicit_bzero(i8* %0, i64 %1) {
%3 = tail call i32 @signify_bzero(i8* %0, i64 %1)
ret void
}
char kernel__Char___43d(char self, long p0) {
  char var;
  char var1;
  var1 = self + p0;
  var = var1;
  goto RET_LABEL;
RET_LABEL:;
  return var;
}


x86 assembly (clang, -O0):
<kernel__Char___43d>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movsbq -0x1(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kernel__Char___43d>:
lea    (%rsi,%rdi,1),%eax
ret

LLVM IR (-O0):
define signext i8 @kernel__Char___43d(i8 signext %0, i64 %1) {
%3 = alloca i8
%4 = alloca i64
%5 = alloca i8
%6 = alloca i8
store i8 %0, i8* %3
store i64 %1, i64* %4
%7 = load i8, i8* %3
%8 = sext i8 %7 to i64
%9 = load i64, i64* %4
%10 = add nsw i64 %8, %9
%11 = trunc i64 %10 to i8
store i8 %11, i8* %6
%12 = load i8, i8* %6
store i8 %12, i8* %5
br label %13
13: ; preds = %2
%14 = load i8, i8* %5
ret i8 %14
}

LLVM IR (-O2):
define signext i8 @kernel__Char___43d(i8 signext %0, i64 %1) {
%3 = trunc i64 %1 to i8
%4 = add i8 %3, %0
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ MCL_CURRENT;
int /*<<< orphan*/ MCL_FUTURE;
int /*<<< orphan*/ MCL_ONFAULT;
int mlockall(int /*<<< orphan*/);
int main(void) {
  int ret;
  ret = mlockall(MCL_CURRENT);
  (void)ret;
  ret = mlockall(MCL_FUTURE);
  (void)ret;
  ret = mlockall(MCL_ONFAULT);
  (void)ret;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
call   1030 <mlockall@plt>
mov    %eax,-0x8(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
call   1030 <mlockall@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1030 <mlockall@plt>
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
call   1030 <mlockall@plt>
mov    0x2eca(%rip),%rax
mov    (%rax),%edi
call   1030 <mlockall@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1030 <mlockall@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@MCL_CURRENT = global i32 0
@MCL_FUTURE = global i32 0
@MCL_ONFAULT = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @MCL_CURRENT
%4 = call i32 @mlockall(i32 %3)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = load i32, i32* @MCL_FUTURE
%7 = call i32 @mlockall(i32 %6)
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = load i32, i32* @MCL_ONFAULT
%10 = call i32 @mlockall(i32 %9)
store i32 %10, i32* %2
%11 = load i32, i32* %2
ret i32 0
}

LLVM IR (-O2):
@MCL_CURRENT = global i32 0
@MCL_FUTURE = global i32 0
@MCL_ONFAULT = global i32 0
define i32 @main() {
%1 = load i32, i32* @MCL_CURRENT
%2 = tail call i32 @mlockall(i32 %1)
%3 = load i32, i32* @MCL_FUTURE
%4 = tail call i32 @mlockall(i32 %3)
%5 = load i32, i32* @MCL_ONFAULT
%6 = tail call i32 @mlockall(i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void quit() { exit(-1); }


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

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

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

LLVM IR (-O2):
define void @quit() {
%1 = tail call i32 @exit(i32 -1)
unreachable
}
void rho_ruby_enable_gc(unsigned long val) {}


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

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

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

LLVM IR (-O2):
define void @rho_ruby_enable_gc(i64 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nao_troca(int, int);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  int x = 100, y = 200;
  nao_troca(x, y);
  printf("Na main: x = %d, y = %d\n", x, y);
  printf("\n\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x64,-0x8(%rbp)
movl   $0xc8,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <nao_troca@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x64,%edi
mov    $0xc8,%esi
call   1050 <nao_troca@plt>
lea    0xeb9(%rip),%rdi
mov    $0x64,%esi
mov    $0xc8,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Na main: x = %d, y = %d\0A\00"
@.str.1 = [3 x i8] c"\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 100, i32* %2
store i32 200, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = call i32 @nao_troca(i32 %4, i32 %5)
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"Na main: x = %d, y = %d\0A\00"
@str = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = tail call i32 @nao_troca(i32 100, i32 200)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 100, i32 200)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void TDB_cmd_help_print_connect() { printf("connect help goes here.\n"); }


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

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

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

LLVM IR (-O2):
@str = [24 x i8] c"connect help goes here.\00"
define void @TDB_cmd_help_print_connect() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
void *malloc(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  void *p1 = NULL;
  p1 = malloc(sizeof(int));
  int *p1_convertido = (int *)p1;
  *p1_convertido = 3;
  printf("p1 convertido:%d \n", *p1_convertido);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x3,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [19 x i8] c"p1 convertido:%d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32*
store i32 0, i32* %1
store i8* null, i8** %2
%4 = call i8* @malloc(i32 4)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = bitcast i8* %5 to i32*
store i32* %6, i32** %3
%7 = load i32*, i32** %3
store i32 3, i32* %7
%8 = load i32*, i32** %3
%9 = load i32, i32* %8
%10 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"p1 convertido:%d \0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int TID = 0;
  printf("Thread ID of the master thread is %d\n", TID);
#pragma omp parallel
  {
    int TID = 0;
    printf("In parallel region - Thread ID is %d\n", TID);
  }
  return (0);
}


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

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

LLVM IR (-O0):
@.str = [38 x i8] c"Thread ID of the master thread is %d\0A\00"
@.str.1 = [38 x i8] c"In parallel region - Thread ID is %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%8 = load i32, i32* %6
%9 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %8)
store i32 0, i32* %7
%10 = load i32, i32* %7
%11 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [38 x i8] c"Thread ID of the master thread is %d\0A\00"
@.str.1 = [38 x i8] c"In parallel region - Thread ID is %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret i32 0
}
int f2(int i) {
  if (i == 0)
    return 0;
  return i % 10;
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <f2+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    112b <f2+0x2b>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
movslq %edi,%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @f2(i32 %0) {
%2 = srem i32 %0, 10
ret i32 %2
}
void str_fill_blanks(char *str, int const length) {
  assert(str);
  assert(length >= 0);
  memset(str, ' ', length);
  str[length] = '\0';
}


x86 assembly (clang, -O0):
<str_fill_blanks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <assert@plt>
cmpl   $0x0,-0xc(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rdx
mov    $0x20,%esi
call   1030 <memset@plt>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_fill_blanks>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <assert@plt>
mov    %ebp,%edi
not    %edi
shr    $0x1f,%edi
xor    %eax,%eax
call   1040 <assert@plt>
movslq %ebp,%rbp
mov    %rbx,%rdi
mov    $0x20,%esi
mov    %rbp,%rdx
call   1030 <memset@plt>
movb   $0x0,(%rbx,%rbp,1)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @str_fill_blanks(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @assert to i32 (i8*, ...)*)(i8* %5)
%7 = load i32, i32* %4
%8 = icmp sge i32 %7, 0
%9 = zext i1 %8 to i32
%10 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %9)
%11 = load i8*, i8** %3
%12 = load i32, i32* %4
%13 = sext i32 %12 to i64
%14 = load i8*, i8** %3
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
store i8 0, i8* %17
ret void
}

LLVM IR (-O2):
define void @str_fill_blanks(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @assert to i32 (i8*, ...)*)(i8* %0)
%4 = xor i32 %1, -1
%5 = lshr i32 %4, 31
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %5)
%7 = sext i32 %1 to i64
tail call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 32, i64 %7, i1 false)
%8 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 0, i8* %8
ret void
}
int get_num_digits(int n) {
  int i = 0;
  for (; n > 0; ++i) {
    n = n / 10;
  }
  return i;
}


x86 assembly (clang, -O0):
<get_num_digits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1134 <get_num_digits+0x34>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <get_num_digits+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_num_digits>:
xor    %eax,%eax
test   %edi,%edi
jle    1124 <get_num_digits+0x24>
mov    $0xcccccccd,%ecx
nopl   0x0(%rax,%rax,1)
mov    %edi,%edx
imul   %rcx,%rdx
shr    $0x23,%rdx
add    $0x1,%eax
cmp    $0x9,%edi
mov    %edx,%edi
ja     1110 <get_num_digits+0x10>
ret

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

LLVM IR (-O2):
define i32 @get_num_digits(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = udiv i32 %5, 10
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i32 %5, 10
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
int test_imm_46uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x46 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_46uint64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x20,%rdx
and    $0x46,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_46uint64_highword_reg>:
movabs $0x4600000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_46uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 300647710720
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int random_int(int, int);
void random_matrix_int(int *a, const unsigned int rows,
                       const unsigned int cols) {
  for (unsigned int i = 0; i < rows * cols; i++) {
    a[i] = random_int(1, 10);
  }
}


x86 assembly (clang, -O0):
<random_matrix_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
imul   -0x10(%rbp),%ecx
cmp    %ecx,%eax
jae    1164 <random_matrix_int+0x54>
mov    $0x1,%edi
mov    $0xa,%esi
call   1030 <random_int@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1129 <random_matrix_int+0x19>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_matrix_int>:
push   %r15
push   %r14
push   %rbx
imul   %edx,%esi
test   %esi,%esi
je     114c <random_matrix_int+0x3c>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x1,%edi
mov    $0xa,%esi
call   1030 <random_int@plt>
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <random_matrix_int+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @random_matrix_int(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 0, i32* %7
br label %8
8: ; preds = %20, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = mul i32 %10, %11
%13 = icmp ult i32 %9, %12
br i1 %13, label %14, label %23
14: ; preds = %8
%15 = call i32 @random_int(i32 1, i32 10)
%16 = load i32*, i32** %4
%17 = load i32, i32* %7
%18 = zext i32 %17 to i64
%19 = getelementptr inbounds i32, i32* %16, i64 %18
store i32 %15, i32* %19
br label %20
20: ; preds = %14
%21 = load i32, i32* %7
%22 = add i32 %21, 1
store i32 %22, i32* %7
br label %8
23: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @random_matrix_int(i32* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = mul i32 %2, %1
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = zext i32 %4 to i64
br label %9
8: ; preds = %9, %3
ret void
9: ; preds = %6, %9
%10 = phi i64 [ 0, %6 ], [ %13, %9 ]
%11 = tail call i32 @random_int(i32 1, i32 10)
%12 = getelementptr inbounds i32, i32* %0, i64 %10
store i32 %11, i32* %12
%13 = add nuw nsw i64 %10, 1
%14 = icmp eq i64 %13, %7
br i1 %14, label %8, label %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void output(char *str) {
  printf(str);
  printf("\n");
}


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

x86 assembly (clang, -O2):
<output>:
push   %rax
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @output(i8* nocapture %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) %0)
%3 = tail call i32 @putchar(i32 10)
ret void
}
void defineArray() {
  char c[] = {'a', 'b', '\0'};
  char *str1 = "hello";
  char *str2 = "abc"
               "ddd"
               "zz";
  char *str3 = "abc"
               "ddd"
               "zz";
  printf("c = %o\n", c);
  printf("c = %s\n", c);
}


x86 assembly (clang, -O0):
<defineArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee1(%rip),%ax
mov    %ax,-0x3(%rbp)
mov    0xed9(%rip),%al
mov    %al,-0x1(%rbp)
lea    0xed0(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xecb(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xec0(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    -0x3(%rbp),%rsi
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x3(%rbp),%rsi
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<defineArray>:
push   %rbx
sub    $0x10,%rsp
movb   $0x0,0xe(%rsp)
movw   $0x6261,0xc(%rsp)
lea    0xedb(%rip),%rdi
lea    0xc(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.defineArray.c = [3 x i8] c"ab\00"
@.str = [6 x i8] c"hello\00"
@.str.1 = [9 x i8] c"abcdddzz\00"
@.str.2 = [8 x i8] c"c = %o\0A\00"
@.str.3 = [8 x i8] c"c = %s\0A\00"
define void @defineArray() {
%1 = alloca [3 x i8]
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = bitcast [3 x i8]* %1 to i8*
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8** %3
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8** %4
%6 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %6)
%8 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* %8)
ret void
}

LLVM IR (-O2):
@__const.defineArray.c = [3 x i8] c"ab\00"
@.str.2 = [8 x i8] c"c = %o\0A\00"
@.str.3 = [8 x i8] c"c = %s\0A\00"
define void @defineArray() {
%1 = alloca [3 x i8]
%2 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %2)
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_bom();
int /*<<< orphan*/ test_file();
int /*<<< orphan*/ test_no_newline();
int main() {
  test_file();
  test_bom();
  test_no_newline();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <test_file@plt>
mov    $0x0,%al
call   1040 <test_bom@plt>
mov    $0x0,%al
call   1030 <test_no_newline@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @test_file()
%2 = call i32 (...) @test_bom()
%3 = call i32 (...) @test_no_newline()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_file()
%2 = tail call i32 (...) @test_bom()
%3 = tail call i32 (...) @test_no_newline()
ret i32 0
}
__attribute__((always_)) void write_cr3(void *cr3) {
  asm volatile("mov %0, %%cr3" : : "r"(cr3));
}


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

x86 assembly (clang, -O2):
<write_cr3>:
mov    %rdi,%cr3
ret

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

LLVM IR (-O2):
define void @write_cr3(i8* %0) {
tail call void asm sideeffect "mov $0, %cr3", "r,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ vt;
struct vt_sizes {
  int dummy;
};

/* Variables and functions */
int main(void) {
  struct vt_sizes vt;
  (void)vt;
  return sizeof(vt);
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ vdp_dma_vram(int /*<<< orphan*/, int, int);
void vdp_map_hline(uint16_t plan, const uint16_t *tiles, uint16_t x, uint16_t y,
                   uint16_t len) {
  vdp_dma_vram((uint32_t)tiles, plan + ((x + (y << 6)) << 1), len);
}


x86 assembly (clang, -O0):
<vdp_map_hline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,%edi
mov    -0x4(%rbp),%esi
mov    -0x14(%rbp),%eax
mov    -0x18(%rbp),%ecx
shl    $0x6,%ecx
add    %ecx,%eax
shl    $0x1,%eax
add    %eax,%esi
mov    -0x1c(%rbp),%edx
call   1030 <vdp_dma_vram@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vdp_map_hline>:
mov    %rsi,%rax
shl    $0x6,%ecx
add    %edx,%ecx
lea    (%rdi,%rcx,2),%esi
mov    %eax,%edi
mov    %r8d,%edx
jmp    1030 <vdp_dma_vram@plt>

LLVM IR (-O0):
define void @vdp_map_hline(i32 %0, i32* %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i32* %1, i32** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32*, i32** %7
%12 = ptrtoint i32* %11 to i32
%13 = load i32, i32* %6
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = shl i32 %15, 6
%17 = add nsw i32 %14, %16
%18 = shl i32 %17, 1
%19 = add nsw i32 %13, %18
%20 = load i32, i32* %10
%21 = call i32 @vdp_dma_vram(i32 %12, i32 %19, i32 %20)
ret void
}

LLVM IR (-O2):
define void @vdp_map_hline(i32 %0, i32* %1, i32 %2, i32 %3, i32 %4) {
%6 = ptrtoint i32* %1 to i64
%7 = trunc i64 %6 to i32
%8 = shl i32 %3, 6
%9 = add nsw i32 %8, %2
%10 = shl i32 %9, 1
%11 = add nsw i32 %10, %0
%12 = tail call i32 @vdp_dma_vram(i32 %7, i32 %11, i32 %4)
ret void
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
scalar_t__ EINTR;
scalar_t__ errno;
int write(int, void const *, size_t);
ssize_t Write(int fd, const void *ptr, size_t nbytes) {
  ssize_t n;
again:
  if ((n = write(fd, ptr, nbytes)) == -1) {
    if (errno == EINTR)
      goto again;
    else
      return -1;
  }
  return n;
}


x86 assembly (clang, -O0):
<Write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <write@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0xffffffff,%eax
jne    116a <Write+0x5a>
mov    0x2e9a(%rip),%rax
mov    (%rax),%rax
mov    0x2e88(%rip),%rcx
cmp    (%rcx),%rax
jne    115e <Write+0x4e>
jmp    1123 <Write+0x13>
movl   $0xffffffff,-0x4(%rbp)
jmp    1170 <Write+0x60>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Write>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2eb9(%rip),%r15
mov    0x2eaa(%rip),%r12
xchg   %ax,%ax
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <write@plt>
cmp    $0xffffffff,%eax
jne    114b <Write+0x3b>
mov    (%r15),%rcx
cmp    (%r12),%rcx
je     1130 <Write+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i64 0
@EINTR = global i64 0
define i32 @Write(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i64 %2, i64* %7
br label %9
9: ; preds = %19, %3
%10 = load i32, i32* %5
%11 = load i8*, i8** %6
%12 = load i64, i64* %7
%13 = call i32 @write(i32 %10, i8* %11, i64 %12)
store i32 %13, i32* %8
%14 = icmp eq i32 %13, -1
br i1 %14, label %15, label %21
15: ; preds = %9
%16 = load i64, i64* @errno
%17 = load i64, i64* @EINTR
%18 = icmp eq i64 %16, %17
br i1 %18, label %19, label %20
19: ; preds = %15
br label %9
20: ; preds = %15
store i32 -1, i32* %4
br label %23
21: ; preds = %9
%22 = load i32, i32* %8
store i32 %22, i32* %4
br label %23
23: ; preds = %21, %20
%24 = load i32, i32* %4
ret i32 %24
}

LLVM IR (-O2):
@errno = global i64 0
@EINTR = global i64 0
define i32 @Write(i32 %0, i8* nocapture %1, i64 %2) {
br label %4
4: ; preds = %7, %3
%5 = tail call i32 @write(i32 %0, i8* %1, i64 %2)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = load i64, i64* @errno
%9 = load i64, i64* @EINTR
%10 = icmp eq i64 %8, %9
br i1 %10, label %4, label %11
11: ; preds = %4, %7
ret i32 %5
}
int main() {
  int x$1[20];
  return (*(x$1 + 0));
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 undef
}
/* Type definitions */
struct stat {
  int st_blocks;
};

/* Variables and functions */
int /*<<< orphan*/ lstat(char const *, struct stat *);
size_t filesize(const char *fn) {
  struct stat st;
  if (!lstat(fn, &st))
    return 512 * st.st_blocks;
  return 0;
}


x86 assembly (clang, -O0):
<filesize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <lstat@plt>
cmp    $0x0,%eax
jne    1143 <filesize+0x33>
mov    -0x18(%rbp),%eax
shl    $0x9,%eax
cltq
mov    %rax,-0x8(%rbp)
jmp    114b <filesize+0x3b>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filesize>:
push   %rax
mov    %rsp,%rsi
call   1030 <lstat@plt>
mov    (%rsp),%ecx
shl    $0x9,%ecx
xor    %edx,%edx
test   %eax,%eax
cmove  %ecx,%edx
movslq %edx,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i64 @filesize(i8* %0) {
%2 = alloca i64
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @lstat(i8* %5, %struct.stat* %4)
%7 = icmp ne i32 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %1
%9 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%10 = load i32, i32* %9
%11 = mul nsw i32 512, %10
%12 = sext i32 %11 to i64
store i64 %12, i64* %2
br label %14
13: ; preds = %1
store i64 0, i64* %2
br label %14
14: ; preds = %13, %8
%15 = load i64, i64* %2
ret i64 %15
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i64 @filesize(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @lstat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, 0
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = shl nsw i32 %7, 9
%9 = select i1 %5, i32 %8, i32 0
%10 = sext i32 %9 to i64
ret i64 %10
}