xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() {
  int x = 0;
  int y = -1;
  if (x)
    printf("x vrai\n");
  else
    printf("x faux\n");
  if (y)
    printf("y vrai\n");
  else
    printf("y faux\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1148 <main+0x38>
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
jmp    1154 <main+0x44>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x0,-0xc(%rbp)
je     116f <main+0x5f>
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
jmp    117b <main+0x6b>
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [7 x i8] c"x faux\00"
@str.4 = [7 x i8] c"y vrai\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.4, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct clib_iterator {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct clib_iterator *);
void delete_iterator_c_map(struct clib_iterator *pItr) { free(pItr); }


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

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

LLVM IR (-O2):
%struct.clib_iterator = type { i32 }
define void @delete_iterator_c_map(%struct.clib_iterator* nocapture %0) {
%2 = tail call i32 @free(%struct.clib_iterator* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "compute_gist options... [infilename]\n"
                  "infile is a PPM raw file\n"
                  "options:\n"
                  "[-nblocks nb] use a grid of nb*nb cells (default 4)\n"
                  "[-orientationsPerScale o_1,..,o_n] use n scales and compute "
                  "o_i orientations for scale i\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [213 x i8] c"compute_gist options... [infilename]\0Ainfile is a PPM raw file\0Aoptions:\0A[-nblocks nb] use a grid of nb*nb cells (default 4)\0A[-orientationsPerScale o_1,..,o_n] use n scales and compute o_i orientations for scale i\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([213 x i8], [213 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [213 x i8] c"compute_gist options... [infilename]\0Ainfile is a PPM raw file\0Aoptions:\0A[-nblocks nb] use a grid of nb*nb cells (default 4)\0A[-orientationsPerScale o_1,..,o_n] use n scales and compute o_i orientations for scale i\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([213 x i8], [213 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int binarySearch(int *, int, int /*<<< orphan*/, int);
int searchInsert(int *nums, int numsSize, int target) {
  return binarySearch(nums, target, 0, numsSize - 1);
}


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

x86 assembly (clang, -O2):
<searchInsert>:
lea    -0x1(%rsi),%ecx
mov    %edx,%esi
xor    %edx,%edx
jmp    1030 <binarySearch@plt>

LLVM IR (-O0):
define i32 @searchInsert(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** %4
%8 = load i32, i32* %6
%9 = load i32, i32* %5
%10 = sub nsw i32 %9, 1
%11 = call i32 @binarySearch(i32* %7, i32 %8, i32 0, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @searchInsert(i32* %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, -1
%5 = tail call i32 @binarySearch(i32* %0, i32 %2, i32 0, i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void sigpipe_handler(int sig) { printf("\tsignal %d received\n", sig); }


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

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

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

LLVM IR (-O2):
@.str = [21 x i8] c"\09signal %d received\0A\00"
define void @sigpipe_handler(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint16_t le16_to_cpu(uint16_t v) { return (v); }


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

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

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

LLVM IR (-O2):
define i32 @le16_to_cpu(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void freep(void *p) {
  if (!p)
    return;
  free(*(void **)p);
  *(void **)p = NULL;
}


x86 assembly (clang, -O0):
<freep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <freep+0x1c>
jmp    1143 <freep+0x33>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freep>:
test   %rdi,%rdi
je     1129 <freep+0x19>
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @freep(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 %6, label %5
5: ; preds = %1
br label %13
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = bitcast i8* %7 to i8**
%9 = load i8*, i8** %8
%10 = call i32 @free(i8* %9)
%11 = load i8*, i8** %2
%12 = bitcast i8* %11 to i8**
store i8* null, i8** %12
br label %13
13: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
define void @freep(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = bitcast i8* %0 to i8**
%5 = load i8*, i8** %4
%6 = tail call i32 @free(i8* %5)
store i8* null, i8** %4
br label %7
7: ; preds = %1, %3
ret void
}
int compare_int_dec(void const *a, void const *b) {
  int const *pa = a;
  int const *pb = b;
  return *pb - *pa;
}


x86 assembly (clang, -O0):
<compare_int_dec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @compare_int_dec(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = sub nsw i32 %5, %6
ret i32 %7
}
/* Variables and functions */
int sv_load(int, char *);
int vox_load(int slot, char *name) { return sv_load(slot, name); }


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

x86 assembly (clang, -O2):
<vox_load>:
jmp    1030 <sv_load@plt>

LLVM IR (-O0):
define i32 @vox_load(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 i8*, i8** %4
%7 = call i32 @sv_load(i32 %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @vox_load(i32 %0, i8* %1) {
%3 = tail call i32 @sv_load(i32 %0, i8* %1)
ret i32 %3
}
/* Type definitions */
struct pci_dev {
  int dummy;
};
struct device {
  int dummy;
};

/* Variables and functions */
struct pci_dev *pci_p2pmem_find_many(struct device **, int);
struct pci_dev *pci_p2pmem_find(struct device *client) {
  return pci_p2pmem_find_many(&client, 1);
}


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

x86 assembly (clang, -O2):
<pci_p2pmem_find>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rdi
mov    $0x1,%esi
call   1030 <pci_p2pmem_find_many@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.pci_dev = type { i32 }
%struct.device = type { i32 }
define %struct.pci_dev* @pci_p2pmem_find(%struct.device* %0) {
%2 = alloca %struct.device*
store %struct.device* %0, %struct.device** %2
%3 = call %struct.pci_dev* @pci_p2pmem_find_many(%struct.device** %2, i32 1)
ret %struct.pci_dev* %3
}

LLVM IR (-O2):
%struct.pci_dev = type { i32 }
%struct.device = type { i32 }
define %struct.pci_dev* @pci_p2pmem_find(%struct.device* %0) {
%2 = alloca %struct.device*
store %struct.device* %0, %struct.device** %2
%3 = call %struct.pci_dev* @pci_p2pmem_find_many(%struct.device** %2, i32 1)
ret %struct.pci_dev* %3
}
void array_free(char **string_array) {
  char *string;
  int i = 0;
  if (!string_array)
    return;
  while ((string = string_array[i++]))
    free(string);
  free(string_array);
}


x86 assembly (clang, -O0):
<array_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1133 <array_free+0x23>
jmp    1173 <array_free+0x63>
jmp    1138 <array_free+0x28>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x14(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     116a <array_free+0x5a>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
jmp    1138 <array_free+0x28>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_free>:
test   %rdi,%rdi
je     1150 <array_free+0x40>
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <array_free+0x31>
lea    0x8(%r14),%rbx
nopl   0x0(%rax,%rax,1)
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <array_free+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @array_free(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %15, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i64 [ %9, %6 ], [ 0, %3 ]
%8 = phi i8* [ %11, %6 ], [ %4, %3 ]
%9 = add nuw nsw i64 %7, 1
tail call void @free(i8* %8)
%10 = getelementptr inbounds i8*, i8** %0, i64 %9
%11 = load i8*, i8** %10
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %6
13: ; preds = %6, %3
%14 = bitcast i8** %0 to i8*
tail call void @free(i8* %14)
br label %15
15: ; preds = %1, %13
ret void
}
unsigned long ElfHash(const unsigned char *name) {
  unsigned long h = 0, g;
  while (*name) {
    h = (h << 4) + *name++;
    g = h & 0xF0000000;
    if (g)
      h ^= g >> 24;
    h &= ~g;
  }
  return h;
}


x86 assembly (clang, -O0):
<ElfHash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1180 <ElfHash+0x80>
mov    -0x10(%rbp),%rax
shl    $0x4,%rax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movzbl (%rcx),%ecx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
movabs $0xf0000000,%rax
and    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     116b <ElfHash+0x6b>
mov    -0x18(%rbp),%rax
shr    $0x18,%rax
xor    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
xor    $0xffffffffffffffff,%rax
and    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <ElfHash+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ElfHash>:
mov    (%rdi),%cl
test   %cl,%cl
je     113d <ElfHash+0x3d>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
shl    $0x4,%rax
movzbl %cl,%ecx
add    %rax,%rcx
mov    %ecx,%eax
and    $0xf0000000,%eax
mov    %rax,%rdx
shr    $0x18,%rdx
xor    %rcx,%rdx
not    %rax
and    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <ElfHash+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @ElfHash(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i64
store i8* %0, i8** %2
store i64 0, i64* %3
br label %5
5: ; preds = %26, %1
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %31
9: ; preds = %5
%10 = load i64, i64* %3
%11 = shl i64 %10, 4
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %2
%14 = load i8, i8* %12
%15 = zext i8 %14 to i64
%16 = add i64 %11, %15
store i64 %16, i64* %3
%17 = load i64, i64* %3
%18 = and i64 %17, 4026531840
store i64 %18, i64* %4
%19 = load i64, i64* %4
%20 = icmp ne i64 %19, 0
br i1 %20, label %21, label %26
21: ; preds = %9
%22 = load i64, i64* %4
%23 = lshr i64 %22, 24
%24 = load i64, i64* %3
%25 = xor i64 %24, %23
store i64 %25, i64* %3
br label %26
26: ; preds = %21, %9
%27 = load i64, i64* %4
%28 = xor i64 %27, -1
%29 = load i64, i64* %3
%30 = and i64 %29, %28
store i64 %30, i64* %3
br label %5
31: ; preds = %5
%32 = load i64, i64* %3
ret i64 %32
}

LLVM IR (-O2):
define i64 @ElfHash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %19, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %17, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = phi i64 [ %16, %4 ], [ 0, %1 ]
%8 = shl i64 %7, 4
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = zext i8 %5 to i64
%11 = add i64 %8, %10
%12 = and i64 %11, 4026531840
%13 = lshr exact i64 %12, 24
%14 = xor i64 %13, %11
%15 = xor i64 %12, -1
%16 = and i64 %14, %15
%17 = load i8, i8* %9
%18 = icmp eq i8 %17, 0
br i1 %18, label %19, label %4
19: ; preds = %4, %1
%20 = phi i64 [ 0, %1 ], [ %16, %4 ]
ret i64 %20
}
/* Type definitions */
typedef int /*<<< orphan*/ X509_CERT_AUX;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int ASN1_item_i2d(int /*<<< orphan*/ *, unsigned char **, int /*<<< orphan*/ *);
int /*<<< orphan*/ X509_CERT_AUX_it;
int i2d_X509_CERT_AUX(X509_CERT_AUX *a, unsigned char **out) {
  return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_CERT_AUX_it);
}


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

x86 assembly (clang, -O2):
<i2d_X509_CERT_AUX>:
mov    0x2ec9(%rip),%rdx
jmp    1030 <ASN1_item_i2d@plt>

LLVM IR (-O0):
@X509_CERT_AUX_it = global i32 0
define i32 @i2d_X509_CERT_AUX(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 i8**, i8*** %4
%7 = call i32 @ASN1_item_i2d(i32* %5, i8** %6, i32* @X509_CERT_AUX_it)
ret i32 %7
}

LLVM IR (-O2):
@X509_CERT_AUX_it = global i32 0
define i32 @i2d_X509_CERT_AUX(i32* %0, i8** %1) {
%3 = tail call i32 @ASN1_item_i2d(i32* %0, i8** %1, i32* @X509_CERT_AUX_it)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ cgcmp(char *);
void cgge() { cgcmp("jl"); }


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"jl\00"
define void @cgge() {
%1 = call i32 @cgcmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"jl\00"
define void @cgge() {
%1 = tail call i32 @cgcmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
void g_date_set_dmy() {}


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

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

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

LLVM IR (-O2):
define void @g_date_set_dmy() {
ret void
}
/* Variables and functions */
scalar_t__ nexttoward(double, double);
long double nexttowardl(long double x, long double y) {
  return (long double)nexttoward((double)x, (double)y);
}


x86 assembly (clang, -O0):
<nexttowardl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
fldt   -0x20(%rbp)
fstpl  -0x30(%rbp)
movsd  -0x30(%rbp),%xmm1
call   1030 <nexttoward@plt>
mov    %rax,-0x28(%rbp)
fildll -0x28(%rbp)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nexttowardl>:
sub    $0x18,%rsp
fldt   0x30(%rsp)
fldt   0x20(%rsp)
fstpl  0x8(%rsp)
movsd  0x8(%rsp),%xmm0
fstpl  (%rsp)
movsd  (%rsp),%xmm1
call   1030 <nexttoward@plt>
mov    %rax,0x10(%rsp)
fildll 0x10(%rsp)
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @nexttowardl(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = fptrunc x86_fp80 %5 to double
%7 = load x86_fp80, x86_fp80* %4
%8 = fptrunc x86_fp80 %7 to double
%9 = call i64 @nexttoward(double %6, double %8)
%10 = sitofp i64 %9 to x86_fp80
ret x86_fp80 %10
}

LLVM IR (-O2):
define x86_fp80 @nexttowardl(x86_fp80 %0, x86_fp80 %1) {
%3 = fptrunc x86_fp80 %0 to double
%4 = fptrunc x86_fp80 %1 to double
%5 = tail call i64 @nexttoward(double %3, double %4)
%6 = sitofp i64 %5 to x86_fp80
ret x86_fp80 %6
}
void decode(int *xp, int *yp, int *zp) {
  int x = *xp;
  *xp = *zp;
  *zp = *yp;
  *yp = x;
}


x86 assembly (clang, -O0):
<decode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode>:
mov    (%rdi),%eax
mov    (%rdx),%ecx
mov    %ecx,(%rdi)
mov    (%rsi),%ecx
mov    %ecx,(%rdx)
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @decode(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
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
store i32 %9, i32* %7
%10 = load i32*, i32** %6
%11 = load i32, i32* %10
%12 = load i32*, i32** %4
store i32 %11, i32* %12
%13 = load i32*, i32** %5
%14 = load i32, i32* %13
%15 = load i32*, i32** %6
store i32 %14, i32* %15
%16 = load i32, i32* %7
%17 = load i32*, i32** %5
store i32 %16, i32* %17
ret void
}

LLVM IR (-O2):
define void @decode(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %0
%5 = load i32, i32* %2
store i32 %5, i32* %0
%6 = load i32, i32* %1
store i32 %6, i32* %2
store i32 %4, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
float mlt(float f, float s) {
  float t;
  t = f * s;
  if (t > 9999999 || t < -9999999) {
    printf("ERROR 5");
    printf("\n");
    exit(0);
  } else {
    return t;
  }
}


x86 assembly (clang, -O0):
<mlt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  0xeb2(%rip),%xmm1
ucomiss %xmm1,%xmm0
ja     1169 <mlt+0x49>
movss  0xea5(%rip),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    1188 <mlt+0x68>
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mlt>:
push   %rax
mulss  %xmm1,%xmm0
ucomiss 0xec4(%rip),%xmm0
ja     114d <mlt+0x1d>
movss  0xebe(%rip),%xmm1
ucomiss %xmm0,%xmm1
ja     114d <mlt+0x1d>
pop    %rax
ret
lea    0xeb4(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"ERROR 5\00"
@.str.1 = [2 x i8] c"\0A\00"
define float @mlt(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = load float, float* %4
%8 = fmul float %6, %7
store float %8, float* %5
%9 = load float, float* %5
%10 = fcmp ogt float %9, 0x416312CFE0000000
br i1 %10, label %14, label %11
11: ; preds = %2
%12 = load float, float* %5
%13 = fcmp olt float %12, 0xC16312CFE0000000
br i1 %13, label %14, label %18
14: ; preds = %11, %2
%15 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%16 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%17 = call i32 @exit(i32 0)
unreachable
18: ; preds = %11
%19 = load float, float* %5
ret float %19
}

LLVM IR (-O2):
@.str = [8 x i8] c"ERROR 5\00"
define float @mlt(float %0, float %1) {
%3 = fmul float %0, %1
%4 = fcmp ogt float %3, 0x416312CFE0000000
%5 = fcmp olt float %3, 0xC16312CFE0000000
%6 = or i1 %4, %5
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @putchar(i32 10)
%10 = tail call i32 @exit(i32 0)
unreachable
11: ; preds = %2
ret float %3
}
int is_aluimm(int opcode) { return (opcode & 0xF8) == 0x08; }


x86 assembly (clang, -O0):
<is_aluimm>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf8,%eax
cmp    $0x8,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_aluimm>:
and    $0xf8,%edi
xor    %eax,%eax
cmp    $0x8,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @is_aluimm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 248
%5 = icmp eq i32 %4, 8
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @is_aluimm(i32 %0) {
%2 = and i32 %0, 248
%3 = icmp eq i32 %2, 8
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t not_xtrail_1s(uint64_t u) { return ~((u + 1) & u); }


x86 assembly (clang, -O0):
<not_xtrail_1s>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
and    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<not_xtrail_1s>:
lea    0x1(%rdi),%eax
and    %edi,%eax
not    %eax
ret

LLVM IR (-O0):
define i32 @not_xtrail_1s(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
%5 = load i32, i32* %2
%6 = and i32 %4, %5
%7 = xor i32 %6, -1
ret i32 %7
}

LLVM IR (-O2):
define i32 @not_xtrail_1s(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = and i32 %2, %0
%4 = xor i32 %3, -1
ret i32 %4
}
/* Type definitions */
struct pqNode {
  int dummy;
};

/* Variables and functions */
int isEmptyPQ(struct pqNode *head) {
  if (head != NULL)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<isEmptyPQ>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     111f <isEmptyPQ+0x1f>
movl   $0x0,-0x4(%rbp)
jmp    1126 <isEmptyPQ+0x26>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isEmptyPQ>:
xor    %eax,%eax
test   %rdi,%rdi
sete   %al
ret

LLVM IR (-O0):
%struct.pqNode = type { i32 }
define i32 @isEmptyPQ(%struct.pqNode* %0) {
%2 = alloca i32
%3 = alloca %struct.pqNode*
store %struct.pqNode* %0, %struct.pqNode** %3
%4 = load %struct.pqNode*, %struct.pqNode** %3
%5 = icmp ne %struct.pqNode* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %8
7: ; preds = %1
store i32 1, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
%struct.pqNode = type { i32 }
define i32 @isEmptyPQ(%struct.pqNode* readnone %0) {
%2 = icmp eq %struct.pqNode* %0, null
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int vfork();
int main() {
  int pid;
  pid = vfork();
  if (pid == 0) {
    printf("I'm the child!\n");
    _exit(0);
  } else {
    printf("I'm the proud parent of child #%d!\n", pid);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
call   1050 <vfork@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1166 <main+0x36>
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %edi,%edi
call   1030 <_exit@plt>
mov    -0x8(%rbp),%esi
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
call   1060 <vfork@plt>
test   %eax,%eax
je     1160 <main+0x20>
mov    %eax,%esi
lea    0xead(%rip),%rdi
xor    %ebx,%ebx
mov    %ebx,%eax
call   1050 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xebd(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"I'm the child!\0A\00"
@.str.1 = [36 x i8] c"I'm the proud parent of child #%d!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @vfork()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @_exit(i32 0)
unreachable
9: ; preds = %0
%10 = load i32, i32* %2
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [36 x i8] c"I'm the proud parent of child #%d!\0A\00"
@str = [15 x i8] c"I'm the child!\00"
define i32 @main() {
%1 = call i32 @vfork()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%5 = call i32 @_exit(i32 0)
unreachable
6: ; preds = %0
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int8_t bno_hal_read(uint8_t address, uint8_t reg_address, uint8_t *data_out,
                    uint8_t data_size) {
  uint8_t buffer[1];
  uint8_t *bfr_ptr = data_out;
  buffer[0] = reg_address;
  return 0;
}


x86 assembly (clang, -O0):
<bno_hal_read>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @bno_hal_read(i32 %0, i32 %1, i32* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32
%9 = alloca [1 x i32]
%10 = alloca i32*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%11 = load i32*, i32** %7
store i32* %11, i32** %10
%12 = load i32, i32* %6
%13 = getelementptr inbounds [1 x i32], [1 x i32]* %9, i64 0, i64 0
store i32 %12, i32* %13
ret i32 0
}

LLVM IR (-O2):
define i32 @bno_hal_read(i32 %0, i32 %1, i32* nocapture readnone %2, i32 %3) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ doit();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main() {
  doit();
  printf("hello\n");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <doit@plt>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <doit@plt>
lea    0xec1(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@str = [6 x i8] c"hello\00"
define i32 @main() {
%1 = tail call i32 (...) @doit()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
int eff_adr_mode(int dis_mode, int pfx_adr) {
  if (dis_mode == 64) {
    return pfx_adr ? 32 : 64;
  } else if (dis_mode == 32) {
    return pfx_adr ? 16 : 32;
  } else {
    ;
    return pfx_adr ? 32 : 16;
  }
}


x86 assembly (clang, -O0):
<eff_adr_mode>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x40,-0x8(%rbp)
jne    112f <eff_adr_mode+0x2f>
mov    -0xc(%rbp),%edx
mov    $0x40,%eax
mov    $0x20,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    116a <eff_adr_mode+0x6a>
cmpl   $0x20,-0x8(%rbp)
jne    1154 <eff_adr_mode+0x54>
mov    -0xc(%rbp),%edx
mov    $0x20,%eax
mov    $0x10,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    116a <eff_adr_mode+0x6a>
mov    -0xc(%rbp),%edx
mov    $0x10,%eax
mov    $0x20,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eff_adr_mode>:
xor    %eax,%eax
cmp    $0x20,%edi
je     1118 <eff_adr_mode+0x18>
cmp    $0x40,%edi
jne    111f <eff_adr_mode+0x1f>
test   %esi,%esi
sete   %al
shl    $0x5,%eax
add    $0x20,%eax
ret
test   %esi,%esi
sete   %al
jmp    1124 <eff_adr_mode+0x24>
test   %esi,%esi
setne  %al
shl    $0x4,%eax
add    $0x10,%eax
ret

LLVM IR (-O0):
define i32 @eff_adr_mode(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 64
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i64
%12 = select i1 %10, i32 32, i32 64
store i32 %12, i32* %3
br label %26
13: ; preds = %2
%14 = load i32, i32* %4
%15 = icmp eq i32 %14, 32
br i1 %15, label %16, label %21
16: ; preds = %13
%17 = load i32, i32* %5
%18 = icmp ne i32 %17, 0
%19 = zext i1 %18 to i64
%20 = select i1 %18, i32 16, i32 32
store i32 %20, i32* %3
br label %26
21: ; preds = %13
%22 = load i32, i32* %5
%23 = icmp ne i32 %22, 0
%24 = zext i1 %23 to i64
%25 = select i1 %23, i32 32, i32 16
store i32 %25, i32* %3
br label %26
26: ; preds = %21, %16, %8
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @eff_adr_mode(i32 %0, i32 %1) {
switch i32 %0, label %9 [
i32 64, label %3
i32 32, label %6
]
3: ; preds = %2
%4 = icmp eq i32 %1, 0
%5 = select i1 %4, i32 64, i32 32
br label %12
6: ; preds = %2
%7 = icmp eq i32 %1, 0
%8 = select i1 %7, i32 32, i32 16
br label %12
9: ; preds = %2
%10 = icmp eq i32 %1, 0
%11 = select i1 %10, i32 16, i32 32
br label %12
12: ; preds = %9, %6, %3
%13 = phi i32 [ %5, %3 ], [ %8, %6 ], [ %11, %9 ]
ret i32 %13
}
int exact_square(int num) {
  int i;
  for (i = 1; i <= num; i++) {
    if (i * i == num)
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<exact_square>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1149 <exact_square+0x49>
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1136 <exact_square+0x36>
movl   $0x1,-0x4(%rbp)
jmp    1150 <exact_square+0x50>
jmp    113b <exact_square+0x3b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <exact_square+0xe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<exact_square>:
xor    %eax,%eax
test   %edi,%edi
jle    1127 <exact_square+0x27>
mov    %edi,%ecx
neg    %ecx
mov    $0x1,%edx
nop
mov    %edx,%esi
imul   %edx,%esi
cmp    %edi,%esi
je     1128 <exact_square+0x28>
lea    (%rcx,%rdx,1),%esi
add    $0x1,%esi
add    $0x1,%edx
cmp    $0x1,%esi
jne    1110 <exact_square+0x10>
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @exact_square(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 1, i32* %4
br label %5
5: ; preds = %17, %1
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = icmp sle i32 %6, %7
br i1 %8, label %9, label %20
9: ; preds = %5
%10 = load i32, i32* %4
%11 = load i32, i32* %4
%12 = mul nsw i32 %10, %11
%13 = load i32, i32* %3
%14 = icmp eq i32 %12, %13
br i1 %14, label %15, label %16
15: ; preds = %9
store i32 1, i32* %2
br label %21
16: ; preds = %9
br label %17
17: ; preds = %16
%18 = load i32, i32* %4
%19 = add nsw i32 %18, 1
store i32 %19, i32* %4
br label %5
20: ; preds = %5
store i32 0, i32* %2
br label %21
21: ; preds = %20, %15
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @exact_square(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %10, label %6
3: ; preds = %6
%4 = add nuw i32 %7, 1
%5 = icmp eq i32 %7, %0
br i1 %5, label %10, label %6
6: ; preds = %1, %3
%7 = phi i32 [ %4, %3 ], [ 1, %1 ]
%8 = mul nsw i32 %7, %7
%9 = icmp eq i32 %8, %0
br i1 %9, label %10, label %3
10: ; preds = %6, %3, %1
%11 = phi i32 [ 0, %1 ], [ 0, %3 ], [ 1, %6 ]
ret i32 %11
}
int main(int argc, char *argv[]) {
#pragma omp taskwait noflush
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int fact = 1, c;
  for (c = 1; c <= 10; c += 1) {
    fact = fact * c;
  }
  printf("%d\n", fact);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jg     114f <main+0x3f>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <main+0x1d>
mov    -0x8(%rbp),%esi
lea    0xea7(%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
mov    $0x375f00,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3628800)
ret i32 0
}
/* Variables and functions */
long getSystemTime();
int /*<<< orphan*/ printf(char *, int, long);
int /*<<< orphan*/ quickSort(int *, int, int);
void quickSortTest(int *arr, int start, int end) {
  long startTime = getSystemTime();
  quickSort(arr, start, end);
  printf("quickSort count %d use time: %ld \n", (end + 1),
         (getSystemTime() - startTime));
}


x86 assembly (clang, -O0):
<quickSortTest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getSystemTime@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1050 <quickSort@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1040 <getSystemTime@plt>
mov    -0x1c(%rbp),%esi
mov    %rax,%rdx
sub    -0x18(%rbp),%rdx
lea    0xe83(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quickSortTest>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%r14d
mov    %rdi,%rbp
xor    %eax,%eax
call   1040 <getSystemTime@plt>
mov    %rax,%r15
mov    %rbp,%rdi
mov    %r14d,%esi
mov    %ebx,%edx
call   1050 <quickSort@plt>
add    $0x1,%ebx
xor    %eax,%eax
call   1040 <getSystemTime@plt>
sub    %r15,%rax
lea    0xe96(%rip),%rdi
mov    %ebx,%esi
mov    %rax,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"quickSort count %d use time: %ld \0A\00"
define void @quickSortTest(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = call i64 (...) @getSystemTime()
store i64 %8, i64* %7
%9 = load i32*, i32** %4
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = call i32 @quickSort(i32* %9, i32 %10, i32 %11)
%13 = load i32, i32* %6
%14 = add nsw i32 %13, 1
%15 = call i64 (...) @getSystemTime()
%16 = load i64, i64* %7
%17 = sub nsw i64 %15, %16
%18 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %14, i64 %17)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"quickSort count %d use time: %ld \0A\00"
define void @quickSortTest(i32* %0, i32 %1, i32 %2) {
%4 = tail call i64 (...) @getSystemTime()
%5 = tail call i32 @quickSort(i32* %0, i32 %1, i32 %2)
%6 = add nsw i32 %2, 1
%7 = tail call i64 (...) @getSystemTime()
%8 = sub nsw i64 %7, %4
%9 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %6, i64 %8)
ret void
}
/* Variables and functions */
int rom_present(char *);
int wd1002a_27x_available(void) {
  return (rom_present(L"roms/hdd/st506/wd1002a_27x-62-000094-032.bin"));
}


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

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

LLVM IR (-O0):
@.str = [45 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 104, i32 100, i32 100, i32 47, i32 115, i32 116, i32 53, i32 48, i32 54, i32 47, i32 119, i32 100, i32 49, i32 48, i32 48, i32 50, i32 97, i32 95, i32 50, i32 55, i32 120, i32 45, i32 54, i32 50, i32 45, i32 48, i32 48, i32 48, i32 48, i32 57, i32 52, i32 45, i32 48, i32 51, i32 50, i32 46, i32 98, i32 105, i32 110, i32 0]
define i32 @wd1002a_27x_available() {
%1 = call i32 @rom_present(i8* bitcast ([45 x i32]* @.str to i8*))
ret i32 %1
}

LLVM IR (-O2):
@.str = [45 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 104, i32 100, i32 100, i32 47, i32 115, i32 116, i32 53, i32 48, i32 54, i32 47, i32 119, i32 100, i32 49, i32 48, i32 48, i32 50, i32 97, i32 95, i32 50, i32 55, i32 120, i32 45, i32 54, i32 50, i32 45, i32 48, i32 48, i32 48, i32 48, i32 57, i32 52, i32 45, i32 48, i32 51, i32 50, i32 46, i32 98, i32 105, i32 110, i32 0]
define i32 @wd1002a_27x_available() {
%1 = tail call i32 @rom_present(i8* bitcast ([45 x i32]* @.str to i8*))
ret i32 %1
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMR70_get(void) { return U_WMRCORENONE_get("U_WMR70"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR70\00"
define i32 @U_WMR70_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR70\00"
define i32 @U_WMR70_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void check_arguments(char *arguments[]) {
  if (arguments[2] != NULL) {
    printf("you've passed a wrong number of arguments\n");
    printf("usage : trashiterm file\n");
    exit(0);
  }
}


x86 assembly (clang, -O0):
<check_arguments>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,0x10(%rax)
je     115a <check_arguments+0x3a>
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_arguments>:
push   %rax
cmpq   $0x0,0x10(%rdi)
jne    112a <check_arguments+0xa>
pop    %rax
ret
lea    0xecf(%rip),%rdi
call   1030 <puts@plt>
lea    0xeed(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"you've passed a wrong number of arguments\0A\00"
@.str.1 = [25 x i8] c"usage : trashiterm file\0A\00"
define void @check_arguments(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = getelementptr inbounds i8*, i8** %3, i64 2
%5 = load i8*, i8** %4
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @exit(i32 0)
unreachable
11: ; preds = %1
ret void
}

LLVM IR (-O2):
@str = [42 x i8] c"you've passed a wrong number of arguments\00"
@str.2 = [24 x i8] c"usage : trashiterm file\00"
define void @check_arguments(i8** nocapture %0) {
%2 = getelementptr inbounds i8*, i8** %0, i64 2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.2, i64 0, i64 0))
%8 = tail call i32 @exit(i32 0)
unreachable
9: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *);
int foo(char *arg) {
  char buf[400];
  snprintf(buf, sizeof buf, arg);
  return 0;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x1a0(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x190,%esi
call   1030 <snprintf@plt>
xor    %eax,%eax
add    $0x1a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
sub    $0x198,%rsp
mov    %rdi,%rdx
mov    %rsp,%rdi
mov    $0x190,%esi
call   1030 <snprintf@plt>
xor    %eax,%eax
add    $0x198,%rsp
ret

LLVM IR (-O0):
define i32 @foo(i8* %0) {
%2 = alloca i8*
%3 = alloca [400 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [400 x i8], [400 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @snprintf(i8* %4, i32 400, i8* %5)
ret i32 0
}

LLVM IR (-O2):
define i32 @foo(i8* %0) {
%2 = alloca [400 x i8]
%3 = getelementptr inbounds [400 x i8], [400 x i8]* %2, i64 0, i64 0
%4 = call i32 @snprintf(i8* %3, i32 400, i8* %0)
ret i32 0
}