xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr, "usage: nice [-n incr] utility [arguments]\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 = [43 x i8] c"usage: nice [-n incr] utility [arguments]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [43 x i8] c"usage: nice [-n incr] utility [arguments]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ unprotect(unsigned int *, unsigned int *);
void unprotect_msg(unsigned int *key, char *buf, size_t buf_len) {
  unsigned int i;
  for (i = 0; i < buf_len / 8; ++i)
    unprotect(key, (unsigned int *)&buf[i * 8]);
}


x86 assembly (clang, -O0):
<unprotect_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x18(%rbp),%rcx
shr    $0x3,%rcx
cmp    %rcx,%rax
jae    1165 <unprotect_msg+0x55>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x1c(%rbp),%eax
shl    $0x3,%eax
mov    %eax,%eax
add    %rax,%rsi
call   1030 <unprotect@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112b <unprotect_msg+0x1b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unprotect_msg>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
cmp    $0x8,%rdx
jb     115a <unprotect_msg+0x4a>
mov    %rdx,%r12
mov    %rsi,%r14
mov    %rdi,%r15
shr    $0x3,%r12
mov    $0x1,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ebx,%esi
add    %r14,%rsi
mov    %r15,%rdi
call   1030 <unprotect@plt>
mov    %ebp,%eax
add    $0x1,%ebp
add    $0x8,%ebx
cmp    %rax,%r12
ja     1140 <unprotect_msg+0x30>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @unprotect_msg(i32* %0, i8* %1, i64 %2) {
%4 = lshr i64 %2, 3
%5 = icmp ult i64 %2, 8
br i1 %5, label %16, label %6
6: ; preds = %3, %6
%7 = phi i32 [ %13, %6 ], [ 0, %3 ]
%8 = shl i32 %7, 3
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = bitcast i8* %10 to i32*
%12 = tail call i32 @unprotect(i32* %0, i32* %11)
%13 = add i32 %7, 1
%14 = zext i32 %13 to i64
%15 = icmp ugt i64 %4, %14
br i1 %15, label %6, label %16
16: ; preds = %6, %3
ret void
}
/* Type definitions */
typedef int wint_t;

/* Variables and functions */
int iswxdigit(wint_t wc) {
  return (unsigned)(wc - '0') < 10 || (unsigned)((wc | 32) - 'a') < 6;
}


