xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
char *now() {
  static char str[64];
  time_t epochsec = time(NULL);
  struct tm *proute;
  proute = localtime(&epochsec);
  strftime(str, 64, "%Y-%m-%d %H:%M:%S", proute);
  return str;
}


x86 assembly (clang, -O0):
<now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
lea    0x2ef4(%rip),%rdi
mov    $0x40,%esi
lea    0xe98(%rip),%rdx
call   1050 <strftime@plt>
lea    0x2edc(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<now>:
push   %rbx
sub    $0x10,%rsp
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <localtime@plt>
lea    0x2eff(%rip),%rbx
lea    0xea8(%rip),%rdx
mov    %rbx,%rdi
mov    $0x40,%esi
mov    %rax,%rcx
call   1050 <strftime@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@now.str = internal global [64 x i8] zeroinitializer
@.str = [18 x i8] c"%Y-%m-%d %H:%M:%S\00"
define i8* @now() {
%1 = alloca i32
%2 = alloca %struct.tm*
%3 = call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call %struct.tm* @localtime(i32* %1)
store %struct.tm* %4, %struct.tm** %2
%5 = load %struct.tm*, %struct.tm** %2
%6 = call i32 @strftime(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @now.str, i64 0, i64 0), i32 64, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), %struct.tm* %5)
ret i8* getelementptr inbounds ([64 x i8], [64 x i8]* @now.str, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@now.str = internal global [64 x i8] zeroinitializer
@.str = [18 x i8] c"%Y-%m-%d %H:%M:%S\00"
define i8* @now() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call %struct.tm* @localtime(i32* %1)
%5 = call i32 @strftime(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @now.str, i64 0, i64 0), i32 64, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), %struct.tm* %4)
ret i8* getelementptr inbounds ([64 x i8], [64 x i8]* @now.str, i64 0, i64 0)
}
const char *nepim_version() { return "0.55"; }


x86 assembly (clang, -O0):
<nepim_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [5 x i8] c"0.55\00"
define i8* @nepim_version() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [5 x i8] c"0.55\00"
define i8* @nepim_version() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int equeue_tickdiff(unsigned int, unsigned int);
int equeue_clampdiff(unsigned a, unsigned b) {
  int diff = equeue_tickdiff(a, b);
  return diff > 0 ? diff : 0;
}


