xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void show_help() {
  const char *help_text =
      "Brainfuck interpreter by Nicolas Koch\n"
      "Syntax: brainfuck-interpreter [-vh] bf-filename\n"
      "Without arguments, this program will run in interactive mode. In this "
      "case type \"help\" for more information.\n"
      "Options:\n"
      "\t-h: show this help\n"
      "\t-v: show version information\n"
      "\t-m: minimize brainfuck file";
  printf("%s", help_text);
}


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

x86 assembly (clang, -O2):
<show_help>:
lea    0x1004(%rip),%rdi
lea    0xee2(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [283 x i8] c"Brainfuck interpreter by Nicolas Koch\0ASyntax: brainfuck-interpreter [-vh] bf-filename\0AWithout arguments, this program will run in interactive mode. In this case type \22help\22 for more information.\0AOptions:\0A\09-h: show this help\0A\09-v: show version information\0A\09-m: minimize brainfuck file\00"
@.str.1 = [3 x i8] c"%s\00"
define void @show_help() {
%1 = alloca i8*
store i8* getelementptr inbounds ([283 x i8], [283 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
%3 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret void
}

LLVM IR (-O2):
@.str = [283 x i8] c"Brainfuck interpreter by Nicolas Koch\0ASyntax: brainfuck-interpreter [-vh] bf-filename\0AWithout arguments, this program will run in interactive mode. In this case type \22help\22 for more information.\0AOptions:\0A\09-h: show this help\0A\09-v: show version information\0A\09-m: minimize brainfuck file\00"
@.str.1 = [3 x i8] c"%s\00"
define void @show_help() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([283 x i8], [283 x i8]* @.str, i64 0, i64 0))
ret void
}
unsigned int _tlb_trans(unsigned int vir_addr) {
  if (vir_addr < 0x80000000) {
    return (vir_addr + ((unsigned int)0x20000000));
  } else {
    return (vir_addr - ((unsigned int)0xA0000000));
  }
}


x86 assembly (clang, -O0):
<_tlb_trans>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x80000000,-0x8(%rbp)
jae    1124 <_tlb_trans+0x24>
mov    -0x8(%rbp),%eax
add    $0x20000000,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <_tlb_trans+0x2f>
mov    -0x8(%rbp),%eax
sub    $0xa0000000,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_tlb_trans>:
mov    %edi,%eax
shr    %eax
and    $0x40000000,%eax
add    %edi,%eax
add    $0x20000000,%eax
ret

LLVM IR (-O0):
define i32 @_tlb_trans(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ult i32 %4, -2147483648
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %3
%8 = add i32 %7, 536870912
store i32 %8, i32* %2
br label %12
9: ; preds = %1
%10 = load i32, i32* %3
%11 = sub i32 %10, -1610612736
store i32 %11, i32* %2
br label %12
12: ; preds = %9, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @_tlb_trans(i32 %0) {
%2 = icmp sgt i32 %0, -1
%3 = select i1 %2, i32 536870912, i32 1610612736
%4 = add i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ generation();
int /*<<< orphan*/ glFinish();
void display(void) {
  generation();
  glFinish();
  return;
}


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

x86 assembly (clang, -O2):
<display>:
push   %rax
xor    %eax,%eax
call   1030 <generation@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <glFinish@plt>

LLVM IR (-O0):
define void @display() {
%1 = call i32 (...) @generation()
%2 = call i32 (...) @glFinish()
ret void
}

LLVM IR (-O2):
define void @display() {
%1 = tail call i32 (...) @generation()
%2 = tail call i32 (...) @glFinish()
ret void
}
/* Type definitions */
struct forf_env {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ forf_pop_num(struct forf_env *);
void forf_proc_pop(struct forf_env *env) { forf_pop_num(env); }


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

x86 assembly (clang, -O2):
<forf_proc_pop>:
jmp    1030 <forf_pop_num@plt>

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

LLVM IR (-O2):
%struct.forf_env = type { i32 }
define void @forf_proc_pop(%struct.forf_env* %0) {
%2 = tail call i32 @forf_pop_num(%struct.forf_env* %0)
ret void
}
void unback_pages() {}


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

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

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

LLVM IR (-O2):
define void @unback_pages() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int reverse(char *a) {
  if (*a != '\0') {
    reverse(a + 1);
  }
  printf("%c", *a);
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1149 <reverse+0x29>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1030 <reverse@plt>
mov    -0x10(%rbp),%rax
lea    0xeac(%rip),%rdi
movsbl (%rax),%esi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
push   %rbx
cmpb   $0x0,(%rdi)
je     1136 <reverse+0x16>
mov    %rdi,%rbx
add    $0x1,%rdi
call   1030 <reverse@plt>
mov    (%rbx),%al
jmp    1138 <reverse+0x18>
xor    %eax,%eax
movsbl %al,%esi
lea    0xebe(%rip),%rdi
pop    %rbx
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @reverse(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = tail call i32 @reverse(i8* %5)
%7 = load i8, i8* %0
br label %8
8: ; preds = %4, %1
%9 = phi i8 [ %7, %4 ], [ 0, %1 ]
%10 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %9)
ret i32 undef
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t op_and(uint32_t a, uint32_t b) { return a & b; }


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

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

LLVM IR (-O0):
define i32 @op_and(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = and i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @op_and(i32 %0, i32 %1) {
%3 = and i32 %1, %0
ret i32 %3
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void SHAMD5Reset(uint32_t ui32Base) {
  ;
  (*((volatile unsigned long *)(ui32Base + 0x00000110))) |= 0x00000002;
  while (((*((volatile unsigned long *)(ui32Base + 0x00000114))) &
          0x00000001) == 0) {
  }
  (*((volatile unsigned long *)(ui32Base + 0x00000110))) =
      (((*((volatile unsigned long *)(ui32Base + 0x00000110))) & ~0x00000030) |
       0x00000000);
}


x86 assembly (clang, -O0):
<SHAMD5Reset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x110(%rax),%rcx
or     $0x2,%rcx
mov    %rcx,0x110(%rax)
mov    -0x8(%rbp),%rax
mov    0x114(%rax),%rax
and    $0x1,%rax
cmp    $0x0,%rax
jne    113c <SHAMD5Reset+0x3c>
jmp    111e <SHAMD5Reset+0x1e>
mov    -0x8(%rbp),%rax
mov    0x110(%rax),%rcx
and    $0xffffffffffffffcf,%rcx
or     $0x0,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x110(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAMD5Reset>:
orq    $0x2,0x110(%rdi)
02
nopl   0x0(%rax,%rax,1)
testq  $0x1,0x114(%rdi)
je     1110 <SHAMD5Reset+0x10>
andq   $0xffffffffffffffcf,0x110(%rdi)
cf
ret

LLVM IR (-O0):
define void @SHAMD5Reset(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 272
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = or i64 %6, 2
store volatile i64 %7, i64* %5
br label %8
8: ; preds = %15, %1
%9 = load i64, i64* %2
%10 = add nsw i64 %9, 276
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
%13 = and i64 %12, 1
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %8
br label %8
16: ; preds = %8
%17 = load i64, i64* %2
%18 = add nsw i64 %17, 272
%19 = inttoptr i64 %18 to i64*
%20 = load volatile i64, i64* %19
%21 = and i64 %20, -49
%22 = or i64 %21, 0
%23 = load i64, i64* %2
%24 = add nsw i64 %23, 272
%25 = inttoptr i64 %24 to i64*
store volatile i64 %22, i64* %25
ret void
}

LLVM IR (-O2):
define void @SHAMD5Reset(i64 %0) {
%2 = add nsw i64 %0, 272
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = or i64 %4, 2
store volatile i64 %5, i64* %3
%6 = add nsw i64 %0, 276
%7 = inttoptr i64 %6 to i64*
br label %8
8: ; preds = %8, %1
%9 = load volatile i64, i64* %7
%10 = and i64 %9, 1
%11 = icmp eq i64 %10, 0
br i1 %11, label %8, label %12
12: ; preds = %8
%13 = load volatile i64, i64* %3
%14 = and i64 %13, -49
store volatile i64 %14, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *);
void erro(const char *str, int erro) {
  printf("%s", str);
  exit(erro);
}


x86 assembly (clang, -O0):
<erro>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<erro>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rsi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @erro(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 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i32, i32* %4
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @erro(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 %1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ eFree(char *);
scalar_t__ insert(char *, char *, int);
scalar_t__ popNumber();
char *popString();
int /*<<< orphan*/ pushString(char *);
void basInsert() {
  char *source, *target;
  int i;
  i = (int)popNumber();
  target = popString();
  source = popString();
  pushString((char *)insert(source, target, i));
  eFree(source);
  eFree(target);
}


x86 assembly (clang, -O0):
<basInsert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1070 <popNumber@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1040 <popString@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <popString@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1060 <insert@plt>
mov    %rax,%rdi
call   1050 <pushString@plt>
mov    -0x8(%rbp),%rdi
call   1030 <eFree@plt>
mov    -0x10(%rbp),%rdi
call   1030 <eFree@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basInsert>:
push   %r15
push   %r14
push   %rbx
xor    %eax,%eax
call   1070 <popNumber@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1040 <popString@plt>
mov    %rax,%r15
xor    %eax,%eax
call   1040 <popString@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
mov    %r14d,%edx
call   1060 <insert@plt>
mov    %rax,%rdi
call   1050 <pushString@plt>
mov    %rbx,%rdi
call   1030 <eFree@plt>
mov    %r15,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <eFree@plt>

LLVM IR (-O0):
define void @basInsert() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca i32
%4 = call i64 (...) @popNumber()
%5 = trunc i64 %4 to i32
store i32 %5, i32* %3
%6 = call i8* (...) @popString()
store i8* %6, i8** %2
%7 = call i8* (...) @popString()
store i8* %7, i8** %1
%8 = load i8*, i8** %1
%9 = load i8*, i8** %2
%10 = load i32, i32* %3
%11 = call i64 @insert(i8* %8, i8* %9, i32 %10)
%12 = inttoptr i64 %11 to i8*
%13 = call i32 @pushString(i8* %12)
%14 = load i8*, i8** %1
%15 = call i32 @eFree(i8* %14)
%16 = load i8*, i8** %2
%17 = call i32 @eFree(i8* %16)
ret void
}

LLVM IR (-O2):
define void @basInsert() {
%1 = tail call i64 (...) @popNumber()
%2 = trunc i64 %1 to i32
%3 = tail call i8* (...) @popString()
%4 = tail call i8* (...) @popString()
%5 = tail call i64 @insert(i8* %4, i8* %3, i32 %2)
%6 = inttoptr i64 %5 to i8*
%7 = tail call i32 @pushString(i8* %6)
%8 = tail call i32 @eFree(i8* %4)
%9 = tail call i32 @eFree(i8* %3)
ret void
}
void pti_check_boottime_disable(void) {}


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

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

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

LLVM IR (-O2):
define void @pti_check_boottime_disable() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ buildMaxHeap(int *, int);
int /*<<< orphan*/ maxHeapify(int *, int /*<<< orphan*/, int);
int /*<<< orphan*/ swap(int *, int /*<<< orphan*/, int);
void heapSort(int array[], int heapSize) {
  int i;
  buildMaxHeap(array, heapSize);
  for (i = heapSize - 1; i > 0; i--) {
    swap(array, 0, i);
    maxHeapify(array, 0, i);
  }
}


x86 assembly (clang, -O0):
<heapSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <buildMaxHeap@plt>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jle    1188 <heapSort+0x58>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%edx
xor    %esi,%esi
call   1050 <swap@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%edx
xor    %esi,%esi
call   1040 <maxHeapify@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1154 <heapSort+0x24>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<heapSort>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %rdi,%r14
call   1030 <buildMaxHeap@plt>
cmp    $0x2,%ebx
jl     1173 <heapSort+0x43>
add    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
lea    -0x2(%rbx),%ebp
mov    %r14,%rdi
xor    %esi,%esi
mov    %ebp,%edx
call   1050 <swap@plt>
mov    %r14,%rdi
xor    %esi,%esi
mov    %ebp,%edx
call   1040 <maxHeapify@plt>
add    $0xffffffff,%ebx
cmp    $0x2,%ebx
ja     1150 <heapSort+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @heapSort(i32* %0, i32 %1) {
%3 = tail call i32 @buildMaxHeap(i32* %0, i32 %1)
%4 = icmp sgt i32 %1, 1
br i1 %4, label %5, label %11
5: ; preds = %2, %5
%6 = phi i32 [ %7, %5 ], [ %1, %2 ]
%7 = add nsw i32 %6, -1
%8 = tail call i32 @swap(i32* %0, i32 0, i32 %7)
%9 = tail call i32 @maxHeapify(i32* %0, i32 0, i32 %7)
%10 = icmp ugt i32 %6, 2
br i1 %10, label %5, label %11
11: ; preds = %5, %2
ret void
}
int sign_ext(int bits, int value) {
  if (value & (1 << (bits - 1)))
    return value | (-1 << (bits - 1));
  return value;
}


x86 assembly (clang, -O0):
<sign_ext>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1143 <sign_ext+0x43>
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1149 <sign_ext+0x49>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign_ext>:
add    $0xff,%dil
movzbl %dil,%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
xor    %eax,%eax
bt     %ecx,%esi
cmovb  %edx,%eax
or     %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @sign_ext(i32 %0, i32 %1) {
%3 = add nsw i32 %0, -1
%4 = shl nuw i32 1, %3
%5 = and i32 %4, %1
%6 = icmp eq i32 %5, 0
%7 = shl nsw i32 -1, %3
%8 = select i1 %6, i32 0, i32 %7
%9 = or i32 %8, %1
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int age = 10;
  int height;
  printf("Age is %d.\n");
  printf("Height is %d.\n", height);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xece(%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
lea    0xee8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee6(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Age is %d.\0A\00"
@.str.1 = [15 x i8] c"Height is %d.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %3
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Age is %d.\0A\00"
@.str.1 = [15 x i8] c"Height is %d.\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 undef)
ret i32 0
}
int ls_costN_nm7_n_in(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @ls_costN_nm7_n_in() {
ret i32 1
}

LLVM IR (-O2):
define i32 @ls_costN_nm7_n_in() {
ret i32 1
}
void swapSetElements(int *E1, int *E2) {
  int tmp = (*E1);
  (*E1) = (*E2);
  (*E2) = tmp;
}


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

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

LLVM IR (-O0):
define void @swapSetElements(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @swapSetElements(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ err(int, char *);
scalar_t__ prctl(int, unsigned long, unsigned long, unsigned long,
                 unsigned long);
void xprctl(int option, unsigned long arg2, unsigned long arg3,
            unsigned long arg4, unsigned long arg5) {
  if (prctl(option, arg2, arg3, arg4, arg5) < 0)
    err(1, "prctl");
}


x86 assembly (clang, -O0):
<xprctl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <prctl@plt>
cmp    $0x0,%rax
jge    116e <xprctl+0x4e>
mov    $0x1,%edi
lea    0xe97(%rip),%rsi
call   1040 <err@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xprctl>:
push   %rax
call   1030 <prctl@plt>
test   %rax,%rax
js     112d <xprctl+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rsi
mov    $0x1,%edi
pop    %rax
jmp    1040 <err@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"prctl\00"
define void @xprctl(i32 %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = tail call i64 @prctl(i32 %0, i64 %1, i64 %2, i64 %3, i64 %4)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %5
ret void
}
float asin(float x) { return fmod(((native_asin(x)) * 57.2957795131f), 360.f); }


x86 assembly (clang, -O0):
<asin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    $0x1,%al
call   1040 <native_asin@plt>
cvtsi2ss %eax,%xmm0
movss  0xebf(%rip),%xmm1
mulss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xea7(%rip),%xmm1
call   1030 <fmod@plt>
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asin>:
push   %rax
cvtss2sd %xmm0,%xmm0
mov    $0x1,%al
call   1040 <native_asin@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
mulss  0xec5(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xec1(%rip),%xmm1
call   1030 <fmod@plt>
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @asin(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = call i32 (double, ...) bitcast (i32 (...)* @native_asin to i32 (double, ...)*)(double %4)
%6 = sitofp i32 %5 to float
%7 = fmul float %6, 0x404CA5DC20000000
%8 = fpext float %7 to double
%9 = call double @fmod(double %8, double 3.600000e+02)
%10 = fptrunc double %9 to float
ret float %10
}

LLVM IR (-O2):
define float @asin(float %0) {
%2 = fpext float %0 to double
%3 = tail call i32 (double, ...) bitcast (i32 (...)* @native_asin to i32 (double, ...)*)(double %2)
%4 = sitofp i32 %3 to float
%5 = fmul float %4, 0x404CA5DC20000000
%6 = fpext float %5 to double
%7 = tail call double @fmod(double %6, double 3.600000e+02)
%8 = fptrunc double %7 to float
ret float %8
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int pthread_attr_getschedpolicy(const pthread_attr_t *a, int *b) { assert(0); }


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

x86 assembly (clang, -O2):
<pthread_attr_getschedpolicy>:
xor    %edi,%edi
jmp    1030 <assert@plt>

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

LLVM IR (-O2):
define i32 @pthread_attr_getschedpolicy(i32* nocapture readnone %0, i32* nocapture readnone %1) {
%3 = tail call i32 @assert(i32 0)
ret i32 undef
}
int nWithinLimits(int n, int low, int hi) {
  if (n < low)
    return low;
  else if (n > hi)
    return hi;
  return n;
}


x86 assembly (clang, -O0):
<nWithinLimits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1124 <nWithinLimits+0x24>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1146 <nWithinLimits+0x46>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    113b <nWithinLimits+0x3b>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1146 <nWithinLimits+0x46>
jmp    1140 <nWithinLimits+0x40>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nWithinLimits>:
mov    %edx,%eax
cmp    %edx,%edi
cmovle %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @nWithinLimits(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = icmp sgt i32 %0, %2
%6 = select i1 %5, i32 %2, i32 %0
%7 = select i1 %4, i32 %1, i32 %6
ret i32 %7
}
/* Variables and functions */
char *malloc(int);
int rand();
char *realloc(char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
char *fn25() {
  char *result;
  result = malloc(20 + rand() % 20);
  result = realloc(result, 30 + rand() % 20);
  strcpy((char *)result, "fn25");
  return result;
}


x86 assembly (clang, -O0):
<fn25>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
mov    -0x10(%rbp),%rdi
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
add    $0x1e,%esi
call   1050 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe67(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn25>:
push   %rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0x1e,%esi
mov    %rbx,%rdi
call   1050 <realloc@plt>
mov    %rax,%rbx
lea    0xe4f(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"fn25\00"
define i8* @fn25() {
%1 = alloca i8*
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 20
%4 = add nsw i32 20, %3
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %1
%6 = load i8*, i8** %1
%7 = call i32 (...) @rand()
%8 = srem i32 %7, 20
%9 = add nsw i32 30, %8
%10 = call i8* @realloc(i8* %6, i32 %9)
store i8* %10, i8** %1
%11 = load i8*, i8** %1
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%13 = load i8*, i8** %1
ret i8* %13
}

LLVM IR (-O2):
@.str = [5 x i8] c"fn25\00"
define i8* @fn25() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 20
%3 = add nsw i32 %2, 20
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, 20
%7 = add nsw i32 %6, 30
%8 = tail call i8* @realloc(i8* %4, i32 %7)
%9 = tail call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ mdaq_stream_dealloc(unsigned char);
void OutStreamTerminate(unsigned char stream_ch) {
  mdaq_stream_dealloc(stream_ch);
}


x86 assembly (clang, -O0):
<OutStreamTerminate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <mdaq_stream_dealloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OutStreamTerminate>:
jmp    1030 <mdaq_stream_dealloc@plt>

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

LLVM IR (-O2):
define void @OutStreamTerminate(i8 zeroext %0) {
%2 = tail call i32 @mdaq_stream_dealloc(i8 zeroext %0)
ret void
}
int main(argc, argv)
int argc;
char *argv[];
{
  int i = 42;
  tree_test();
  i++;
  list_test(i);
  i++;
  array_test();
  i++;
  type_test();
  --i;
  in_out_test();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x2a,-0x14(%rbp)
mov    $0x0,%al
call   1070 <tree_test@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    $0x0,%al
call   1040 <list_test@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1060 <array_test@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1030 <type_test@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1050 <in_out_test@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <tree_test@plt>
mov    $0x2b,%edi
xor    %eax,%eax
call   1040 <list_test@plt>
xor    %eax,%eax
call   1060 <array_test@plt>
xor    %eax,%eax
call   1030 <type_test@plt>
xor    %eax,%eax
call   1050 <in_out_test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 42, i32* %6
%7 = call i32 (...) @tree_test()
%8 = load i32, i32* %6
%9 = add nsw i32 %8, 1
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = call i32 (i32, ...) bitcast (i32 (...)* @list_test to i32 (i32, ...)*)(i32 %10)
%12 = load i32, i32* %6
%13 = add nsw i32 %12, 1
store i32 %13, i32* %6
%14 = call i32 (...) @array_test()
%15 = load i32, i32* %6
%16 = add nsw i32 %15, 1
store i32 %16, i32* %6
%17 = call i32 (...) @type_test()
%18 = load i32, i32* %6
%19 = add nsw i32 %18, -1
store i32 %19, i32* %6
%20 = call i32 (...) @in_out_test()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @tree_test()
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @list_test to i32 (i32, ...)*)(i32 43)
%5 = tail call i32 (...) @array_test()
%6 = tail call i32 (...) @type_test()
%7 = tail call i32 (...) @in_out_test()
ret i32 0
}
/* Variables and functions */
char *cat2(char *, char *);
char *cat3(char *str1, char *str2, char *str3) {
  return cat2(cat2(str1, str2), str3);
}


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

x86 assembly (clang, -O2):
<cat3>:
push   %rbx
mov    %rdx,%rbx
call   1030 <cat2@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <cat2@plt>

LLVM IR (-O0):
define i8* @cat3(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = call i8* @cat2(i8* %7, i8* %8)
%10 = load i8*, i8** %6
%11 = call i8* @cat2(i8* %9, i8* %10)
ret i8* %11
}

LLVM IR (-O2):
define i8* @cat3(i8* %0, i8* %1, i8* %2) {
%4 = tail call i8* @cat2(i8* %0, i8* %1)
%5 = tail call i8* @cat2(i8* %4, i8* %2)
ret i8* %5
}
void debug(char *msg, ...) {}


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

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

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

LLVM IR (-O2):
define void @debug(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int sumadeljivih(int, int);
int main(int argc, char *argv[]) {
  int n, d, i;
  scanf("%d %d", &n, &d);
  printf("sumadeljivih(%d, %d) = %d\n", n, d, sumadeljivih(n, d));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1050 <sumadeljivih@plt>
mov    -0x24(%rbp),%esi
mov    -0x20(%rbp),%edx
mov    %eax,%ecx
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xec6(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%ebx
mov    (%rsp),%ebp
mov    %ebx,%edi
mov    %ebp,%esi
call   1050 <sumadeljivih@plt>
lea    0xea8(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %eax,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [27 x i8] c"sumadeljivih(%d, %d) = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @sumadeljivih(i32 %8, i32 %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %8, i32 %9, i32 %10)
ret i32 0
}
int test_imm_B4int16_mem(short *val) {
  return ((*val) & (0xB4 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_B4int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 180
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
__attribute__((always_)) int queue_is_locked(struct request_queue *q) {
  return 1;
}


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

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

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

LLVM IR (-O2):
%struct.request_queue = type opaque
define i32 @queue_is_locked(%struct.request_queue* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int fixed_point_add(int, int /*<<< orphan*/);
int /*<<< orphan*/ int2fixed_point(int);
int fixed_point_add_mixed(int x, int n) {
  return fixed_point_add(x, int2fixed_point(n));
}


x86 assembly (clang, -O0):
<fixed_point_add_mixed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <int2fixed_point@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
call   1040 <fixed_point_add@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fixed_point_add_mixed>:
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
call   1030 <int2fixed_point@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <fixed_point_add@plt>

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

LLVM IR (-O2):
define i32 @fixed_point_add_mixed(i32 %0, i32 %1) {
%3 = tail call i32 @int2fixed_point(i32 %1)
%4 = tail call i32 @fixed_point_add(i32 %0, i32 %3)
ret i32 %4
}
int main(void) {
  int x = 5;
  float *p = (float *)&x;
  *p;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EFSM_efsmDebugTester_Init();
void EFSM_InitializeProcess() { EFSM_efsmDebugTester_Init(); }


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

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

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

LLVM IR (-O2):
define void @EFSM_InitializeProcess() {
%1 = tail call i32 (...) @EFSM_efsmDebugTester_Init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void pop(char *s) { printf("\tpop\t%%%s\n", s); }


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

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"\09pop\09%%%s\0A\00"
define void @pop(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int test_imm_02int8_reg(signed char val) {
  return ((val) & (0x02 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_02int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x2,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_02int8_reg>:
test   $0x2,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_02int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 2
%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_02int8_reg(i8 signext %0) {
%2 = and i8 %0, 2
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ send_freq_to_FT817(double);
void plugin_set_uplink_frequency(double frequency) {
  send_freq_to_FT817(frequency);
}


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

x86 assembly (clang, -O2):
<plugin_set_uplink_frequency>:
jmp    1030 <send_freq_to_FT817@plt>

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

LLVM IR (-O2):
define void @plugin_set_uplink_frequency(double %0) {
%2 = tail call i32 @send_freq_to_FT817(double %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error(char const *);
int /*<<< orphan*/ exit(int);
void panic(const char *s) {
  error(s);
  exit(1);
}


x86 assembly (clang, -O0):
<panic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <error@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<panic>:
push   %rax
call   1030 <error@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @panic(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @error(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @panic(i8* %0) {
%2 = tail call i32 @error(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
void cast_float_to_int_Good() {
  char arr[10];
  float x = 15.0;
  int32_t y = (int32_t)x;
  if (y < 10) {
    arr[y] = 0;
  }
}


x86 assembly (clang, -O0):
<cast_float_to_int_Good>:
push   %rbp
mov    %rsp,%rbp
movss  0xef4(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
cvttss2si -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    112c <cast_float_to_int_Good+0x2c>
movslq -0x14(%rbp),%rax
movb   $0x0,-0xa(%rbp,%rax,1)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @cast_float_to_int_Good() {
%1 = alloca [10 x i8]
%2 = alloca float
%3 = alloca i32
store float 1.500000e+01, float* %2
%4 = load float, float* %2
%5 = fptosi float %4 to i32
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 10
br i1 %7, label %8, label %12
8: ; preds = %0
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 %10
store i8 0, i8* %11
br label %12
12: ; preds = %8, %0
ret void
}

LLVM IR (-O2):
define void @cast_float_to_int_Good() {
ret void
}
/* Variables and functions */
int creat(char const *, int);
int create_file(const char *fileName, int pmode) {
  return creat(fileName, pmode);
}


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

x86 assembly (clang, -O2):
<create_file>:
jmp    1030 <creat@plt>

LLVM IR (-O0):
define i32 @create_file(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 @creat(i8* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @create_file(i8* %0, i32 %1) {
%3 = tail call i32 @creat(i8* %0, i32 %1)
ret i32 %3
}