xunge/DecIR huggingface dataset:
int is_matrix(const int symbology) {
  int result = 0;
  switch (symbology) {
  case 58:
  case 71:
  case 97:
  case 102:
  case 92:
  case 104:
  case 112:
  case 128:
  case 141:
  case 142:
  case 116:
  case 115:
  case 143:
    result = 1;
    break;
  }
  return result;
}


x86 assembly (clang, -O0):
<is_matrix>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffc6,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x55,%eax
ja     113e <is_matrix+0x3e>
mov    -0x10(%rbp),%rax
lea    0xed2(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_matrix>:
xor    %eax,%eax
add    $0xffffffc6,%edi
cmp    $0x55,%edi
ja     111f <is_matrix+0x1f>
lea    0xeef(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @is_matrix(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
switch i32 %4, label %6 [
i32 58, label %5
i32 71, label %5
i32 97, label %5
i32 102, label %5
i32 92, label %5
i32 104, label %5
i32 112, label %5
i32 128, label %5
i32 141, label %5
i32 142, label %5
i32 116, label %5
i32 115, label %5
i32 143, label %5
]
5: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
store i32 1, i32* %3
br label %6
6: ; preds = %1, %5
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @is_matrix(i32 %0) {
switch i32 %0, label %3 [
i32 58, label %2
i32 71, label %2
i32 97, label %2
i32 102, label %2
i32 92, label %2
i32 104, label %2
i32 112, label %2
i32 128, label %2
i32 141, label %2
i32 142, label %2
i32 116, label %2
i32 115, label %2
i32 143, label %2
]
2: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
br label %3
3: ; preds = %1, %2
%4 = phi i32 [ 0, %1 ], [ 1, %2 ]
ret i32 %4
}
char *RCSid() {
  return RCSid("$Id: vms.c,v 1.5 2004/07/01 17:10:09 broeker Exp $");
}


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

x86 assembly (clang, -O2):
<RCSid>:
jmp    1100 <RCSid>

LLVM IR (-O0):
@.str = [51 x i8] c"$Id: vms.c,v 1.5 2004/07/01 17:10:09 broeker Exp $\00"
define i8* @RCSid() {
%1 = call i8* (i8*, ...) bitcast (i8* ()* @RCSid to i8* (i8*, ...)*)(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
define noalias i8* @RCSid() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ get_label_uuid(char *);
int /*<<< orphan*/ uuidcache_addentry(char *);
void uuidcache_init() {
  char d[1];
  get_label_uuid(d);
  uuidcache_addentry(d);
}


x86 assembly (clang, -O0):
<uuidcache_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x1(%rbp),%rdi
call   1040 <get_label_uuid@plt>
lea    -0x1(%rbp),%rdi
call   1030 <uuidcache_addentry@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uuidcache_init>:
push   %rbx
sub    $0x10,%rsp
lea    0xf(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <get_label_uuid@plt>
mov    %rbx,%rdi
call   1030 <uuidcache_addentry@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @uuidcache_init() {
%1 = alloca [1 x i8]
%2 = getelementptr inbounds [1 x i8], [1 x i8]* %1, i64 0, i64 0
%3 = call i32 @get_label_uuid(i8* %2)
%4 = getelementptr inbounds [1 x i8], [1 x i8]* %1, i64 0, i64 0
%5 = call i32 @uuidcache_addentry(i8* %4)
ret void
}

LLVM IR (-O2):
define void @uuidcache_init() {
%1 = alloca [1 x i8]
%2 = getelementptr inbounds [1 x i8], [1 x i8]* %1, i64 0, i64 0
%3 = call i32 @get_label_uuid(i8* %2)
%4 = call i32 @uuidcache_addentry(i8* %2)
ret void
}
/* Variables and functions */
char *_my_strstr(char *, char *, int /*<<< orphan*/, int /*<<< orphan*/);
char *my_strstr(char *str, char *to_find) {
  return _my_strstr(str, to_find, 0, 0);
}


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

x86 assembly (clang, -O2):
<my_strstr>:
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <_my_strstr@plt>

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

LLVM IR (-O2):
define i8* @my_strstr(i8* %0, i8* %1) {
%3 = tail call i8* @_my_strstr(i8* %0, i8* %1, i32 0, i32 0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ RotShift_instr(int);
void SLA(void) { RotShift_instr(4); }


x86 assembly (clang, -O0):
<SLA>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
call   1030 <RotShift_instr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SLA>:
mov    $0x4,%edi
jmp    1030 <RotShift_instr@plt>

LLVM IR (-O0):
define void @SLA() {
%1 = call i32 @RotShift_instr(i32 4)
ret void
}

LLVM IR (-O2):
define void @SLA() {
%1 = tail call i32 @RotShift_instr(i32 4)
ret void
}
unsigned int map2check_non_det_uint() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @map2check_non_det_uint() {
ret i32 0
}
void uksm_vm_flags_mod(unsigned long *vm_flags_p) {}


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

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

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

LLVM IR (-O2):
define void @uksm_vm_flags_mod(i64* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, int /*<<< orphan*/);
int get_noblock(int fd, void *optval, int *optlen) {
  int flags;
  if ((flags = fcntl(fd, F_GETFL, 0)) < 0)
    flags = 0;
  *(int *)optval = (flags & O_NONBLOCK) ? 1 : 0;
  return 0;
}


x86 assembly (clang, -O0):
<get_noblock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
jge    1149 <get_noblock+0x39>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%edx
mov    0x2e95(%rip),%rax
and    (%rax),%edx
xor    %ecx,%ecx
mov    $0x1,%eax
cmp    $0x0,%edx
cmovne %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_noblock>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
xor    %ebp,%ebp
xor    %edx,%edx
call   1030 <fcntl@plt>
test   %eax,%eax
cmovs  %ebp,%eax
mov    0x2eb4(%rip),%rcx
xor    %edx,%edx
and    (%rcx),%eax
setne  %dl
mov    %edx,(%rbx)
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@F_GETFL = global i32 0
@O_NONBLOCK = global i32 0
define i32 @get_noblock(i32 %0, i8* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32* %2, i32** %6
%8 = load i32, i32* %4
%9 = load i32, i32* @F_GETFL
%10 = call i32 @fcntl(i32 %8, i32 %9, i32 0)
store i32 %10, i32* %7
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %3
store i32 0, i32* %7
br label %13
13: ; preds = %12, %3
%14 = load i32, i32* %7
%15 = load i32, i32* @O_NONBLOCK
%16 = and i32 %14, %15
%17 = icmp ne i32 %16, 0
%18 = zext i1 %17 to i64
%19 = select i1 %17, i32 1, i32 0
%20 = load i8*, i8** %5
%21 = bitcast i8* %20 to i32*
store i32 %19, i32* %21
ret i32 0
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@O_NONBLOCK = global i32 0
define i32 @get_noblock(i32 %0, i8* nocapture writeonly %1, i32* nocapture readnone %2) {
%4 = load i32, i32* @F_GETFL
%5 = tail call i32 @fcntl(i32 %0, i32 %4, i32 0)
%6 = icmp sgt i32 %5, 0
%7 = select i1 %6, i32 %5, i32 0
%8 = load i32, i32* @O_NONBLOCK
%9 = and i32 %7, %8
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i32
%12 = bitcast i8* %1 to i32*
store i32 %11, i32* %12
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void bookNameDuplicate(char bookName[]) {
  printf("\nAn entry for <%s> is already in the bookstore inventory!\n"
         "New entry not entered.\n",
         bookName);
}


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

x86 assembly (clang, -O2):
<bookNameDuplicate>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [82 x i8] c"\0AAn entry for <%s> is already in the bookstore inventory!\0ANew entry not entered.\0A\00"
define void @bookNameDuplicate(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [82 x i8] c"\0AAn entry for <%s> is already in the bookstore inventory!\0ANew entry not entered.\0A\00"
define void @bookNameDuplicate(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int s2qch();
int s2qch_() { return s2qch(); }


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

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

LLVM IR (-O0):
define i32 @s2qch_() {
%1 = call i32 (...) @s2qch()
ret i32 %1
}

LLVM IR (-O2):
define i32 @s2qch_() {
%1 = tail call i32 (...) @s2qch()
ret i32 %1
}
int CheckConfigFile() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @CheckConfigFile() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("usage: journal [-BPSXeiknqrstv] [-C directory] [-D variable]\n"
         "\t[-d flags] [-E variable] [-f makefile] [-I directory]\n"
         "\t[-j max_jobs] [-m directory] [-V variable]\n"
         "\t[variable=value] [target ...]\n");
}


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

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

LLVM IR (-O0):
@.str = [192 x i8] c"usage: journal [-BPSXeiknqrstv] [-C directory] [-D variable]\0A\09[-d flags] [-E variable] [-f makefile] [-I directory]\0A\09[-j max_jobs] [-m directory] [-V variable]\0A\09[variable=value] [target ...]\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([192 x i8], [192 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [191 x i8] c"usage: journal [-BPSXeiknqrstv] [-C directory] [-D variable]\0A\09[-d flags] [-E variable] [-f makefile] [-I directory]\0A\09[-j max_jobs] [-m directory] [-V variable]\0A\09[variable=value] [target ...]\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([191 x i8], [191 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ symtab_delete(void *);
void symtab_delete_cb(void *self) { symtab_delete(self); }


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

x86 assembly (clang, -O2):
<symtab_delete_cb>:
jmp    1030 <symtab_delete@plt>

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

LLVM IR (-O2):
define void @symtab_delete_cb(i8* %0) {
%2 = tail call i32 @symtab_delete(i8* %0)
ret void
}
int ilog2(unsigned int n) { return (n) ? (31 - __builtin_clz(n)) : (n); }


x86 assembly (clang, -O0):
<ilog2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1129 <ilog2+0x29>
mov    -0x4(%rbp),%eax
bsr    %eax,%ecx
xor    $0x1f,%ecx
mov    $0x1f,%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
jmp    112f <ilog2+0x2f>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ilog2>:
test   %edi,%edi
je     1108 <ilog2+0x8>
bsr    %edi,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @ilog2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 @llvm.ctlz.i32(i32 %6, i1 true)
%8 = sub nsw i32 31, %7
br label %11
9: ; preds = %1
%10 = load i32, i32* %2
br label %11
11: ; preds = %9, %5
%12 = phi i32 [ %8, %5 ], [ %10, %9 ]
ret i32 %12
}

LLVM IR (-O2):
define i32 @ilog2(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @llvm.ctlz.i32(i32 %0, i1 true)
%5 = xor i32 %4, 31
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ %5, %3 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
double StringToNumber2(char *, char, char);
double StringToNumber(char *input) { return StringToNumber2(input, '.', ','); }


x86 assembly (clang, -O0):
<StringToNumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2e,%esi
mov    $0x2c,%edx
call   1030 <StringToNumber2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StringToNumber>:
mov    $0x2e,%esi
mov    $0x2c,%edx
jmp    1030 <StringToNumber2@plt>

LLVM IR (-O0):
define double @StringToNumber(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call double @StringToNumber2(i8* %3, i8 signext 46, i8 signext 44)
ret double %4
}

LLVM IR (-O2):
define double @StringToNumber(i8* %0) {
%2 = tail call double @StringToNumber2(i8* %0, i8 signext 46, i8 signext 44)
ret double %2
}
void *test_anti_range_105(long n) {
  extern void *alloc_anti_range_105(long) __attribute__((alloc_size(1)));
  if (0 <= n && n <= 2)
    n = 0 - 1;
  return alloc_anti_range_105(n);
}


x86 assembly (clang, -O0):
<test_anti_range_105>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
jg     113b <test_anti_range_105+0x2b>
cmpq   $0x2,-0x8(%rbp)
jg     113b <test_anti_range_105+0x2b>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
mov    -0x8(%rbp),%rdi
call   1030 <alloc_anti_range_105@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_105>:
cmp    $0x3,%rdi
mov    $0xffffffffffffffff,%rax
cmovb  %rax,%rdi
jmp    1030 <alloc_anti_range_105@plt>

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

LLVM IR (-O2):
define i8* @test_anti_range_105(i64 %0) {
%2 = icmp ult i64 %0, 3
%3 = select i1 %2, i64 -1, i64 %0
%4 = tail call i8* @alloc_anti_range_105(i64 %3)
ret i8* %4
}
/* Variables and functions */
bool is_floating_point(float a) {
  float diference = a - (int)a;
  if (diference > 0.0001) {
    return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<is_floating_point>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvttss2si -0x8(%rbp),%eax
cvtsi2ss %eax,%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xecf(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1147 <is_floating_point+0x47>
movl   $0x1,-0x4(%rbp)
jmp    114e <is_floating_point+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_floating_point>:
cvttps2dq %xmm0,%xmm1
cvtdq2ps %xmm1,%xmm1
subss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
xor    %eax,%eax
ucomisd 0xee7(%rip),%xmm0
seta   %al
ret

LLVM IR (-O0):
define i32 @is_floating_point(float %0) {
%2 = alloca i32
%3 = alloca float
%4 = alloca float
store float %0, float* %3
%5 = load float, float* %3
%6 = load float, float* %3
%7 = fptosi float %6 to i32
%8 = sitofp i32 %7 to float
%9 = fsub float %5, %8
store float %9, float* %4
%10 = load float, float* %4
%11 = fpext float %10 to double
%12 = fcmp ogt double %11, 1.000000e-04
br i1 %12, label %13, label %14
13: ; preds = %1
store i32 1, i32* %2
br label %15
14: ; preds = %1
store i32 0, i32* %2
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @is_floating_point(float %0) {
%2 = fptosi float %0 to i32
%3 = sitofp i32 %2 to float
%4 = fsub float %0, %3
%5 = fpext float %4 to double
%6 = fcmp ogt double %5, 1.000000e-04
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Type definitions */
struct type_info {
  int dummy;
};
struct scan_ops {
  int dummy;
};

/* Variables and functions */
int scan_type_fl(struct type_info *, struct scan_ops const *, void *, int);
int scan_type_deep(struct type_info *ti, const struct scan_ops *sops,
                   void *aux) {
  return scan_type_fl(ti, sops, aux, (1 << 0));
}


x86 assembly (clang, -O0):
<scan_type_deep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x1,%ecx
call   1030 <scan_type_fl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scan_type_deep>:
mov    $0x1,%ecx
jmp    1030 <scan_type_fl@plt>

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

LLVM IR (-O2):
%struct.type_info = type { i32 }
%struct.scan_ops = type { i32 }
define i32 @scan_type_deep(%struct.type_info* %0, %struct.scan_ops* %1, i8* %2) {
%4 = tail call i32 @scan_type_fl(%struct.type_info* %0, %struct.scan_ops* %1, i8* %2, i32 1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ cadre();
int /*<<< orphan*/ effaceCadre();
int /*<<< orphan*/ printf(char *, ...);
void message(char *chaine) {
  effaceCadre();
  printf("\033[%dm", 33);
  printf("\n[>%s\n", chaine);
  printf("\033[%dm", 37);
  cadre();
}


x86 assembly (clang, -O0):
<message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <effaceCadre@plt>
lea    0xeb6(%rip),%rdi
mov    $0x21,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe91(%rip),%rdi
mov    $0x25,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <cadre@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<message>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <effaceCadre@plt>
lea    0xebb(%rip),%r14
mov    %r14,%rdi
mov    $0x21,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeab(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r14,%rdi
mov    $0x25,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <cadre@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"\1B[%dm\00"
@.str.1 = [7 x i8] c"\0A[>%s\0A\00"
define void @message(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @effaceCadre()
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 33)
%5 = load i8*, i8** %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 37)
%8 = call i32 (...) @cadre()
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[%dm\00"
@.str.1 = [7 x i8] c"\0A[>%s\0A\00"
define void @message(i8* %0) {
%2 = tail call i32 (...) @effaceCadre()
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 33)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 37)
%6 = tail call i32 (...) @cadre()
ret void
}
/* Type definitions */
typedef size_t int32_t;

/* Variables and functions */
int random();
void random_array(int32_t *a, int32_t n) {
  int32_t i;
  for (i = 0; i < n; i++) {
    a[i] = ((int32_t)(random() % 1000)) - 500;
  }
}


x86 assembly (clang, -O0):
<random_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    116c <random_array+0x5c>
mov    $0x0,%al
call   1030 <random@plt>
mov    $0x3e8,%ecx
cltd
idiv   %ecx
movslq %edx,%rdx
sub    $0x1f4,%rdx
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <random_array+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_array>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
je     116b <random_array+0x5b>
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <random@plt>
cltq
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
imul   $0x3e8,%ecx,%ecx
neg    %ecx
add    %ecx,%eax
add    $0xfffffe0c,%eax
cltq
mov    %rax,(%r14,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <random_array+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @random_array(i64* nocapture writeonly %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %11, %4 ], [ 0, %2 ]
%6 = tail call i32 (...) @random()
%7 = srem i32 %6, 1000
%8 = add nsw i32 %7, -500
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i64, i64* %0, i64 %5
store i64 %9, i64* %10
%11 = add nuw i64 %5, 1
%12 = icmp eq i64 %11, %1
br i1 %12, label %13, label %4
13: ; preds = %4, %2
ret void
}
/* Variables and functions */
float ave();
int /*<<< orphan*/ printf(char *, float);
int main(void) {
  float num;
  num = ave();
  printf("ave is %f", num);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"ave is %f\00"
define i32 @main() {
%1 = tail call float (...) @ave()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), float %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, float);
void sprint_soln(int n, int nrhs, float *soln) {
  int i;
  for (i = 0; i < n; i++)
    printf("\t%d: %.4f\n", i, soln[i]);
}


x86 assembly (clang, -O0):
<sprint_soln>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    115f <sprint_soln+0x4f>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1129 <sprint_soln+0x19>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sprint_soln>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1149 <sprint_soln+0x39>
mov    %rdx,%r14
mov    %edi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
movss  (%r14,%rbx,4),%xmm0
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <sprint_soln+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [11 x i8] c"\09%d: %.4f\0A\00"
define void @sprint_soln(i32 %0, i32 %1, float* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca float*
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store float* %2, float** %6
store i32 0, i32* %7
br label %8
8: ; preds = %20, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %4
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %23
12: ; preds = %8
%13 = load i32, i32* %7
%14 = load float*, float** %6
%15 = load i32, i32* %7
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds float, float* %14, i64 %16
%18 = load float, float* %17
%19 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %13, float %18)
br label %20
20: ; preds = %12
%21 = load i32, i32* %7
%22 = add nsw i32 %21, 1
store i32 %22, i32* %7
br label %8
23: ; preds = %8
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"\09%d: %.4f\0A\00"
define void @sprint_soln(i32 %0, i32 %1, float* nocapture %2) {
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = zext i32 %0 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %13, %7 ]
%9 = getelementptr inbounds float, float* %2, i64 %8
%10 = load float, float* %9
%11 = trunc i64 %8 to i32
%12 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %11, float %10)
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %15, label %7
15: ; preds = %7, %3
ret void
}
int isprint(int c) { return (c >= ' ' && c <= '~') || (c > 0x7f); }


x86 assembly (clang, -O0):
<isprint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x20,-0x4(%rbp)
jl     1120 <isprint+0x20>
mov    $0x1,%al
cmpl   $0x7e,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    112a <isprint+0x2a>
cmpl   $0x7f,-0x4(%rbp)
setg   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprint>:
lea    -0x20(%rdi),%eax
cmp    $0x5f,%eax
setb   %al
cmp    $0x7f,%edi
setg   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isprint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 32
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 126
br i1 %7, label %11, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sgt i32 %9, 127
br label %11
11: ; preds = %8, %5
%12 = phi i1 [ true, %5 ], [ %10, %8 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @isprint(i32 %0) {
%2 = add i32 %0, -32
%3 = icmp ult i32 %2, 95
%4 = icmp sgt i32 %0, 127
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
double ls_cost_nm4_twice(double x) { return x + x; }


x86 assembly (clang, -O0):
<ls_cost_nm4_twice>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_cost_nm4_twice>:
addsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @ls_cost_nm4_twice(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fadd double %3, %4
ret double %5
}

LLVM IR (-O2):
define double @ls_cost_nm4_twice(double %0) {
%2 = fadd double %0, %0
ret double %2
}
/* Type definitions */
struct sembuf {
  int sem_num;
  int sem_op;
  scalar_t__ sem_flg;
};

/* Variables and functions */
int /*<<< orphan*/ semop(int, struct sembuf *, int);
int sem_p(int semid, int semnum) {
  struct sembuf cmd;
  cmd.sem_num = semnum;
  cmd.sem_op = -1;
  cmd.sem_flg = 0;
  semop(semid, &cmd, 1);
}


x86 assembly (clang, -O0):
<sem_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
movl   $0xffffffff,-0x1c(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sem_p>:
sub    $0x18,%rsp
mov    %esi,0x8(%rsp)
movl   $0xffffffff,0xc(%rsp)
ff
movq   $0x0,0x10(%rsp)
lea    0x8(%rsp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sembuf = type { i32, i32, i64 }
define i32 @sem_p(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.sembuf
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %5
%8 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %6, i32 0, i32 0
store i32 %7, i32* %8
%9 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %6, i32 0, i32 1
store i32 -1, i32* %9
%10 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %6, i32 0, i32 2
store i64 0, i64* %10
%11 = load i32, i32* %4
%12 = call i32 @semop(i32 %11, %struct.sembuf* %6, i32 1)
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
%struct.sembuf = type { i32, i32, i64 }
define i32 @sem_p(i32 %0, i32 %1) {
%3 = alloca %struct.sembuf
%4 = bitcast %struct.sembuf* %3 to i8*
%5 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i64 0, i32 0
store i32 %1, i32* %5
%6 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i64 0, i32 1
store i32 -1, i32* %6
%7 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i64 0, i32 2
store i64 0, i64* %7
%8 = call i32 @semop(i32 %0, %struct.sembuf* %3, i32 1)
ret i32 undef
}
/* Variables and functions */
char *getlogin();
int test(void) {
  char *loginname;
  loginname = getlogin();
  return (loginname == NULL) ? -1 : 0;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getlogin@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%rdx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
xor    %eax,%eax
call   1030 <getlogin@plt>
cmp    $0x1,%rax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @test() {
%1 = alloca i8*
%2 = call i8* (...) @getlogin()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = icmp eq i8* %3, null
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 -1, i32 0
ret i32 %6
}

LLVM IR (-O2):
define i32 @test() {
%1 = tail call i8* (...) @getlogin()
%2 = icmp eq i8* %1, null
%3 = sext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ i2d_of_void;
typedef int /*<<< orphan*/ X509;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int PEM_ASN1_write(int /*<<< orphan*/ *, int /*<<< orphan*/,
                   int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                   int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                   int /*<<< orphan*/, int /*<<< orphan*/ *,
                   int /*<<< orphan*/ *);
int /*<<< orphan*/ PEM_STRING_X509;
scalar_t__ i2d_X509;
int PEM_write_X509(FILE *fp, X509 *x) {
  return PEM_ASN1_write((i2d_of_void *)i2d_X509, PEM_STRING_X509, fp, x, NULL,
                        NULL, 0, NULL, NULL);
}


x86 assembly (clang, -O0):
<PEM_write_X509>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb1(%rip),%rax
mov    (%rax),%rdi
mov    0x2eb7(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r9d
xor    %eax,%eax
mov    %r9,%r8
movl   $0x0,(%rsp)
movq   $0x0,0x8(%rsp)
movq   $0x0,0x10(%rsp)
call   1030 <PEM_ASN1_write@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PEM_write_X509>:
sub    $0x18,%rsp
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2eb7(%rip),%rax
mov    (%rax),%rdi
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
xorps  %xmm0,%xmm0
movups %xmm0,0x8(%rsp)
movl   $0x0,(%rsp)
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <PEM_ASN1_write@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@i2d_X509 = global i64 0
@PEM_STRING_X509 = global i32 0
define i32 @PEM_write_X509(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i64, i64* @i2d_X509
%6 = inttoptr i64 %5 to i32*
%7 = load i32, i32* @PEM_STRING_X509
%8 = load i32*, i32** %3
%9 = load i32*, i32** %4
%10 = call i32 @PEM_ASN1_write(i32* %6, i32 %7, i32* %8, i32* %9, i32* null, i32* null, i32 0, i32* null, i32* null)
ret i32 %10
}

LLVM IR (-O2):
@i2d_X509 = global i64 0
@PEM_STRING_X509 = global i32 0
define i32 @PEM_write_X509(i32* %0, i32* %1) {
%3 = load i64, i64* @i2d_X509
%4 = inttoptr i64 %3 to i32*
%5 = load i32, i32* @PEM_STRING_X509
%6 = tail call i32 @PEM_ASN1_write(i32* %4, i32 %5, i32* %0, i32* %1, i32* null, i32* null, i32 0, i32* null, i32* null)
ret i32 %6
}
/* Variables and functions */
scalar_t__ malloc(int);
int *makeList(int i) {
  int *newList;
  int j;
  newList = (int *)malloc(100 * sizeof(int));
  for (j = 0; j < 100; j++) {
    newList[j] = -1;
  }
  newList[0] = i;
  return newList;
}


x86 assembly (clang, -O0):
<makeList>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x190,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x64,-0x14(%rbp)
jge    1157 <makeList+0x47>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movl   $0xffffffff,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1130 <makeList+0x20>
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<makeList>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0x190,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    $0x190,%edx
mov    %rax,%rdi
mov    $0xff,%esi
call   1030 <memset@plt>
mov    %ebp,(%rbx)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32* @makeList(i32 %0) {
%2 = tail call i64 @malloc(i32 400)
%3 = inttoptr i64 %2 to i32*
%4 = inttoptr i64 %2 to i8*
store i32 %0, i32* %3
ret i32* %3
}
void simple_spin_unlock(int *lock) { __sync_bool_compare_and_swap(lock, 1, 0); }


x86 assembly (clang, -O0):
<simple_spin_unlock>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x1,%eax
xor    %edx,%edx
lock cmpxchg %edx,(%rcx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<simple_spin_unlock>:
xor    %ecx,%ecx
mov    $0x1,%eax
lock cmpxchg %ecx,(%rdi)
ret

LLVM IR (-O0):
define void @simple_spin_unlock(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = cmpxchg i32* %3, i32 1, i32 0 seq_cst seq_cst
%5 = extractvalue { i32, i1 } %4, 1
ret void
}

LLVM IR (-O2):
define void @simple_spin_unlock(i32* nocapture %0) {
%2 = cmpxchg i32* %0, i32 1, i32 0 seq_cst seq_cst
ret void
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int posix_spawnp(int *, char const *, int /*<<< orphan*/ *,
                 int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                 int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, int);
void test_spawn(const char *process) {
  pid_t pid;
  int status;
  status = posix_spawnp(&pid, process, NULL, NULL, NULL, NULL);
  if (status == 0) {
    printf("Child id: %d\n", pid);
    fflush(NULL);
  }
}


x86 assembly (clang, -O0):
<test_spawn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%r9d
mov    %r9,%rdx
mov    %r9,%rcx
mov    %r9,%r8
call   1050 <posix_spawnp@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    117c <test_spawn+0x4c>
mov    -0xc(%rbp),%esi
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_spawn>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1050 <posix_spawnp@plt>
test   %eax,%eax
je     114e <test_spawn+0x1e>
pop    %rax
ret
mov    0x4(%rsp),%esi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <fflush@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"Child id: %d\0A\00"
define void @test_spawn(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @posix_spawnp(i32* %2, i8* %0, i32* null, i32* null, i32* null, i32* null)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 @fflush(i32* null)
br label %10
10: ; preds = %6, %1
ret void
}
const char *envGetSystemArgList(void) {
  extern const char *__system_arglist;
  return __system_arglist;
}


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

x86 assembly (clang, -O2):
<envGetSystemArgList>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%rax
ret

LLVM IR (-O0):
@__system_arglist = external global i8*
define i8* @envGetSystemArgList() {
%1 = load i8*, i8** @__system_arglist
ret i8* %1
}

LLVM IR (-O2):
@__system_arglist = external global i8*
define i8* @envGetSystemArgList() {
%1 = load i8*, i8** @__system_arglist
ret i8* %1
}
void set_trap_flag(int enable) {
  asm("pushfq");
  asm("pop %rax");
  asm("mov %rax, %rcx");
  if (enable) {
    asm("or $0x100, %rax");
  } else {
    asm("xor $0x100, %rax");
  }
  asm("push %rax");
  asm("popfq");
}


x86 assembly (clang, -O0):
<set_trap_flag>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pushf
pop    %rax
mov    %rax,%rcx
cmpl   $0x0,-0x4(%rbp)
je     1121 <set_trap_flag+0x21>
or     $0x100,%rax
jmp    1127 <set_trap_flag+0x27>
xor    $0x100,%rax
push   %rax
popf
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_trap_flag>:
pushf
pop    %rax
mov    %rax,%rcx
test   %edi,%edi
je     1111 <set_trap_flag+0x11>
or     $0x100,%rax
jmp    1117 <set_trap_flag+0x17>
xor    $0x100,%rax
push   %rax
popf
ret

LLVM IR (-O0):
define void @set_trap_flag(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %7
6: ; preds = %1
br label %7
7: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
define void @set_trap_flag(i32 %0) {
tail call void asm sideeffect "pushfq", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "pop %rax", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "mov %rax, %rcx", "~{dirflag},~{fpsr},~{flags}"()
%2 = icmp eq i32 %0, 0
br i1 %2, label %4, label %3
3: ; preds = %1
tail call void asm sideeffect "or $$0x100, %rax", "~{dirflag},~{fpsr},~{flags}"()
br label %5
4: ; preds = %1
tail call void asm sideeffect "xor $$0x100, %rax", "~{dirflag},~{fpsr},~{flags}"()
br label %5
5: ; preds = %4, %3
tail call void asm sideeffect "push %rax", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "popfq", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
int lt(int a, int b) { return a < b ? a : b; }


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

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

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

LLVM IR (-O2):
define i32 @lt(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
int minimum(int a, int b, int c) {
  int min = (a < b) ? a : b;
  min = (min < c) ? min : c;
  return min;
}


x86 assembly (clang, -O0):
<minimum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1124 <minimum+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    112a <minimum+0x2a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1147 <minimum+0x47>
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    114d <minimum+0x4d>
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<minimum>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
cmp    %edx,%eax
cmovge %edx,%eax
ret

LLVM IR (-O0):
define i32 @minimum(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* %5
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load i32, i32* %4
br label %15
13: ; preds = %3
%14 = load i32, i32* %5
br label %15
15: ; preds = %13, %11
%16 = phi i32 [ %12, %11 ], [ %14, %13 ]
store i32 %16, i32* %7
%17 = load i32, i32* %7
%18 = load i32, i32* %6
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %22
20: ; preds = %15
%21 = load i32, i32* %7
br label %24
22: ; preds = %15
%23 = load i32, i32* %6
br label %24
24: ; preds = %22, %20
%25 = phi i32 [ %21, %20 ], [ %23, %22 ]
store i32 %25, i32* %7
%26 = load i32, i32* %7
ret i32 %26
}

LLVM IR (-O2):
define i32 @minimum(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = select i1 %4, i32 %0, i32 %1
%6 = icmp slt i32 %5, %2
%7 = select i1 %6, i32 %5, i32 %2
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *vhost_usage();
void vhost_showusage() { printf("usage : net_ %s", vhost_usage()); }


x86 assembly (clang, -O0):
<vhost_showusage>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <vhost_usage@plt>
mov    %rax,%rsi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<vhost_showusage>:
push   %rax
xor    %eax,%eax
call   1040 <vhost_usage@plt>
lea    0xed1(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"usage : net_ %s\00"
define void @vhost_showusage() {
%1 = call i8* (...) @vhost_usage()
%2 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"usage : net_ %s\00"
define void @vhost_showusage() {
%1 = tail call i8* (...) @vhost_usage()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
double sphere_volume(double);
double sc_volume_fraction(double radius, double dnn) {
  return sphere_volume(radius / dnn);
}


x86 assembly (clang, -O0):
<sc_volume_fraction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
call   1030 <sphere_volume@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sc_volume_fraction>:
divsd  %xmm1,%xmm0
jmp    1030 <sphere_volume@plt>

LLVM IR (-O0):
define double @sc_volume_fraction(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fdiv double %5, %6
%8 = call double @sphere_volume(double %7)
ret double %8
}

LLVM IR (-O2):
define double @sc_volume_fraction(double %0, double %1) {
%3 = fdiv double %0, %1
%4 = tail call double @sphere_volume(double %3)
ret double %4
}