x86 assembly (clang, -O0):
<iswxdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
sub    $0x30,%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x5(%rbp)
jb     112d <iswxdigit+0x2d>
mov    -0x4(%rbp),%eax
or     $0x20,%eax
sub    $0x61,%eax
cmp    $0x6,%eax
setb   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iswxdigit>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
setb   %al
or     $0x20,%edi
add    $0xffffff9f,%edi
cmp    $0x6,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @iswxdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 48
%5 = icmp ult i32 %4, 10
br i1 %5, label %11, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = or i32 %7, 32
%9 = sub nsw i32 %8, 97
%10 = icmp ult i32 %9, 6
br label %11
11: ; preds = %6, %1
%12 = phi i1 [ true, %1 ], [ %10, %6 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @iswxdigit(i32 %0) {
%2 = add nsw i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = or i32 %0, 32
%5 = add nsw i32 %4, -97
%6 = icmp ult i32 %5, 6
%7 = select i1 %3, i1 true, i1 %6
%8 = zext i1 %7 to i32
ret i32 %8
}
void putch(char **wordp, int *limp, int c) {
  if (*limp > 1) {
    *(*wordp)++ = c;
    (*limp)--;
  }
  if (*limp > 0)
    **wordp = '\0';
}


x86 assembly (clang, -O0):
<putch>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x1,(%rax)
jle    113f <putch+0x3f>
mov    -0x14(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rdx
mov    (%rdx),%rax
mov    %rax,%rsi
add    $0x1,%rsi
mov    %rsi,(%rdx)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0xffffffff,%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
jle    1156 <putch+0x56>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<putch>:
mov    (%rsi),%eax
cmp    $0x2,%eax
jl     111a <putch+0x1a>
mov    (%rdi),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rdi)
mov    %dl,(%rax)
mov    (%rsi),%eax
add    $0xffffffff,%eax
mov    %eax,(%rsi)
test   %eax,%eax
jle    1124 <putch+0x24>
mov    (%rdi),%rax
movb   $0x0,(%rax)
ret

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

LLVM IR (-O2):
define void @putch(i8** nocapture %0, i32* nocapture %1, i32 %2) {
%4 = load i32, i32* %1
%5 = icmp sgt i32 %4, 1
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = trunc i32 %2 to i8
%8 = load i8*, i8** %0
%9 = getelementptr inbounds i8, i8* %8, i64 1
store i8* %9, i8** %0
store i8 %7, i8* %8
%10 = load i32, i32* %1
%11 = add nsw i32 %10, -1
store i32 %11, i32* %1
br label %12
12: ; preds = %6, %3
%13 = phi i32 [ %11, %6 ], [ %4, %3 ]
%14 = icmp sgt i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = load i8*, i8** %0
store i8 0, i8* %16
br label %17
17: ; preds = %15, %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ free(int /*<<< orphan*/);
void *malloc(int);
int /*<<< orphan*/ zero();
void *one(void) {
  if (malloc(1001) == NULL) {
    exit(-1);
  }
  free(zero());
  return malloc(2001);
}


x86 assembly (clang, -O0):
<one>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3e9,%edi
call   1040 <malloc@plt>
cmp    $0x0,%rax
jne    1162 <one+0x22>
mov    $0xffffffff,%edi
call   1060 <exit@plt>
mov    $0x0,%al
call   1050 <zero@plt>
mov    %eax,%edi
call   1030 <free@plt>
mov    $0x7d1,%edi
call   1040 <malloc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<one>:
push   %rax
xor    %eax,%eax
call   1050 <zero@plt>
mov    %eax,%edi
call   1030 <free@plt>
mov    $0x7d1,%edi
pop    %rax
jmp    1040 <malloc@plt>

LLVM IR (-O0):
define i8* @one() {
%1 = call i8* @malloc(i32 1001)
%2 = icmp eq i8* %1, null
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @exit(i32 -1)
unreachable
5: ; preds = %0
%6 = call i32 (...) @zero()
%7 = call i32 @free(i32 %6)
%8 = call i8* @malloc(i32 2001)
ret i8* %8
}

LLVM IR (-O2):
define noalias i8* @one() {
%1 = tail call i32 (...) @zero()
%2 = tail call i32 @free(i32 %1)
%3 = tail call dereferenceable_or_null(2001) i8* @malloc(i32 2001)
ret i8* %3
}
int hash_direct_equal(void *key1, void *key2) { return key1 == key2; }


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

x86 assembly (clang, -O2):
<hash_direct_equal>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @hash_direct_equal(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 = icmp eq i8* %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @hash_direct_equal(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
int do_356() { return 356; }


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

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

LLVM IR (-O0):
define i32 @do_356() {
ret i32 356
}

LLVM IR (-O2):
define i32 @do_356() {
ret i32 356
}
/* Type definitions */
struct prb_table {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
void **prb_probe(struct prb_table *, void *);
void(prb_assert_insert)(struct prb_table *table, void *item) {
  void **p = prb_probe(table, item);
  assert(p != NULL && *p == item);
}


x86 assembly (clang, -O0):
<prb_assert_insert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <prb_probe@plt>
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x18(%rbp)
mov    %al,-0x19(%rbp)
je     1162 <prb_assert_insert+0x42>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
cmp    -0x10(%rbp),%rax
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prb_assert_insert>:
push   %rbx
mov    %rsi,%rbx
call   1030 <prb_probe@plt>
xor    %edi,%edi
test   %rax,%rax
je     1137 <prb_assert_insert+0x17>
cmp    %rbx,(%rax)
sete   %dil
pop    %rbx
jmp    1040 <assert@plt>

LLVM IR (-O0):
%struct.prb_table = type { i32 }
define void @prb_assert_insert(%struct.prb_table* %0, i8* %1) {
%3 = alloca %struct.prb_table*
%4 = alloca i8*
%5 = alloca i8**
store %struct.prb_table* %0, %struct.prb_table** %3
store i8* %1, i8** %4
%6 = load %struct.prb_table*, %struct.prb_table** %3
%7 = load i8*, i8** %4
%8 = call i8** @prb_probe(%struct.prb_table* %6, i8* %7)
store i8** %8, i8*** %5
%9 = load i8**, i8*** %5
%10 = icmp ne i8** %9, null
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = load i8*, i8** %12
%14 = load i8*, i8** %4
%15 = icmp eq i8* %13, %14
br label %16
16: ; preds = %11, %2
%17 = phi i1 [ false, %2 ], [ %15, %11 ]
%18 = zext i1 %17 to i32
%19 = call i32 @assert(i32 %18)
ret void
}

LLVM IR (-O2):
%struct.prb_table = type { i32 }
define void @prb_assert_insert(%struct.prb_table* %0, i8* %1) {
%3 = tail call i8** @prb_probe(%struct.prb_table* %0, i8* %1)
%4 = icmp eq i8** %3, null
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, %1
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 0, %2 ], [ %8, %5 ]
%11 = tail call i32 @assert(i32 %10)
ret void
}
int strcmp(const char *cs, const char *ct) {
  int d0, d1;
  register int __res;
  __asm__ __volatile__("1:\tlodsb\n\t"
                       "scasb\n\t"
                       "jne 2f\n\t"
                       "testb %%al,%%al\n\t"
                       "jne 1b\n\t"
                       "xorl %%eax,%%eax\n\t"
                       "jmp 3f\n"
                       "2:\tsbbl %%eax,%%eax\n\t"
                       "orb $1,%%al\n"
                       "3:"
                       : "=a"(__res), "=&S"(d0), "=&D"(d1)
                       : "1"(cs), "2"(ct));
  return __res;
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdi
lods   %ds:(%rsi),%al
scas   %es:(%rdi),%al
jne    112b <strcmp+0x2b>
test   %al,%al
jne    1114 <strcmp+0x14>
xor    %eax,%eax
jmp    112f <strcmp+0x2f>
sbb    %eax,%eax
or     $0x1,%al
mov    %eax,-0x1c(%rbp)
mov    %esi,%eax
mov    %eax,-0x14(%rbp)
mov    %edi,%eax
mov    %eax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
mov    %rsi,%rax
mov    %rdi,%rsi
mov    %rax,%rdi
lods   %ds:(%rsi),%al
scas   %es:(%rdi),%al
jne    1115 <strcmp+0x15>
test   %al,%al
jne    1109 <strcmp+0x9>
xor    %eax,%eax
jmp    1119 <strcmp+0x19>
sbb    %eax,%eax
or     $0x1,%al
ret

LLVM IR (-O0):
define i32 @strcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = call { i32, i8*, i8* } asm sideeffect "1:\09lodsb\0A\09scasb\0A\09jne 2f\0A\09testb %al,%al\0A\09jne 1b\0A\09xorl %eax,%eax\0A\09jmp 3f\0A2:\09sbbl %eax,%eax\0A\09orb $$1,%al\0A3:", "={ax},=&{si},=&{di},1,2,~{dirflag},~{fpsr},~{flags}"(i8* %8, i8* %9)
%11 = extractvalue { i32, i8*, i8* } %10, 0
%12 = extractvalue { i32, i8*, i8* } %10, 1
%13 = extractvalue { i32, i8*, i8* } %10, 2
store i32 %11, i32* %7
%14 = ptrtoint i8* %12 to i64
%15 = trunc i64 %14 to i32
store i32 %15, i32* %5
%16 = ptrtoint i8* %13 to i64
%17 = trunc i64 %16 to i32
store i32 %17, i32* %6
%18 = load i32, i32* %7
ret i32 %18
}

LLVM IR (-O2):
define i32 @strcmp(i8* %0, i8* %1) {
%3 = tail call { i32, i8*, i8* } asm sideeffect "1:\09lodsb\0A\09scasb\0A\09jne 2f\0A\09testb %al,%al\0A\09jne 1b\0A\09xorl %eax,%eax\0A\09jmp 3f\0A2:\09sbbl %eax,%eax\0A\09orb $$1,%al\0A3:", "={ax},=&{si},=&{di},1,2,~{dirflag},~{fpsr},~{flags}"(i8* %0, i8* %1)
%4 = extractvalue { i32, i8*, i8* } %3, 0
ret i32 %4
}
int is_endb(unsigned char *b) {
  if (b[0] == '7' && b[1] == '7' && b[2] == '7' && b[3] == '7')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_endb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x37,%eax
jne    1157 <is_endb+0x57>
mov    -0x10(%rbp),%rax
movzbl 0x1(%rax),%eax
cmp    $0x37,%eax
jne    1157 <is_endb+0x57>
mov    -0x10(%rbp),%rax
movzbl 0x2(%rax),%eax
cmp    $0x37,%eax
jne    1157 <is_endb+0x57>
mov    -0x10(%rbp),%rax
movzbl 0x3(%rax),%eax
cmp    $0x37,%eax
jne    1157 <is_endb+0x57>
movl   $0x1,-0x4(%rbp)
jmp    115e <is_endb+0x5e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_endb>:
cmpb   $0x37,(%rdi)
jne    111c <is_endb+0x1c>
cmpb   $0x37,0x1(%rdi)
jne    111c <is_endb+0x1c>
cmpb   $0x37,0x2(%rdi)
jne    111c <is_endb+0x1c>
mov    $0x1,%eax
cmpb   $0x37,0x3(%rdi)
je     111e <is_endb+0x1e>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @is_endb(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 55
br i1 %3, label %4, label %16
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 55
br i1 %7, label %8, label %16
8: ; preds = %4
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 55
br i1 %11, label %12, label %16
12: ; preds = %8
%13 = getelementptr inbounds i8, i8* %0, i64 3
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 55
br i1 %15, label %17, label %16
16: ; preds = %12, %8, %4, %1
br label %17
17: ; preds = %12, %16
%18 = phi i32 [ 0, %16 ], [ 1, %12 ]
ret i32 %18
}
/* Variables and functions */
double *_zero_arr_plus_double_fn(double *, int, int, char const *,
                                 unsigned int);
double *_zero_arr_inplace_plus_post_double_fn(double **x, int orig_i,
                                              const char *filename,
                                              unsigned lineno) {
  double *_zap_res = *x;
  *x = _zero_arr_plus_double_fn(_zap_res, 1, orig_i, filename, lineno);
  return _zap_res;
}


x86 assembly (clang, -O0):
<_zero_arr_inplace_plus_post_double_fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
mov    $0x1,%esi
call   1030 <_zero_arr_plus_double_fn@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_zero_arr_inplace_plus_post_double_fn>:
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r8d
mov    %rdx,%rcx
mov    %esi,%edx
mov    %rdi,%rbx
mov    (%rdi),%r14
mov    %r14,%rdi
mov    $0x1,%esi
call   1030 <_zero_arr_plus_double_fn@plt>
mov    %rax,(%rbx)
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define double* @_zero_arr_inplace_plus_post_double_fn(double** nocapture %0, i32 %1, i8* %2, i32 %3) {
%5 = load double*, double** %0
%6 = tail call double* @_zero_arr_plus_double_fn(double* %5, i32 1, i32 %1, i8* %2, i32 %3)
store double* %6, double** %0
ret double* %5
}
/* Variables and functions */
int bar();
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", bar());
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <bar@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1040 <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
store i32 0, i32* %1
%2 = call i32 (...) @bar()
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @bar()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int test_imm_E3int64_highword_reg(long long val) {
  return ((val >> 32) & (0xE3 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_E3int64_highword_reg(i64 %0) {
%2 = and i64 %0, 974957576192
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void s2e_codext_enableMultiple() {
  __asm__ __volatile__(".byte 0x0f, 0x3f\n"
                       ".byte 0x00, 0xFA, 0x07, 0x00\n"
                       ".byte 0x00, 0x00, 0x00, 0x00\n");
}


x86 assembly (clang, -O0):
<s2e_codext_enableMultiple>:
push   %rbp
mov    %rsp,%rbp
(bad)
add    %bh,%dl
(bad)
add    %al,(%rax)
add    %al,(%rax)
add    %bl,-0x3d(%rbp)

x86 assembly (clang, -O2):
<s2e_codext_enableMultiple>:
(bad)
add    %bh,%dl
(bad)
add    %al,(%rax)
add    %al,(%rax)
add    %al,%bl

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

LLVM IR (-O2):
define void @s2e_codext_enableMultiple() {
tail call void asm sideeffect ".byte 0x0f, 0x3f\0A.byte 0x00, 0xFA, 0x07, 0x00\0A.byte 0x00, 0x00, 0x00, 0x00\0A", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int open(char const *, int, int);
int ops_open(const char *filename, int flag, int pmode) {
  return open(filename, flag, pmode);
}


x86 assembly (clang, -O0):
<ops_open>:
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    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <open@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ops_open>:
jmp    1030 <open@plt>

LLVM IR (-O0):
define i32 @ops_open(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @open(i8* %7, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @ops_open(i8* nocapture %0, i32 %1, i32 %2) {
%4 = tail call i32 @open(i8* %0, i32 %1, i32 %2)
ret i32 %4
}
double relu(double x) { return x * (x > 0); }


x86 assembly (clang, -O0):
<relu>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
xorps  %xmm2,%xmm2
ucomisd %xmm2,%xmm1
seta   %al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<relu>:
xorpd  %xmm1,%xmm1
cmpltsd %xmm0,%xmm1
movsd  0xeef(%rip),%xmm2
andpd  %xmm1,%xmm2
mulsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @relu(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fcmp ogt double %4, 0.000000e+00
%6 = zext i1 %5 to i32
%7 = sitofp i32 %6 to double
%8 = fmul double %3, %7
ret double %8
}

LLVM IR (-O2):
define double @relu(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
%3 = uitofp i1 %2 to double
%4 = fmul double %3, %0
ret double %4
}
/* Variables and functions */
int EXIT_FAILURE;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
int usage(const char *exe) {
  fprintf(stderr,
          "Usage:\t%s [-tIT] "
          "[-l size] "
          "[-n height] "
          "[-m width] "
          "[-p samples] image\n",
          exe);
  return EXIT_FAILURE;
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [70 x i8] c"Usage:\09%s [-tIT] [-l size] [-n height] [-m width] [-p samples] image\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
ret i32 %6
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [70 x i8] c"Usage:\09%s [-tIT] [-l size] [-n height] [-m width] [-p samples] image\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int munmap(void *, int /*<<< orphan*/);
int vhost_user_unmap_guest_memory(void *ptr, uint64_t size) {
  return munmap(ptr, size);
}


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

x86 assembly (clang, -O2):
<vhost_user_unmap_guest_memory>:
jmp    1030 <munmap@plt>

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

LLVM IR (-O2):
define i32 @vhost_user_unmap_guest_memory(i8* %0, i32 %1) {
%3 = tail call i32 @munmap(i8* %0, i32 %1)
ret i32 %3
}
void usage(argv) char *argv[];
{
  AJKNETusage("UPDATE", "0.0.2", "UPDATE", argv[0],
              "dr.ea.ms [Y]\n\tthe Y switch implies that you absolutly want to "
              "download.\n\tOnly use it if this is your first install\n\tor "
              "really want to download again.");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
lea    0xed6(%rip),%rdx
lea    0xed6(%rip),%rsi
lea    0xed5(%rip),%r8
mov    %rdx,%rdi
mov    $0x0,%al
call   1030 <AJKNETusage@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    (%rdi),%rcx
lea    0xeed(%rip),%rsi
lea    0xedf(%rip),%rdi
lea    0xee5(%rip),%r8
mov    %rdi,%rdx
xor    %eax,%eax
jmp    1030 <AJKNETusage@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"UPDATE\00"
@.str.1 = [6 x i8] c"0.0.2\00"
@.str.2 = [150 x i8] c"dr.ea.ms [Y]\0A\09the Y switch implies that you absolutly want to download.\0A\09Only use it if this is your first install\0A\09or really want to download again.\00"
define void @usage(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = getelementptr inbounds i8*, i8** %3, i64 0
%5 = load i8*, i8** %4
%6 = call i32 (i8*, i8*, i8*, i8*, i8*, ...) bitcast (i32 (...)* @AJKNETusage to i32 (i8*, i8*, i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %5, i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"UPDATE\00"
@.str.1 = [6 x i8] c"0.0.2\00"
@.str.2 = [150 x i8] c"dr.ea.ms [Y]\0A\09the Y switch implies that you absolutly want to download.\0A\09Only use it if this is your first install\0A\09or really want to download again.\00"
define void @usage(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 (i8*, i8*, i8*, i8*, i8*, ...) bitcast (i32 (...)* @AJKNETusage to i32 (i8*, i8*, i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %2, i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str.2, i64 0, i64 0))
ret void
}
void XStringListToTextProperty() {}


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

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

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

LLVM IR (-O2):
define void @XStringListToTextProperty() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int /*<<< orphan*/);
void stink_2(void) {
  char string[] = "Is is supposed to smell that way?";
  char *s;
  s = string;
  while (*s) {
    putchar(*s++);
  }
}


x86 assembly (clang, -O0):
<stink_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x22,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
cmpb   $0x0,(%rax)
je     116e <stink_2+0x4e>
mov    -0x38(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x38(%rbp)
movsbl (%rax),%edi
call   1030 <putchar@plt>
jmp    1145 <stink_2+0x25>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stink_2>:
push   %rbx
sub    $0x30,%rsp
movaps 0xef4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xed8(%rip),%xmm0
movaps %xmm0,(%rsp)
movw   $0x3f,0x20(%rsp)
lea    0x1(%rsp),%rbx
mov    $0x49,%al
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1140 <stink_2+0x30>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.stink_2.string = [34 x i8] c"Is is supposed to smell that way?\00"
define void @stink_2() {
%1 = alloca [34 x i8]
%2 = alloca i8*
%3 = bitcast [34 x i8]* %1 to i8*
%4 = getelementptr inbounds [34 x i8], [34 x i8]* %1, i64 0, i64 0
store i8* %4, i8** %2
br label %5
5: ; preds = %9, %0
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %5
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %2
%12 = load i8, i8* %10
%13 = sext i8 %12 to i32
%14 = call i32 @putchar(i32 %13)
br label %5
15: ; preds = %5
ret void
}

LLVM IR (-O2):
@__const.stink_2.string = [34 x i8] c"Is is supposed to smell that way?\00"
define void @stink_2() {
%1 = alloca [34 x i8]
%2 = getelementptr inbounds [34 x i8], [34 x i8]* %1, i64 0, i64 0
br label %3
3: ; preds = %0, %3
%4 = phi i8 [ %9, %3 ], [ 73, %0 ]
%5 = phi i8* [ %6, %3 ], [ %2, %0 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = sext i8 %4 to i32
%8 = tail call i32 @putchar(i32 %7)
%9 = load i8, i8* %6
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %3
11: ; preds = %3
ret void
}
unsigned int bit_group_no_starts_uint(unsigned int val) {
  return ((val) ^ (((((val))) & ((((val))) ^ ((((val))) >> 1)))));
}


x86 assembly (clang, -O0):
<bit_group_no_starts_uint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
mov    -0x4(%rbp),%edx
mov    -0x4(%rbp),%esi
shr    $0x1,%esi
xor    %esi,%edx
and    %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @bit_group_no_starts_uint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = load i32, i32* %2
%7 = lshr i32 %6, 1
%8 = xor i32 %5, %7
%9 = and i32 %4, %8
%10 = xor i32 %3, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @bit_group_no_starts_uint(i32 %0) {
%2 = lshr i32 %0, 1
%3 = and i32 %2, %0
ret i32 %3
}
/* Type definitions */
struct stat {
  int st_mode;
};

/* Variables and functions */
int S_IFDIR;
scalar_t__ stat(char const *, struct stat *);
int io_fileexists(const char *path) {
  struct stat buf;
  if (stat(path, &buf) == 0) {
    if (buf.st_mode & S_IFDIR)
      return 0;
    else
      return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<io_fileexists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
jne    1160 <io_fileexists+0x50>
mov    -0x18(%rbp),%eax
mov    0x2e9b(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1154 <io_fileexists+0x44>
movl   $0x0,-0x4(%rbp)
jmp    1167 <io_fileexists+0x57>
movl   $0x1,-0x4(%rbp)
jmp    1167 <io_fileexists+0x57>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_fileexists>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1125 <io_fileexists+0x15>
pop    %rcx
ret
mov    0x2eac(%rip),%rax
mov    (%rax),%ecx
xor    %eax,%eax
test   %ecx,(%rsp)
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@S_IFDIR = global i32 0
define i32 @io_fileexists(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %16
8: ; preds = %1
%9 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%10 = load i32, i32* %9
%11 = load i32, i32* @S_IFDIR
%12 = and i32 %10, %11
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %8
store i32 0, i32* %2
br label %17
15: ; preds = %8
store i32 1, i32* %2
br label %17
16: ; preds = %1
store i32 0, i32* %2
br label %17
17: ; preds = %16, %15, %14
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@S_IFDIR = global i32 0
define i32 @io_fileexists(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = load i32, i32* @S_IFDIR
%10 = and i32 %9, %8
%11 = icmp eq i32 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %1, %6
%14 = phi i32 [ %12, %6 ], [ 0, %1 ]
ret i32 %14
}
int gcol(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @gcol() {
ret i32 0
}
void PDO_DBG_ENTER(const char *func_name) {}


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

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

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

LLVM IR (-O2):
define void @PDO_DBG_ENTER(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int flsl(unsigned long);
unsigned long rounddown_pow_of_two(unsigned long x) {
  return (1UL << (flsl(x) - 1));
}


x86 assembly (clang, -O0):
<rounddown_pow_of_two>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <flsl@plt>
sub    $0x1,%eax
mov    %eax,%eax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rounddown_pow_of_two>:
push   %rax
call   1030 <flsl@plt>
lea    -0x1(%rax),%ecx
mov    $0x1,%eax
shl    %cl,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @rounddown_pow_of_two(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @flsl(i64 %3)
%5 = sub nsw i32 %4, 1
%6 = zext i32 %5 to i64
%7 = shl i64 1, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @rounddown_pow_of_two(i64 %0) {
%2 = tail call i32 @flsl(i64 %0)
%3 = add nsw i32 %2, -1
%4 = zext i32 %3 to i64
%5 = shl nuw i64 1, %4
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr,
          "usage: cl2c [-n <array name>] [-o <output file>] <input file>\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [63 x i8] c"usage: cl2c [-n <array name>] [-o <output file>] <input file>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [63 x i8] c"usage: cl2c [-n <array name>] [-o <output file>] <input file>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
ret void
}
double Test(double A, double B, double C, double D) {
  return -(A - B) - (C - D);
}


x86 assembly (clang, -O0):
<Test>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x18(%rbp),%xmm1
subsd  -0x20(%rbp),%xmm1
subsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Test>:
subsd  %xmm1,%xmm0
xorpd  0xef4(%rip),%xmm0
subsd  %xmm3,%xmm2
subsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @Test(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %6
%11 = fsub double %9, %10
%12 = fneg double %11
%13 = load double, double* %7
%14 = load double, double* %8
%15 = fsub double %13, %14
%16 = fsub double %12, %15
ret double %16
}

LLVM IR (-O2):
define double @Test(double %0, double %1, double %2, double %3) {
%5 = fsub double %0, %1
%6 = fneg double %5
%7 = fsub double %2, %3
%8 = fsub double %6, %7
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ fexpect(char *, int, int, int);
void t6() {
  int a[] = {20, 30, 40};
  fexpect("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/decl.c",
          37, 20, *a);
  ;
}


x86 assembly (clang, -O0):
<t6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    0xedf(%rip),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%ecx
lea    0xed6(%rip),%rdi
mov    $0x25,%esi
mov    $0x14,%edx
call   1030 <fexpect@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t6>:
lea    0xee9(%rip),%rdi
mov    $0x25,%esi
mov    $0x14,%edx
mov    $0x14,%ecx
jmp    1030 <fexpect@plt>

LLVM IR (-O0):
@__const.t6.a = [3 x i32] [i32 20, i32 30, i32 40]
@.str = [127 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/decl.c\00"
define void @t6() {
%1 = alloca [3 x i32]
%2 = bitcast [3 x i32]* %1 to i8*
%3 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%4 = load i32, i32* %3
%5 = call i32 @fexpect(i8* getelementptr inbounds ([127 x i8], [127 x i8]* @.str, i64 0, i64 0), i32 37, i32 20, i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [127 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/decl.c\00"
define void @t6() {
%1 = tail call i32 @fexpect(i8* getelementptr inbounds ([127 x i8], [127 x i8]* @.str, i64 0, i64 0), i32 37, i32 20, i32 20)
ret void
}
int get_ncpu(void) {
  int ncpu = -1;
  return ncpu;
}


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

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

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

LLVM IR (-O2):
define i32 @get_ncpu() {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ ATKprintf(char *, char *, ...);
void prl(char *s, float f) {
  if (f == (-1.0E10))
    ATKprintf("%s =%9s", s, "Log0");
  else
    ATKprintf("%s =%9.2f", s, f);
}


x86 assembly (clang, -O0):
<prl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xece(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1160 <prl+0x50>
jp     1160 <prl+0x50>
mov    -0x8(%rbp),%rsi
lea    0xebb(%rip),%rdi
lea    0xebc(%rip),%rdx
mov    $0x0,%al
call   1030 <ATKprintf@plt>
jmp    117b <prl+0x6b>
mov    -0x8(%rbp),%rsi
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xea1(%rip),%rdi
mov    $0x1,%al
call   1030 <ATKprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prl>:
mov    %rdi,%rsi
ucomiss 0xee6(%rip),%xmm0
jne    1133 <prl+0x23>
jp     1133 <prl+0x23>
lea    0xedf(%rip),%rdi
lea    0xee0(%rip),%rdx
xor    %eax,%eax
jmp    1030 <ATKprintf@plt>
cvtss2sd %xmm0,%xmm0
lea    0xed3(%rip),%rdi
mov    $0x1,%al
jmp    1030 <ATKprintf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%s =%9s\00"
@.str.1 = [5 x i8] c"Log0\00"
@.str.2 = [10 x i8] c"%s =%9.2f\00"
define void @prl(i8* %0, float %1) {
%3 = alloca i8*
%4 = alloca float
store i8* %0, i8** %3
store float %1, float* %4
%5 = load float, float* %4
%6 = fpext float %5 to double
%7 = fcmp oeq double %6, -1.000000e+10
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = call i32 (i8*, i8*, ...) @ATKprintf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %16
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = load float, float* %4
%14 = fpext float %13 to double
%15 = call i32 (i8*, i8*, ...) @ATKprintf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %12, double %14)
br label %16
16: ; preds = %11, %8
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s =%9s\00"
@.str.1 = [5 x i8] c"Log0\00"
@.str.2 = [10 x i8] c"%s =%9.2f\00"
define void @prl(i8* %0, float %1) {
%3 = fcmp oeq float %1, -1.000000e+10
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (i8*, i8*, ...) @ATKprintf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %9
6: ; preds = %2
%7 = fpext float %1 to double
%8 = tail call i32 (i8*, i8*, ...) @ATKprintf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %0, double %7)
br label %9
9: ; preds = %6, %4
ret void
}
int hash(int val) { return val % 20; }


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @hash(i32 %0) {
%2 = srem i32 %0, 20
ret i32 %2
}
/* Type definitions */
struct RNAduplex_args_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/
RNAduplex_cmdline_parser_release(struct RNAduplex_args_info *);
void RNAduplex_cmdline_parser_free(struct RNAduplex_args_info *args_info) {
  RNAduplex_cmdline_parser_release(args_info);
}


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

x86 assembly (clang, -O2):
<RNAduplex_cmdline_parser_free>:
jmp    1030 <RNAduplex_cmdline_parser_release@plt>

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

LLVM IR (-O2):
%struct.RNAduplex_args_info = type { i32 }
define void @RNAduplex_cmdline_parser_free(%struct.RNAduplex_args_info* %0) {
%2 = tail call i32 @RNAduplex_cmdline_parser_release(%struct.RNAduplex_args_info* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void caml_js_pretty_xml_of_dom() { exit(1); }


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

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

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

LLVM IR (-O2):
define void @caml_js_pretty_xml_of_dom() {
%1 = tail call i32 @exit(i32 1)
unreachable
}