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

/* Variables and functions */
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
int count_lines(FILE *infile) {
  char readline[80];
  int lines = 0;
  while (fgets(readline, 80, infile) != NULL)
    lines++;
  rewind(infile);
  return (lines);
}


x86 assembly (clang, -O0):
<count_lines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x64(%rbp)
lea    -0x60(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x50,%esi
call   1040 <fgets@plt>
cmp    $0x0,%rax
je     115d <count_lines+0x3d>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    1133 <count_lines+0x13>
mov    -0x8(%rbp),%rdi
call   1030 <rewind@plt>
mov    -0x64(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_lines>:
push   %r15
push   %r14
push   %rbx
sub    $0x50,%rsp
mov    %rdi,%r14
mov    $0xffffffff,%ebx
mov    %rsp,%r15
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r15,%rdi
mov    $0x50,%esi
mov    %r14,%rdx
call   1040 <fgets@plt>
add    $0x1,%ebx
test   %rax,%rax
jne    1140 <count_lines+0x20>
mov    %r14,%rdi
call   1030 <rewind@plt>
mov    %ebx,%eax
add    $0x50,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @count_lines(i32* %0) {
%2 = alloca i32*
%3 = alloca [80 x i8]
%4 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %4
br label %5
5: ; preds = %10, %1
%6 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%7 = load i32*, i32** %2
%8 = call i32* @fgets(i8* %6, i32 80, i32* %7)
%9 = icmp ne i32* %8, null
br i1 %9, label %10, label %13
10: ; preds = %5
%11 = load i32, i32* %4
%12 = add nsw i32 %11, 1
store i32 %12, i32* %4
br label %5
13: ; preds = %5
%14 = load i32*, i32** %2
%15 = call i32 @rewind(i32* %14)
%16 = load i32, i32* %4
ret i32 %16
}

LLVM IR (-O2):
define i32 @count_lines(i32* nocapture %0) {
%2 = alloca [80 x i8]
%3 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
br label %4
4: ; preds = %4, %1
%5 = phi i32 [ 0, %1 ], [ %8, %4 ]
%6 = call i32* @fgets(i8* %3, i32 80, i32* %0)
%7 = icmp eq i32* %6, null
%8 = add nuw nsw i32 %5, 1
br i1 %7, label %9, label %4
9: ; preds = %4
%10 = call i32 @rewind(i32* %0)
ret i32 %5
}
void free(void *ptr) {
  static int in_progress = 0;
  void __libc_free(void *ptr);
  if (in_progress)
    return;
  in_progress = 1;
  __libc_free(ptr);
  in_progress = 0;
}


x86 assembly (clang, -O0):
<free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpl   $0x0,0x2f09(%rip)
je     112e <free+0x1e>
jmp    114b <free+0x3b>
movl   $0x1,0x2ef4(%rip)
mov    -0x8(%rbp),%rdi
call   1030 <__libc_free@plt>
movl   $0x0,0x2ee1(%rip)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free>:
push   %rax
cmpb   $0x0,0x2f14(%rip)
jne    112d <free+0x1d>
movb   $0x1,0x2f0b(%rip)
call   1030 <__libc_free@plt>
movb   $0x0,0x2eff(%rip)
pop    %rax
ret

LLVM IR (-O0):
@free.in_progress = internal global i32 0
define void @free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @free.in_progress
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %8
6: ; preds = %1
store i32 1, i32* @free.in_progress
%7 = load i8*, i8** %2
store i32 0, i32* @free.in_progress
br label %8
8: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
@free.in_progress = internal unnamed_addr global i1 false
define void @free(i8* %0) {
%2 = load i1, i1* @free.in_progress
br i1 %2, label %4, label %3
3: ; preds = %1
store i1 true, i1* @free.in_progress
tail call void @__libc_free(i8* %0)
store i1 false, i1* @free.in_progress
br label %4
4: ; preds = %1, %3
ret void
}
void kfree(void const *addr) {
  { return; }
}


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

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

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

LLVM IR (-O2):
define void @kfree(i8* nocapture %0) {
ret void
}
__attribute__((weak)) void _init() {}


x86 assembly (clang, -O0):
<_init>:
endbr64
sub    $0x8,%rsp
mov    0x2fd9(%rip),%rax
test   %rax,%rax
je     1016 <_init+0x16>
call   *%rax
add    $0x8,%rsp
ret

x86 assembly (clang, -O2):
<_init>:
endbr64
sub    $0x8,%rsp
mov    0x2fd9(%rip),%rax
test   %rax,%rax
je     1016 <_init+0x16>
call   *%rax
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define weak void @_init() {
ret void
}
int trlang_shutdown(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @trlang_shutdown() {
ret i32 0
}
msm_panic_wdt_set(unsigned int timeout) {}


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

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

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

LLVM IR (-O2):
define i32 @msm_panic_wdt_set(i32 %0) {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
uint32_t sancus_u32zu(size_t v) {
  assert(v <= 0xffffffff);
  return (uint32_t)v;
}


x86 assembly (clang, -O0):
<sancus_u32zu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xffffffff,%eax
cmp    %rax,-0x8(%rbp)
setbe  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sancus_u32zu>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
mov    %rbx,%rax
shr    $0x20,%rax
sete   %dil
call   1030 <assert@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @sancus_u32zu(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ule i64 %3, 4294967295
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i64, i64* %2
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @sancus_u32zu(i64 %0) {
%2 = icmp ult i64 %0, 4294967296
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = trunc i64 %0 to i32
ret i32 %5
}
void gtk_file_filter_new() {}


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

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

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

LLVM IR (-O2):
define void @gtk_file_filter_new() {
ret void
}
void RTTestValueV(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTestValueV() {
ret void
}
/* Variables and functions */
int getfreeindex(size_t size) {
  return (((size / 8) < (512 - 1)) ? (size / 8) : (512 - 1));
}


x86 assembly (clang, -O0):
<getfreeindex>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x3,%rax
cmp    $0x1ff,%rax
jae    112d <getfreeindex+0x2d>
mov    -0x8(%rbp),%rax
shr    $0x3,%rax
mov    %rax,-0x10(%rbp)
jmp    113b <getfreeindex+0x3b>
mov    $0x1ff,%eax
mov    %rax,-0x10(%rbp)
jmp    113b <getfreeindex+0x3b>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getfreeindex>:
mov    %rdi,%rcx
shr    $0x3,%rcx
cmp    $0xff8,%rdi
mov    $0x1ff,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @getfreeindex(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = udiv i64 %3, 8
%5 = icmp ult i64 %4, 511
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i64, i64* %2
%8 = udiv i64 %7, 8
br label %10
9: ; preds = %1
br label %10
10: ; preds = %9, %6
%11 = phi i64 [ %8, %6 ], [ 511, %9 ]
%12 = trunc i64 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @getfreeindex(i64 %0) {
%2 = icmp ult i64 %0, 4088
%3 = lshr i64 %0, 3
%4 = trunc i64 %3 to i32
%5 = select i1 %2, i32 %4, i32 511
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sayHello() { printf("hello world\nNOOOOO!\nANOTHER!\n"); }


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"hello world\0ANOOOOO!\0AANOTHER!\0A\00"
define void @sayHello() {
%1 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [29 x i8] c"hello world\0ANOOOOO!\0AANOTHER!\00"
define void @sayHello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
char *key_to_string(uint64_t val) {
  static char msg[9];
  int j;
  for (j = 7; j > -1; j--) {
    msg[j] = (val >> (8 * (7 - j))) & 0xff;
  }
  msg[8] = 0;
  return msg;
}


x86 assembly (clang, -O0):
<key_to_string>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x7,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jle    114b <key_to_string+0x4b>
mov    -0x4(%rbp),%eax
mov    $0x7,%ecx
sub    -0x8(%rbp),%ecx
shl    $0x3,%ecx
sar    %cl,%eax
and    $0xff,%eax
mov    %al,%dl
movslq -0x8(%rbp),%rcx
lea    0x2ee7(%rip),%rax
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <key_to_string+0xe>
movb   $0x0,0x2ed7(%rip)
lea    0x2ec8(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<key_to_string>:
lea    0x2f1a(%rip),%rax
mov    %edi,%ecx
rol    $0x8,%cx
mov    %cx,0x2f13(%rip)
mov    %edi,%ecx
shr    $0x10,%ecx
mov    %cl,0x2f07(%rip)
shr    $0x18,%edi
mov    %dil,0x2efc(%rip)
movb   $0x0,0x2ef9(%rip)
ret

LLVM IR (-O0):
@key_to_string.msg = internal global [9 x i8] zeroinitializer
define i8* @key_to_string(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 7, i32* %3
br label %4
4: ; preds = %18, %1
%5 = load i32, i32* %3
%6 = icmp sgt i32 %5, -1
br i1 %6, label %7, label %21
7: ; preds = %4
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = sub nsw i32 7, %9
%11 = mul nsw i32 8, %10
%12 = ashr i32 %8, %11
%13 = and i32 %12, 255
%14 = trunc i32 %13 to i8
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [9 x i8], [9 x i8]* @key_to_string.msg, i64 0, i64 %16
store i8 %14, i8* %17
br label %18
18: ; preds = %7
%19 = load i32, i32* %3
%20 = add nsw i32 %19, -1
store i32 %20, i32* %3
br label %4
21: ; preds = %4
store i8 0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @key_to_string.msg, i64 0, i64 8)
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @key_to_string.msg, i64 0, i64 0)
}

LLVM IR (-O2):
@key_to_string.msg = internal global [9 x i8] zeroinitializer
define i8* @key_to_string(i32 %0) {
%2 = trunc i32 %0 to i8
store i8 %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @key_to_string.msg, i64 0, i64 7)
%3 = lshr i32 %0, 8
%4 = trunc i32 %3 to i8
store i8 %4, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @key_to_string.msg, i64 0, i64 6)
%5 = lshr i32 %0, 16
%6 = trunc i32 %5 to i8
store i8 %6, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @key_to_string.msg, i64 0, i64 5)
%7 = lshr i32 %0, 24
%8 = trunc i32 %7 to i8
store i8 %8, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @key_to_string.msg, i64 0, i64 4)
store i8 0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @key_to_string.msg, i64 0, i64 8)
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @key_to_string.msg, i64 0, i64 0)
}
void RTGetOptArgvToUtf16String(void) {}


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

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

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

LLVM IR (-O2):
define void @RTGetOptArgvToUtf16String() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ md_free_Fu();
int /*<<< orphan*/ md_free_K();
int /*<<< orphan*/ md_free_eqs();
void md_free_stuff(void) {
  md_free_Fu();
  md_free_K();
  md_free_eqs();
}


x86 assembly (clang, -O0):
<md_free_stuff>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <md_free_Fu@plt>
mov    $0x0,%al
call   1030 <md_free_K@plt>
mov    $0x0,%al
call   1050 <md_free_eqs@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<md_free_stuff>:
push   %rax
xor    %eax,%eax
call   1040 <md_free_Fu@plt>
xor    %eax,%eax
call   1030 <md_free_K@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <md_free_eqs@plt>

LLVM IR (-O0):
define void @md_free_stuff() {
%1 = call i32 (...) @md_free_Fu()
%2 = call i32 (...) @md_free_K()
%3 = call i32 (...) @md_free_eqs()
ret void
}

LLVM IR (-O2):
define void @md_free_stuff() {
%1 = tail call i32 (...) @md_free_Fu()
%2 = tail call i32 (...) @md_free_K()
%3 = tail call i32 (...) @md_free_eqs()
ret void
}
PHP_FUNCTION(connection_status) { RETURN_LONG(PG(connection_status)); }


x86 assembly (clang, -O0):
<PHP_FUNCTION>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1030 <PG@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1040 <RETURN_LONG@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PHP_FUNCTION>:
push   %rax
xor    %eax,%eax
call   1030 <PG@plt>
mov    %eax,%edi
xor    %eax,%eax
pop    %rcx
jmp    1040 <RETURN_LONG@plt>

LLVM IR (-O0):
define i32 @PHP_FUNCTION(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 (i32, ...) bitcast (i32 (...)* @PG to i32 (i32, ...)*)(i32 %4)
%6 = call i32 (i32, ...) bitcast (i32 (...)* @RETURN_LONG to i32 (i32, ...)*)(i32 %5)
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
define i32 @PHP_FUNCTION(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @PG to i32 (i32, ...)*)(i32 %0)
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @RETURN_LONG to i32 (i32, ...)*)(i32 %2)
ret i32 undef
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int apply_sign64(int, int const);
int iclip(int const, int, int);
long long llabs(int const);
int get_mult_shift_ndiag(const int64_t px, const int idet, const int shift) {
  const int64_t v1 = px * idet;
  const int v2 =
      apply_sign64((int)((llabs(v1) + ((1LL << shift) >> 1)) >> shift), v1);
  return iclip(v2, -0x1fff, 0x1fff);
}


x86 assembly (clang, -O0):
<get_mult_shift_ndiag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1040 <llabs@plt>
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%rdx
mov    %rdx,%rcx
sar    $0x1,%rcx
add    %rcx,%rax
mov    -0xc(%rbp),%ecx
sar    %cl,%rax
mov    %eax,%edi
mov    -0x10(%rbp),%esi
call   1050 <apply_sign64@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    $0xffffe001,%esi
mov    $0x1fff,%edx
call   1030 <iclip@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_mult_shift_ndiag>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%ebp
imul   %edi,%ebp
mov    %ebp,%edi
call   1040 <llabs@plt>
mov    $0x1,%edi
mov    %ebx,%ecx
shl    %cl,%rdi
sar    %rdi
add    %rax,%rdi
sar    %cl,%rdi
mov    %ebp,%esi
call   1050 <apply_sign64@plt>
mov    %eax,%edi
mov    $0xffffe001,%esi
mov    $0x1fff,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <iclip@plt>

LLVM IR (-O0):
define i32 @get_mult_shift_ndiag(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = mul nsw i32 %9, %10
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = call i64 @llabs(i32 %12)
%14 = load i32, i32* %6
%15 = zext i32 %14 to i64
%16 = shl i64 1, %15
%17 = ashr i64 %16, 1
%18 = add nsw i64 %13, %17
%19 = load i32, i32* %6
%20 = zext i32 %19 to i64
%21 = ashr i64 %18, %20
%22 = trunc i64 %21 to i32
%23 = load i32, i32* %7
%24 = call i32 @apply_sign64(i32 %22, i32 %23)
store i32 %24, i32* %8
%25 = load i32, i32* %8
%26 = call i32 @iclip(i32 %25, i32 -8191, i32 8191)
ret i32 %26
}

LLVM IR (-O2):
define i32 @get_mult_shift_ndiag(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %1, %0
%5 = tail call i64 @llabs(i32 %4)
%6 = zext i32 %2 to i64
%7 = shl nuw i64 1, %6
%8 = ashr i64 %7, 1
%9 = add nsw i64 %5, %8
%10 = ashr i64 %9, %6
%11 = trunc i64 %10 to i32
%12 = tail call i32 @apply_sign64(i32 %11, i32 %4)
%13 = tail call i32 @iclip(i32 %12, i32 -8191, i32 8191)
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void show_ver(void) {
  printf("Version.1.1.0\n");
  printf("Copyright(C)2009. Matayoshi.\n");
  exit(0);
}


x86 assembly (clang, -O0):
<show_ver>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<show_ver>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Version.1.1.0\0A\00"
@.str.1 = [30 x i8] c"Copyright(C)2009. Matayoshi.\0A\00"
define void @show_ver() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [14 x i8] c"Version.1.1.0\00"
@str.2 = [29 x i8] c"Copyright(C)2009. Matayoshi.\00"
define void @show_ver() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.2, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
void set_matrix_l(unsigned long **matrix, unsigned int x, unsigned int y,
                  unsigned long value) {
  (matrix[y])[x] = value;
}


x86 assembly (clang, -O0):
<set_matrix_l>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    (%rax,%rcx,8),%rax
mov    -0xc(%rbp),%ecx
mov    %rdx,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_matrix_l>:
mov    %edx,%eax
mov    (%rdi,%rax,8),%rax
mov    %esi,%edx
mov    %rcx,(%rax,%rdx,8)
ret

LLVM IR (-O0):
define void @set_matrix_l(i64** %0, i32 %1, i32 %2, i64 %3) {
%5 = alloca i64**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i64
store i64** %0, i64*** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i64 %3, i64* %8
%9 = load i64, i64* %8
%10 = load i64**, i64*** %5
%11 = load i32, i32* %7
%12 = zext i32 %11 to i64
%13 = getelementptr inbounds i64*, i64** %10, i64 %12
%14 = load i64*, i64** %13
%15 = load i32, i32* %6
%16 = zext i32 %15 to i64
%17 = getelementptr inbounds i64, i64* %14, i64 %16
store i64 %9, i64* %17
ret void
}

LLVM IR (-O2):
define void @set_matrix_l(i64** nocapture %0, i32 %1, i32 %2, i64 %3) {
%5 = zext i32 %2 to i64
%6 = getelementptr inbounds i64*, i64** %0, i64 %5
%7 = load i64*, i64** %6
%8 = zext i32 %1 to i64
%9 = getelementptr inbounds i64, i64* %7, i64 %8
store i64 %3, i64* %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f(int, int, ...);
int main() {
  f(1, 1);
  f(2, 2, 2);
  f(3, 3, 3, 3);
  f(1, 2);
  f(2, 3, 2);
  f(3, 4, 3, 3);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%esi
mov    %esi,%edi
mov    $0x0,%al
call   1030 <f@plt>
mov    $0x2,%edx
mov    %edx,%edi
mov    %edx,%esi
mov    $0x0,%al
call   1030 <f@plt>
mov    $0x3,%ecx
mov    %ecx,%edi
mov    %ecx,%esi
mov    %ecx,%edx
mov    $0x0,%al
call   1030 <f@plt>
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x0,%al
call   1030 <f@plt>
mov    $0x2,%edx
mov    $0x3,%esi
mov    %edx,%edi
mov    $0x0,%al
call   1030 <f@plt>
mov    $0x3,%ecx
mov    $0x4,%esi
mov    %ecx,%edi
mov    %ecx,%edx
mov    $0x0,%al
call   1030 <f@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <f@plt>
mov    $0x2,%edi
mov    $0x2,%esi
mov    $0x2,%edx
xor    %eax,%eax
call   1030 <f@plt>
mov    $0x3,%edi
mov    $0x3,%esi
mov    $0x3,%edx
mov    $0x3,%ecx
xor    %eax,%eax
call   1030 <f@plt>
mov    $0x1,%edi
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <f@plt>
mov    $0x2,%edi
mov    $0x3,%esi
mov    $0x2,%edx
xor    %eax,%eax
call   1030 <f@plt>
mov    $0x3,%edi
mov    $0x4,%esi
mov    $0x3,%edx
mov    $0x3,%ecx
xor    %eax,%eax
call   1030 <f@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (i32, i32, ...) @f(i32 1, i32 1)
%2 = call i32 (i32, i32, ...) @f(i32 2, i32 2, i32 2)
%3 = call i32 (i32, i32, ...) @f(i32 3, i32 3, i32 3, i32 3)
%4 = call i32 (i32, i32, ...) @f(i32 1, i32 2)
%5 = call i32 (i32, i32, ...) @f(i32 2, i32 3, i32 2)
%6 = call i32 (i32, i32, ...) @f(i32 3, i32 4, i32 3, i32 3)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (i32, i32, ...) @f(i32 1, i32 1)
%2 = tail call i32 (i32, i32, ...) @f(i32 2, i32 2, i32 2)
%3 = tail call i32 (i32, i32, ...) @f(i32 3, i32 3, i32 3, i32 3)
%4 = tail call i32 (i32, i32, ...) @f(i32 1, i32 2)
%5 = tail call i32 (i32, i32, ...) @f(i32 2, i32 3, i32 2)
%6 = tail call i32 (i32, i32, ...) @f(i32 3, i32 4, i32 3, i32 3)
ret i32 0
}
void motion_test11(int *data) {
  int p = data[1];
  int i = data[0];
  do {
    if (p)
      i = i + 1;
    else
      i = i + 2;
    data[data[2]] = 2;
  } while (i < data[3]);
}


x86 assembly (clang, -O0):
<motion_test11>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1133 <motion_test11+0x33>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113c <motion_test11+0x3c>
mov    -0x10(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq 0x8(%rcx),%rcx
movl   $0x2,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%rcx
cmp    0xc(%rcx),%eax
jl     111b <motion_test11+0x1b>
pop    %rbp
ret

x86 assembly (clang, -O2):
<motion_test11>:
cmpl   $0x1,0x4(%rdi)
mov    (%rdi),%eax
mov    $0x1,%ecx
adc    $0x0,%ecx
xchg   %ax,%ax
add    %ecx,%eax
movslq 0x8(%rdi),%rdx
movl   $0x2,(%rdi,%rdx,4)
cmp    0xc(%rdi),%eax
jl     1110 <motion_test11+0x10>
ret

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

LLVM IR (-O2):
define void @motion_test11(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
%4 = load i32, i32* %0
%5 = icmp eq i32 %3, 0
%6 = select i1 %5, i32 2, i32 1
%7 = getelementptr inbounds i32, i32* %0, i64 2
%8 = getelementptr inbounds i32, i32* %0, i64 3
br label %9
9: ; preds = %9, %1
%10 = phi i32 [ %4, %1 ], [ %11, %9 ]
%11 = add nsw i32 %10, %6
%12 = load i32, i32* %7
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %0, i64 %13
store i32 2, i32* %14
%15 = load i32, i32* %8
%16 = icmp slt i32 %11, %15
br i1 %16, label %9, label %17
17: ; preds = %9
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fwrite(unsigned char *, int, int, int /*<<< orphan*/ *);
int WritePriHdr(FILE *f, unsigned char *buf) {
  if (fwrite(buf, 6, 1, f) != 1)
    return (-1);
  return (0);
}


x86 assembly (clang, -O0):
<WritePriHdr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x6,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
cmp    $0x1,%eax
je     114c <WritePriHdr+0x3c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1153 <WritePriHdr+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WritePriHdr>:
push   %rax
mov    %rdi,%rcx
mov    %rsi,%rdi
mov    $0x6,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
setne  %cl
neg    %ecx
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @WritePriHdr(i32* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @fwrite(i8* %1, i32 6, i32 1, i32* %0)
%4 = icmp ne i32 %3, 1
%5 = sext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ _rdtsc();
int /*<<< orphan*/ _sync_tsc();
uint64_t bench_start(void) {
  _sync_tsc();
  return _rdtsc();
}


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

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

LLVM IR (-O0):
define i32 @bench_start() {
%1 = call i32 (...) @_sync_tsc()
%2 = call i32 (...) @_rdtsc()
ret i32 %2
}

LLVM IR (-O2):
define i32 @bench_start() {
%1 = tail call i32 (...) @_sync_tsc()
%2 = tail call i32 (...) @_rdtsc()
ret i32 %2
}
/* Type definitions */
struct rb_root {
  int dummy;
};
struct rb_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ rb_erase(struct rb_node *, struct rb_root *);
int /*<<< orphan*/ rb_init_node(struct rb_node *);
void rb_erase_init(struct rb_node *node, struct rb_root *root) {
  rb_erase(node, root);
  rb_init_node(node);
}


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

x86 assembly (clang, -O2):
<rb_erase_init>:
push   %rbx
mov    %rdi,%rbx
call   1040 <rb_erase@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <rb_init_node@plt>

LLVM IR (-O0):
%struct.rb_node = type { i32 }
%struct.rb_root = type { i32 }
define void @rb_erase_init(%struct.rb_node* %0, %struct.rb_root* %1) {
%3 = alloca %struct.rb_node*
%4 = alloca %struct.rb_root*
store %struct.rb_node* %0, %struct.rb_node** %3
store %struct.rb_root* %1, %struct.rb_root** %4
%5 = load %struct.rb_node*, %struct.rb_node** %3
%6 = load %struct.rb_root*, %struct.rb_root** %4
%7 = call i32 @rb_erase(%struct.rb_node* %5, %struct.rb_root* %6)
%8 = load %struct.rb_node*, %struct.rb_node** %3
%9 = call i32 @rb_init_node(%struct.rb_node* %8)
ret void
}

LLVM IR (-O2):
%struct.rb_node = type { i32 }
%struct.rb_root = type { i32 }
define void @rb_erase_init(%struct.rb_node* %0, %struct.rb_root* %1) {
%3 = tail call i32 @rb_erase(%struct.rb_node* %0, %struct.rb_root* %1)
%4 = tail call i32 @rb_init_node(%struct.rb_node* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_store_pd(double *, int /*<<< orphan*/);
void test_mm_store_pd(double *A, __m128d B) { _mm_store_pd(A, B); }


x86 assembly (clang, -O0):
<test_mm_store_pd>:
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 <_mm_store_pd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_mm_store_pd>:
jmp    1030 <_mm_store_pd@plt>

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

LLVM IR (-O2):
define void @test_mm_store_pd(double* %0, i32 %1) {
%3 = tail call i32 @_mm_store_pd(double* %0, i32 %1)
ret void
}
/* Variables and functions */
double **getData(char *, int, int);
void readInMiniData(double ***trainingData, int minTestPicNum) {
  char trainingDataPath[100] = "../../input/train.csv";
  int trainingPicNum = minTestPicNum;
  (*trainingData) = getData(trainingDataPath, trainingPicNum, 785);
}


x86 assembly (clang, -O0):
<readInMiniData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x70(%rbp),%rdi
lea    0xec3(%rip),%rsi
mov    $0x64,%edx
call   1040 <memcpy@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x74(%rbp)
lea    -0x70(%rbp),%rdi
mov    -0x74(%rbp),%esi
mov    $0x311,%edx
call   1030 <getData@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readInMiniData>:
push   %rbx
sub    $0x70,%rsp
mov    %rdi,%rbx
movaps 0xf31(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xf15(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xef9(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xedd(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xec1(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xea5(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x0,0x60(%rsp)
mov    %rsp,%rdi
mov    $0x311,%edx
call   1030 <getData@plt>
mov    %rax,(%rbx)
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.readInMiniData.trainingDataPath = [100 x i8] c"../../input/train.csv\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
define void @readInMiniData(double*** %0, i32 %1) {
%3 = alloca double***
%4 = alloca i32
%5 = alloca [100 x i8]
%6 = alloca i32
store double*** %0, double**** %3
store i32 %1, i32* %4
%7 = bitcast [100 x i8]* %5 to i8*
%8 = load i32, i32* %4
store i32 %8, i32* %6
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%10 = load i32, i32* %6
%11 = call double** @getData(i8* %9, i32 %10, i32 785)
%12 = load double***, double**** %3
store double** %11, double*** %12
ret void
}

LLVM IR (-O2):
@__const.readInMiniData.trainingDataPath = [100 x i8] c"../../input/train.csv\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
define void @readInMiniData(double*** nocapture writeonly %0, i32 %1) {
%3 = alloca [100 x i8]
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%5 = call double** @getData(i8* %4, i32 %1, i32 785)
store double** %5, double*** %0
ret void
}
/* Variables and functions */
scalar_t__ luaL_check_number(int);
int /*<<< orphan*/ srand(int);
void math_randomseed(void) { srand(((int)luaL_check_number(1))); }


x86 assembly (clang, -O0):
<math_randomseed>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <luaL_check_number@plt>
mov    %eax,%edi
call   1040 <srand@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<math_randomseed>:
push   %rax
mov    $0x1,%edi
call   1030 <luaL_check_number@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <srand@plt>

LLVM IR (-O0):
define void @math_randomseed() {
%1 = call i64 @luaL_check_number(i32 1)
%2 = trunc i64 %1 to i32
%3 = call i32 @srand(i32 %2)
ret void
}

LLVM IR (-O2):
define void @math_randomseed() {
%1 = tail call i64 @luaL_check_number(i32 1)
%2 = trunc i64 %1 to i32
%3 = tail call i32 @srand(i32 %2)
ret void
}
int chkspace(c)
int c;
{ return ((c == ' ') || (c == '\t')) ? 1 : 0; }


x86 assembly (clang, -O0):
<chkspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1120 <chkspace+0x20>
cmpl   $0x9,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chkspace>:
cmp    $0x20,%edi
sete   %al
cmp    $0x9,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @chkspace(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 32
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 9
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 1, i32 0
ret i32 %11
}

LLVM IR (-O2):
define i32 @chkspace(i32 %0) {
%2 = icmp eq i32 %0, 32
%3 = icmp eq i32 %0, 9
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
void xyz(void) {}


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

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

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

LLVM IR (-O2):
define void @xyz() {
ret void
}
/* Variables and functions */
char *strdup(char *);
char *unknown_comm(void) { return strdup("<unknown>"); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"<unknown>\00"
define i8* @unknown_comm() {
%1 = call i8* @strdup(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [10 x i8] c"<unknown>\00"
define noalias i8* @unknown_comm() {
%1 = tail call dereferenceable_or_null(10) i8* @strdup(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ GL_CULL_FACE;
int /*<<< orphan*/ GL_DEPTH_TEST;
int /*<<< orphan*/ build_lists();
int /*<<< orphan*/ glClearColor(double, double, double, double);
int /*<<< orphan*/ glEnable(int /*<<< orphan*/);
int /*<<< orphan*/ texture_init();
void init(void) {
  glEnable(GL_DEPTH_TEST);
  glEnable(GL_CULL_FACE);
  glClearColor(0.0, 0.0, 0.0, 1.0);
  build_lists();
  texture_init();
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
xorps  %xmm2,%xmm2
movsd  0xe95(%rip),%xmm3
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   1050 <glClearColor@plt>
mov    $0x0,%al
call   1040 <build_lists@plt>
mov    $0x0,%al
call   1060 <texture_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rax
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
movsd  0xe9b(%rip),%xmm3
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
call   1050 <glClearColor@plt>
xor    %eax,%eax
call   1040 <build_lists@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <texture_init@plt>

LLVM IR (-O0):
@GL_DEPTH_TEST = global i32 0
@GL_CULL_FACE = global i32 0
define void @init() {
%1 = load i32, i32* @GL_DEPTH_TEST
%2 = call i32 @glEnable(i32 %1)
%3 = load i32, i32* @GL_CULL_FACE
%4 = call i32 @glEnable(i32 %3)
%5 = call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 1.000000e+00)
%6 = call i32 (...) @build_lists()
%7 = call i32 (...) @texture_init()
ret void
}

LLVM IR (-O2):
@GL_DEPTH_TEST = global i32 0
@GL_CULL_FACE = global i32 0
define void @init() {
%1 = load i32, i32* @GL_DEPTH_TEST
%2 = tail call i32 @glEnable(i32 %1)
%3 = load i32, i32* @GL_CULL_FACE
%4 = tail call i32 @glEnable(i32 %3)
%5 = tail call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 1.000000e+00)
%6 = tail call i32 (...) @build_lists()
%7 = tail call i32 (...) @texture_init()
ret void
}
int raw_write_str(const char *s) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @raw_write_str(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int AppMain();
int main(void) { return AppMain(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @AppMain()
ret i32 %2
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @AppMain()
ret i32 %1
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ outb(int, int);
void pit_set_periodic_frequency(uint16_t freq) {
  int counter = (3579545 / 3) / freq;
  outb(0x43, 0x34);
  outb(0x40, counter & 0xFF);
  outb(0x40, counter >> 8);
}


x86 assembly (clang, -O0):
<pit_set_periodic_frequency>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1234dd,%eax
cltd
idivl  -0x4(%rbp)
mov    %eax,-0x8(%rbp)
mov    $0x43,%edi
mov    $0x34,%esi
call   1030 <outb@plt>
mov    -0x8(%rbp),%esi
and    $0xff,%esi
mov    $0x40,%edi
call   1030 <outb@plt>
mov    -0x8(%rbp),%esi
sar    $0x8,%esi
mov    $0x40,%edi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pit_set_periodic_frequency>:
push   %rbx
mov    $0x1234dd,%eax
xor    %edx,%edx
idiv   %edi
mov    %eax,%ebx
mov    $0x43,%edi
mov    $0x34,%esi
call   1030 <outb@plt>
movzbl %bl,%esi
mov    $0x40,%edi
call   1030 <outb@plt>
sar    $0x8,%ebx
mov    $0x40,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @pit_set_periodic_frequency(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sdiv i32 1193181, %4
store i32 %5, i32* %3
%6 = call i32 @outb(i32 67, i32 52)
%7 = load i32, i32* %3
%8 = and i32 %7, 255
%9 = call i32 @outb(i32 64, i32 %8)
%10 = load i32, i32* %3
%11 = ashr i32 %10, 8
%12 = call i32 @outb(i32 64, i32 %11)
ret void
}

LLVM IR (-O2):
define void @pit_set_periodic_frequency(i32 %0) {
%2 = sdiv i32 1193181, %0
%3 = tail call i32 @outb(i32 67, i32 52)
%4 = and i32 %2, 255
%5 = tail call i32 @outb(i32 64, i32 %4)
%6 = ashr i32 %2, 8
%7 = tail call i32 @outb(i32 64, i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *, int, char const *);
int /*<<< orphan*/ stderr;
void SchemeLogMeta(const char *file, const char *fn, int lineno,
                   const char *kind) {
  fprintf(stderr, "%s:%s:%d: (%s)", file, fn, lineno, kind);
}


x86 assembly (clang, -O0):
<SchemeLogMeta>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
mov    -0x20(%rbp),%r9
lea    0xeb9(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SchemeLogMeta>:
mov    %rcx,%r9
mov    %edx,%r8d
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
lea    0xed4(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"%s:%s:%d: (%s)\00"
define void @SchemeLogMeta(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %5
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load i8*, i8** %8
%14 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %11, i32 %12, i8* %13)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"%s:%s:%d: (%s)\00"
define void @SchemeLogMeta(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i32 %2, i8* %3)
ret void
}
/* Variables and functions */
int strlen(char *);
char *strtok(char *, char *);
int sindex(char *haystack, char *needle) {
  char *p = strtok(haystack, needle);
  if (p) {
    return strlen(p);
  }
  return -1;
}


x86 assembly (clang, -O0):
<sindex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strtok@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     115d <sindex+0x3d>
mov    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x4(%rbp)
jmp    1164 <sindex+0x44>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sindex>:
push   %rax
call   1040 <strtok@plt>
test   %rax,%rax
je     1134 <sindex+0x14>
mov    %rax,%rdi
pop    %rax
jmp    1030 <strlen@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @sindex(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strtok(i8* %0, i8* %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @strlen(i8* %3)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ -1, %2 ]
ret i32 %8
}
argtoi(flag, req, str, base) int flag;
char *req, *str;
int base;
{
  char *cp;
  int ret;
  ret = (int)strtol(str, &cp, base);
  if (cp == str || *cp)
    errexit("-%c flag requires a %s\n", flag, req);
  return (ret);
}


x86 assembly (clang, -O0):
<argtoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%edx
lea    -0x28(%rbp),%rsi
call   1040 <strtol@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x18(%rbp),%rax
je     1167 <argtoi+0x47>
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     117c <argtoi+0x5c>
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1030 <errexit@plt>
mov    -0x2c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<argtoi>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbp
mov    %rsi,%r14
mov    %edi,%r15d
mov    %rsp,%rsi
mov    %rdx,%rdi
mov    %ecx,%edx
call   1040 <strtol@plt>
mov    %rax,%rbx
mov    (%rsp),%rax
cmp    %rbp,%rax
je     114e <argtoi+0x2e>
cmpb   $0x0,(%rax)
je     1162 <argtoi+0x42>
lea    0xeab(%rip),%rdi
mov    %r15d,%esi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <errexit@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [24 x i8] c"-%c flag requires a %s\0A\00"
define i32 @argtoi(i32 %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i64 @strtol(i8* %11, i8** %9, i32 %12)
%14 = trunc i64 %13 to i32
store i32 %14, i32* %10
%15 = load i8*, i8** %9
%16 = load i8*, i8** %7
%17 = icmp eq i8* %15, %16
br i1 %17, label %23, label %18
18: ; preds = %4
%19 = load i8*, i8** %9
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp ne i32 %21, 0
br i1 %22, label %23, label %27
23: ; preds = %18, %4
%24 = load i32, i32* %5
%25 = load i8*, i8** %6
%26 = call i32 (i8*, i32, i8*, ...) bitcast (i32 (...)* @errexit to i32 (i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %24, i8* %25)
br label %27
27: ; preds = %23, %18
%28 = load i32, i32* %10
ret i32 %28
}

LLVM IR (-O2):
@.str = [24 x i8] c"-%c flag requires a %s\0A\00"
define i32 @argtoi(i32 %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = bitcast i8** %5 to i8*
%7 = call i64 @strtol(i8* %2, i8** %5, i32 %3)
%8 = load i8*, i8** %5
%9 = icmp eq i8* %8, %2
br i1 %9, label %13, label %10
10: ; preds = %4
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 0
br i1 %12, label %15, label %13
13: ; preds = %10, %4
%14 = tail call i32 (i8*, i32, i8*, ...) bitcast (i32 (...)* @errexit to i32 (i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
br label %15
15: ; preds = %13, %10
%16 = trunc i64 %7 to i32
ret i32 %16
}
int fun925() { return 925; }


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

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

LLVM IR (-O0):
define i32 @fun925() {
ret i32 925
}

LLVM IR (-O2):
define i32 @fun925() {
ret i32 925
}
unsigned addval_149(unsigned x) { return x + 3347664115U; }


x86 assembly (clang, -O0):
<addval_149>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xc7894cf3,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @addval_149(i32 %0) {
%2 = add i32 %0, -947303181
ret i32 %2
}
int configureAsAService(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @configureAsAService() {
ret i32 0
}