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

/* Variables and functions */
struct arg_lit *arg_litn(char const *, char const *, int /*<<< orphan*/, int,
                         char const *);
struct arg_lit *arg_lit0(const char *shortopts, const char *longopts,
                         const char *glossary) {
  return arg_litn(shortopts, longopts, 0, 1, glossary);
}


x86 assembly (clang, -O0):
<arg_lit0>:
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),%r8
xor    %edx,%edx
mov    $0x1,%ecx
call   1030 <arg_litn@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arg_lit0>:
mov    %rdx,%r8
xor    %edx,%edx
mov    $0x1,%ecx
jmp    1030 <arg_litn@plt>

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

LLVM IR (-O2):
%struct.arg_lit = type { i32 }
define %struct.arg_lit* @arg_lit0(i8* %0, i8* %1, i8* %2) {
%4 = tail call %struct.arg_lit* @arg_litn(i8* %0, i8* %1, i32 0, i32 1, i8* %2)
ret %struct.arg_lit* %4
}
/* Type definitions */
typedef char uint8_t;

/* Variables and functions */
void scan_text(const uint8_t **bufptr) {
  const uint8_t *ptr = *bufptr;
  while (*ptr != '"') {
    if (*ptr == '\\') {
      ptr++;
    }
    ptr++;
  }
  ptr++;
  *bufptr = ptr;
}


x86 assembly (clang, -O0):
<scan_text>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x22,%eax
je     1150 <scan_text+0x50>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
jne    113f <scan_text+0x3f>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1113 <scan_text+0x13>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<scan_text>:
mov    (%rdi),%rax
jmp    1118 <scan_text+0x18>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rax
add    $0x1,%rax
movzbl (%rax),%ecx
cmp    $0x5c,%cl
je     1110 <scan_text+0x10>
cmp    $0x22,%cl
jne    1114 <scan_text+0x14>
add    $0x1,%rax
mov    %rax,(%rdi)
ret

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

LLVM IR (-O2):
define void @scan_text(i8** nocapture %0) {
%2 = load i8*, i8** %0
br label %3
3: ; preds = %8, %1
%4 = phi i8* [ %2, %1 ], [ %10, %8 ]
%5 = load i8, i8* %4
switch i8 %5, label %8 [
i8 34, label %11
i8 92, label %6
]
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %4, i64 1
br label %8
8: ; preds = %3, %6
%9 = phi i8* [ %7, %6 ], [ %4, %3 ]
%10 = getelementptr inbounds i8, i8* %9, i64 1
br label %3
11: ; preds = %3
%12 = getelementptr inbounds i8, i8* %4, i64 1
store i8* %12, i8** %0
ret void
}
/* Variables and functions */
int foo_OK();
int bar_OK() {
  int j = 0;
  j++;
  j++;
  j++;
  j = foo_OK();
  j++;
  return j;
}


