xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_CUR;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
int getc(int /*<<< orphan*/ *);
void skipC(FILE *f, char c) {
  while (getc(f) == (int)c)
    ;
  fseek(f, -1, SEEK_CUR);
}


x86 assembly (clang, -O0):
<skipC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <getc@plt>
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    114c <skipC+0x2c>
jmp    1132 <skipC+0x12>
mov    -0x8(%rbp),%rdi
mov    0x2e91(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%esi
call   1030 <fseek@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipC>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1040 <getc@plt>
cmp    %ebp,%eax
je     1130 <skipC+0x10>
mov    0x2ea5(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    $0xffffffff,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fseek@plt>

LLVM IR (-O0):
@SEEK_CUR = global i32 0
define void @skipC(i32* %0, i8 signext %1) {
%3 = alloca i32*
%4 = alloca i8
store i32* %0, i32** %3
store i8 %1, i8* %4
br label %5
5: ; preds = %11, %2
%6 = load i32*, i32** %3
%7 = call i32 @getc(i32* %6)
%8 = load i8, i8* %4
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %7, %9
br i1 %10, label %11, label %12
11: ; preds = %5
br label %5
12: ; preds = %5
%13 = load i32*, i32** %3
%14 = load i32, i32* @SEEK_CUR
%15 = call i32 @fseek(i32* %13, i32 -1, i32 %14)
ret void
}

LLVM IR (-O2):
@SEEK_CUR = global i32 0
define void @skipC(i32* nocapture %0, i8 signext %1) {
%3 = sext i8 %1 to i32
br label %4
4: ; preds = %4, %2
%5 = tail call i32 @getc(i32* %0)
%6 = icmp eq i32 %5, %3
br i1 %6, label %4, label %7
7: ; preds = %4
%8 = load i32, i32* @SEEK_CUR
%9 = tail call i32 @fseek(i32* %0, i32 -1, i32 %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putnum(int /*<<< orphan*/);
int /*<<< orphan*/ solution();
int main() { putnum(solution()); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @solution()
%2 = call i32 @putnum(i32 %1)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @solution()
%2 = tail call i32 @putnum(i32 %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_cond_t;

/* Variables and functions */
int pthread_cond_broadcast(int /*<<< orphan*/ *);
int pthread_cond_signal(pthread_cond_t *cond) {
  ;
  return pthread_cond_broadcast(cond);
}


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

x86 assembly (clang, -O2):
<pthread_cond_signal>:
jmp    1030 <pthread_cond_broadcast@plt>

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

LLVM IR (-O2):
define i32 @pthread_cond_signal(i32* %0) {
%2 = tail call i32 @pthread_cond_broadcast(i32* %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
uint16_t load16(uint8_t *b) {
  uint16_t x;
  memcpy(&x, b, 2);
  return x;
}


x86 assembly (clang, -O0):
<load16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x2,%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<load16>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x2,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @load16(i32* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @memcpy(i32* %2, i32* %0, i32 2)
%5 = load i32, i32* %2
ret i32 %5
}
void aFunction() {}


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

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

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

LLVM IR (-O2):
define void @aFunction() {
ret void
}
int isadigit(int x) {
  if (x >= '0' && x <= '9') {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<isadigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x30,-0x8(%rbp)
jl     1127 <isadigit+0x27>
cmpl   $0x39,-0x8(%rbp)
jg     1127 <isadigit+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <isadigit+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isadigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isadigit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 57
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %11
10: ; preds = %6, %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @isadigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
int check_prime(int num) {
  int i;
  for (i = 2; i < num; i++) {
    if (num % i != 0)
      continue;
    else
      return 0;
  }
  return num;
}


x86 assembly (clang, -O0):
<check_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1149 <check_prime+0x49>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
je     112f <check_prime+0x2f>
jmp    113b <check_prime+0x3b>
movl   $0x0,-0x4(%rbp)
jmp    114f <check_prime+0x4f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <check_prime+0xe>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_prime>:
cmp    $0x3,%edi
jl     1120 <check_prime+0x20>
mov    $0x2,%ecx
nopw   0x0(%rax,%rax,1)
mov    %edi,%eax
cltd
idiv   %ecx
test   %edx,%edx
je     1123 <check_prime+0x23>
add    $0x1,%ecx
cmp    %ecx,%edi
jne    1110 <check_prime+0x10>
mov    %edi,%eax
ret
xor    %edi,%edi
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @check_prime(i32 %0) {
%2 = icmp sgt i32 %0, 2
br i1 %2, label %5, label %10
3: ; preds = %5
%4 = icmp eq i32 %9, %0
br i1 %4, label %10, label %5
5: ; preds = %1, %3
%6 = phi i32 [ %9, %3 ], [ 2, %1 ]
%7 = srem i32 %0, %6
%8 = icmp eq i32 %7, 0
%9 = add nuw nsw i32 %6, 1
br i1 %8, label %10, label %3
10: ; preds = %5, %3, %1
%11 = phi i32 [ %0, %1 ], [ %0, %3 ], [ 0, %5 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ __coverity_panic__();
void _assertFail(const char *filename, unsigned int linenum) {
  __coverity_panic__();
}


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

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

LLVM IR (-O0):
define void @_assertFail(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 (...) @__coverity_panic__()
ret void
}

LLVM IR (-O2):
define void @_assertFail(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 (...) @__coverity_panic__()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ol(char *);
m_or() { ol("OR   AX,BX"); }


x86 assembly (clang, -O0):
<m_or>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <ol@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [11 x i8] c"OR AX,BX\00"
define i32 @m_or() {
%1 = alloca i32
%2 = call i32 @ol(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [11 x i8] c"OR AX,BX\00"
define i32 @m_or() {
%1 = tail call i32 @ol(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int execveat_(int fd, const char *path, char **argv, char **envp, int flags) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<execveat_>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    0x2eca(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb1(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<execveat_>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @execveat_(i32 %0, i8* %1, i8** %2, i8** %3, i32 %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8**
%9 = alloca i8**
%10 = alloca i32
store i32 %0, i32* %6
store i8* %1, i8** %7
store i8** %2, i8*** %8
store i8** %3, i8*** %9
store i32 %4, i32* %10
%11 = load i32, i32* @ENOSYS
store i32 %11, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @execveat_(i32 %0, i8* nocapture readnone %1, i8** nocapture readnone %2, i8** nocapture readnone %3, i32 %4) {
%6 = load i32, i32* @ENOSYS
store i32 %6, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int);
int /*<<< orphan*/ stderr;
void check_d(char *func_name, int d) {
  if ((d < 1) || (d > 3)) {
    fprintf(stderr, "%s:  d out of range 1-3 (got %d).\n", func_name, d);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<check_d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jl     1143 <check_d+0x23>
cmpl   $0x3,-0xc(%rbp)
jle    1169 <check_d+0x49>
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
lea    0xea6(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_d>:
mov    %esi,%ecx
lea    -0x4(%rcx),%eax
cmp    $0xfffffffc,%eax
jbe    112b <check_d+0xb>
ret
push   %rax
mov    %rdi,%rdx
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
lea    0xec1(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"%s: d out of range 1-3 (got %d).\0A\00"
define void @check_d(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp slt i32 %5, 1
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp sgt i32 %8, 3
br i1 %9, label %10, label %16
10: ; preds = %7, %2
%11 = load i32, i32* @stderr
%12 = load i8*, i8** %3
%13 = load i32, i32* %4
%14 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %12, i32 %13)
%15 = call i32 @exit(i32 1)
unreachable
16: ; preds = %7
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"%s: d out of range 1-3 (got %d).\0A\00"
define void @check_d(i8* %0, i32 %1) {
%3 = add i32 %1, -4
%4 = icmp ult i32 %3, -3
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ putchar(char);
void show(int *nums, int n) {
  int i;
  for (i = 0; i < n; i++) {
    printf("%d ", nums[i]);
  }
  putchar('\n');
}


x86 assembly (clang, -O0):
<show>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1167 <show+0x47>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <show+0x16>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1155 <show+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xec5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <show+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @show(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i8 signext 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ merge(int *, int, int, int);
void mergesort(int a[], int low, int high) {
  int mid;
  if (low < high) {
    mid = (low + high) / 2;
    mergesort(a, low, mid);
    mergesort(a, mid + 1, high);
    merge(a, low, mid, high);
  }
}


x86 assembly (clang, -O0):
<mergesort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1182 <mergesort+0x62>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1040 <mergesort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <mergesort@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1030 <merge@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mergesort>:
cmp    %edx,%esi
jge    1172 <mergesort+0x52>
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%r12d
mov    %rdi,%r15
lea    (%r14,%r12,1),%eax
mov    %eax,%ebx
shr    $0x1f,%ebx
add    %eax,%ebx
sar    %ebx
mov    %ebx,%edx
call   1040 <mergesort@plt>
lea    0x1(%rbx),%esi
mov    %r15,%rdi
mov    %r14d,%edx
call   1040 <mergesort@plt>
mov    %r15,%rdi
mov    %r12d,%esi
mov    %ebx,%edx
mov    %r14d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <merge@plt>
ret

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

LLVM IR (-O2):
define void @mergesort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %6, label %5
5: ; preds = %3, %6
ret void
6: ; preds = %3
%7 = add nsw i32 %2, %1
%8 = sdiv i32 %7, 2
tail call void @mergesort(i32* %0, i32 %1, i32 %8)
%9 = add nsw i32 %8, 1
tail call void @mergesort(i32* %0, i32 %9, i32 %2)
%10 = tail call i32 @merge(i32* %0, i32 %1, i32 %8, i32 %2)
br label %5
}
char *scanspaces(char *p) {
  while (*p == ' ' || *p == '\t') {
    p++;
  }
  return p;
}


x86 assembly (clang, -O0):
<scanspaces>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x9(%rbp)
je     112d <scanspaces+0x2d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    113d <scanspaces+0x3d>
jmp    114e <scanspaces+0x4e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <scanspaces+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @scanspaces(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 eq i32 %6, 32
br i1 %7, label %13, label %8
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 9
br label %13
13: ; preds = %8, %3
%14 = phi i1 [ true, %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* @scanspaces(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 32, label %5
i8 9, label %5
]
5: ; preds = %2, %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
ret i8* %3
}
/* Variables and functions */
scalar_t__ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, char *);
void die_motherfucker(char *message) {
  if (errno) {
    printf("\x1b[31m"
           "\n[ERROR]:  %s \r\n"
           "\x1b[0m",
           message);
    ;
    perror("");
  } else {
    printf("\x1b[31m"
           "\n[ERROR]:  %s \r\n"
           "\x1b[0m",
           message);
    ;
  }
  exit(1);
}


x86 assembly (clang, -O0):
<die_motherfucker>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
cmpq   $0x0,(%rax)
je     116e <die_motherfucker+0x3e>
mov    -0x8(%rbp),%rsi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb5(%rip),%rdi
call   1040 <perror@plt>
jmp    117e <die_motherfucker+0x4e>
mov    -0x8(%rbp),%rsi
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<die_motherfucker>:
push   %rbx
mov    %rdi,%rsi
mov    0x2ea5(%rip),%rax
mov    (%rax),%rbx
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
test   %rbx,%rbx
je     115b <die_motherfucker+0x2b>
lea    0xec3(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@errno = global i64 0
@.str = [26 x i8] c"\1B[31m\0A[ERROR]: %s \0D\0A\1B[0m\00"
@.str.1 = [1 x i8] zeroinitializer
define void @die_motherfucker(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i64, i64* @errno
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = call i32 @perror(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %12
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %12
12: ; preds = %9, %5
%13 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@errno = global i64 0
@.str = [26 x i8] c"\1B[31m\0A[ERROR]: %s \0D\0A\1B[0m\00"
@.str.1 = [1 x i8] zeroinitializer
define void @die_motherfucker(i8* %0) {
%2 = load i64, i64* @errno
%3 = icmp eq i64 %2, 0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0)
br i1 %3, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @perror(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %1, %5
%8 = tail call i32 @exit(i32 1)
unreachable
}
unsigned long strnlen(const char *s, unsigned long count) {
  const char *sc;
  for (sc = s; count-- && *sc != '\0'; ++sc)
    ;
  return sc - s;
}


x86 assembly (clang, -O0):
<strnlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rcx
mov    %rcx,%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x19(%rbp)
je     1142 <strnlen+0x42>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1152 <strnlen+0x52>
jmp    1168 <strnlen+0x68>
jmp    1157 <strnlen+0x57>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <strnlen+0x14>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnlen>:
mov    %rdi,%rax
test   %rsi,%rsi
je     1125 <strnlen+0x25>
lea    (%rdi,%rsi,1),%rcx
mov    %rdi,%rax
nop
cmpb   $0x0,(%rax)
je     1125 <strnlen+0x25>
add    $0xffffffffffffffff,%rsi
add    $0x1,%rax
test   %rsi,%rsi
jne    1110 <strnlen+0x10>
mov    %rcx,%rax
sub    %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @strnlen(i8* %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %15, label %4
4: ; preds = %2
%5 = getelementptr i8, i8* %0, i64 %1
br label %6
6: ; preds = %4, %12
%7 = phi i64 [ %9, %12 ], [ %1, %4 ]
%8 = phi i8* [ %13, %12 ], [ %0, %4 ]
%9 = add i64 %7, -1
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %6
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = icmp eq i64 %9, 0
br i1 %14, label %15, label %6
15: ; preds = %6, %12, %2
%16 = phi i8* [ %0, %2 ], [ %5, %12 ], [ %8, %6 ]
%17 = ptrtoint i8* %16 to i64
%18 = ptrtoint i8* %0 to i64
%19 = sub i64 %17, %18
ret i64 %19
}
/* Variables and functions */
int do_ls(char *);
int main(int argc, char *argv[]) {
  char *path = ".";
  int ret;
  if (argc == 2)
    path = argv[1];
  ret = do_ls(path);
  return ret;
}


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)
lea    0xed3(%rip),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    1147 <main+0x37>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <do_ls@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x2,%edi
jne    111e <main+0xe>
mov    0x8(%rsi),%rdi
jmp    1030 <do_ls@plt>
lea    0xedb(%rip),%rdi
jmp    1030 <do_ls@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c".\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
br label %7
7: ; preds = %4, %2
%8 = phi i8* [ %6, %4 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %2 ]
%9 = tail call i32 @do_ls(i8* %8)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ __real_Cache_Read_Enable(int, int, int /*<<< orphan*/);
void __wrap_Cache_Read_Enable(int a, int b, int c) {
  __real_Cache_Read_Enable(a, b, 0);
}


x86 assembly (clang, -O0):
<__wrap_Cache_Read_Enable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
xor    %edx,%edx
call   1030 <__real_Cache_Read_Enable@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__wrap_Cache_Read_Enable>:
xor    %edx,%edx
jmp    1030 <__real_Cache_Read_Enable@plt>

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

LLVM IR (-O2):
define void @__wrap_Cache_Read_Enable(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @__real_Cache_Read_Enable(i32 %0, i32 %1, i32 0)
ret void
}
/* Variables and functions */
double pi();
int /*<<< orphan*/ printf(char *, double);
int main(void) { printf("%f\n", pi()); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <pi@plt>
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = call double (...) @pi()
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = tail call double (...) @pi()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %1)
ret i32 0
}
int test_imm_BBuint16_reg(unsigned short val) {
  return ((val) & (-0xBB << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_BBuint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffff45,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_BBuint16_reg>:
test   $0xff45,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_BBuint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, -187
%6 = icmp ne i32 %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_BBuint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -187
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ write(int /*<<< orphan*/, char *, int);
int main() {
  char Q[16] __attribute__((aligned(256)));
  char P[16] __attribute__((aligned(256)));
  write(STDOUT_FILENO, "recovered\n", 10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
and    $0xffffffffffffff00,%rsp
sub    $0x200,%rsp
movl   $0x0,0x1ec(%rsp)
mov    0x2ebc(%rip),%rax
mov    (%rax),%edi
lea    0xec3(%rip),%rsi
mov    $0xa,%edx
call   1030 <write@plt>
xor    %eax,%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ed8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
mov    $0xa,%edx
call   1030 <write@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
@.str = [11 x i8] c"recovered\0A\00"
define i32 @main() {
%1 = load i32, i32* @STDOUT_FILENO
%2 = tail call i32 @write(i32 %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
void integer_to_string(char *str, int n) { sprintf(str, "%d", n); }


x86 assembly (clang, -O0):
<integer_to_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<integer_to_string>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <sprintf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @integer_to_string(i8* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ output_line(char *);
void gen_swap_stack(void) { output_line("xthl"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"xthl\00"
define void @gen_swap_stack() {
%1 = call i32 @output_line(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"xthl\00"
define void @gen_swap_stack() {
%1 = tail call i32 @output_line(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
void ECPKParameters_print_fp(void) {}


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

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

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

LLVM IR (-O2):
define void @ECPKParameters_print_fp() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ erase();
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ stdscr;
int /*<<< orphan*/ touchwin(int /*<<< orphan*/);
int interface_reset_screen(void) {
  erase();
  touchwin(stdscr);
  refresh();
  return (0);
}


x86 assembly (clang, -O0):
<interface_reset_screen>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <erase@plt>
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
call   1030 <touchwin@plt>
mov    $0x0,%al
call   1050 <refresh@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<interface_reset_screen>:
push   %rax
xor    %eax,%eax
call   1040 <erase@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1030 <touchwin@plt>
xor    %eax,%eax
call   1050 <refresh@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdscr = global i32 0
define i32 @interface_reset_screen() {
%1 = call i32 (...) @erase()
%2 = load i32, i32* @stdscr
%3 = call i32 @touchwin(i32 %2)
%4 = call i32 (...) @refresh()
ret i32 0
}

LLVM IR (-O2):
@stdscr = global i32 0
define i32 @interface_reset_screen() {
%1 = tail call i32 (...) @erase()
%2 = load i32, i32* @stdscr
%3 = tail call i32 @touchwin(i32 %2)
%4 = tail call i32 (...) @refresh()
ret i32 0
}
/* Variables and functions */
unsigned long long do_div64(unsigned long long, unsigned long long,
                            int /*<<< orphan*/);
unsigned long long div64(unsigned long long x, unsigned long long y) {
  return do_div64(x, y, 0);
}


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

x86 assembly (clang, -O2):
<div64>:
xor    %edx,%edx
jmp    1030 <do_div64@plt>

LLVM IR (-O0):
define i64 @div64(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 i64 @do_div64(i64 %5, i64 %6, i32 0)
ret i64 %7
}

LLVM IR (-O2):
define i64 @div64(i64 %0, i64 %1) {
%3 = tail call i64 @do_div64(i64 %0, i64 %1, i32 0)
ret i64 %3
}
/* Variables and functions */
scalar_t__ statement();
void statementlist() {
  while (statement())
    ;
}


x86 assembly (clang, -O0):
<statementlist>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <statementlist+0x9>
mov    $0x0,%al
call   1030 <statement@plt>
cmp    $0x0,%rax
je     112f <statementlist+0x1f>
jmp    1119 <statementlist+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<statementlist>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <statement@plt>
test   %rax,%rax
jne    1120 <statementlist+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @statementlist() {
br label %1
1: ; preds = %4, %0
%2 = call i64 (...) @statement()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %1
br label %1
5: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @statementlist() {
br label %1
1: ; preds = %1, %0
%2 = tail call i64 (...) @statement()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %1
4: ; preds = %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
FILE *fopen_safe(char *filepath) {
  FILE *f = fopen(filepath, "r");
  if (!f) {
    fprintf(stderr, "Error opening file for reading %s\n", filepath);
  }
  return f;
}


x86 assembly (clang, -O0):
<fopen_safe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1164 <fopen_safe+0x44>
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xea3(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fopen_safe>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0xed2(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1153 <fopen_safe+0x33>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
lea    0xeb7(%rip),%rsi
mov    %r14,%rdx
call   1030 <fprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.1 = [35 x i8] c"Error opening file for reading %s\0A\00"
define i32* @fopen_safe(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = icmp ne i32* %6, null
br i1 %7, label %12, label %8
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %2
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* %10)
br label %12
12: ; preds = %8, %1
%13 = load i32*, i32** %3
ret i32* %13
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.1 = [35 x i8] c"Error opening file for reading %s\0A\00"
define noalias i32* @fopen_safe(i8* %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %7
7: ; preds = %4, %1
ret i32* %2
}
/* Variables and functions */
float fminf(float, float);
float __ocl_fmin_float_float(float src1, float src2) {
  return fminf(src1, src2);
}


x86 assembly (clang, -O0):
<__ocl_fmin_float_float>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm3
movss  -0x8(%rbp),%xmm2
movaps %xmm2,%xmm4
movaps %xmm3,%xmm0
cmpunordss %xmm0,%xmm0
movaps %xmm0,%xmm1
pand   %xmm4,%xmm1
minss  %xmm3,%xmm2
pandn  %xmm2,%xmm0
por    %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ocl_fmin_float_float>:
movaps %xmm0,%xmm2
cmpunordss %xmm0,%xmm2
movaps %xmm2,%xmm3
andps  %xmm1,%xmm3
minss  %xmm0,%xmm1
andnps %xmm1,%xmm2
orps   %xmm3,%xmm2
movaps %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @__ocl_fmin_float_float(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call float @llvm.minnum.f32(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @__ocl_fmin_float_float(float %0, float %1) {
%3 = tail call float @llvm.minnum.f32(float %0, float %1)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
void main() {
  void swap(int *p1, int *p2);
  int a, b;
  int *pointer_1, *pointer_2;
  scanf("%d, %d", &a, &b);
  pointer_1 = &a;
  pointer_2 = &b;
  if (a < b)
    swap(pointer_1, pointer_2);
  printf("\n%d, %d\n", a, b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xec1(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1040 <scanf@plt>
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1175 <main+0x45>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <swap@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
cmp    %edx,%esi
jge    1164 <main+0x34>
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1050 <swap@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d, %d\00"
@.str.1 = [9 x i8] c"\0A%d, %d\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %12
9: ; preds = %0
%10 = load i32, i32* %1
%11 = load i32, i32* %2
br label %12
12: ; preds = %9, %0
%13 = phi i32 [ %11, %9 ], [ %7, %0 ]
%14 = phi i32 [ %10, %9 ], [ %6, %0 ]
%15 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %14, i32 %13)
ret void
}
/* Variables and functions */
char getchar();
void emptyBuffer() {
  while (getchar() != '\n')
    ;
}


x86 assembly (clang, -O0):
<emptyBuffer>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <emptyBuffer+0x9>
mov    $0x0,%al
call   1030 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     1131 <emptyBuffer+0x21>
jmp    1119 <emptyBuffer+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<emptyBuffer>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
jne    1120 <emptyBuffer+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @emptyBuffer() {
br label %1
1: ; preds = %5, %0
%2 = call signext i8 (...) @getchar()
%3 = sext i8 %2 to i32
%4 = icmp ne i32 %3, 10
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @emptyBuffer() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 (...) @getchar()
%3 = icmp eq i8 %2, 10
br i1 %3, label %4, label %1
4: ; preds = %1
ret void
}
void m68k_op_nop(void) {}


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

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

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

LLVM IR (-O2):
define void @m68k_op_nop() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ wczytaj(int *, int *);
int /*<<< orphan*/ wypisz(int, int);
int main(void) {
  int x1, x2;
  wczytaj(&x1, &x2);
  wypisz(x1, x2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1030 <wczytaj@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <wypisz@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <wczytaj@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1040 <wypisz@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @wczytaj(i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @wypisz(i32 %6, i32 %7)
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
char __VERIFIER_nondet_char() {
  char initialValue;
  int byteOffset = 0;
  uint8_t *initialValueAsByte = (uint8_t *)&initialValue;
  for (; byteOffset < sizeof(char); ++byteOffset) {
    initialValueAsByte[byteOffset] = 0;
  }
  return initialValue;
}


x86 assembly (clang, -O0):
<__VERIFIER_nondet_char>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x8(%rbp)
lea    -0x1(%rbp),%rax
mov    %rax,-0x10(%rbp)
movslq -0x8(%rbp),%rax
cmp    $0x1,%rax
jae    113f <__VERIFIER_nondet_char+0x3f>
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
movq   $0x0,(%rax,%rcx,8)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1113 <__VERIFIER_nondet_char+0x13>
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define signext i8 @__VERIFIER_nondet_char() {
ret i8 undef
}
void w5(void *x, long long y) { *(long long *)(x + 32763) = y; }


x86 assembly (clang, -O0):
<w5>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x7ffb(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<w5>:
mov    %rsi,0x7ffb(%rdi)
ret

LLVM IR (-O0):
define void @w5(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = getelementptr i8, i8* %6, i64 32763
%8 = bitcast i8* %7 to i64*
store i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @w5(i8* nocapture writeonly %0, i64 %1) {
%3 = getelementptr i8, i8* %0, i64 32763
%4 = bitcast i8* %3 to i64*
store i64 %1, i64* %4
ret void
}
int adis16260_configure_ring(struct iio_dev *indio_dev) { return 0; }


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

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

LLVM IR (-O0):
%struct.iio_dev = type opaque
define i32 @adis16260_configure_ring(%struct.iio_dev* %0) {
%2 = alloca %struct.iio_dev*
store %struct.iio_dev* %0, %struct.iio_dev** %2
ret i32 0
}

LLVM IR (-O2):
%struct.iio_dev = type opaque
define i32 @adis16260_configure_ring(%struct.iio_dev* nocapture readnone %0) {
ret i32 0
}