xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ signal(int, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void FPEhandler(int sig) {
  signal(sig, SIG_IGN);
  fprintf(stdout, "Quitting because of floating point exception\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<FPEhandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ea3(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
lea    0xea4(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<FPEhandler>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
lea    0xeb1(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@SIG_IGN = global i32 0
@stdout = global i32 0
@.str = [46 x i8] c"Quitting because of floating point exception\0A\00"
@EXIT_FAILURE = global i32 0
define void @FPEhandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIG_IGN
%5 = call i32 @signal(i32 %3, i32 %4)
%6 = load i32, i32* @stdout
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = call i32 @exit(i32 %8)
unreachable
}

LLVM IR (-O2):
@SIG_IGN = global i32 0
@stdout = global i32 0
@.str = [46 x i8] c"Quitting because of floating point exception\0A\00"
@EXIT_FAILURE = global i32 0
define void @FPEhandler(i32 %0) {
%2 = load i32, i32* @SIG_IGN
%3 = tail call i32 @signal(i32 %0, i32 %2)
%4 = load i32, i32* @stdout
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void ksh_command_uname() {
  printf("%s; Build: %s \n", "Ulix-i386 0.13", "Do  3 Sep 2015 15:41:31 CEST");
}


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

x86 assembly (clang, -O2):
<ksh_command_uname>:
lea    0xee9(%rip),%rdi
lea    0xef2(%rip),%rsi
lea    0xefa(%rip),%rdx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"%s; Build: %s \0A\00"
@.str.1 = [15 x i8] c"Ulix-i386 0.13\00"
@.str.2 = [29 x i8] c"Do 3 Sep 2015 15:41:31 CEST\00"
define void @ksh_command_uname() {
%1 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"%s; Build: %s \0A\00"
@.str.1 = [15 x i8] c"Ulix-i386 0.13\00"
@.str.2 = [29 x i8] c"Do 3 Sep 2015 15:41:31 CEST\00"
define void @ksh_command_uname() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
ret void
}
void NES_HEADER_INSERT(char *header, int counter, int data) {
  header[counter] = data;
}


x86 assembly (clang, -O0):
<NES_HEADER_INSERT>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<NES_HEADER_INSERT>:
movslq %esi,%rax
mov    %dl,(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @NES_HEADER_INSERT(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
store i8 %8, i8* %12
ret void
}

LLVM IR (-O2):
define void @NES_HEADER_INSERT(i8* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = trunc i32 %2 to i8
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 %4, i8* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int rand();
int rolldice(void) {
  int die1, die2, work_sm;
  die1 = 1 + (rand() % 6);
  die2 = 1 + (rand() % 6);
  work_sm = die1 + die2;
  printf("jogador obteve %d+%d = %d\n", die1, die2, work_sm);
  return work_sm;
}


x86 assembly (clang, -O0):
<rolldice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <rand@plt>
mov    $0x6,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x4(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    $0x6,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rolldice>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <rand@plt>
cltq
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,2),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%ebx
add    $0x1,%ebx
xor    %eax,%eax
call   1040 <rand@plt>
cltq
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,2),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edx
add    $0x1,%edx
lea    (%rdx,%rbx,1),%ebp
lea    0xe7f(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%ecx
call   1030 <printf@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [27 x i8] c"jogador obteve %d+%d = %d\0A\00"
define i32 @rolldice() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 (...) @rand()
%5 = srem i32 %4, 6
%6 = add nsw i32 1, %5
store i32 %6, i32* %1
%7 = call i32 (...) @rand()
%8 = srem i32 %7, 6
%9 = add nsw i32 1, %8
store i32 %9, i32* %2
%10 = load i32, i32* %1
%11 = load i32, i32* %2
%12 = add nsw i32 %10, %11
store i32 %12, i32* %3
%13 = load i32, i32* %1
%14 = load i32, i32* %2
%15 = load i32, i32* %3
%16 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %13, i32 %14, i32 %15)
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@.str = [27 x i8] c"jogador obteve %d+%d = %d\0A\00"
define i32 @rolldice() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 6
%3 = add nsw i32 %2, 1
%4 = tail call i32 (...) @rand()
%5 = srem i32 %4, 6
%6 = add nsw i32 %5, 1
%7 = add nsw i32 %6, %3
%8 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %6, i32 %7)
ret i32 %7
}
/* Variables and functions */
int ENOSYS;
int errno;
int renameat(const int olddirfd, const char *const oldpath, const int newdirfd,
             const char *const newpath) {
  return errno = ENOSYS, -1;
}


x86 assembly (clang, -O0):
<renameat>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2ecf(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb6(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<renameat>:
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 @renameat(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
%9 = load i32, i32* @ENOSYS
store i32 %9, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @renameat(i32 %0, i8* nocapture readnone %1, i32 %2, i8* nocapture readnone %3) {
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ factorial(long);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ scanf(char *, long *);
int main() {
  long n;
  scanf("%ld", &n);
  printf("%ld", factorial(n));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0x8(%rsp),%rdi
call   1030 <factorial@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %1)
%4 = load i64, i64* %1
%5 = call i32 @factorial(i64 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void a52_set_cmixlev(uint8_t *p_a52, uint8_t i_cmixlev) {
  p_a52[6] &= ~0x18;
  p_a52[6] |= (i_cmixlev & 0x3) << 3;
}


x86 assembly (clang, -O0):
<a52_set_cmixlev>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%ecx
and    $0xffffffe7,%ecx
mov    %ecx,0x18(%rax)
mov    -0xc(%rbp),%ecx
and    $0x3,%ecx
shl    $0x3,%ecx
mov    -0x8(%rbp),%rax
or     0x18(%rax),%ecx
mov    %ecx,0x18(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<a52_set_cmixlev>:
mov    0x18(%rdi),%eax
and    $0xffffffe7,%eax
and    $0x3,%esi
lea    (%rax,%rsi,8),%eax
mov    %eax,0x18(%rdi)
ret

LLVM IR (-O0):
define void @a52_set_cmixlev(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = getelementptr inbounds i32, i32* %5, i64 6
%7 = load i32, i32* %6
%8 = and i32 %7, -25
store i32 %8, i32* %6
%9 = load i32, i32* %4
%10 = and i32 %9, 3
%11 = shl i32 %10, 3
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 6
%14 = load i32, i32* %13
%15 = or i32 %14, %11
store i32 %15, i32* %13
ret void
}

LLVM IR (-O2):
define void @a52_set_cmixlev(i32* nocapture %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 6
%4 = load i32, i32* %3
%5 = and i32 %4, -25
%6 = shl i32 %1, 3
%7 = and i32 %6, 24
%8 = or i32 %5, %7
store i32 %8, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f1(int);
int f2(int);
int tailCall(int data) {
  f1(data);
  return f2(data);
}


x86 assembly (clang, -O0):
<tailCall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <f1@plt>
mov    -0x4(%rbp),%edi
call   1030 <f2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tailCall>:
push   %rbx
mov    %edi,%ebx
call   1040 <f1@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <f2@plt>

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

LLVM IR (-O2):
define i32 @tailCall(i32 %0) {
%2 = tail call i32 @f1(i32 %0)
%3 = tail call i32 @f2(i32 %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ getyx(int /*<<< orphan*/, int, int);
int /*<<< orphan*/ stdscr;
void nc_get_yx(int *y, int *x) { getyx(stdscr, *y, *x); }


x86 assembly (clang, -O0):
<nc_get_yx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
call   1030 <getyx@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nc_get_yx>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
mov    (%rdi),%ecx
mov    (%rsi),%edx
mov    %eax,%edi
mov    %ecx,%esi
jmp    1030 <getyx@plt>

LLVM IR (-O0):
@stdscr = global i32 0
define void @nc_get_yx(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32, i32* @stdscr
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = call i32 @getyx(i32 %5, i32 %7, i32 %9)
ret void
}

LLVM IR (-O2):
@stdscr = global i32 0
define void @nc_get_yx(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* @stdscr
%4 = load i32, i32* %0
%5 = load i32, i32* %1
%6 = tail call i32 @getyx(i32 %3, i32 %4, i32 %5)
ret void
}
void foo() {
  int i, j;
  for (i = 0; i < 10; ++i) {
#pragma omp for
    for (j = ({
           continue;
           0;
         });
         j < ({
           continue;
           10;
         });
         j += ({
           continue;
           1;
         }))
      continue;
#pragma omp for
    for (j = ({
           break;
           0;
         });
         j < ({
           break;
           10;
         });
         j += ({
           break;
           1;
         }))
      break;
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    1128 <foo+0x28>
jmp    111a <foo+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <foo+0xb>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @foo() {
ret void
}
long long ffiTestLongLong(long long i1, long long i2) {
  ;
  return i1 + i2;
}


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

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

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

LLVM IR (-O2):
define i64 @ffiTestLongLong(i64 %0, i64 %1) {
%3 = add nsw i64 %1, %0
ret i64 %3
}
int nospacein(char *s) {
  while (*s) {
    if (*s == ' ' || *s == '\t')
      return 0;
    s++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<nospacein>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1152 <nospacein+0x52>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     1135 <nospacein+0x35>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
jne    1141 <nospacein+0x41>
movl   $0x0,-0x4(%rbp)
jmp    1159 <nospacein+0x59>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1108 <nospacein+0x8>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nospacein>:
movzbl (%rdi),%eax
test   %al,%al
je     1118 <nospacein+0x18>
cmp    $0x9,%al
je     1115 <nospacein+0x15>
cmp    $0x20,%al
je     1115 <nospacein+0x15>
add    $0x1,%rdi
jmp    1100 <nospacein>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @nospacein(i8* nocapture %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %8
i8 32, label %7
i8 9, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %2
br label %8
8: ; preds = %2, %7
%9 = phi i32 [ 0, %7 ], [ 1, %2 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void shrd_reg32_reg32_cl(unsigned int reg1, unsigned int reg2) {
  put8(0x0F);
  put8(0xAD);
  put8(0xC0 | (reg2 << 3) | reg1);
}


x86 assembly (clang, -O0):
<shrd_reg32_reg32_cl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0xf,%edi
call   1030 <put8@plt>
mov    $0xad,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%edi
shl    $0x3,%edi
or     $0xc0,%edi
or     -0x4(%rbp),%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shrd_reg32_reg32_cl>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0xf,%edi
call   1030 <put8@plt>
mov    $0xad,%edi
call   1030 <put8@plt>
shl    $0x3,%ebx
or     %ebp,%ebx
or     $0xc0,%ebx
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @shrd_reg32_reg32_cl(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @put8(i32 15)
%6 = call i32 @put8(i32 173)
%7 = load i32, i32* %4
%8 = shl i32 %7, 3
%9 = or i32 192, %8
%10 = load i32, i32* %3
%11 = or i32 %9, %10
%12 = call i32 @put8(i32 %11)
ret void
}

LLVM IR (-O2):
define void @shrd_reg32_reg32_cl(i32 %0, i32 %1) {
%3 = tail call i32 @put8(i32 15)
%4 = tail call i32 @put8(i32 173)
%5 = shl i32 %1, 3
%6 = or i32 %5, %0
%7 = or i32 %6, 192
%8 = tail call i32 @put8(i32 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cerr(char *);
void test_end(char *k) {
  if (k)
    cerr("Too many arguments");
}


x86 assembly (clang, -O0):
<test_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1133 <test_end+0x23>
lea    0xed2(%rip),%rdi
call   1030 <cerr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_end>:
test   %rdi,%rdi
je     1121 <test_end+0x11>
lea    0xee4(%rip),%rdi
jmp    1030 <cerr@plt>
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Too many arguments\00"
define void @test_end(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @cerr(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"Too many arguments\00"
define void @test_end(i8* readnone %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @cerr(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ setpgid(int /*<<< orphan*/, int /*<<< orphan*/);
pid_t setpgrp(void) { return setpgid(0, 0); }


x86 assembly (clang, -O0):
<setpgrp>:
push   %rbp
mov    %rsp,%rbp
xor    %esi,%esi
mov    %esi,%edi
call   1030 <setpgid@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<setpgrp>:
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <setpgid@plt>

LLVM IR (-O0):
define i32 @setpgrp() {
%1 = call i32 @setpgid(i32 0, i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @setpgrp() {
%1 = tail call i32 @setpgid(i32 0, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ memory_error();
void *realloc(void *, size_t);
void *xrealloc(void *ptr, size_t size) {
  void *p = realloc(ptr, size);
  if (!p)
    memory_error();
  return p;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1153 <xrealloc+0x33>
mov    $0x0,%al
call   1040 <memory_error@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rbx
call   1030 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <xrealloc+0x15>
xor    %eax,%eax
call   1040 <memory_error@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @xrealloc(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
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %13, label %11
11: ; preds = %2
%12 = call i32 (...) @memory_error()
br label %13
13: ; preds = %11, %2
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @memory_error()
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int nstudents = 0;
  printf("HOW many students do you know?");
  scanf("%d", &nstudents);
  printf("So, you have %d students", nstudents);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xed0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
lea    0xecf(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"HOW many students do you know?\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [25 x i8] c"So, you have %d students\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"HOW many students do you know?\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [25 x i8] c"So, you have %d students\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}
int aswap(int addr) {
  addr = ((addr & 0xaa) >> 1) | ((addr & 0x55) << 1);
  addr = ((addr & 0xcc) >> 2) | ((addr & 0x33) << 2);
  addr = ((addr & 0xf0) >> 4) | ((addr & 0x0f) << 4);
  return addr;
}


x86 assembly (clang, -O0):
<aswap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xaa,%eax
sar    $0x1,%eax
mov    -0x4(%rbp),%ecx
and    $0x55,%ecx
shl    $0x1,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xcc,%eax
sar    $0x2,%eax
mov    -0x4(%rbp),%ecx
and    $0x33,%ecx
shl    $0x2,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf0,%eax
sar    $0x4,%eax
mov    -0x4(%rbp),%ecx
and    $0xf,%ecx
shl    $0x4,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<aswap>:
rol    $0x4,%dil
mov    %edi,%eax
and    $0x33,%al
shl    $0x2,%al
shr    $0x2,%dil
and    $0x33,%dil
or     %al,%dil
mov    %edi,%eax
and    $0x55,%al
add    %al,%al
shr    %dil
and    $0x55,%dil
or     %al,%dil
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @aswap(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 170
%5 = ashr i32 %4, 1
%6 = load i32, i32* %2
%7 = and i32 %6, 85
%8 = shl i32 %7, 1
%9 = or i32 %5, %8
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = and i32 %10, 204
%12 = ashr i32 %11, 2
%13 = load i32, i32* %2
%14 = and i32 %13, 51
%15 = shl i32 %14, 2
%16 = or i32 %12, %15
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = and i32 %17, 240
%19 = ashr i32 %18, 4
%20 = load i32, i32* %2
%21 = and i32 %20, 15
%22 = shl i32 %21, 4
%23 = or i32 %19, %22
store i32 %23, i32* %2
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
define i32 @aswap(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = tail call i8 @llvm.bitreverse.i8(i8 %2)
%4 = zext i8 %3 to i32
ret i32 %4
}
/* Type definitions */
struct tm {
  int dummy;
};

/* Variables and functions */
size_t strftime(char *, size_t, char *, struct tm *);
char *fmt_tm(struct tm *tmptr, size_t timestr_len, char *timestr) {
  if (strftime(timestr, timestr_len, "%d-%b-%Y %T", tmptr) == (size_t)0) {
    return (NULL);
  }
  return (timestr);
}


x86 assembly (clang, -O0):
<fmt_tm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rcx
lea    0xec9(%rip),%rdx
call   1030 <strftime@plt>
cmp    $0x0,%rax
jne    1153 <fmt_tm+0x43>
movq   $0x0,-0x8(%rbp)
jmp    115b <fmt_tm+0x4b>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmt_tm>:
push   %rbx
mov    %rdx,%rbx
mov    %rdi,%rcx
lea    0xee2(%rip),%rdx
mov    %rbx,%rdi
call   1030 <strftime@plt>
test   %rax,%rax
cmovne %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [12 x i8] c"%d-%b-%Y %T\00"
define i8* @fmt_tm(%struct.tm* %0, i64 %1, i8* %2) {
%4 = tail call i64 @strftime(i8* %2, i64 %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), %struct.tm* %0)
%5 = icmp eq i64 %4, 0
%6 = select i1 %5, i8* null, i8* %2
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ memmove(char *, char *, int);
int strlen(char *);
int strspn(char *, char *);
void LeftTrim(char *str) {
  int k, n;
  k = strlen(str);
  if (k) {
    n = strspn(str, " \t");
    memmove(str, str + n, k - n + 1);
  }
}


x86 assembly (clang, -O0):
<LeftTrim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1182 <LeftTrim+0x52>
mov    -0x8(%rbp),%rdi
lea    0xea3(%rip),%rsi
call   1040 <strspn@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0x10(%rbp),%rax
add    %rax,%rsi
mov    -0xc(%rbp),%edx
sub    -0x10(%rbp),%edx
add    $0x1,%edx
call   1050 <memmove@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LeftTrim>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %eax,%eax
je     116b <LeftTrim+0x3b>
mov    %eax,%ebp
lea    0xeb8(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strspn@plt>
cltq
lea    (%rbx,%rax,1),%rsi
sub    %eax,%ebp
add    $0x1,%ebp
mov    %rbx,%rdi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <memmove@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c" \09\00"
define void @LeftTrim(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = tail call i32 @strspn(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = add i32 %2, 1
%9 = sub i32 %8, %5
%10 = tail call i32 @memmove(i8* %0, i8* %7, i32 %9)
br label %11
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int __infer_nondet_int();
int printf(const char *format, ...) {
  int res;
  res = __infer_nondet_int();
  if (res < 0)
    while (1)
      ;
  return res;
}


x86 assembly (clang, -O0):
<printf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_int@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    113a <printf+0x2a>
jmp    1135 <printf+0x25>
jmp    1135 <printf+0x25>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printf>:
push   %rax
xor    %eax,%eax
call   1030 <__infer_nondet_int@plt>
test   %eax,%eax
js     1120 <printf+0x10>
pop    %rcx
ret
xchg   %ax,%ax
jmp    1120 <printf+0x10>

LLVM IR (-O0):
define i32 @printf(i8* %0, ...) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = call i32 (...) @__infer_nondet_int()
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
br label %8
8: ; preds = %7, %8
br label %8
9: ; preds = %1
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @printf(i8* nocapture readnone %0, ...) {
%2 = tail call i32 (...) @__infer_nondet_int()
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %1, %4
br label %4
5: ; preds = %1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void Parrot_free_memalign(void *p) { free(p); }


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

x86 assembly (clang, -O2):
<Parrot_free_memalign>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @Parrot_free_memalign(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int call(int num) {
  int y = 1, x = 1;
  if (num < 4) {
    x = 3 * x + num;
    y = call(x + 1) + 2 + call(x + 3);
  }
  return y;
}


x86 assembly (clang, -O0):
<call>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x4,-0x4(%rbp)
jge    1163 <call+0x53>
imul   $0x3,-0xc(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
add    $0x1,%edi
call   1030 <call@plt>
add    $0x2,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
add    $0x3,%edi
call   1030 <call@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%r14d
cmp    $0x3,%edi
jg     114b <call+0x3b>
mov    %edi,%ebx
add    $0xfffffffa,%ebx
xor    %r14d,%r14d
nopw   0x0(%rax,%rax,1)
lea    0xa(%rbx),%edi
call   1030 <call@plt>
add    %eax,%r14d
add    $0x2,%r14d
add    $0x6,%ebx
cmp    $0xfffffffe,%ebx
jl     1130 <call+0x20>
add    $0x1,%r14d
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @call(i32 %0) {
%2 = icmp slt i32 %0, 4
br i1 %2, label %3, label %14
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %10, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, 4
%7 = tail call i32 @call(i32 %6)
%8 = add nsw i32 %4, 6
%9 = add i32 %5, 2
%10 = add i32 %9, %7
%11 = icmp slt i32 %4, -2
br i1 %11, label %3, label %12
12: ; preds = %3
%13 = add i32 %10, 1
br label %14
14: ; preds = %12, %1
%15 = phi i32 [ 1, %1 ], [ %13, %12 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Hello World! 22 & Hello Eunji2");
  printf("Hello World! 22 & Hello Yeji");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [31 x i8] c"Hello World! 22 & Hello Eunji2\00"
@.str.1 = [29 x i8] c"Hello World! 22 & Hello Yeji\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"Hello World! 22 & Hello Eunji2\00"
@.str.1 = [29 x i8] c"Hello World! 22 & Hello Yeji\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char EOF;
char fgetc(int /*<<< orphan*/ *);
int count(FILE *in) {
  char ch;
  int cnt = 0;
  while ((ch = fgetc(in)) != EOF) {
    if (ch == '\n') {
      cnt++;
    }
  }
  return cnt;
}


x86 assembly (clang, -O0):
<count>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %al,-0x9(%rbp)
movsbl %al,%eax
mov    0x2eaf(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     115f <count+0x4f>
movsbl -0x9(%rbp),%eax
cmp    $0xa,%eax
jne    115a <count+0x4a>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1123 <count+0x13>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<count>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1030 <fgetc@plt>
mov    0x2ec5(%rip),%r14
xor    %ebp,%ebp
cmp    (%r14),%al
je     1146 <count+0x36>
xor    %ebp,%ebp
nopl   0x0(%rax)
xor    %ecx,%ecx
cmp    $0xa,%al
sete   %cl
add    %ecx,%ebp
mov    %rbx,%rdi
call   1030 <fgetc@plt>
cmp    (%r14),%al
jne    1130 <count+0x20>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@EOF = global i8 0
define i32 @count(i32* nocapture %0) {
%2 = tail call signext i8 @fgetc(i32* %0)
%3 = load i8, i8* @EOF
%4 = icmp eq i8 %2, %3
br i1 %4, label %14, label %5
5: ; preds = %1, %5
%6 = phi i8 [ %11, %5 ], [ %2, %1 ]
%7 = phi i32 [ %10, %5 ], [ 0, %1 ]
%8 = icmp eq i8 %6, 10
%9 = zext i1 %8 to i32
%10 = add nuw nsw i32 %7, %9
%11 = tail call signext i8 @fgetc(i32* %0)
%12 = load i8, i8* @EOF
%13 = icmp eq i8 %11, %12
br i1 %13, label %14, label %5
14: ; preds = %5, %1
%15 = phi i32 [ 0, %1 ], [ %10, %5 ]
ret i32 %15
}
char *send_command(char *command) { return "ok"; }


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

x86 assembly (clang, -O2):
<send_command>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"ok\00"
define i8* @send_command(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [3 x i8] c"ok\00"
define i8* @send_command(i8* nocapture readnone %0) {
ret i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ _free_vita_heap();
void _free_vita_newlib(void) { _free_vita_heap(); }


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

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

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

LLVM IR (-O2):
define void @_free_vita_newlib() {
%1 = tail call i32 (...) @_free_vita_heap()
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
double mp_load_double(char const **);
int mp_load_u8(char const **);
double mp_decode_double(const char **data) {
  uint8_t c = mp_load_u8(data);
  assert(c == 0xcb);
  (void)c;
  return mp_load_double(data);
}


x86 assembly (clang, -O0):
<mp_decode_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <mp_load_u8@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xcb,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1030 <mp_load_double@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_decode_double>:
push   %rbx
mov    %rdi,%rbx
call   1050 <mp_load_u8@plt>
xor    %edi,%edi
cmp    $0xcb,%eax
sete   %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <mp_load_double@plt>

LLVM IR (-O0):
define double @mp_decode_double(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = call i32 @mp_load_u8(i8** %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 203
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i32, i32* %3
%11 = load i8**, i8*** %2
%12 = call double @mp_load_double(i8** %11)
ret double %12
}

LLVM IR (-O2):
define double @mp_decode_double(i8** %0) {
%2 = tail call i32 @mp_load_u8(i8** %0)
%3 = icmp eq i32 %2, 203
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call double @mp_load_double(i8** %0)
ret double %6
}
void intersectionAlgoOne() {}


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

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

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

LLVM IR (-O2):
define void @intersectionAlgoOne() {
ret void
}
/* Variables and functions */
size_t strlen(char *);
int /*<<< orphan*/ terminal_putchar(char);
void terminal_write(char *data) {
  size_t len = strlen(data);
  for (size_t i = 0; i < len; i++)
    terminal_putchar(data[i]);
}


x86 assembly (clang, -O0):
<terminal_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1171 <terminal_write+0x51>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <terminal_putchar@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1141 <terminal_write+0x21>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<terminal_write>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
test   %rax,%rax
je     1153 <terminal_write+0x33>
mov    %rax,%r15
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%edi
call   1040 <terminal_putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1140 <terminal_write+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @terminal_write(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %5, %1
ret void
5: ; preds = %1, %5
%6 = phi i64 [ %10, %5 ], [ 0, %1 ]
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = tail call i32 @terminal_putchar(i8 signext %8)
%10 = add nuw i64 %6, 1
%11 = icmp eq i64 %10, %2
br i1 %11, label %4, label %5
}
int cyttsp5_devtree_register_devices(struct device *adap_dev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.device = type opaque
define i32 @cyttsp5_devtree_register_devices(%struct.device* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ handle_BUS(int /*<<< orphan*/);
int gen_BUS() {
  handle_BUS(0);
  return 0;
}


x86 assembly (clang, -O0):
<gen_BUS>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <handle_BUS@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @gen_BUS() {
%1 = call i32 @handle_BUS(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @gen_BUS() {
%1 = tail call i32 @handle_BUS(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ flusha();
int do_quit() {
  flusha();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @do_quit() {
%1 = call i32 (...) @flusha()
ret i32 0
}

LLVM IR (-O2):
define i32 @do_quit() {
%1 = tail call i32 (...) @flusha()
ret i32 0
}
int execute_fgetxattr() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_fgetxattr() {
ret i32 0
}
/* Variables and functions */
int mcfioC_GetNTupleUID(int, int);
int mcfio_getntupleuid_(int *stream, int *id) {
  return mcfioC_GetNTupleUID(*stream, *id);
}


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

x86 assembly (clang, -O2):
<mcfio_getntupleuid_>:
mov    (%rdi),%edi
mov    (%rsi),%esi
jmp    1030 <mcfioC_GetNTupleUID@plt>

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

LLVM IR (-O2):
define i32 @mcfio_getntupleuid_(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = tail call i32 @mcfioC_GetNTupleUID(i32 %3, i32 %4)
ret i32 %5
}