x86 assembly (clang, -O0):
<equeue_clampdiff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <equeue_tickdiff@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1141 <equeue_clampdiff+0x31>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    114b <equeue_clampdiff+0x3b>
xor    %eax,%eax
mov    %eax,-0x10(%rbp)
jmp    114b <equeue_clampdiff+0x3b>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<equeue_clampdiff>:
push   %rax
call   1030 <equeue_tickdiff@plt>
xor    %ecx,%ecx
test   %eax,%eax
cmovs  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @equeue_clampdiff(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 @equeue_tickdiff(i32 %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = load i32, i32* %5
br label %14
13: ; preds = %2
br label %14
14: ; preds = %13, %11
%15 = phi i32 [ %12, %11 ], [ 0, %13 ]
ret i32 %15
}

LLVM IR (-O2):
define i32 @equeue_clampdiff(i32 %0, i32 %1) {
%3 = tail call i32 @equeue_tickdiff(i32 %0, i32 %1)
%4 = icmp sgt i32 %3, 0
%5 = select i1 %4, i32 %3, i32 0
ret i32 %5
}
void debugOff() {}


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

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

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

LLVM IR (-O2):
define void @debugOff() {
ret void
}
int main() {
  int x;
  int a;
  int b;
  if (x > 0) {
    x = a;
  } else {
    x = b;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1120 <main+0x20>
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x26>
mov    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int test_bit(int nr, const unsigned long *addr) { return 1UL & (*addr >> nr); }


x86 assembly (clang, -O0):
<test_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x4(%rbp),%ecx
shr    %cl,%rax
and    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_bit>:
mov    %edi,%ecx
mov    (%rsi),%rax
shr    %cl,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @test_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
store i32 %0, i32* %3
store i64* %1, i64** %4
%5 = load i64*, i64** %4
%6 = load i64, i64* %5
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
%9 = lshr i64 %6, %8
%10 = and i64 1, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @test_bit(i32 %0, i64* nocapture %1) {
%3 = load i64, i64* %1
%4 = zext i32 %0 to i64
%5 = lshr i64 %3, %4
%6 = trunc i64 %5 to i32
%7 = and i32 %6, 1
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
scalar_t__ ctime(int /*<<< orphan*/ const *);
char *sys_ctime(const time_t *t) {
  char *str = (char *)ctime(t);
  return (str ? str : (char *)"Sun Jan 01 00:00:00 1970");
}


x86 assembly (clang, -O0):
<sys_ctime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ctime@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1141 <sys_ctime+0x31>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1151 <sys_ctime+0x41>
lea    0xeb8(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1151 <sys_ctime+0x41>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_ctime>:
push   %rax
call   1030 <ctime@plt>
test   %rax,%rax
lea    0xee0(%rip),%rcx
cmove  %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Sun Jan 01 00:00:00 1970\00"
define i8* @sys_ctime(i32* %0) {
%2 = alloca i32*
%3 = alloca i8*
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i64 @ctime(i32* %4)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i8*, i8** %3
br label %12
11: ; preds = %1
br label %12
12: ; preds = %11, %9
%13 = phi i8* [ %10, %9 ], [ getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), %11 ]
ret i8* %13
}

LLVM IR (-O2):
@.str = [25 x i8] c"Sun Jan 01 00:00:00 1970\00"
define i8* @sys_ctime(i32* %0) {
%2 = tail call i64 @ctime(i32* %0)
%3 = inttoptr i64 %2 to i8*
%4 = icmp eq i64 %2, 0
%5 = select i1 %4, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ Put(char);
void *Producer() {
  int i;
  for (i = 0; i < 26; i++) {
    Put((char)('A' + i % 26));
  }
}


x86 assembly (clang, -O0):
<Producer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0xc(%rbp)
cmpl   $0x1a,-0xc(%rbp)
jge    114f <Producer+0x3f>
mov    -0xc(%rbp),%eax
mov    $0x1a,%ecx
cltd
idiv   %ecx
add    $0x41,%edx
mov    %dl,%al
movsbl %al,%edi
call   1030 <Put@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111f <Producer+0xf>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Producer>:
push   %rbp
push   %r14
push   %rbx
mov    $0x1a,%r14d
mov    $0x41,%bl
xor    %ebp,%ebp
xchg   %ax,%ax
movzbl %bpl,%ebp
imul   $0x4f,%ebp,%eax
shr    $0xb,%eax
lea    (%rax,%rax,4),%ecx
lea    (%rcx,%rcx,4),%ecx
add    %eax,%ecx
mov    %ebx,%eax
sub    %cl,%al
movsbl %al,%edi
call   1030 <Put@plt>
add    $0x1,%bl
add    $0x1,%bpl
add    $0xffffffff,%r14d
jne    1120 <Producer+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @Producer() {
%1 = alloca i8*
%2 = alloca i32
store i32 0, i32* %2
br label %3
3: ; preds = %12, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 26
br i1 %5, label %6, label %15
6: ; preds = %3
%7 = load i32, i32* %2
%8 = srem i32 %7, 26
%9 = add nsw i32 65, %8
%10 = trunc i32 %9 to i8
%11 = call i32 @Put(i8 signext %10)
br label %12
12: ; preds = %6
%13 = load i32, i32* %2
%14 = add nsw i32 %13, 1
store i32 %14, i32* %2
br label %3
15: ; preds = %3
%16 = load i8*, i8** %1
ret i8* %16
}

LLVM IR (-O2):
define noalias i8* @Producer() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %7, %1 ]
%3 = trunc i32 %2 to i8
%4 = urem i8 %3, 26
%5 = add nuw nsw i8 %4, 65
%6 = tail call i32 @Put(i8 signext %5)
%7 = add nuw nsw i32 %2, 1
%8 = icmp eq i32 %7, 26
br i1 %8, label %9, label %1
9: ; preds = %1
ret i8* undef
}
void init_random_dither(int line) { ; }


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

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

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

LLVM IR (-O2):
define void @init_random_dither(i32 %0) {
ret void
}
/* Variables and functions */
int isgraph(int);
bool invalidFunctionArgBool_isgraph(bool b, int c) {
  (void)isgraph(b);
  return isgraph(c != 0);
}


x86 assembly (clang, -O0):
<invalidFunctionArgBool_isgraph>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <isgraph@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<invalidFunctionArgBool_isgraph>:
xor    %edi,%edi
test   %esi,%esi
setne  %dil
jmp    1030 <isgraph@plt>

LLVM IR (-O0):
define i32 @invalidFunctionArgBool_isgraph(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 = call i32 @isgraph(i32 %5)
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i32
%10 = call i32 @isgraph(i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @invalidFunctionArgBool_isgraph(i32 %0, i32 %1) {
%3 = icmp ne i32 %1, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @isgraph(i32 %4)
ret i32 %5
}
char *langRomTypeEseRam256() { return "256kB Ese-RAM"; }


x86 assembly (clang, -O0):
<langRomTypeEseRam256>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"256kB Ese-RAM\00"
define i8* @langRomTypeEseRam256() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [14 x i8] c"256kB Ese-RAM\00"
define i8* @langRomTypeEseRam256() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}
int test_imm_2Auint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x2A << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_2Auint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 42
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
void quit_err(const char *s) {
  perror(s);
  exit(1);
}


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

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

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

LLVM IR (-O2):
define void @quit_err(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
int lqtvq_clamp2047(int x) { return ((x < 0) ? 0 : ((x > 2047) ? 2047 : x)); }


x86 assembly (clang, -O0):
<lqtvq_clamp2047>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111b <lqtvq_clamp2047+0x1b>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    1141 <lqtvq_clamp2047+0x41>
cmpl   $0x7ff,-0x4(%rbp)
jle    1135 <lqtvq_clamp2047+0x35>
mov    $0x7ff,%eax
mov    %eax,-0xc(%rbp)
jmp    113b <lqtvq_clamp2047+0x3b>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lqtvq_clamp2047>:
cmp    $0x7ff,%edi
mov    $0x7ff,%ecx
cmovl  %edi,%ecx
xor    %eax,%eax
test   %ecx,%ecx
cmovns %ecx,%eax
ret

LLVM IR (-O0):
define i32 @lqtvq_clamp2047(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %14
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp sgt i32 %7, 2047
br i1 %8, label %9, label %10
9: ; preds = %6
br label %12
10: ; preds = %6
%11 = load i32, i32* %2
br label %12
12: ; preds = %10, %9
%13 = phi i32 [ 2047, %9 ], [ %11, %10 ]
br label %14
14: ; preds = %12, %5
%15 = phi i32 [ 0, %5 ], [ %13, %12 ]
ret i32 %15
}

LLVM IR (-O2):
define i32 @lqtvq_clamp2047(i32 %0) {
%2 = icmp slt i32 %0, 2047
%3 = select i1 %2, i32 %0, i32 2047
%4 = icmp sgt i32 %3, 0
%5 = select i1 %4, i32 %3, i32 0
ret i32 %5
}
char *optParse(char **argx, int whatYouWant) {
  if (whatYouWant > 0) {
    return (argx[4]);
  } else {
    return (argx[2]);
  }
  return (argx[2]);
}


x86 assembly (clang, -O0):
<optParse>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    1126 <optParse+0x26>
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1132 <optParse+0x32>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<optParse>:
xor    %eax,%eax
test   %esi,%esi
setg   %al
shl    $0x4,%rax
mov    0x10(%rax,%rdi,1),%rax
ret

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

LLVM IR (-O2):
define i8* @optParse(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
%4 = select i1 %3, i64 4, i64 2
%5 = getelementptr inbounds i8*, i8** %0, i64 %4
%6 = load i8*, i8** %5
ret i8* %6
}
void function_priority(char *prior) {}


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

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

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

LLVM IR (-O2):
define void @function_priority(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int getc(int /*<<< orphan*/ *);
int /*<<< orphan*/ putc(int, int /*<<< orphan*/ *);
void file_copy(FILE *from, FILE *to) {
  int c;
  while ((c = getc(from)) != EOF)
    putc(c, to);
}


x86 assembly (clang, -O0):
<file_copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <getc@plt>
mov    %eax,-0x14(%rbp)
mov    0x2ea5(%rip),%rcx
cmp    (%rcx),%eax
je     115c <file_copy+0x3c>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <putc@plt>
jmp    1130 <file_copy+0x10>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_copy>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <getc@plt>
mov    0x2eb1(%rip),%r15
cmp    (%r15),%eax
je     1157 <file_copy+0x37>
nopl   0x0(%rax)
mov    %eax,%edi
mov    %r14,%rsi
call   1030 <putc@plt>
mov    %rbx,%rdi
call   1040 <getc@plt>
cmp    (%r15),%eax
jne    1140 <file_copy+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@EOF = global i32 0
define void @file_copy(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
br label %6
6: ; preds = %11, %2
%7 = load i32*, i32** %3
%8 = call i32 @getc(i32* %7)
store i32 %8, i32* %5
%9 = load i32, i32* @EOF
%10 = icmp ne i32 %8, %9
br i1 %10, label %11, label %15
11: ; preds = %6
%12 = load i32, i32* %5
%13 = load i32*, i32** %4
%14 = call i32 @putc(i32 %12, i32* %13)
br label %6
15: ; preds = %6
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
define void @file_copy(i32* nocapture %0, i32* nocapture %1) {
%3 = tail call i32 @getc(i32* %0)
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %12, label %6
6: ; preds = %2, %6
%7 = phi i32 [ %9, %6 ], [ %3, %2 ]
%8 = tail call i32 @putc(i32 %7, i32* %1)
%9 = tail call i32 @getc(i32* %0)
%10 = load i32, i32* @EOF
%11 = icmp eq i32 %9, %10
br i1 %11, label %12, label %6
12: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ BNCIO(int);
long int BNCFieldLeft() {
  long int stat = 99;
  BNCIO(40);
  return (stat);
}


x86 assembly (clang, -O0):
<BNCFieldLeft>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x63,-0x8(%rbp)
mov    $0x28,%edi
call   1030 <BNCIO@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BNCFieldLeft>:
push   %rax
mov    $0x28,%edi
call   1030 <BNCIO@plt>
mov    $0x63,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @BNCFieldLeft() {
%1 = alloca i64
store i64 99, i64* %1
%2 = call i32 @BNCIO(i32 40)
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @BNCFieldLeft() {
%1 = tail call i32 @BNCIO(i32 40)
ret i64 99
}
/* Variables and functions */
int foo();
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  printf("%d\n", foo());
  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)
mov    $0x0,%al
call   1040 <foo@plt>
mov    %eax,%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\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 (...) @foo()
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @foo()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EOPNOTSUPP;
int /*<<< orphan*/ errno;
int get_reuseaddr(int fd, void *optval, int *optlen) {
  errno = EOPNOTSUPP;
  return -1;
}


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

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

LLVM IR (-O0):
@EOPNOTSUPP = global i32 0
@errno = global i32 0
define i32 @get_reuseaddr(i32 %0, i8* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32* %2, i32** %6
%7 = load i32, i32* @EOPNOTSUPP
store i32 %7, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EOPNOTSUPP = global i32 0
@errno = global i32 0
define i32 @get_reuseaddr(i32 %0, i8* nocapture readnone %1, i32* nocapture readnone %2) {
%4 = load i32, i32* @EOPNOTSUPP
store i32 %4, i32* @errno
ret i32 -1
}
float vec2_norm2(const float a[2]) { return vec2_dot(a, a); }


x86 assembly (clang, -O0):
<vec2_norm2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1030 <vec2_dot@plt>
cvtsi2ss %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec2_norm2>:
push   %rax
mov    %rdi,%rsi
xor    %eax,%eax
call   1030 <vec2_dot@plt>
cvtsi2ss %eax,%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
define float @vec2_norm2(float* %0) {
%2 = tail call i32 (float*, float*, ...) bitcast (i32 (...)* @vec2_dot to i32 (float*, float*, ...)*)(float* %0, float* %0)
%3 = sitofp i32 %2 to float
ret float %3
}
/* Variables and functions */
int signed_range(int, int);
void test_narrow_vflow(void) {
  int i = signed_range((0x7fffffffffffffffL - 2), (0x7fffffffffffffffL));
  int j = signed_range((1), (0x7fffffffffffffffL));
  const char *p0 = "123";
  const char *p1 = p0 + i;
  const char *p2 = p1 + i;
  const char *p3 = p2 + i;
  const char *p4 = p3 + i;
}


x86 assembly (clang, -O0):
<test_narrow_vflow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    $0xfffffffd,%edi
mov    $0xffffffff,%esi
call   1030 <signed_range@plt>
mov    %eax,-0x4(%rbp)
mov    $0x1,%edi
mov    $0xffffffff,%esi
call   1030 <signed_range@plt>
mov    %eax,-0x8(%rbp)
lea    0xebd(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x4(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x4(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x4(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x30(%rbp)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_narrow_vflow>:
push   %rax
mov    $0xfffffffd,%edi
mov    $0xffffffff,%esi
call   1030 <signed_range@plt>
mov    $0x1,%edi
mov    $0xffffffff,%esi
pop    %rax
jmp    1030 <signed_range@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"123\00"
define void @test_narrow_vflow() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = call i32 @signed_range(i32 -3, i32 -1)
store i32 %8, i32* %1
%9 = call i32 @signed_range(i32 1, i32 -1)
store i32 %9, i32* %2
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %3
%10 = load i8*, i8** %3
%11 = load i32, i32* %1
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %10, i64 %12
store i8* %13, i8** %4
%14 = load i8*, i8** %4
%15 = load i32, i32* %1
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
store i8* %17, i8** %5
%18 = load i8*, i8** %5
%19 = load i32, i32* %1
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %18, i64 %20
store i8* %21, i8** %6
%22 = load i8*, i8** %6
%23 = load i32, i32* %1
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %22, i64 %24
store i8* %25, i8** %7
ret void
}

LLVM IR (-O2):
define void @test_narrow_vflow() {
%1 = tail call i32 @signed_range(i32 -3, i32 -1)
%2 = tail call i32 @signed_range(i32 1, i32 -1)
ret void
}
void function(int a, int b) { int array[5]; }


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

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

LLVM IR (-O0):
define void @function(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [5 x i32]
store i32 %0, i32* %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @function(i32 %0, i32 %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                          int);
uint64_t _wyr4(const uint8_t *p) {
  uint32_t v;
  memcpy(&v, p, 4);
  return v;
}


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

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

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

LLVM IR (-O2):
define i32 @_wyr4(i32* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @memcpy(i32* %2, i32* %0, i32 4)
%5 = load i32, i32* %2
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
int /*<<< orphan*/ False;
unsigned int get_time_resource(int /*<<< orphan*/ *, char *, char *,
                               int /*<<< orphan*/);
unsigned int get_minutes_resource(Display *dpy, char *res_name,
                                  char *res_class) {
  return get_time_resource(dpy, res_name, res_class, False);
}


x86 assembly (clang, -O0):
<get_minutes_resource>:
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
mov    -0x18(%rbp),%rdx
mov    0x2eb1(%rip),%rax
mov    (%rax),%ecx
call   1030 <get_time_resource@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_minutes_resource>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%ecx
jmp    1030 <get_time_resource@plt>

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

LLVM IR (-O2):
@False = global i32 0
define i32 @get_minutes_resource(i32* %0, i8* %1, i8* %2) {
%4 = load i32, i32* @False
%5 = tail call i32 @get_time_resource(i32* %0, i8* %1, i8* %2, i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void syntax_error(void) {
  fprintf(stderr, "syntax: elf2flt [-s stacksize] -o outputfile inputfile\n");
  exit(1);
}


x86 assembly (clang, -O0):
<syntax_error>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<syntax_error>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [56 x i8] c"syntax: elf2flt [-s stacksize] -o outputfile inputfile\0A\00"
define void @syntax_error() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [56 x i8] c"syntax: elf2flt [-s stacksize] -o outputfile inputfile\0A\00"
define void @syntax_error() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
void firstExtern(void) {}


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

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

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

LLVM IR (-O2):
define void @firstExtern() {
ret void
}
void *nextFixedValue(void *env) {}


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

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

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

LLVM IR (-O2):
define noalias i8* @nextFixedValue(i8* nocapture readnone %0) {
ret i8* undef
}
void fadein(unsigned char *light, unsigned char incr, unsigned char ending) {
  if ((*light + incr) >= ending)
    *light = ending;
  else
    (*light) += incr;
}


x86 assembly (clang, -O0):
<fadein>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
add    %ecx,%eax
movzbl -0xa(%rbp),%ecx
cmp    %ecx,%eax
jl     113a <fadein+0x3a>
mov    -0xa(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
jmp    1149 <fadein+0x49>
movzbl -0x9(%rbp),%edx
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
add    %edx,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fadein>:
movzbl (%rdi),%eax
add    %esi,%eax
cmp    %edx,%eax
cmovae %edx,%eax
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @fadein(i8* %0, i8 zeroext %1, i8 zeroext %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* %7
%9 = zext i8 %8 to i32
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = add nsw i32 %9, %11
%13 = load i8, i8* %6
%14 = zext i8 %13 to i32
%15 = icmp sge i32 %12, %14
br i1 %15, label %16, label %19
16: ; preds = %3
%17 = load i8, i8* %6
%18 = load i8*, i8** %4
store i8 %17, i8* %18
br label %27
19: ; preds = %3
%20 = load i8, i8* %5
%21 = zext i8 %20 to i32
%22 = load i8*, i8** %4
%23 = load i8, i8* %22
%24 = zext i8 %23 to i32
%25 = add nsw i32 %24, %21
%26 = trunc i32 %25 to i8
store i8 %26, i8* %22
br label %27
27: ; preds = %19, %16
ret void
}

LLVM IR (-O2):
define void @fadein(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = zext i8 %4 to i32
%6 = zext i8 %1 to i32
%7 = add nuw nsw i32 %5, %6
%8 = zext i8 %2 to i32
%9 = icmp ult i32 %7, %8
%10 = trunc i32 %7 to i8
%11 = select i1 %9, i8 %10, i8 %2
store i8 %11, i8* %0
ret void
}
void test27(void) {
  double a;
  for (a = 0.0; a < 10.0; ++a) {
  }
}


x86 assembly (clang, -O0):
<test27>:
push   %rbp
mov    %rsp,%rbp
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xeec(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    113b <test27+0x3b>
jmp    1124 <test27+0x24>
movsd  0xedc(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    110c <test27+0xc>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test27() {
%1 = alloca double
store double 0.000000e+00, double* %1
br label %2
2: ; preds = %6, %0
%3 = load double, double* %1
%4 = fcmp olt double %3, 1.000000e+01
br i1 %4, label %5, label %9
5: ; preds = %2
br label %6
6: ; preds = %5
%7 = load double, double* %1
%8 = fadd double %7, 1.000000e+00
store double %8, double* %1
br label %2
9: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @test27() {
ret void
}
/* Variables and functions */
char *tokenParser(char *, char *, int, char *);
char *refseqParser(char *header) {
  return tokenParser(header, "|", 3, "refseqParser");
  return NULL;
}


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

x86 assembly (clang, -O2):
<refseqParser>:
lea    0xee9(%rip),%rsi
lea    0xee4(%rip),%rcx
mov    $0x3,%edx
jmp    1030 <tokenParser@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"|\00"
@.str.1 = [13 x i8] c"refseqParser\00"
define i8* @refseqParser(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @tokenParser(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret i8* %4
}

LLVM IR (-O2):
@.str = [2 x i8] c"|\00"
@.str.1 = [13 x i8] c"refseqParser\00"
define i8* @refseqParser(i8* %0) {
%2 = tail call i8* @tokenParser(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ MADV_MERGEABLE;
int errno;
scalar_t__ madvise(void *, size_t, int /*<<< orphan*/);
void madvmerge_madvise_mergeable_page_aligned(void *aligned, size_t size) {
  int error = errno;
  if (size != 0 && madvise(aligned, size, MADV_MERGEABLE) != 0)
    do {
    } while (0);
  errno = error;
}


x86 assembly (clang, -O0):
<madvmerge_madvise_mergeable_page_aligned>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1166 <madvmerge_madvise_mergeable_page_aligned+0x56>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2e92(%rip),%rax
mov    (%rax),%edx
call   1030 <madvise@plt>
cmp    $0x0,%rax
je     1166 <madvmerge_madvise_mergeable_page_aligned+0x56>
jmp    115c <madvmerge_madvise_mergeable_page_aligned+0x4c>
jmp    1161 <madvmerge_madvise_mergeable_page_aligned+0x51>
jmp    1166 <madvmerge_madvise_mergeable_page_aligned+0x56>
mov    -0x14(%rbp),%ecx
mov    0x2e70(%rip),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<madvmerge_madvise_mergeable_page_aligned>:
push   %rbp
push   %rbx
push   %rax
mov    0x2ec6(%rip),%rbx
mov    (%rbx),%ebp
test   %rsi,%rsi
je     112f <madvmerge_madvise_mergeable_page_aligned+0x1f>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edx
call   1030 <madvise@plt>
mov    %ebp,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i32 0
@MADV_MERGEABLE = global i32 0
define void @madvmerge_madvise_mergeable_page_aligned(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i32, i32* @errno
store i32 %6, i32* %5
%7 = load i64, i64* %4
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %18
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = load i64, i64* %4
%12 = load i32, i32* @MADV_MERGEABLE
%13 = call i64 @madvise(i8* %10, i64 %11, i32 %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %9
br label %16
16: ; preds = %15
br label %17
17: ; preds = %16
br label %18
18: ; preds = %17, %9, %2
%19 = load i32, i32* %5
store i32 %19, i32* @errno
ret void
}

LLVM IR (-O2):
@errno = global i32 0
@MADV_MERGEABLE = global i32 0
define void @madvmerge_madvise_mergeable_page_aligned(i8* %0, i64 %1) {
%3 = load i32, i32* @errno
%4 = icmp eq i64 %1, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = load i32, i32* @MADV_MERGEABLE
%7 = tail call i64 @madvise(i8* %0, i64 %1, i32 %6)
br label %8
8: ; preds = %5, %2
store i32 %3, i32* @errno
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_tagstruct_get_timeval() {
  printf("NOT IMPLEMENTED:"
         "pa_tagstruct_get_timeval"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [42 x i8] c"NOT IMPLEMENTED:pa_tagstruct_get_timeval\0A\00"
define i32 @pa_tagstruct_get_timeval() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [41 x i8] c"NOT IMPLEMENTED:pa_tagstruct_get_timeval\00"
define i32 @pa_tagstruct_get_timeval() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void addvv(float *result, const float *s1) {
  result[0] += s1[0];
  result[1] += s1[1];
  result[2] += s1[2];
}


x86 assembly (clang, -O0):
<addvv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
addss  (%rax),%xmm0
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
addss  0x4(%rax),%xmm0
movss  %xmm0,0x4(%rax)
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
addss  0x8(%rax),%xmm0
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<addvv>:
movss  (%rsi),%xmm0
addss  (%rdi),%xmm0
movss  %xmm0,(%rdi)
movss  0x4(%rsi),%xmm0
addss  0x4(%rdi),%xmm0
movss  %xmm0,0x4(%rdi)
movss  0x8(%rsi),%xmm0
addss  0x8(%rdi),%xmm0
movss  %xmm0,0x8(%rdi)
ret

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

LLVM IR (-O2):
define void @addvv(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = load float, float* %0
%5 = fadd float %3, %4
store float %5, float* %0
%6 = getelementptr inbounds float, float* %1, i64 1
%7 = load float, float* %6
%8 = getelementptr inbounds float, float* %0, i64 1
%9 = load float, float* %8
%10 = fadd float %7, %9
store float %10, float* %8
%11 = getelementptr inbounds float, float* %1, i64 2
%12 = load float, float* %11
%13 = getelementptr inbounds float, float* %0, i64 2
%14 = load float, float* %13
%15 = fadd float %12, %14
store float %15, float* %13
ret void
}
double _snp_pow10(int exp) {
  double result = 1;
  while (exp) {
    result *= 10;
    exp--;
  }
  return result;
}


x86 assembly (clang, -O0):
<_snp_pow10>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movsd  0xef1(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     113e <_snp_pow10+0x3e>
movsd  0xee2(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    1114 <_snp_pow10+0x14>
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_snp_pow10>:
test   %edi,%edi
je     1134 <_snp_pow10+0x34>
lea    -0x1(%rdi),%eax
mov    %edi,%ecx
and    $0x7,%ecx
je     113d <_snp_pow10+0x3d>
xor    %edx,%edx
movsd  0xee8(%rip),%xmm0
movsd  0xee8(%rip),%xmm1
mulsd  %xmm1,%xmm0
add    $0x1,%edx
cmp    %edx,%ecx
jne    1120 <_snp_pow10+0x20>
sub    %edx,%edi
cmp    $0x7,%eax
jae    114a <_snp_pow10+0x4a>
jmp    1185 <_snp_pow10+0x85>
movsd  0xec4(%rip),%xmm0
ret
movsd  0xebb(%rip),%xmm0
cmp    $0x7,%eax
jb     1185 <_snp_pow10+0x85>
movsd  0xeb6(%rip),%xmm1
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
add    $0xfffffff8,%edi
jne    1160 <_snp_pow10+0x60>
ret

LLVM IR (-O0):
define double @_snp_pow10(i32 %0) {
%2 = alloca i32
%3 = alloca double
store i32 %0, i32* %2
store double 1.000000e+00, double* %3
br label %4
4: ; preds = %7, %1
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = load double, double* %3
%9 = fmul double %8, 1.000000e+01
store double %9, double* %3
%10 = load i32, i32* %2
%11 = add nsw i32 %10, -1
store i32 %11, i32* %2
br label %4
12: ; preds = %4
%13 = load double, double* %3
ret double %13
}

LLVM IR (-O2):
define double @_snp_pow10(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %33, label %3
3: ; preds = %1
%4 = add i32 %0, -1
%5 = and i32 %0, 7
%6 = icmp eq i32 %5, 0
br i1 %6, label %15, label %7
7: ; preds = %3, %7
%8 = phi double [ %11, %7 ], [ 1.000000e+00, %3 ]
%9 = phi i32 [ %12, %7 ], [ %0, %3 ]
%10 = phi i32 [ %13, %7 ], [ 0, %3 ]
%11 = fmul double %8, 1.000000e+01
%12 = add nsw i32 %9, -1
%13 = add i32 %10, 1
%14 = icmp eq i32 %13, %5
br i1 %14, label %15, label %7
15: ; preds = %7, %3
%16 = phi double [ undef, %3 ], [ %11, %7 ]
%17 = phi double [ 1.000000e+00, %3 ], [ %11, %7 ]
%18 = phi i32 [ %0, %3 ], [ %12, %7 ]
%19 = icmp ult i32 %4, 7
br i1 %19, label %33, label %20
20: ; preds = %15, %20
%21 = phi double [ %30, %20 ], [ %17, %15 ]
%22 = phi i32 [ %31, %20 ], [ %18, %15 ]
%23 = fmul double %21, 1.000000e+01
%24 = fmul double %23, 1.000000e+01
%25 = fmul double %24, 1.000000e+01
%26 = fmul double %25, 1.000000e+01
%27 = fmul double %26, 1.000000e+01
%28 = fmul double %27, 1.000000e+01
%29 = fmul double %28, 1.000000e+01
%30 = fmul double %29, 1.000000e+01
%31 = add nsw i32 %22, -8
%32 = icmp eq i32 %31, 0
br i1 %32, label %33, label %20
33: ; preds = %15, %20, %1
%34 = phi double [ 1.000000e+00, %1 ], [ %16, %15 ], [ %30, %20 ]
ret double %34
}
int test_imm_47int8_mem(signed char *val) {
  return ((*val) & (-0x47 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_47int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, -71
%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_47int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -71
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
float tml_sr_vMinExt(float const *, int, int *);
float tml_sr_vMin(const float *vec, int n) {
  int index;
  return tml_sr_vMinExt(vec, n, &index);
}


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

x86 assembly (clang, -O2):
<tml_sr_vMin>:
push   %rax
lea    0x4(%rsp),%rdx
call   1030 <tml_sr_vMinExt@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define float @tml_sr_vMin(float* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call float @tml_sr_vMinExt(float* %0, i32 %1, i32* %3)
ret float %5
}
__typeof__(mempcpy(1, 1, (void *)1)) test_mempcpy_122(void) {
  return mempcpy(1, 1, (void *)1);
}


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

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

LLVM IR (-O0):
define i8* @test_mempcpy_122() {
ret i8* getelementptr inbounds (i8, i8* inttoptr (i64 1 to i8*), i64 1)
}

LLVM IR (-O2):
define i8* @test_mempcpy_122() {
ret i8* inttoptr (i64 2 to i8*)
}
char *slash_prompt() { return "SLASH > "; }


x86 assembly (clang, -O0):
<slash_prompt>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [9 x i8] c"SLASH > \00"
define i8* @slash_prompt() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [9 x i8] c"SLASH > \00"
define i8* @slash_prompt() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void unload(void) { exit(EXIT_SUCCESS); }


x86 assembly (clang, -O0):
<unload>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<unload>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define void @unload() {
%1 = load i32, i32* @EXIT_SUCCESS
%2 = call i32 @exit(i32 %1)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define void @unload() {
%1 = load i32, i32* @EXIT_SUCCESS
%2 = tail call i32 @exit(i32 %1)
unreachable
}
char *get_word(void *cell) { return (char *)cell + sizeof(void *); }


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

x86 assembly (clang, -O2):
<get_word>:
lea    0x8(%rdi),%rax
ret

LLVM IR (-O0):
define i8* @get_word(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 8
ret i8* %4
}

LLVM IR (-O2):
define i8* @get_word(i8* readnone %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 8
ret i8* %2
}