xunge/DecIR huggingface dataset:
/* Variables and functions */
int mount(char const *, char const *, char const *, int, char const *);
int /*<<< orphan*/ strcmp(char const *, char *);
int mount_one(const char *source, const char *target, const char *type,
              int flags, const char *opts) {
  if (!strcmp(source, "none"))
    source = NULL;
  return mount(source, target, type, flags, opts);
}


x86 assembly (clang, -O0):
<mount_one>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeba(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    115c <mount_one+0x3c>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x28(%rbp),%r8
call   1030 <mount@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mount_one>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8,%r14
mov    %ecx,%r15d
mov    %rdx,%r12
mov    %rsi,%rbp
mov    %rdi,%rbx
lea    0xec2(%rip),%rsi
call   1040 <strcmp@plt>
xor    %edi,%edi
test   %eax,%eax
cmovne %rbx,%rdi
mov    %rbp,%rsi
mov    %r12,%rdx
mov    %r15d,%ecx
mov    %r14,%r8
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <mount@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"none\00"
define i32 @mount_one(i8* %0, i8* %1, i8* %2, i32 %3, i8* %4) {
%6 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i8* null, i8* %0
%9 = tail call i32 @mount(i8* %8, i8* %1, i8* %2, i32 %3, i8* %4)
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
scalar_t__ fread(void *, size_t, size_t, int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
void eread(void *p, size_t size, size_t nmemb, FILE *f) {
  if (fread(p, size, nmemb, f))
    return;
  fprintf(stderr, "fail to read binary data\n");
  exit(2);
}


x86 assembly (clang, -O0):
<eread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <fread@plt>
cmp    $0x0,%rax
je     116d <eread+0x3d>
add    $0x20,%rsp
pop    %rbp
ret
mov    0x2e6c(%rip),%rax
mov    (%rax),%edi
lea    0xe83(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x2,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<eread>:
push   %rax
call   1030 <fread@plt>
test   %rax,%rax
je     113d <eread+0xd>
pop    %rax
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x2,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"fail to read binary data\0A\00"
define void @eread(i8* %0, i64 %1, i64 %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i32* %3, i32** %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load i64, i64* %7
%12 = load i32*, i32** %8
%13 = call i64 @fread(i8* %9, i64 %10, i64 %11, i32* %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %4
ret void
16: ; preds = %4
%17 = load i32, i32* @stderr
%18 = call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%19 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"fail to read binary data\0A\00"
define void @eread(i8* nocapture %0, i64 %1, i64 %2, i32* nocapture %3) {
%5 = tail call i64 @fread(i8* %0, i64 %1, i64 %2, i32* %3)
%6 = icmp eq i64 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %4
ret void
8: ; preds = %4
%9 = load i32, i32* @stderr
%10 = tail call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%11 = tail call i32 @exit(i32 2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
int sum(int, int, int *, int, int *, int /*<<< orphan*/);
int main(void) {
  int i1 = 5;
  int i2 = 7;
  if (sum(0xA, 3, &i1, 7, &i2, 0) != 22) {
    printf("Error %d\n", (int)1);
    exit(1);
  };
  {
    printf("Success\n");
    exit(0);
  };
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0x7,-0xc(%rbp)
mov    $0xa,%edi
mov    $0x3,%esi
lea    -0x8(%rbp),%rdx
mov    $0x7,%ecx
lea    -0xc(%rbp),%r8
xor    %r9d,%r9d
call   1040 <sum@plt>
cmp    $0x16,%eax
je     1192 <main+0x62>
lea    0xe84(%rip),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x5,0x4(%rsp)
movl   $0x7,(%rsp)
lea    0x4(%rsp),%rdx
mov    %rsp,%r8
mov    $0xa,%edi
mov    $0x3,%esi
mov    $0x7,%ecx
xor    %r9d,%r9d
call   1050 <sum@plt>
cmp    $0x16,%eax
jne    1187 <main+0x47>
lea    0xe8f(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1060 <exit@plt>
lea    0xe72(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"Error %d\0A\00"
@.str.1 = [9 x i8] c"Success\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 5, i32* %2
store i32 7, i32* %3
%4 = call i32 @sum(i32 10, i32 3, i32* %2, i32 7, i32* %3, i32 0)
%5 = icmp ne i32 %4, 22
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 1)
%8 = call i32 @exit(i32 1)
unreachable
9: ; preds = %0
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [10 x i8] c"Error %d\0A\00"
@str = [8 x i8] c"Success\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 5, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 7, i32* %2
%5 = call i32 @sum(i32 10, i32 3, i32* %1, i32 7, i32* %2, i32 0)
%6 = icmp eq i32 %5, 22
br i1 %6, label %10, label %7
7: ; preds = %0
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 1)
%9 = call i32 @exit(i32 1)
unreachable
10: ; preds = %0
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%12 = call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
long double expd(long double);
long double alog10d(long double x) { return expd(x * (2.302585092994046e+0L)); }


x86 assembly (clang, -O0):
<alog10d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fldt   0xed9(%rip)
fmulp  %st,%st(1)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <expd@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alog10d>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
fldt   0xee2(%rip)
fmulp  %st,%st(1)
fstpt  (%rsp)
call   1030 <expd@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @alog10d(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fmul x86_fp80 %3, 0xK4000935D8DDDAAA8B1C8
%5 = call x86_fp80 @expd(x86_fp80 %4)
ret x86_fp80 %5
}

LLVM IR (-O2):
define x86_fp80 @alog10d(x86_fp80 %0) {
%2 = fmul x86_fp80 %0, 0xK4000935D8DDDAAA8B1C8
%3 = tail call x86_fp80 @expd(x86_fp80 %2)
ret x86_fp80 %3
}
/* Variables and functions */
char isnan(float);
char futhark_isnan32(float x) { return isnan(x); }


x86 assembly (clang, -O0):
<futhark_isnan32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <isnan@plt>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<futhark_isnan32>:
jmp    1030 <isnan@plt>

LLVM IR (-O0):
define signext i8 @futhark_isnan32(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call signext i8 @isnan(float %3)
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @futhark_isnan32(float %0) {
%2 = tail call signext i8 @isnan(float %0)
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long, long);
void compute(long a, long b) { printf("a=%d b=%d\n", a, b); }


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

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"a=%d b=%d\0A\00"
define void @compute(i64 %0, i64 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i64 %0, i64 %1)
ret void
}
/* Variables and functions */
long atoi(char *);
int /*<<< orphan*/ wo_dead_local_store();
int main(int argc, char *argv[]) {
  long i, n;
  n = atoi(argv[1]);
  for (i = 0; i < n; i++)
    wo_dead_local_store();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %rax,-0x20(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
jge    1175 <main+0x55>
mov    $0x0,%al
call   1030 <wo_dead_local_store@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    114f <main+0x2f>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
test   %rax,%rax
jle    114d <main+0x2d>
mov    %rax,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <wo_dead_local_store@plt>
add    $0xffffffffffffffff,%rbx
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
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 @atoi(i8* %4)
%6 = icmp sgt i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %2, %7
%8 = phi i64 [ %10, %7 ], [ 0, %2 ]
%9 = tail call i32 (...) @wo_dead_local_store()
%10 = add nuw nsw i64 %8, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %7
12: ; preds = %7, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ bar();
int foo(void) { bar(); }


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

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

LLVM IR (-O0):
define i32 @foo() {
%1 = alloca i32
%2 = call i32 (...) @bar()
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @foo() {
%1 = tail call i32 (...) @bar()
ret i32 undef
}
unsigned int SCE_String_lenof(long arg) {
  unsigned int size = 1;
  long nb = 1;
  if (arg < 0) {
    arg = -arg;
    size++;
  }
  while (1) {
    nb = nb * 10;
    if (arg >= nb)
      size++;
    else
      break;
  }
  return size;
}


x86 assembly (clang, -O0):
<SCE_String_lenof>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movq   $0x1,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    1135 <SCE_String_lenof+0x35>
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113a <SCE_String_lenof+0x3a>
imul   $0xa,-0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
jl     115f <SCE_String_lenof+0x5f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1164 <SCE_String_lenof+0x64>
jmp    1169 <SCE_String_lenof+0x69>
jmp    113a <SCE_String_lenof+0x3a>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SCE_String_lenof>:
mov    %rdi,%rax
mov    %rdi,%rcx
neg    %rcx
cmovs  %rdi,%rcx
shr    $0x3f,%rax
mov    $0x1,%edx
cs nopw 0x0(%rax,%rax,1)
add    %rdx,%rdx
lea    (%rdx,%rdx,4),%rdx
add    $0x1,%eax
cmp    %rdx,%rcx
jge    1120 <SCE_String_lenof+0x20>
ret

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

LLVM IR (-O2):
define i32 @SCE_String_lenof(i64 %0) {
%2 = icmp slt i64 %0, 0
%3 = sub nsw i64 0, %0
%4 = select i1 %2, i64 %3, i64 %0
%5 = select i1 %2, i32 2, i32 1
br label %6
6: ; preds = %6, %1
%7 = phi i32 [ %5, %1 ], [ %11, %6 ]
%8 = phi i64 [ 1, %1 ], [ %9, %6 ]
%9 = mul nsw i64 %8, 10
%10 = icmp slt i64 %4, %9
%11 = add i32 %7, 1
br i1 %10, label %12, label %6
12: ; preds = %6
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_CIPHER_CTX;

/* Variables and functions */
int EVP_CIPHER_CTX_reset(int /*<<< orphan*/ *);
int sb_aes_deinit(EVP_CIPHER_CTX *ctx) { return EVP_CIPHER_CTX_reset(ctx); }


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

x86 assembly (clang, -O2):
<sb_aes_deinit>:
jmp    1030 <EVP_CIPHER_CTX_reset@plt>

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

LLVM IR (-O2):
define i32 @sb_aes_deinit(i32* %0) {
%2 = tail call i32 @EVP_CIPHER_CTX_reset(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ willus_mem_free(double **, char *);
void freexy(double **x) { willus_mem_free(x, "freexy"); }


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"freexy\00"
define void @freexy(double** %0) {
%2 = tail call i32 @willus_mem_free(double** %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ bar();
scalar_t__ foo();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("[BEGIN] dlopen-in-init2\n");
  if (foo() != 0)
    return 0;
  if (bar() != 0)
    return 0;
  printf("[PASS]  dlopen-in-init2\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <foo@plt>
cmp    $0x0,%rax
je     1168 <main+0x38>
movl   $0x0,-0x4(%rbp)
jmp    1198 <main+0x68>
mov    $0x0,%al
call   1030 <bar@plt>
cmp    $0x0,%rax
je     1185 <main+0x55>
movl   $0x0,-0x4(%rbp)
jmp    1198 <main+0x68>
lea    0xe8d(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <foo@plt>
test   %rax,%rax
jne    1161 <main+0x31>
xor    %eax,%eax
call   1040 <bar@plt>
test   %rax,%rax
jne    1161 <main+0x31>
lea    0xebc(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"[BEGIN] dlopen-in-init2\0A\00"
@.str.1 = [25 x i8] c"[PASS] dlopen-in-init2\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = call i64 (...) @foo()
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
store i32 0, i32* %1
br label %12
6: ; preds = %0
%7 = call i64 (...) @bar()
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 0, i32* %1
br label %12
10: ; preds = %6
%11 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %1
br label %12
12: ; preds = %10, %9, %5
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@str = [24 x i8] c"[BEGIN] dlopen-in-init2\00"
@str.2 = [24 x i8] c"[PASS] dlopen-in-init2\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%2 = tail call i64 (...) @foo()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %0
%5 = tail call i64 (...) @bar()
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.2, i64 0, i64 0))
br label %9
9: ; preds = %4, %0, %7
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ op_tge();
void vm_op_tge(void) {
  op_tge();
  return;
}


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

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

LLVM IR (-O0):
define void @vm_op_tge() {
%1 = call i32 (...) @op_tge()
ret void
}

LLVM IR (-O2):
define void @vm_op_tge() {
%1 = tail call i32 (...) @op_tge()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void WriteStopErrorFile(char sMess[]) {
  FILE *fsync;
  fsync = fopen("stop_error.txt", "w");
  fprintf(fsync, sMess);
  fclose(fsync);
}


x86 assembly (clang, -O0):
<WriteStopErrorFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
lea    0xec5(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteStopErrorFile>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0xec2(%rip),%rdi
lea    0xeca(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1040 <fprintf@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"stop_error.txt\00"
@.str.1 = [2 x i8] c"w\00"
define void @WriteStopErrorFile(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = call i32* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %4, i32** %3
%5 = load i32*, i32** %3
%6 = load i8*, i8** %2
%7 = call i32 @fprintf(i32* %5, i8* %6)
%8 = load i32*, i32** %3
%9 = call i32 @fclose(i32* %8)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"stop_error.txt\00"
@.str.1 = [2 x i8] c"w\00"
define void @WriteStopErrorFile(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @fprintf(i32* %2, i8* %0)
%4 = tail call i32 @fclose(i32* %2)
ret void
}
int msm_iommu_map_contig_buffer(unsigned long phys, unsigned int domain_no,
                                unsigned int partition_no, unsigned long size,
                                unsigned long align, unsigned long cached,
                                unsigned long *iova_val) {
  *iova_val = phys;
  return 0;
}


x86 assembly (clang, -O0):
<msm_iommu_map_contig_buffer>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x8(%rbp),%rcx
mov    0x10(%rbp),%rax
mov    %rcx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<msm_iommu_map_contig_buffer>:
mov    0x8(%rsp),%rax
mov    %rdi,(%rax)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @msm_iommu_map_contig_buffer(i64 %0, i32 %1, i32 %2, i64 %3, i64 %4, i64 %5, i64* %6) {
%8 = alloca i64
%9 = alloca i32
%10 = alloca i32
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca i64*
store i64 %0, i64* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i64 %3, i64* %11
store i64 %4, i64* %12
store i64 %5, i64* %13
store i64* %6, i64** %14
%15 = load i64, i64* %8
%16 = load i64*, i64** %14
store i64 %15, i64* %16
ret i32 0
}

LLVM IR (-O2):
define i32 @msm_iommu_map_contig_buffer(i64 %0, i32 %1, i32 %2, i64 %3, i64 %4, i64 %5, i64* nocapture writeonly %6) {
store i64 %0, i64* %6
ret i32 0
}
void intel_register_dsm_handler(void) { return; }


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

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

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

LLVM IR (-O2):
define void @intel_register_dsm_handler() {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ ext_data;
};
typedef TYPE_1__ Screen;

/* Variables and functions */
void *get_Screen_ext_data(void *_p) { return (void *)((Screen *)_p)->ext_data; }


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i8* @get_Screen_ext_data(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}

LLVM IR (-O2):
define i8* @get_Screen_ext_data(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
int main() {
  int i = 0;
  while (i < 2) {
    i++;
  }
  if (i != 2) {
  ERROR:
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    112a <main+0x2a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
cmpl   $0x2,-0x8(%rbp)
je     1145 <main+0x45>
jmp    1139 <main+0x39>
movl   $0x1,-0x4(%rbp)
jmp    114c <main+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
long long abs(long long x) { return x > 0 ? x : -x; }


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jle    1120 <abs+0x20>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    112a <abs+0x2a>
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @abs(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
ret i64 %2
}
void dv2_3point_cross(double *output, double *origo, double *a, double *b) {}


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

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

LLVM IR (-O0):
define void @dv2_3point_cross(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
ret void
}

LLVM IR (-O2):
define void @dv2_3point_cross(double* nocapture %0, double* nocapture %1, double* nocapture %2, double* nocapture %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ yml_parser(char *);
int main(void) {
  yml_parser("debridage.ini");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"debridage.ini\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @yml_parser(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"debridage.ini\00"
define i32 @main() {
%1 = tail call i32 @yml_parser(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int main(int argc, char **argv) {
  int *p = 0;
  *p = 10;
  return 0;
}


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

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32* null, i32** %6
%7 = load i32*, i32** %6
store i32 10, i32* %7
ret i32 0
}

LLVM IR (-O2):
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char **argv) {
  fprintf(stderr, "%s tcp <ip> <port>\n", argv[0]);
  fprintf(stderr, "%s unix <path_to_socket>\n", argv[0]);
}


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),%rax
mov    (%rax),%rdx
lea    0xecd(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ec2(%rip),%r14
mov    (%r14),%edi
mov    (%rbx),%rdx
lea    0xed5(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%r14),%edi
mov    (%rbx),%rdx
lea    0xed7(%rip),%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"%s tcp <ip> <port>\0A\00"
@.str.1 = [26 x i8] c"%s unix <path_to_socket>\0A\00"
define void @usage(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i32, i32* @stderr
%4 = load i8**, i8*** %2
%5 = getelementptr inbounds i8*, i8** %4, i64 0
%6 = load i8*, i8** %5
%7 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32, i32* @stderr
%9 = load i8**, i8*** %2
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %11)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"%s tcp <ip> <port>\0A\00"
@.str.1 = [26 x i8] c"%s unix <path_to_socket>\0A\00"
define void @usage(i8** nocapture %0) {
%2 = load i32, i32* @stderr
%3 = load i8*, i8** %0
%4 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %0
%7 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %6)
ret void
}
/* Type definitions */
struct llist_head {
  int dummy;
};

/* Variables and functions */
int atoi(char *);
char *nubase_config_table_get_or_default(struct llist_head *, char *,
                                         int /*<<< orphan*/);
int /*<<< orphan*/ str_itoa(int);
int nubase_config_table_get_or_default_int(struct llist_head *config_table_list,
                                           char *key, int defint) {
  char *str;
  int i;
  str = nubase_config_table_get_or_default(config_table_list, key,
                                           str_itoa(defint));
  i = atoi(str);
  return i;
}


x86 assembly (clang, -O0):
<nubase_config_table_get_or_default_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <str_itoa@plt>
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    %eax,%edx
call   1050 <nubase_config_table_get_or_default@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nubase_config_table_get_or_default_int>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %edx,%edi
call   1030 <str_itoa@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
call   1050 <nubase_config_table_get_or_default@plt>
mov    %rax,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <atoi@plt>

LLVM IR (-O0):
%struct.llist_head = type { i32 }
define i32 @nubase_config_table_get_or_default_int(%struct.llist_head* %0, i8* %1, i32 %2) {
%4 = alloca %struct.llist_head*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store %struct.llist_head* %0, %struct.llist_head** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%9 = load %struct.llist_head*, %struct.llist_head** %4
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = call i32 @str_itoa(i32 %11)
%13 = call i8* @nubase_config_table_get_or_default(%struct.llist_head* %9, i8* %10, i32 %12)
store i8* %13, i8** %7
%14 = load i8*, i8** %7
%15 = call i32 @atoi(i8* %14)
store i32 %15, i32* %8
%16 = load i32, i32* %8
ret i32 %16
}

LLVM IR (-O2):
%struct.llist_head = type { i32 }
define i32 @nubase_config_table_get_or_default_int(%struct.llist_head* %0, i8* %1, i32 %2) {
%4 = tail call i32 @str_itoa(i32 %2)
%5 = tail call i8* @nubase_config_table_get_or_default(%struct.llist_head* %0, i8* %1, i32 %4)
%6 = tail call i32 @atoi(i8* %5)
ret i32 %6
}
long int gcd(long int a, long int b) {
  long int rem, max, min;
  if (a >= b) {
    max = a;
    min = b;
  } else {
    max = b;
    min = a;
  }
  while (min != 0) {
    rem = max % min;
    max = min;
    min = rem;
  }
  return max;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jl     112f <gcd+0x2f>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    113f <gcd+0x3f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    1144 <gcd+0x44>
cmpq   $0x0,-0x28(%rbp)
je     1172 <gcd+0x72>
mov    -0x20(%rbp),%rax
cqto
idivq  -0x28(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    1144 <gcd+0x44>
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %rsi,%rdx
cmp    %rsi,%rdi
mov    %rdi,%rax
cmovl  %rsi,%rax
cmovl  %rdi,%rdx
test   %rdx,%rdx
jne    112d <gcd+0x2d>
ret
nopw   0x0(%rax,%rax,1)
cqto
idiv   %rcx
mov    %rcx,%rax
test   %rdx,%rdx
je     1142 <gcd+0x42>
mov    %rdx,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
jne    1120 <gcd+0x20>
xor    %edx,%edx
div    %ecx
jmp    1125 <gcd+0x25>
mov    %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @gcd(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %1, i64 %0
%5 = select i1 %3, i64 %0, i64 %1
%6 = icmp eq i64 %5, 0
br i1 %6, label %12, label %7
7: ; preds = %2, %7
%8 = phi i64 [ %10, %7 ], [ %5, %2 ]
%9 = phi i64 [ %8, %7 ], [ %4, %2 ]
%10 = srem i64 %9, %8
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %7
12: ; preds = %7, %2
%13 = phi i64 [ %4, %2 ], [ %8, %7 ]
ret i64 %13
}
void blargg_dprintf_(const char *fmt, ...) {}


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

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

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

LLVM IR (-O2):
define void @blargg_dprintf_(i8* nocapture %0, ...) {
ret void
}
void board_enddatawrite(void) {}


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

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

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

LLVM IR (-O2):
define void @board_enddatawrite() {
ret void
}
/* Variables and functions */
long genr_rand_port(long);
int /*<<< orphan*/ init_rand_port(long);
long rand_port(void) {
  extern long rand_num;
  if (rand_num == (-1)) {
    rand_num = 1;
    init_rand_port(rand_num);
  }
  rand_num = genr_rand_port(rand_num);
  return rand_num;
}


x86 assembly (clang, -O0):
<rand_port>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
cmpq   $0xffffffffffffffff,(%rax)
jne    1152 <rand_port+0x32>
mov    0x2eac(%rip),%rax
movq   $0x1,(%rax)
mov    0x2e9e(%rip),%rax
mov    (%rax),%rdi
call   1040 <init_rand_port@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%rdi
call   1030 <genr_rand_port@plt>
mov    %rax,%rcx
mov    0x2e7d(%rip),%rax
mov    %rcx,(%rax)
mov    0x2e73(%rip),%rax
mov    (%rax),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_port>:
push   %rbx
mov    0x2ec0(%rip),%rbx
mov    (%rbx),%rdi
cmp    $0xffffffffffffffff,%rdi
jne    1145 <rand_port+0x25>
movq   $0x1,(%rbx)
mov    $0x1,%edi
call   1040 <init_rand_port@plt>
mov    (%rbx),%rdi
call   1030 <genr_rand_port@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
@rand_num = external global i64
define i64 @rand_port() {
%1 = load i64, i64* @rand_num
%2 = icmp eq i64 %1, -1
br i1 %2, label %3, label %6
3: ; preds = %0
store i64 1, i64* @rand_num
%4 = load i64, i64* @rand_num
%5 = call i32 @init_rand_port(i64 %4)
br label %6
6: ; preds = %3, %0
%7 = load i64, i64* @rand_num
%8 = call i64 @genr_rand_port(i64 %7)
store i64 %8, i64* @rand_num
%9 = load i64, i64* @rand_num
ret i64 %9
}

LLVM IR (-O2):
@rand_num = external global i64
define i64 @rand_port() {
%1 = load i64, i64* @rand_num
%2 = icmp eq i64 %1, -1
br i1 %2, label %3, label %6
3: ; preds = %0
store i64 1, i64* @rand_num
%4 = tail call i32 @init_rand_port(i64 1)
%5 = load i64, i64* @rand_num
br label %6
6: ; preds = %3, %0
%7 = phi i64 [ %5, %3 ], [ %1, %0 ]
%8 = tail call i64 @genr_rand_port(i64 %7)
store i64 %8, i64* @rand_num
ret i64 %8
}
/* Variables and functions */
bool isFloat(float val) {
  int truncated = (int)val;
  return (val == truncated);
}


x86 assembly (clang, -O0):
<isFloat>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
cvttss2si -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
ucomiss %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isFloat>:
cvttps2dq %xmm0,%xmm1
cvtdq2ps %xmm1,%xmm1
cmpeqss %xmm0,%xmm1
movd   %xmm1,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @isFloat(float %0) {
%2 = alloca float
%3 = alloca i32
store float %0, float* %2
%4 = load float, float* %2
%5 = fptosi float %4 to i32
store i32 %5, i32* %3
%6 = load float, float* %2
%7 = load i32, i32* %3
%8 = sitofp i32 %7 to float
%9 = fcmp oeq float %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isFloat(float %0) {
%2 = fptosi float %0 to i32
%3 = sitofp i32 %2 to float
%4 = fcmp oeq float %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
int isSymbol(char c) {
  switch (c) {
  case ' ':
  case '\t':
  case '\n':
  case '(':
  case ')':
  case '[':
  case ']':
  case ':':
  case ';':
  case ',':
  case '.':
  case '=':
  case '$':
  case -1:
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<isSymbol>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0x1,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x5e,%eax
ja     1140 <isSymbol+0x40>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x4(%rbp)
jmp    1147 <isSymbol+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isSymbol>:
add    $0x1,%edi
cmp    $0x5e,%edi
ja     111e <isSymbol+0x1e>
mov    $0x1,%eax
lea    0xeec(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @isSymbol(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %7 [
i32 32, label %6
i32 9, label %6
i32 10, label %6
i32 40, label %6
i32 41, label %6
i32 91, label %6
i32 93, label %6
i32 58, label %6
i32 59, label %6
i32 44, label %6
i32 46, label %6
i32 61, label %6
i32 36, label %6
i32 -1, label %6
]
6: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %8
7: ; preds = %1
store i32 0, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @isSymbol(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %3 [
i32 32, label %4
i32 9, label %4
i32 10, label %4
i32 40, label %4
i32 41, label %4
i32 91, label %4
i32 93, label %4
i32 58, label %4
i32 59, label %4
i32 44, label %4
i32 46, label %4
i32 61, label %4
i32 36, label %4
i32 -1, label %4
]
3: ; preds = %1
br label %4
4: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %3
%5 = phi i32 [ 0, %3 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void _indent(int i_indent) {
  for (int i = 0; i < i_indent; ++i)
    if (i % 3)
      printf(" ");
    else
      printf("|");
}


x86 assembly (clang, -O0):
<_indent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1172 <_indent+0x62>
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1153 <_indent+0x43>
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
jmp    115f <_indent+0x4f>
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
jmp    1164 <_indent+0x54>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <_indent+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_indent>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    115e <_indent+0x4e>
mov    %edi,%r15d
xor    %ebp,%ebp
mov    $0xaaaaaaab,%r14d
xor    %ebx,%ebx
jmp    1141 <_indent+0x31>
nopw   0x0(%rax,%rax,1)
call   1030 <putchar@plt>
add    $0x1,%ebx
add    $0xffffffff,%ebp
add    $0xffffffff,%r15d
je     115e <_indent+0x4e>
mov    %ebx,%eax
imul   %r14,%rax
shr    $0x21,%rax
lea    (%rax,%rax,2),%eax
mov    $0x7c,%edi
add    %ebp,%eax
je     1130 <_indent+0x20>
mov    $0x20,%edi
jmp    1130 <_indent+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @_indent(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %4, label %3
3: ; preds = %4, %1
ret void
4: ; preds = %1, %4
%5 = phi i32 [ %10, %4 ], [ 0, %1 ]
%6 = urem i32 %5, 3
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i32 124, i32 32
%9 = tail call i32 @putchar(i32 %8)
%10 = add nuw nsw i32 %5, 1
%11 = icmp eq i32 %10, %0
br i1 %11, label %3, label %4
}
/* Variables and functions */
int /*<<< orphan*/ function1();
int /*<<< orphan*/ function2();
void main() {
  while (1) {
    function1();
    function2();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <main+0x9>
mov    $0x0,%al
call   1030 <function1@plt>
mov    $0x0,%al
call   1040 <function2@plt>
jmp    1129 <main+0x9>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <function1@plt>
xor    %eax,%eax
call   1040 <function2@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
define void @main() {
br label %1
1: ; preds = %0, %1
%2 = call i32 (...) @function1()
%3 = call i32 (...) @function2()
br label %1
}

LLVM IR (-O2):
define void @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 (...) @function1()
%3 = tail call i32 (...) @function2()
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ NEDPositionHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void NEDPositionUpdated() { UAVObjUpdated(NEDPositionHandle()); }


x86 assembly (clang, -O0):
<NEDPositionUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <NEDPositionHandle@plt>
mov    %eax,%edi
call   1030 <UAVObjUpdated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<NEDPositionUpdated>:
push   %rax
xor    %eax,%eax
call   1040 <NEDPositionHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <UAVObjUpdated@plt>

LLVM IR (-O0):
define void @NEDPositionUpdated() {
%1 = call i32 (...) @NEDPositionHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @NEDPositionUpdated() {
%1 = tail call i32 (...) @NEDPositionHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ func1(void *);
void *make_invalid_ptr();
int main(void) {
  void *invalid_ptr;
  invalid_ptr = make_invalid_ptr();
  func1(invalid_ptr);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <make_invalid_ptr@plt>
mov    %rax,%rdi
call   1040 <func1@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i8* (...) @make_invalid_ptr()
%2 = tail call i32 @func1(i8* %1)
ret i32 0
}