xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ is_space(char);
char *skip_space(char *p) {
  while (*p && is_space(*p))
    ++p;
  return p;
}


x86 assembly (clang, -O0):
<skip_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1147 <skip_space+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <is_space@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1157 <skip_space+0x47>
jmp    1168 <skip_space+0x58>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <skip_space+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_space>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1139 <skip_space+0x29>
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <is_space@plt>
test   %rax,%rax
je     1139 <skip_space+0x29>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <skip_space+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @skip_space(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %15, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = call i64 @is_space(i8 signext %10)
%12 = icmp ne i64 %11, 0
br label %13
13: ; preds = %8, %3
%14 = phi i1 [ false, %3 ], [ %12, %8 ]
br i1 %14, label %15, label %18
15: ; preds = %13
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %2
br label %3
18: ; preds = %13
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
define i8* @skip_space(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %9
%5 = phi i8 [ %11, %9 ], [ %2, %1 ]
%6 = phi i8* [ %10, %9 ], [ %0, %1 ]
%7 = tail call i64 @is_space(i8 signext %5)
%8 = icmp eq i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %9, %1
%14 = phi i8* [ %0, %1 ], [ %10, %9 ], [ %6, %4 ]
ret i8* %14
}
double blzrand() { return 0x1p-64 * ((double)blzrand64()); }


x86 assembly (clang, -O0):
<blzrand>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <blzrand64@plt>
cvtsi2sd %eax,%xmm1
movsd  0xed9(%rip),%xmm0
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<blzrand>:
push   %rax
xor    %eax,%eax
call   1030 <blzrand64@plt>
cvtsi2sd %eax,%xmm0
mulsd  0xedc(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @blzrand() {
%1 = call i32 (...) @blzrand64()
%2 = sitofp i32 %1 to double
%3 = fmul double 0x3BF0000000000000, %2
ret double %3
}

LLVM IR (-O2):
define double @blzrand() {
%1 = tail call i32 (...) @blzrand64()
%2 = sitofp i32 %1 to double
%3 = fmul double %2, 0x3BF0000000000000
ret double %3
}
void handle_44(int sig) {}


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

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

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

LLVM IR (-O2):
define void @handle_44(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar();
int __attribute__((no, noclone)) foo(int z, int x, int b) {
  if (x == 1) {
    bar();
    return z;
  } else {
    int a = (x + z) + b;
    return a;
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    113d <foo+0x2d>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114f <foo+0x3f>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
mov    %edi,%ebx
cmp    $0x1,%esi
jne    1121 <foo+0x11>
xor    %eax,%eax
call   1030 <bar@plt>
jmp    1127 <foo+0x17>
add    %ebx,%esi
add    %edx,%esi
mov    %esi,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, 1
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 (...) @bar()
br label %10
7: ; preds = %3
%8 = add nsw i32 %1, %0
%9 = add nsw i32 %8, %2
br label %10
10: ; preds = %7, %5
%11 = phi i32 [ %0, %5 ], [ %9, %7 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("nullderef\n");
  char *ptr = 0;
  ptr[0] = 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [10 x i8] c"nullderef\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
unreachable
}
int foo2(int *arr, int len) {
  int i = 0;
  int sum = 0;
  while (i < len) {
    if (i <= 100)
      continue;
    sum += arr[i];
    i++;
  }
  return sum;
}


x86 assembly (clang, -O0):
<foo2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1153 <foo2+0x53>
cmpl   $0x64,-0x10(%rbp)
jg     1134 <foo2+0x34>
jmp    1119 <foo2+0x19>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1119 <foo2+0x19>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo2>:
test   %esi,%esi
jle    1112 <foo2+0x12>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
jmp    1110 <foo2+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @foo2(i32* nocapture readnone %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %5
4: ; preds = %2, %4
br label %4
5: ; preds = %2
ret i32 0
}
/* Variables and functions */
int toggle_setting(char *);
int toggle_mptcp() {
  return toggle_setting("/proc/sys/net/mptcp/mptcp_enabled");
}


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"/proc/sys/net/mptcp/mptcp_enabled\00"
define i32 @toggle_mptcp() {
%1 = call i32 @toggle_setting(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [34 x i8] c"/proc/sys/net/mptcp/mptcp_enabled\00"
define i32 @toggle_mptcp() {
%1 = tail call i32 @toggle_setting(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Type definitions */
struct semaphore {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ sema_init(struct semaphore *, int);
__attribute__((always_)) void init_MUTEX(struct semaphore *sem) {
  sema_init(sem, 1);
}


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

x86 assembly (clang, -O2):
<init_MUTEX>:
mov    $0x1,%esi
jmp    1030 <sema_init@plt>

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

LLVM IR (-O2):
%struct.semaphore = type { i32 }
define void @init_MUTEX(%struct.semaphore* %0) {
%2 = tail call i32 @sema_init(%struct.semaphore* %0, i32 1)
ret void
}
/* Variables and functions */
double atof(char const *);
double safe_atod(const char *name, const char *expr) {
  double f = atof(expr);
  return f;
}


x86 assembly (clang, -O0):
<safe_atod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_atod>:
mov    %rsi,%rdi
jmp    1030 <atof@plt>

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

LLVM IR (-O2):
define double @safe_atod(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = tail call double @atof(i8* %1)
ret double %3
}
void mpi_set_arrays_multidimen(void) {}


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

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

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

LLVM IR (-O2):
define void @mpi_set_arrays_multidimen() {
ret void
}
/* Variables and functions */
int Add(int, int);
int /*<<< orphan*/ printf(char *, int);
void ExportB() { printf("ExportB: 3 + 9 = %d\n", Add(3, 9)); }


x86 assembly (clang, -O0):
<ExportB>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
mov    $0x9,%esi
call   1040 <Add@plt>
mov    %eax,%esi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ExportB>:
push   %rax
mov    $0x3,%edi
mov    $0x9,%esi
call   1040 <Add@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"ExportB: 3 + 9 = %d\0A\00"
define void @ExportB() {
%1 = call i32 @Add(i32 3, i32 9)
%2 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"ExportB: 3 + 9 = %d\0A\00"
define void @ExportB() {
%1 = tail call i32 @Add(i32 3, i32 9)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
scalar_t__ strcmp(int /*<<< orphan*/, char *);
int /*<<< orphan*/ syserr();
int wasintr(void) { return strcmp(syserr(), "interrupted") == 0; }


x86 assembly (clang, -O0):
<wasintr>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <syserr@plt>
mov    %eax,%edi
lea    0xecc(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wasintr>:
push   %rax
xor    %eax,%eax
call   1030 <syserr@plt>
lea    0xed1(%rip),%rsi
mov    %eax,%edi
call   1040 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"interrupted\00"
define i32 @wasintr() {
%1 = call i32 (...) @syserr()
%2 = call i64 @strcmp(i32 %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
@.str = [12 x i8] c"interrupted\00"
define i32 @wasintr() {
%1 = tail call i32 (...) @syserr()
%2 = tail call i64 @strcmp(i32 %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int main(void) {
  fprintf(stderr, "TM_ZONE is not defined in <time.h> !!\n");
  return 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
lea    0xed1(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [39 x i8] c"TM_ZONE is not defined in <time.h> !!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stderr
%3 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [39 x i8] c"TM_ZONE is not defined in <time.h> !!\0A\00"
define i32 @main() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
long long llabs(long long);
int llong_chars(long long numb) {
  int i;
  long long ll;
  ll = llabs(numb);
  i = 1;
  while (ll > 9) {
    i++;
    ll /= 10;
  }
  return i;
}


x86 assembly (clang, -O0):
<llong_chars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <llabs@plt>
mov    %rax,-0x18(%rbp)
movl   $0x1,-0xc(%rbp)
cmpq   $0x9,-0x18(%rbp)
jle    115b <llong_chars+0x4b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rax,-0x18(%rbp)
jmp    1130 <llong_chars+0x20>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<llong_chars>:
mov    %rdi,%rcx
neg    %rcx
cmovs  %rdi,%rcx
mov    $0x1,%esi
cmp    $0xa,%rcx
jb     1146 <llong_chars+0x46>
mov    $0x1,%esi
movabs $0xcccccccccccccccd,%rdi
cc cc cc
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%esi
mov    %rcx,%rax
mul    %rdi
shr    $0x3,%rdx
cmp    $0x63,%rcx
mov    %rdx,%rcx
ja     1130 <llong_chars+0x30>
mov    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @llong_chars(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
%3 = icmp ugt i64 %2, 9
br i1 %3, label %4, label %10
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ %2, %1 ]
%6 = phi i32 [ %7, %4 ], [ 1, %1 ]
%7 = add nuw nsw i32 %6, 1
%8 = udiv i64 %5, 10
%9 = icmp ugt i64 %5, 99
br i1 %9, label %4, label %10
10: ; preds = %4, %1
%11 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %11
}
void vflash_log() {}


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

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

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

LLVM IR (-O2):
define void @vflash_log() {
ret void
}
char *parse_execv_file(char *filename) {
  if (filename[0] == '/') {
    return filename + 8;
  } else
    return filename;
}


x86 assembly (clang, -O0):
<parse_execv_file>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1129 <parse_execv_file+0x29>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
jmp    1131 <parse_execv_file+0x31>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_execv_file>:
xor    %eax,%eax
cmpb   $0x2f,(%rdi)
sete   %al
lea    (%rdi,%rax,8),%rax
ret

LLVM IR (-O0):
define i8* @parse_execv_file(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 47
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 8
store i8* %11, i8** %2
br label %14
12: ; preds = %1
%13 = load i8*, i8** %3
store i8* %13, i8** %2
br label %14
14: ; preds = %12, %9
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
define i8* @parse_execv_file(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 47
%4 = select i1 %3, i64 8, i64 0
%5 = getelementptr i8, i8* %0, i64 %4
ret i8* %5
}
int test_imm_B5int64_lowword_mem(long long *val) {
  return ((*val) & (0xB5 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_B5int64_lowword_mem>:
testb  $0xb5,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_B5int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 181
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ bgnline();
void bgnlin_() { bgnline(); }


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

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

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

LLVM IR (-O2):
define void @bgnlin_() {
%1 = tail call i32 (...) @bgnline()
ret void
}
int Decodeaddress(unsigned int addr, char *symb, int nsymb, char *comment) {
  return 0;
}


x86 assembly (clang, -O0):
<Decodeaddress>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @Decodeaddress(i32 %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
ret i32 0
}

LLVM IR (-O2):
define i32 @Decodeaddress(i32 %0, i8* nocapture readnone %1, i32 %2, i8* nocapture readnone %3) {
ret i32 0
}
int _falmbGenericDrawString() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @_falmbGenericDrawString() {
ret i32 0
}
long double ref_map(long dim_in, long dim_out, long pos) {
  return (pos + 0.5l) * (long double)dim_in / dim_out - 0.5l;
}


x86 assembly (clang, -O0):
<ref_map>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
fildll -0x20(%rbp)
flds   0xedf(%rip)
fadd   %st,%st(1)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
fildll -0x28(%rbp)
fmulp  %st,%st(2)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
fildll -0x30(%rbp)
fdivrp %st,%st(2)
fsubrp %st,%st(1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ref_map>:
mov    %rdx,-0x8(%rsp)
fildll -0x8(%rsp)
fadds  0xef1(%rip)
mov    %rdi,-0x18(%rsp)
fildll -0x18(%rsp)
fmulp  %st,%st(1)
mov    %rsi,-0x10(%rsp)
fildll -0x10(%rsp)
fdivrp %st,%st(1)
fadds  0xed9(%rip)
ret

LLVM IR (-O0):
define x86_fp80 @ref_map(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to x86_fp80
%9 = fadd x86_fp80 %8, 0xK3FFE8000000000000000
%10 = load i64, i64* %4
%11 = sitofp i64 %10 to x86_fp80
%12 = fmul x86_fp80 %9, %11
%13 = load i64, i64* %5
%14 = sitofp i64 %13 to x86_fp80
%15 = fdiv x86_fp80 %12, %14
%16 = fsub x86_fp80 %15, 0xK3FFE8000000000000000
ret x86_fp80 %16
}

LLVM IR (-O2):
define x86_fp80 @ref_map(i64 %0, i64 %1, i64 %2) {
%4 = sitofp i64 %2 to x86_fp80
%5 = fadd x86_fp80 %4, 0xK3FFE8000000000000000
%6 = sitofp i64 %0 to x86_fp80
%7 = fmul x86_fp80 %5, %6
%8 = sitofp i64 %1 to x86_fp80
%9 = fdiv x86_fp80 %7, %8
%10 = fadd x86_fp80 %9, 0xKBFFE8000000000000000
ret x86_fp80 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint64_t;

/* Variables and functions */
scalar_t__ get32_be(int /*<<< orphan*/ *);
uint64_t get64_be(void *p) {
  return (uint64_t)get32_be((uint8_t *)p) << 32 |
         (uint64_t)get32_be((uint8_t *)p + 4);
}


x86 assembly (clang, -O0):
<get64_be>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <get32_be@plt>
mov    $0x20,%ecx
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x10,%rdi
call   1030 <get32_be@plt>
mov    %rax,%rcx
mov    -0xc(%rbp),%eax
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get64_be>:
push   %rbx
mov    %rdi,%rbx
call   1030 <get32_be@plt>
add    $0x10,%rbx
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <get32_be@plt>

LLVM IR (-O0):
define i32 @get64_be(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = call i64 @get32_be(i32* %4)
%6 = trunc i64 %5 to i32
%7 = shl i32 %6, 32
%8 = load i8*, i8** %2
%9 = bitcast i8* %8 to i32*
%10 = getelementptr inbounds i32, i32* %9, i64 4
%11 = call i64 @get32_be(i32* %10)
%12 = trunc i64 %11 to i32
%13 = or i32 %7, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @get64_be(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i64 @get32_be(i32* %2)
%4 = getelementptr inbounds i8, i8* %0, i64 16
%5 = bitcast i8* %4 to i32*
%6 = tail call i64 @get32_be(i32* %5)
ret i32 poison
}
/* Variables and functions */
unsigned char *memset(unsigned char *dest, unsigned char val, int count) {
  char *cdest = (char *)dest;
  while (*cdest && count > 0) {
    *cdest = val;
    cdest++;
    count--;
  }
  return dest;
}


x86 assembly (clang, -O0):
<memset>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x19(%rbp)
je     1138 <memset+0x38>
cmpl   $0x0,-0x10(%rbp)
setg   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1148 <memset+0x48>
jmp    116b <memset+0x6b>
mov    -0x9(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1119 <memset+0x19>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memset>:
mov    %rdi,%rax
cmpb   $0x0,(%rdi)
je     1127 <memset+0x27>
test   %edx,%edx
jle    1127 <memset+0x27>
lea    0x1(%rax),%rcx
mov    %sil,-0x1(%rcx)
cmpb   $0x0,(%rcx)
je     1127 <memset+0x27>
lea    -0x1(%rdx),%edi
add    $0x1,%rcx
cmp    $0x1,%edx
mov    %edi,%edx
ja     1110 <memset+0x10>
ret

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

LLVM IR (-O2):
define i8* @memset(i8* returned %0, i8 zeroext %1, i32 %2) {
%4 = load i8, i8* %0
%5 = icmp ne i8 %4, 0
%6 = icmp sgt i32 %2, 0
%7 = and i1 %5, %6
br i1 %7, label %8, label %17
8: ; preds = %3, %8
%9 = phi i8* [ %11, %8 ], [ %0, %3 ]
%10 = phi i32 [ %12, %8 ], [ %2, %3 ]
store i8 %1, i8* %9
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = add nsw i32 %10, -1
%13 = load i8, i8* %11
%14 = icmp ne i8 %13, 0
%15 = icmp ugt i32 %10, 1
%16 = select i1 %14, i1 %15, i1 false
br i1 %16, label %8, label %17
17: ; preds = %8, %3
ret i8* %0
}
void gtk_tree_view_get_visible_rect() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_view_get_visible_rect() {
ret void
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int getpgid(int);
int getpid();
int getppid();
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  pid_t pid, ppid, pgid;
  pid = getpid();
  ppid = getppid();
  pgid = getpgid(pid);
  printf("pid=%d\nppid=%d\npgid=%d\n", pid, ppid, pgid);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1060 <getppid@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <getpgid@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xe82(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1060 <getppid@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1050 <getpgid@plt>
lea    0xe9d(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %eax,%ecx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [24 x i8] c"pid=%d\0Appid=%d\0Apgid=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (...) @getpid()
store i32 %5, i32* %2
%6 = call i32 (...) @getppid()
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = call i32 @getpgid(i32 %7)
store i32 %8, i32* %4
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10, i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"pid=%d\0Appid=%d\0Apgid=%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 (...) @getppid()
%3 = tail call i32 @getpgid(i32 %1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2, i32 %3)
ret i32 0
}
char hex(int i) {
  static char hexdigits[] = "0123456789ABCDEF";
  return hexdigits[i % 16];
}


x86 assembly (clang, -O0):
<hex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
movslq %edx,%rcx
lea    0x2f14(%rip),%rax
movsbl (%rax,%rcx,1),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex>:
lea    0xf(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
and    $0xfffffff0,%eax
sub    %eax,%edi
movslq %edi,%rax
lea    0xee9(%rip),%rcx
mov    (%rax,%rcx,1),%al
ret

LLVM IR (-O0):
@hex.hexdigits = internal global [17 x i8] c"0123456789ABCDEF\00"
define signext i8 @hex(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 16
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds [17 x i8], [17 x i8]* @hex.hexdigits, i64 0, i64 %5
%7 = load i8, i8* %6
ret i8 %7
}

LLVM IR (-O2):
@hex.hexdigits = internal unnamed_addr constant [17 x i8] c"0123456789ABCDEF\00"
define signext i8 @hex(i32 %0) {
%2 = srem i32 %0, 16
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds [17 x i8], [17 x i8]* @hex.hexdigits, i64 0, i64 %3
%5 = load i8, i8* %4
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ func_4(int, char *, unsigned long);
void func_3(int a, char *b, unsigned long c) { func_4(a, b, c); }


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

x86 assembly (clang, -O2):
<func_3>:
jmp    1030 <func_4@plt>

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

LLVM IR (-O2):
define void @func_3(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @func_4(i32 %0, i8* %1, i64 %2)
ret void
}
void scsi_hd_log(const char *fmt, ...) {}


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

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

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

LLVM IR (-O2):
define void @scsi_hd_log(i8* nocapture %0, ...) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t load32(uint8_t *p) { return ((*((uint32_t *)p))); }


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

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

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

LLVM IR (-O2):
define i32 @load32(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
/* Variables and functions */
int pow(double, double);
double f4_x6_2_prime(double x) { return 6 * pow(x, 5.0); }


x86 assembly (clang, -O0):
<f4_x6_2_prime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
call   1030 <pow@plt>
imul   $0x6,%eax,%eax
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_x6_2_prime>:
push   %rax
movsd  0xee7(%rip),%xmm1
call   1030 <pow@plt>
add    %eax,%eax
lea    (%rax,%rax,2),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @f4_x6_2_prime(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @pow(double %3, double 5.000000e+00)
%5 = mul nsw i32 6, %4
%6 = sitofp i32 %5 to double
ret double %6
}

LLVM IR (-O2):
define double @f4_x6_2_prime(double %0) {
%2 = tail call i32 @pow(double %0, double 5.000000e+00)
%3 = mul nsw i32 %2, 6
%4 = sitofp i32 %3 to double
ret double %4
}
XAutoRepeatOn() {}


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

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

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

LLVM IR (-O2):
define i32 @XAutoRepeatOn() {
ret i32 undef
}
/* Variables and functions */
int exp(float);
float gumbel(float x, float mu, float b) {
  float z, u;
  z = (x - mu) / b;
  u = z + exp(-z);
  return (1 / b) * exp(-u);
}


x86 assembly (clang, -O0):
<gumbel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
divss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x10(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
call   1030 <exp@plt>
movss  -0x1c(%rbp),%xmm0
cvtsi2ss %eax,%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xe8a(%rip),%xmm0
divss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
call   1030 <exp@plt>
movss  -0x18(%rbp),%xmm0
cvtsi2ss %eax,%xmm1
mulss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gumbel>:
sub    $0x28,%rsp
movss  %xmm2,0xc(%rsp)
subss  %xmm1,%xmm0
divss  %xmm2,%xmm0
movaps %xmm0,0x10(%rsp)
xorps  0xed2(%rip),%xmm0
call   1030 <exp@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
addss  0x10(%rsp),%xmm0
movss  0xec8(%rip),%xmm1
divss  0xc(%rsp),%xmm1
movss  %xmm1,0xc(%rsp)
xorps  0xea5(%rip),%xmm0
call   1030 <exp@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
mulss  0xc(%rsp),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define float @gumbel(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%9 = load float, float* %4
%10 = load float, float* %5
%11 = fsub float %9, %10
%12 = load float, float* %6
%13 = fdiv float %11, %12
store float %13, float* %7
%14 = load float, float* %7
%15 = load float, float* %7
%16 = fneg float %15
%17 = call i32 @exp(float %16)
%18 = sitofp i32 %17 to float
%19 = fadd float %14, %18
store float %19, float* %8
%20 = load float, float* %6
%21 = fdiv float 1.000000e+00, %20
%22 = load float, float* %8
%23 = fneg float %22
%24 = call i32 @exp(float %23)
%25 = sitofp i32 %24 to float
%26 = fmul float %21, %25
ret float %26
}

LLVM IR (-O2):
define float @gumbel(float %0, float %1, float %2) {
%4 = fsub float %0, %1
%5 = fdiv float %4, %2
%6 = fneg float %5
%7 = tail call i32 @exp(float %6)
%8 = sitofp i32 %7 to float
%9 = fadd float %5, %8
%10 = fdiv float 1.000000e+00, %2
%11 = fneg float %9
%12 = tail call i32 @exp(float %11)
%13 = sitofp i32 %12 to float
%14 = fmul float %10, %13
ret float %14
}
/* Variables and functions */
int /*<<< orphan*/ syscall1(int, int);
void sleep(int ticks) { syscall1(0x2000, ticks); }


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

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

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

LLVM IR (-O2):
define void @sleep(i32 %0) {
%2 = tail call i32 @syscall1(i32 8192, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ col_on_comm(int *, int *, void *, int *, void *, int *,
                               int /*<<< orphan*/);
void collect_on_comm0_(int *comm, int *typesize, void *inbuf, int *ninbuf,
                       void *outbuf, int *noutbuf) {
  col_on_comm(comm, typesize, inbuf, ninbuf, outbuf, noutbuf, 0);
}


x86 assembly (clang, -O0):
<collect_on_comm0_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
xor    %eax,%eax
movl   $0x0,(%rsp)
call   1030 <col_on_comm@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<collect_on_comm0_>:
push   %rax
movl   $0x0,(%rsp)
call   1030 <col_on_comm@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @collect_on_comm0_(i32* %0, i32* %1, i8* %2, i32* %3, i8* %4, i32* %5) {
%7 = tail call i32 @col_on_comm(i32* %0, i32* %1, i8* %2, i32* %3, i8* %4, i32* %5, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cprintf(char *, unsigned int const);
void ns_swi(const unsigned int nIRQ) { cprintf("normal world SWI %d\n", nIRQ); }


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

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

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

LLVM IR (-O2):
@.str = [21 x i8] c"normal world SWI %d\0A\00"
define void @ns_swi(i32 %0) {
%2 = tail call i32 @cprintf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
void wake_up_process(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<wake_up_process>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wake_up_process>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.wake_up_process = [16 x i8] c"wake_up_process\00"
define void @wake_up_process() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__func__.wake_up_process, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.wake_up_process = [16 x i8] c"wake_up_process\00"
define void @wake_up_process() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__func__.wake_up_process, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long);
void kb_wait_3(void) {
  unsigned long timeout = 2;
  do {
    (1 ? printf("timeout=%ld\n", timeout) : ({
      int i = 1;
      goto label;
      i = i + 2;
    label:
      i = i + 3;
    }));
    timeout--;
  } while (timeout);
}


x86 assembly (clang, -O0):
<kb_wait_3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x2,-0x8(%rbp)
mov    $0x1,%al
test   $0x1,%al
jne    112f <kb_wait_3+0x1f>
jmp    1144 <kb_wait_3+0x34>
mov    -0x8(%rbp),%rsi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
jmp    115a <kb_wait_3+0x4a>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0xc(%rbp)
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1120 <kb_wait_3+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kb_wait_3>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    $0x2,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    $0x1,%esi
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [13 x i8] c"timeout=%ld\0A\00"
define void @kb_wait_3() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i64 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i64 1)
ret void
}
/* Type definitions */
typedef size_t uint32_t;

/* Variables and functions */
int /*<<< orphan*/ assert(size_t *);
void Swap(uint32_t *array, uint32_t i, uint32_t j) {
  assert(array);
  uint32_t tmp = 0;
  tmp = array[j];
  array[j] = array[i];
  array[i] = tmp;
}


x86 assembly (clang, -O0):
<Swap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <assert@plt>
movq   $0x0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x20(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Swap>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <assert@plt>
mov    (%rbx,%r15,8),%rax
mov    (%rbx,%r14,8),%rcx
mov    %rcx,(%rbx,%r15,8)
mov    %rax,(%rbx,%r14,8)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @Swap(i64* %0, i64 %1, i64 %2) {
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i64* %0, i64** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = load i64*, i64** %4
%9 = call i32 @assert(i64* %8)
store i64 0, i64* %7
%10 = load i64*, i64** %4
%11 = load i64, i64* %6
%12 = getelementptr inbounds i64, i64* %10, i64 %11
%13 = load i64, i64* %12
store i64 %13, i64* %7
%14 = load i64*, i64** %4
%15 = load i64, i64* %5
%16 = getelementptr inbounds i64, i64* %14, i64 %15
%17 = load i64, i64* %16
%18 = load i64*, i64** %4
%19 = load i64, i64* %6
%20 = getelementptr inbounds i64, i64* %18, i64 %19
store i64 %17, i64* %20
%21 = load i64, i64* %7
%22 = load i64*, i64** %4
%23 = load i64, i64* %5
%24 = getelementptr inbounds i64, i64* %22, i64 %23
store i64 %21, i64* %24
ret void
}

LLVM IR (-O2):
define void @Swap(i64* %0, i64 %1, i64 %2) {
%4 = tail call i32 @assert(i64* %0)
%5 = getelementptr inbounds i64, i64* %0, i64 %2
%6 = load i64, i64* %5
%7 = getelementptr inbounds i64, i64* %0, i64 %1
%8 = load i64, i64* %7
store i64 %8, i64* %5
store i64 %6, i64* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage() {
  printf("Usage: memwatch [arguments]\n");
  printf("\t-l\t\tList every proc registered\n");
  printf("\t-ld <proc name>\t\tList detailed info of proc\n");
  printf("\tv 1.0\n");
}


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

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0c(%rip),%rdi
call   1030 <puts@plt>
lea    0xf2d(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"Usage: memwatch [arguments]\0A\00"
@.str.1 = [33 x i8] c"\09-l\09\09List every proc registered\0A\00"
@.str.2 = [46 x i8] c"\09-ld <proc name>\09\09List detailed info of proc\0A\00"
@.str.3 = [8 x i8] c"\09v 1.0\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [28 x i8] c"Usage: memwatch [arguments]\00"
@str.4 = [32 x i8] c"\09-l\09\09List every proc registered\00"
@str.5 = [45 x i8] c"\09-ld <proc name>\09\09List detailed info of proc\00"
@str.6 = [7 x i8] c"\09v 1.0\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.6, i64 0, i64 0))
ret void
}
unsigned char h(unsigned char x) { return x + 1; }


x86 assembly (clang, -O0):
<h>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x1,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<h>:
lea    0x1(%rdi),%eax
ret

LLVM IR (-O0):
define zeroext i8 @h(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = add nsw i32 %4, 1
%6 = trunc i32 %5 to i8
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @h(i8 zeroext %0) {
%2 = add i8 %0, 1
ret i8 %2
}
/* Variables and functions */
int printf(char *);
int main(void) { return printf("Hello World"); }


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

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"Hello World\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}