x86 assembly (clang, -O0):
<bar_OK>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <foo_OK@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar_OK>:
push   %rax
xor    %eax,%eax
call   1030 <foo_OK@plt>
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @bar_OK() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* %1
%3 = add nsw i32 %2, 1
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = add nsw i32 %4, 1
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = add nsw i32 %6, 1
store i32 %7, i32* %1
%8 = call i32 (...) @foo_OK()
store i32 %8, i32* %1
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
define i32 @bar_OK() {
%1 = tail call i32 (...) @foo_OK()
%2 = add nsw i32 %1, 1
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int fgetc(int /*<<< orphan*/ *);
int nb_lignes(FILE *f) {
  int car;
  int i = 1;
  do {
    car = fgetc(f);
    if (car == 10) {
      i++;
    }
  } while (car != EOF);
  return i;
}


x86 assembly (clang, -O0):
<nb_lignes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jne    1142 <nb_lignes+0x32>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1147 <nb_lignes+0x37>
mov    -0xc(%rbp),%eax
mov    0x2e97(%rip),%rcx
cmp    (%rcx),%eax
jne    1123 <nb_lignes+0x13>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nb_lignes>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
mov    $0x1,%ebx
mov    0x2ec4(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
call   1030 <fgetc@plt>
xor    %ecx,%ecx
cmp    $0xa,%eax
sete   %cl
add    %ecx,%ebx
cmp    (%r15),%eax
jne    1130 <nb_lignes+0x20>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@EOF = global i32 0
define i32 @nb_lignes(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 1, %1 ], [ %7, %2 ]
%4 = tail call i32 @fgetc(i32* %0)
%5 = icmp eq i32 %4, 10
%6 = zext i1 %5 to i32
%7 = add nuw nsw i32 %3, %6
%8 = load i32, i32* @EOF
%9 = icmp eq i32 %4, %8
br i1 %9, label %10, label %2
10: ; preds = %2
ret i32 %7
}
int main() { return 42; }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 42
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int CloseFn(void *handler) {
  free(handler);
  return 0;
}


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

x86 assembly (clang, -O2):
<CloseFn>:
push   %rax
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @CloseFn(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret i32 0
}
void foo335(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo335(i32 %0) {
ret void
}
unsigned long val_ulong(unsigned long x) { return x; }


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

x86 assembly (clang, -O2):
<val_ulong>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @val_ulong(i64 returned %0) {
ret i64 %0
}
void __attribute__((
    __warning__("curl_easy_setopt expects a "
                "private data pointer as argument for this option")))
__attribute__((__unused__)) __attribute__((__no__))
_curl_easy_setopt_err_cb_data(void) {
  __asm__("");
}


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

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

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

LLVM IR (-O2):
define void @_curl_easy_setopt_err_cb_data() {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
unsigned int sleep(unsigned int);
int test(void) {
  unsigned int seconds;
  unsigned int result;
  seconds = 10;
  result = sleep(seconds);
  return result;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <sleep@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
mov    $0xa,%edi
jmp    1030 <sleep@plt>

LLVM IR (-O0):
define i32 @test() {
%1 = alloca i32
%2 = alloca i32
store i32 10, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @sleep(i32 %3)
store i32 %4, i32* %2
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
define i32 @test() {
%1 = tail call i32 @sleep(i32 10)
ret i32 %1
}
/* Variables and functions */
long double __infer_nondet_long_double();
long double logl(long double x) { return __infer_nondet_long_double(); }


x86 assembly (clang, -O0):
<logl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
xor    %eax,%eax
call   1030 <__infer_nondet_long_double@plt>
fld    %st(0)
fstp   %st(0)
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define x86_fp80 @logl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = call x86_fp80 (...) @__infer_nondet_long_double()
ret x86_fp80 %3
}

LLVM IR (-O2):
define x86_fp80 @logl(x86_fp80 %0) {
%2 = tail call x86_fp80 (...) @__infer_nondet_long_double()
ret x86_fp80 %2
}
/* Variables and functions */
double __infer_nondet_double();
double exp(double x) { return __infer_nondet_double(); }


x86 assembly (clang, -O0):
<exp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_double@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define double @exp(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call double (...) @__infer_nondet_double()
ret double %3
}

LLVM IR (-O2):
define double @exp(double %0) {
%2 = tail call double (...) @__infer_nondet_double()
ret double %2
}
/* Type definitions */
struct pattern {
  int dummy;
};

/* Variables and functions */
int countlib(int);
int offset(int, int, int, int);
int autohelperowl_attackpat159(struct pattern *patt, int transformation,
                               int move, int color, int action) {
  int A;
  (void)patt;
  (void)color;
  (void)action;
  A = offset(-1, -2, move, transformation);
  return countlib(A) == 2;
}


x86 assembly (clang, -O0):
<autohelperowl_attackpat159>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0xffffffff,%edi
mov    $0xfffffffe,%esi
call   1030 <offset@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
call   1040 <countlib@plt>
cmp    $0x2,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<autohelperowl_attackpat159>:
push   %rax
mov    %esi,%ecx
mov    $0xffffffff,%edi
mov    $0xfffffffe,%esi
call   1030 <offset@plt>
mov    %eax,%edi
call   1040 <countlib@plt>
xor    %ecx,%ecx
cmp    $0x2,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.pattern = type { i32 }
define i32 @autohelperowl_attackpat159(%struct.pattern* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca %struct.pattern*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store %struct.pattern* %0, %struct.pattern** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%12 = load %struct.pattern*, %struct.pattern** %6
%13 = load i32, i32* %9
%14 = load i32, i32* %10
%15 = load i32, i32* %8
%16 = load i32, i32* %7
%17 = call i32 @offset(i32 -1, i32 -2, i32 %15, i32 %16)
store i32 %17, i32* %11
%18 = load i32, i32* %11
%19 = call i32 @countlib(i32 %18)
%20 = icmp eq i32 %19, 2
%21 = zext i1 %20 to i32
ret i32 %21
}

LLVM IR (-O2):
%struct.pattern = type { i32 }
define i32 @autohelperowl_attackpat159(%struct.pattern* nocapture readnone %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @offset(i32 -1, i32 -2, i32 %2, i32 %1)
%7 = tail call i32 @countlib(i32 %6)
%8 = icmp eq i32 %7, 2
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
long double __rinfl(long double);
scalar_t__ signbit(long double);
long double truncl(long double);
long double floorl(long double x) {
  return signbit(x) ? __rinfl(x) : truncl(x);
}


x86 assembly (clang, -O0):
<floorl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <signbit@plt>
cmp    $0x0,%rax
je     116a <floorl+0x3a>
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <__rinfl@plt>
fstpt  -0x1c(%rbp)
jmp    117a <floorl+0x4a>
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1050 <truncl@plt>
fstpt  -0x1c(%rbp)
fldt   -0x1c(%rbp)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<floorl>:
sub    $0x28,%rsp
fldt   0x30(%rsp)
fld    %st(0)
fstpt  0x1c(%rsp)
fstpt  (%rsp)
call   1040 <signbit@plt>
test   %rax,%rax
je     115c <floorl+0x2c>
fldt   0x1c(%rsp)
fstpt  (%rsp)
call   1030 <__rinfl@plt>
add    $0x28,%rsp
ret
fldt   0x1c(%rsp)
fstpt  (%rsp)
call   1050 <truncl@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @floorl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call i64 @signbit(x86_fp80 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load x86_fp80, x86_fp80* %2
%8 = call x86_fp80 @__rinfl(x86_fp80 %7)
br label %12
9: ; preds = %1
%10 = load x86_fp80, x86_fp80* %2
%11 = call x86_fp80 @llvm.trunc.f80(x86_fp80 %10)
br label %12
12: ; preds = %9, %6
%13 = phi x86_fp80 [ %8, %6 ], [ %11, %9 ]
ret x86_fp80 %13
}

LLVM IR (-O2):
define x86_fp80 @floorl(x86_fp80 %0) {
%2 = tail call i64 @signbit(x86_fp80 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call x86_fp80 @__rinfl(x86_fp80 %0)
br label %8
6: ; preds = %1
%7 = tail call x86_fp80 @llvm.trunc.f80(x86_fp80 %0)
br label %8
8: ; preds = %6, %4
%9 = phi x86_fp80 [ %5, %4 ], [ %7, %6 ]
ret x86_fp80 %9
}
/* Variables and functions */
int /*<<< orphan*/ daemonize();
int /*<<< orphan*/ sleep(int);
main() {
  daemonize();
  while (1)
    sleep(1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <daemonize@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    1136 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <daemonize@plt>
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @daemonize()
br label %3
3: ; preds = %0, %3
%4 = call i32 @sleep(i32 1)
br label %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @daemonize()
br label %2
2: ; preds = %0, %2
%3 = tail call i32 @sleep(i32 1)
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
__attribute__((__noreturn__)) void exitfunc6(void) {
  printf("Executing exitfunc"
         "6"
         ".\n");
  exit(0);
}


x86 assembly (clang, -O0):
<exitfunc6>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exitfunc6>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Executing exitfunc6.\0A\00"
define void @exitfunc6() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [21 x i8] c"Executing exitfunc6.\00"
define void @exitfunc6() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ to_gps(int, int /*<<< orphan*/);
void gp2021_latch(void) { to_gps(0x80, 0); }


x86 assembly (clang, -O0):
<gp2021_latch>:
push   %rbp
mov    %rsp,%rbp
mov    $0x80,%edi
xor    %esi,%esi
call   1030 <to_gps@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gp2021_latch>:
mov    $0x80,%edi
xor    %esi,%esi
jmp    1030 <to_gps@plt>

LLVM IR (-O0):
define void @gp2021_latch() {
%1 = call i32 @to_gps(i32 128, i32 0)
ret void
}

LLVM IR (-O2):
define void @gp2021_latch() {
%1 = tail call i32 @to_gps(i32 128, i32 0)
ret void
}
int iscsiAuthClientStringIndex(const char *s, int c) {
  int n = 0;
  while (*s != '\0') {
    if (*s++ == c) {
      return n;
    }
    n++;
  }
  return -1;
}


x86 assembly (clang, -O0):
<iscsiAuthClientStringIndex>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1156 <iscsiAuthClientStringIndex+0x56>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    1148 <iscsiAuthClientStringIndex+0x48>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115d <iscsiAuthClientStringIndex+0x5d>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1112 <iscsiAuthClientStringIndex+0x12>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iscsiAuthClientStringIndex>:
mov    (%rdi),%dl
mov    $0xffffffff,%eax
test   %dl,%dl
je     1124 <iscsiAuthClientStringIndex+0x24>
xor    %ecx,%ecx
nopl   (%rax)
movsbl %dl,%edx
cmp    %esi,%edx
je     1125 <iscsiAuthClientStringIndex+0x25>
movzbl 0x1(%rdi,%rcx,1),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <iscsiAuthClientStringIndex+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @iscsiAuthClientStringIndex(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %11
%6 = phi i8 [ %14, %11 ], [ %3, %2 ]
%7 = phi i32 [ %13, %11 ], [ 0, %2 ]
%8 = phi i8* [ %12, %11 ], [ %0, %2 ]
%9 = sext i8 %6 to i32
%10 = icmp eq i32 %9, %1
br i1 %10, label %16, label %11
11: ; preds = %5
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = add nuw nsw i32 %7, 1
%14 = load i8, i8* %12
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %11, %2
%17 = phi i32 [ -1, %2 ], [ -1, %11 ], [ %7, %5 ]
ret i32 %17
}
/* Variables and functions */
scalar_t__ logb(double);
long double logbl(long double x) { return (long double)logb((double)x); }


x86 assembly (clang, -O0):
<logbl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <logb@plt>
mov    %rax,-0x18(%rbp)
fildll -0x18(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define x86_fp80 @logbl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fptrunc x86_fp80 %3 to double
%5 = call i64 @logb(double %4)
%6 = sitofp i64 %5 to x86_fp80
ret x86_fp80 %6
}

LLVM IR (-O2):
define x86_fp80 @logbl(x86_fp80 %0) {
%2 = fptrunc x86_fp80 %0 to double
%3 = tail call i64 @logb(double %2)
%4 = sitofp i64 %3 to x86_fp80
ret x86_fp80 %4
}
void localvars_after_alloca(c, s, i, l) char c;
short s;
int i;
long l;
{
  char *z = __builtin_alloca(s + 50);
  c = 'a';
  s = 5;
  i = 6;
  l = 7;
}


x86 assembly (clang, -O0):
<localvars_after_alloca>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
mov    %edx,-0x8(%rbp)
mov    %rcx,-0x10(%rbp)
movswq -0x4(%rbp),%rcx
add    $0x41,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rax
sub    %rcx,%rax
mov    %rax,%rsp
mov    %rax,-0x18(%rbp)
movb   $0x61,-0x1(%rbp)
movw   $0x5,-0x4(%rbp)
movl   $0x6,-0x8(%rbp)
movq   $0x7,-0x10(%rbp)
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @localvars_after_alloca(i32 %0, i32 %1, i32 %2, i64 %3) {
%5 = alloca i8
%6 = alloca i16
%7 = alloca i32
%8 = alloca i64
%9 = alloca i8*
%10 = trunc i32 %0 to i8
%11 = trunc i32 %1 to i16
store i8 %10, i8* %5
store i16 %11, i16* %6
store i32 %2, i32* %7
store i64 %3, i64* %8
%12 = load i16, i16* %6
%13 = sext i16 %12 to i32
%14 = add nsw i32 %13, 50
%15 = sext i32 %14 to i64
%16 = alloca i8, i64 %15
store i8* %16, i8** %9
store i8 97, i8* %5
store i16 5, i16* %6
store i32 6, i32* %7
store i64 7, i64* %8
ret void
}

LLVM IR (-O2):
define void @localvars_after_alloca(i32 %0, i32 %1, i32 %2, i64 %3) {
ret void
}
int calcSum(int x, int y) { return x + y; }


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

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

LLVM IR (-O0):
define i32 @calcSum(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @calcSum(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
int out_of_range(int val, int lower, int upper) {
  return val < lower || upper < val;
}


x86 assembly (clang, -O0):
<out_of_range>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%al
cmp    -0x8(%rbp),%ecx
mov    %al,-0xd(%rbp)
jl     112a <out_of_range+0x2a>
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
setl   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<out_of_range>:
cmp    %esi,%edi
setl   %al
cmp    %edi,%edx
setl   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @out_of_range(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = icmp slt i32 %2, %0
%6 = or i1 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ SIGABRT;
int /*<<< orphan*/ SIG_DFL;
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
void fail() {
  signal(SIGABRT, SIG_DFL);
  assert(0);
}


x86 assembly (clang, -O0):
<fail>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
xor    %edi,%edi
call   1040 <assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fail>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <assert@plt>

LLVM IR (-O0):
@SIGABRT = global i32 0
@SIG_DFL = global i32 0
define void @fail() {
%1 = load i32, i32* @SIGABRT
%2 = load i32, i32* @SIG_DFL
%3 = call i32 @signal(i32 %1, i32 %2)
%4 = call i32 @assert(i32 0)
ret void
}

LLVM IR (-O2):
@SIGABRT = global i32 0
@SIG_DFL = global i32 0
define void @fail() {
%1 = load i32, i32* @SIGABRT
%2 = load i32, i32* @SIG_DFL
%3 = tail call i32 @signal(i32 %1, i32 %2)
%4 = tail call i32 @assert(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int soma(int);
scalar_t__ strtol(char *, int /*<<< orphan*/ *, int);
int main(int argc, char *argv[]) {
  printf("Soma: %d",
         soma((int)strtol(argv[1], NULL, 10) + (int)strtol(argv[2], NULL, 10)));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1050 <strtol@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1050 <strtol@plt>
mov    -0x14(%rbp),%edi
add    %eax,%edi
call   1040 <soma@plt>
mov    %eax,%esi
lea    0xe7f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    0x8(%rsi),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1050 <strtol@plt>
mov    %rax,%rbx
mov    0x10(%r14),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1050 <strtol@plt>
add    %eax,%ebx
mov    %ebx,%edi
call   1040 <soma@plt>
lea    0xe96(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [9 x i8] c"Soma: %d\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = getelementptr inbounds i8*, i8** %5, i64 1
%7 = load i8*, i8** %6
%8 = call i64 @strtol(i8* %7, i32* null, i32 10)
%9 = trunc i64 %8 to i32
%10 = load i8**, i8*** %4
%11 = getelementptr inbounds i8*, i8** %10, i64 2
%12 = load i8*, i8** %11
%13 = call i64 @strtol(i8* %12, i32* null, i32 10)
%14 = trunc i64 %13 to i32
%15 = add nsw i32 %9, %14
%16 = call i32 @soma(i32 %15)
%17 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"Soma: %d\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i64 @strtol(i8* nocapture %4, i32* null, i32 10)
%6 = trunc i64 %5 to i32
%7 = getelementptr inbounds i8*, i8** %1, i64 2
%8 = load i8*, i8** %7
%9 = tail call i64 @strtol(i8* nocapture %8, i32* null, i32 10)
%10 = trunc i64 %9 to i32
%11 = add nsw i32 %10, %6
%12 = tail call i32 @soma(i32 %11)
%13 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %12)
ret i32 0
}
void mhl_unpowered_sysfs_release(void) {}


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

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

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

LLVM IR (-O2):
define void @mhl_unpowered_sysfs_release() {
ret void
}
int iLeftChild(int i) { return (i * 2) + 1; }


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

x86 assembly (clang, -O2):
<iLeftChild>:
lea    (%rdi,%rdi,1),%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @iLeftChild(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = or i32 %2, 1
ret i32 %3
}
/* Type definitions */
struct matrix {
  int dummy;
};

/* Variables and functions */
struct matrix *matrix_mult(struct matrix *, struct matrix *);
struct matrix *apply_transform(struct matrix *trans_mat,
                               struct matrix *points) {
  return matrix_mult(trans_mat, points);
}


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

x86 assembly (clang, -O2):
<apply_transform>:
jmp    1030 <matrix_mult@plt>

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

LLVM IR (-O2):
%struct.matrix = type { i32 }
define %struct.matrix* @apply_transform(%struct.matrix* %0, %struct.matrix* %1) {
%3 = tail call %struct.matrix* @matrix_mult(%struct.matrix* %0, %struct.matrix* %1)
ret %struct.matrix* %3
}
int _dl_getuid(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @_dl_getuid() {
ret i32 0
}
/* Type definitions */
struct battle_char {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ add_status(struct battle_char *, int);
scalar_t__ get_random(int /*<<< orphan*/, int);
scalar_t__ mod6(struct battle_char *, struct battle_char *, int);
void protect2(struct battle_char *origin, struct battle_char *target) {
  if (get_random(0, 100) < mod6(origin, target, 120))
    add_status(target, 23);
}


x86 assembly (clang, -O0):
<protect2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
mov    $0x64,%esi
call   1030 <get_random@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x78,%edx
call   1040 <mod6@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
jge    1180 <protect2+0x50>
mov    -0x10(%rbp),%rdi
mov    $0x17,%esi
call   1050 <add_status@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<protect2>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
xor    %edi,%edi
mov    $0x64,%esi
call   1030 <get_random@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x78,%edx
call   1040 <mod6@plt>
cmp    %rax,%rbx
jge    1171 <protect2+0x41>
mov    %r14,%rdi
mov    $0x17,%esi
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <add_status@plt>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.battle_char = type { i32 }
define void @protect2(%struct.battle_char* %0, %struct.battle_char* %1) {
%3 = alloca %struct.battle_char*
%4 = alloca %struct.battle_char*
store %struct.battle_char* %0, %struct.battle_char** %3
store %struct.battle_char* %1, %struct.battle_char** %4
%5 = call i64 @get_random(i32 0, i32 100)
%6 = load %struct.battle_char*, %struct.battle_char** %3
%7 = load %struct.battle_char*, %struct.battle_char** %4
%8 = call i64 @mod6(%struct.battle_char* %6, %struct.battle_char* %7, i32 120)
%9 = icmp slt i64 %5, %8
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load %struct.battle_char*, %struct.battle_char** %4
%12 = call i32 @add_status(%struct.battle_char* %11, i32 23)
br label %13
13: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
%struct.battle_char = type { i32 }
define void @protect2(%struct.battle_char* %0, %struct.battle_char* %1) {
%3 = tail call i64 @get_random(i32 0, i32 100)
%4 = tail call i64 @mod6(%struct.battle_char* %0, %struct.battle_char* %1, i32 120)
%5 = icmp slt i64 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @add_status(%struct.battle_char* %1, i32 23)
br label %8
8: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Log(char *);
int /*<<< orphan*/ abort();
int Div0() {
  Log("Divison by zero");
  abort();
}


x86 assembly (clang, -O0):
<Div0>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <Log@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<Div0>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <Log@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Divison by zero\00"
define i32 @Div0() {
%1 = call i32 @Log(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@.str = [16 x i8] c"Divison by zero\00"
define i32 @Div0() {
%1 = tail call i32 @Log(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void displevel(int *arr, int len) {
  printf("\n");
  for (int i = 0; i < len; i++) {
    printf("[%u]", arr[i]);
  }
}


x86 assembly (clang, -O0):
<displevel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1167 <displevel+0x57>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1134 <displevel+0x24>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<displevel>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%r15
mov    $0xa,%edi
call   1030 <putchar@plt>
test   %ebp,%ebp
jle    1167 <displevel+0x47>
mov    %ebp,%ebp
lea    0xebd(%rip),%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1150 <displevel+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str.1 = [5 x i8] c"[%u]\00"
define void @displevel(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @putchar(i32 10)
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = zext i32 %1 to i64
br label %8
7: ; preds = %8, %2
ret void
8: ; preds = %5, %8
%9 = phi i64 [ 0, %5 ], [ %13, %8 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %7, label %8
}
int UintToInt(unsigned int value) { return (int)value; }


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

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

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

LLVM IR (-O2):
define i32 @UintToInt(i32 returned %0) {
ret i32 %0
}
void audioPlayStop() {}


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

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

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

LLVM IR (-O2):
define void @audioPlayStop() {
ret void
}
/* Variables and functions */
void *_talloc(void const *, size_t);
int /*<<< orphan*/ talloc_set_name_const(void *, char const *);
void *talloc_named_const(const void *context, size_t size, const char *name) {
  void *ptr;
  ptr = _talloc(context, size);
  if (ptr == NULL) {
    return NULL;
  }
  talloc_set_name_const(ptr, name);
  return ptr;
}


x86 assembly (clang, -O0):
<talloc_named_const>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <_talloc@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    115d <talloc_named_const+0x3d>
movq   $0x0,-0x8(%rbp)
jmp    1172 <talloc_named_const+0x52>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <talloc_set_name_const@plt>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<talloc_named_const>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
call   1030 <_talloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     113f <talloc_named_const+0x1f>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <talloc_set_name_const@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @talloc_named_const(i8* %0, i64 %1, i8* %2) {
%4 = tail call i8* @_talloc(i8* %0, i64 %1)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @talloc_set_name_const(i8* %4, i8* %2)
br label %8
8: ; preds = %3, %6
ret i8* %4
}
void check_pc(void) {}


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

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

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

LLVM IR (-O2):
define void @check_pc() {
ret void
}
void sdram_no_memory(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<sdram_no_memory>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <sdram_no_memory+0x9>
jmp    1109 <sdram_no_memory+0x9>

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

LLVM IR (-O0):
define void @sdram_no_memory() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @sdram_no_memory() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
long __semihost(int, int *);
long semihost_flen(int fh) { return __semihost((0xc), &fh); }


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

x86 assembly (clang, -O2):
<semihost_flen>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0xc,%edi
call   1030 <__semihost@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i64 @semihost_flen(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i64 @__semihost(i32 12, i32* %2)
ret i64 %3
}

LLVM IR (-O2):
define i64 @semihost_flen(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i64 @__semihost(i32 12, i32* %2)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ mdfour(unsigned char *, unsigned char *, int);
unsigned int Com_BlockChecksum(void *buffer, int length) {
  int digest[4];
  unsigned int val;
  mdfour((unsigned char *)digest, (unsigned char *)buffer, length);
  val = digest[0] ^ digest[1] ^ digest[2] ^ digest[3];
  return val;
}


x86 assembly (clang, -O0):
<Com_BlockChecksum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <mdfour@plt>
mov    -0x20(%rbp),%eax
xor    -0x1c(%rbp),%eax
xor    -0x18(%rbp),%eax
xor    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Com_BlockChecksum>:
sub    $0x18,%rsp
mov    %esi,%edx
mov    %rdi,%rsi
mov    %rsp,%rdi
call   1030 <mdfour@plt>
movdqa (%rsp),%xmm0
pshufd $0xee,%xmm0,%xmm1
pxor   %xmm0,%xmm1
pshufd $0x55,%xmm1,%xmm0
pxor   %xmm1,%xmm0
movd   %xmm0,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @Com_BlockChecksum(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [4 x i32]
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 0
%8 = bitcast i32* %7 to i8*
%9 = load i8*, i8** %3
%10 = load i32, i32* %4
%11 = call i32 @mdfour(i8* %8, i8* %9, i32 %10)
%12 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 0
%13 = load i32, i32* %12
%14 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 1
%15 = load i32, i32* %14
%16 = xor i32 %13, %15
%17 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 2
%18 = load i32, i32* %17
%19 = xor i32 %16, %18
%20 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 3
%21 = load i32, i32* %20
%22 = xor i32 %19, %21
store i32 %22, i32* %6
%23 = load i32, i32* %6
ret i32 %23
}

LLVM IR (-O2):
define i32 @Com_BlockChecksum(i8* %0, i32 %1) {
%3 = alloca <4 x i32>
%4 = bitcast <4 x i32>* %3 to i8*
%5 = call i32 @mdfour(i8* %4, i8* %0, i32 %1)
%6 = load <4 x i32>, <4 x i32>* %3
%7 = call i32 @llvm.vector.reduce.xor.v4i32(<4 x i32> %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
void main() {
  int m;
  long int sum;
  long int fac(int);
  printf("input an integer number:");
  scanf("%d", &m);
  sum = fac(m);
  printf("%d! = %4ld", m, sum);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xecc(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%edi
call   1030 <fac@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed3(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <fac@plt>
mov    0x4(%rsp),%esi
lea    0xeb8(%rip),%rdi
mov    %rax,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [25 x i8] c"input an integer number:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [11 x i8] c"%d! = %4ld\00"
define void @main() {
%1 = alloca i32
%2 = alloca i64
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i64 @fac(i32 %5)
store i64 %6, i64* %2
%7 = load i32, i32* %1
%8 = load i64, i64* %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %7, i64 %8)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"input an integer number:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [11 x i8] c"%d! = %4ld\00"
define void @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i64 @fac(i32 %5)
%7 = load i32, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %7, i64 %6)
ret void
}
/* Variables and functions */
int main_demo_aa();
int main(void) {
  static int res;
  res = main_demo_aa();
  return res;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <main_demo_aa@plt>
mov    %eax,0x2f00(%rip)
mov    0x2efa(%rip),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@main.res = internal global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @main_demo_aa()
store i32 %2, i32* @main.res
%3 = load i32, i32* @main.res
ret i32 %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @main_demo_aa()
ret i32 %1
}