xunge/DecIR huggingface dataset:
/* Variables and functions */
int soma(int *inteiros, size_t quantos) { return 0; }


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

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

LLVM IR (-O0):
define i32 @soma(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @soma(i32* nocapture readnone %0, i64 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *malloc(size_t);
void *MALLOC(size_t size) {
  void *ptr = NULL;
  if (size > 0) {
    ptr = malloc(size);
    if (NULL == ptr) {
      abort();
    }
  }
  return ptr;
}


x86 assembly (clang, -O0):
<MALLOC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jbe    1164 <MALLOC+0x44>
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    115f <MALLOC+0x3f>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    1164 <MALLOC+0x44>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MALLOC>:
push   %rax
test   %rdi,%rdi
je     1132 <MALLOC+0x12>
call   1040 <malloc@plt>
test   %rax,%rax
je     1136 <MALLOC+0x16>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @MALLOC(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
store i8* null, i8** %3
%4 = load i64, i64* %2
%5 = icmp ugt i64 %4, 0
br i1 %5, label %6, label %14
6: ; preds = %1
%7 = load i64, i64* %2
%8 = call i8* @malloc(i64 %7)
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = icmp eq i8* null, %9
br i1 %10, label %11, label %13
11: ; preds = %6
%12 = call i32 (...) @abort()
unreachable
13: ; preds = %6
br label %14
14: ; preds = %13, %1
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
define noalias i8* @MALLOC(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i8* @malloc(i64 %0)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %3, %1
%9 = phi i8* [ %4, %3 ], [ null, %1 ]
ret i8* %9
}
void vscale(float *v, float div) {
  v[0] *= div;
  v[1] *= div;
  v[2] *= div;
}


x86 assembly (clang, -O0):
<vscale>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulss  (%rax),%xmm0
movss  %xmm0,(%rax)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulss  0x4(%rax),%xmm0
movss  %xmm0,0x4(%rax)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulss  0x8(%rax),%xmm0
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vscale>:
movss  (%rdi),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,(%rdi)
movss  0x4(%rdi),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,0x4(%rdi)
mulss  0x8(%rdi),%xmm0
movss  %xmm0,0x8(%rdi)
ret

LLVM IR (-O0):
define void @vscale(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 = load float*, float** %3
%7 = getelementptr inbounds float, float* %6, i64 0
%8 = load float, float* %7
%9 = fmul float %8, %5
store float %9, float* %7
%10 = load float, float* %4
%11 = load float*, float** %3
%12 = getelementptr inbounds float, float* %11, i64 1
%13 = load float, float* %12
%14 = fmul float %13, %10
store float %14, float* %12
%15 = load float, float* %4
%16 = load float*, float** %3
%17 = getelementptr inbounds float, float* %16, i64 2
%18 = load float, float* %17
%19 = fmul float %18, %15
store float %19, float* %17
ret void
}

LLVM IR (-O2):
define void @vscale(float* nocapture %0, float %1) {
%3 = load float, float* %0
%4 = fmul float %3, %1
store float %4, float* %0
%5 = getelementptr inbounds float, float* %0, i64 1
%6 = load float, float* %5
%7 = fmul float %6, %1
store float %7, float* %5
%8 = getelementptr inbounds float, float* %0, i64 2
%9 = load float, float* %8
%10 = fmul float %9, %1
store float %10, float* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/);
int /*<<< orphan*/ malloc(int);
void zero(int size) { free(malloc(size)); }


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

x86 assembly (clang, -O2):
<zero>:
push   %rax
call   1040 <malloc@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @zero(i32 %0) {
%2 = tail call i32 @malloc(i32 %0)
%3 = tail call i32 @free(i32 %2)
ret void
}
void gtk_text_view_move_visually() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_view_move_visually() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char const *);
char *getprogname();
int /*<<< orphan*/ stderr;
void usage(char const *str) {
  fprintf(stderr, "Usage: %s %s\n", getprogname(), str);
  _exit(2);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1040 <getprogname@plt>
mov    -0xc(%rbp),%edi
mov    %rax,%rdx
mov    -0x8(%rbp),%rcx
lea    0xea0(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x2,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ea3(%rip),%rax
mov    (%rax),%ebp
xor    %eax,%eax
call   1040 <getprogname@plt>
lea    0xeb3(%rip),%rsi
mov    %ebp,%edi
mov    %rax,%rdx
mov    %rbx,%rcx
call   1050 <fprintf@plt>
mov    $0x2,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [14 x i8] c"Usage: %s %s\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i8* (...) @getprogname()
%5 = load i8*, i8** %2
%6 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %5)
%7 = call i32 @_exit(i32 2)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [14 x i8] c"Usage: %s %s\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i8* (...) @getprogname()
%4 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %0)
%5 = tail call i32 @_exit(i32 2)
unreachable
}
int weighted_cost(int factor, int bits) { return (((factor) * (bits)) >> 16); }


x86 assembly (clang, -O0):
<weighted_cost>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
sar    $0x10,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<weighted_cost>:
mov    %edi,%eax
imul   %esi,%eax
sar    $0x10,%eax
ret

LLVM IR (-O0):
define i32 @weighted_cost(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = mul nsw i32 %5, %6
%8 = ashr i32 %7, 16
ret i32 %8
}

LLVM IR (-O2):
define i32 @weighted_cost(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = ashr i32 %3, 16
ret i32 %4
}
main(int argc, char **argv) {
  int retval = 1;
  if (argc != 2)
    usage(argv[0]);
  else
    retval = xor(argv[1]);
  return retval;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     115a <main+0x3a>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    $0x0,%al
call   1040 <usage@plt>
jmp    116c <main+0x4c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x0,%al
call   1030 <xor@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1132 <main+0x12>
mov    0x8(%rsi),%rdi
xor    %eax,%eax
pop    %rcx
jmp    1030 <xor@plt>
mov    (%rsi),%rdi
xor    %eax,%eax
call   1040 <usage@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 2
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 0
%12 = load i8*, i8** %11
%13 = call i32 (i8*, ...) bitcast (i32 (...)* @usage to i32 (i8*, ...)*)(i8* %12)
br label %19
14: ; preds = %2
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = call i32 (i8*, ...) bitcast (i32 (...)* @xor to i32 (i8*, ...)*)(i8* %17)
store i32 %18, i32* %6
br label %19
19: ; preds = %14, %9
%20 = load i32, i32* %6
ret i32 %20
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @usage to i32 (i8*, ...)*)(i8* %5)
br label %11
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 (i8*, ...) bitcast (i32 (...)* @xor to i32 (i8*, ...)*)(i8* %9)
br label %11
11: ; preds = %7, %4
%12 = phi i32 [ 1, %4 ], [ %10, %7 ]
ret i32 %12
}
int test_49_4(int *mem) { return __atomic_fetch_and(mem + 0, 1, 4); }


x86 assembly (clang, -O0):
<test_49_4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    %ecx,-0x18(%rbp)
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%esi
mov    %eax,%edx
and    %esi,%edx
lock cmpxchg %edx,(%rcx)
sete   %cl
mov    %eax,-0x24(%rbp)
test   $0x1,%cl
mov    %eax,-0x14(%rbp)
jne    114b <test_49_4+0x4b>
jmp    1122 <test_49_4+0x22>
mov    -0x24(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_49_4>:
mov    (%rdi),%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%ecx
and    $0x1,%ecx
lock cmpxchg %ecx,(%rdi)
jne    1110 <test_49_4+0x10>
ret

LLVM IR (-O0):
define i32 @test_49_4(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 0
store i32 1, i32* %3
%7 = load i32, i32* %3
%8 = atomicrmw and i32* %6, i32 %7 acq_rel
store i32 %8, i32* %4
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_49_4(i32* nocapture %0) {
%2 = atomicrmw and i32* %0, i32 1 acq_rel
ret i32 %2
}
/* Type definitions */
typedef int time_t;

/* Variables and functions */
int time(int /*<<< orphan*/ *);
int getTimeStamp() {
  time_t stime = time(NULL);
  return stime;
}


x86 assembly (clang, -O0):
<getTimeStamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <time@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @getTimeStamp() {
%1 = alloca i32
%2 = call i32 @time(i32* null)
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @getTimeStamp() {
%1 = tail call i32 @time(i32* null)
ret i32 %1
}
int getCellIdLeft(int cellId) {
  if (cellId % 8 == 0)
    return -1;
  return cellId - 1;
}


x86 assembly (clang, -O0):
<getCellIdLeft>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1127 <getCellIdLeft+0x27>
movl   $0xffffffff,-0x4(%rbp)
jmp    1130 <getCellIdLeft+0x30>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCellIdLeft>:
lea    -0x1(%rdi),%ecx
mov    %edi,%eax
and    $0x7,%eax
cmp    $0x1,%eax
sbb    %eax,%eax
or     %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @getCellIdLeft(i32 %0) {
%2 = and i32 %0, 7
%3 = icmp eq i32 %2, 0
%4 = add nsw i32 %0, -1
%5 = select i1 %3, i32 -1, i32 %4
ret i32 %5
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void *alignptr(void *addr, uint32_t align) {
  uintptr_t mask = ~((uintptr_t)(align - 1));
  return (void *)(((uintptr_t)addr + (align - 1)) & mask);
}


x86 assembly (clang, -O0):
<alignptr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
cltq
xor    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
and    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<alignptr>:
movslq %esi,%rax
lea    (%rax,%rdi,1),%rcx
add    $0xffffffffffffffff,%rcx
neg    %rax
and    %rcx,%rax
ret

LLVM IR (-O0):
define i8* @alignptr(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i64
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = sub nsw i32 %6, 1
%8 = sext i32 %7 to i64
%9 = xor i64 %8, -1
store i64 %9, i64* %5
%10 = load i8*, i8** %3
%11 = ptrtoint i8* %10 to i64
%12 = load i32, i32* %4
%13 = sub nsw i32 %12, 1
%14 = sext i32 %13 to i64
%15 = add i64 %11, %14
%16 = load i64, i64* %5
%17 = and i64 %15, %16
%18 = inttoptr i64 %17 to i8*
ret i8* %18
}

LLVM IR (-O2):
define i8* @alignptr(i8* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = sext i32 %3 to i64
%5 = xor i64 %4, -1
%6 = ptrtoint i8* %0 to i64
%7 = add i64 %4, %6
%8 = and i64 %7, %5
%9 = inttoptr i64 %8 to i8*
ret i8* %9
}
char *pre_process_line(char *line, int print_changes, int addit) {
  return line;
}


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

x86 assembly (clang, -O2):
<pre_process_line>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @pre_process_line(i8* readnone returned %0, i32 %1, i32 %2) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ SSL_library_init();
int cipher_get_by_value_tests();
int cipher_get_put_tests();
int main(int argc, char **argv) {
  int failed = 0;
  SSL_library_init();
  failed |= cipher_get_put_tests();
  failed |= cipher_get_by_value_tests();
  return (failed);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    $0x0,%al
call   1040 <SSL_library_init@plt>
mov    $0x0,%al
call   1050 <cipher_get_put_tests@plt>
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1030 <cipher_get_by_value_tests@plt>
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <SSL_library_init@plt>
xor    %eax,%eax
call   1050 <cipher_get_put_tests@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <cipher_get_by_value_tests@plt>
or     %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%7 = call i32 (...) @SSL_library_init()
%8 = call i32 (...) @cipher_get_put_tests()
%9 = load i32, i32* %6
%10 = or i32 %9, %8
store i32 %10, i32* %6
%11 = call i32 (...) @cipher_get_by_value_tests()
%12 = load i32, i32* %6
%13 = or i32 %12, %11
store i32 %13, i32* %6
%14 = load i32, i32* %6
ret i32 %14
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @SSL_library_init()
%4 = tail call i32 (...) @cipher_get_put_tests()
%5 = tail call i32 (...) @cipher_get_by_value_tests()
%6 = or i32 %5, %4
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ test_vector_basic();
int /*<<< orphan*/ test_vector_find();
int /*<<< orphan*/ test_vector_find_struct();
int /*<<< orphan*/ test_vector_free_strings();
int /*<<< orphan*/ test_vector_reverse_sort();
int /*<<< orphan*/ test_vector_sort_sizet();
int /*<<< orphan*/ test_vector_sort_strings();
int /*<<< orphan*/ test_vector_sort_struct();
void test_vector(void) {
  test_vector_basic();
  test_vector_free_strings();
  test_vector_find();
  test_vector_find_struct();
  test_vector_sort_strings();
  test_vector_sort_sizet();
  test_vector_sort_struct();
  test_vector_reverse_sort();
}


x86 assembly (clang, -O0):
<test_vector>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <test_vector_basic@plt>
mov    $0x0,%al
call   10a0 <test_vector_free_strings@plt>
mov    $0x0,%al
call   1060 <test_vector_find@plt>
mov    $0x0,%al
call   1070 <test_vector_find_struct@plt>
mov    $0x0,%al
call   1080 <test_vector_sort_strings@plt>
mov    $0x0,%al
call   1050 <test_vector_sort_sizet@plt>
mov    $0x0,%al
call   1030 <test_vector_sort_struct@plt>
mov    $0x0,%al
call   1090 <test_vector_reverse_sort@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_vector>:
push   %rax
xor    %eax,%eax
call   1040 <test_vector_basic@plt>
xor    %eax,%eax
call   10a0 <test_vector_free_strings@plt>
xor    %eax,%eax
call   1060 <test_vector_find@plt>
xor    %eax,%eax
call   1070 <test_vector_find_struct@plt>
xor    %eax,%eax
call   1080 <test_vector_sort_strings@plt>
xor    %eax,%eax
call   1050 <test_vector_sort_sizet@plt>
xor    %eax,%eax
call   1030 <test_vector_sort_struct@plt>
xor    %eax,%eax
pop    %rcx
jmp    1090 <test_vector_reverse_sort@plt>

LLVM IR (-O0):
define void @test_vector() {
%1 = call i32 (...) @test_vector_basic()
%2 = call i32 (...) @test_vector_free_strings()
%3 = call i32 (...) @test_vector_find()
%4 = call i32 (...) @test_vector_find_struct()
%5 = call i32 (...) @test_vector_sort_strings()
%6 = call i32 (...) @test_vector_sort_sizet()
%7 = call i32 (...) @test_vector_sort_struct()
%8 = call i32 (...) @test_vector_reverse_sort()
ret void
}

LLVM IR (-O2):
define void @test_vector() {
%1 = tail call i32 (...) @test_vector_basic()
%2 = tail call i32 (...) @test_vector_free_strings()
%3 = tail call i32 (...) @test_vector_find()
%4 = tail call i32 (...) @test_vector_find_struct()
%5 = tail call i32 (...) @test_vector_sort_strings()
%6 = tail call i32 (...) @test_vector_sort_sizet()
%7 = tail call i32 (...) @test_vector_sort_struct()
%8 = tail call i32 (...) @test_vector_reverse_sort()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LDY_();
int /*<<< orphan*/ c64_memAbsoluteAddr();
void LDY_abs(void) {
  c64_memAbsoluteAddr();
  LDY_();
}


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

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

LLVM IR (-O0):
define void @LDY_abs() {
%1 = call i32 (...) @c64_memAbsoluteAddr()
%2 = call i32 (...) @LDY_()
ret void
}

LLVM IR (-O2):
define void @LDY_abs() {
%1 = tail call i32 (...) @c64_memAbsoluteAddr()
%2 = tail call i32 (...) @LDY_()
ret void
}
/* Type definitions */
typedef int uint32_t;
struct pcg_state_64 {
  int dummy;
};

/* Variables and functions */
int pcg_mcg_64_xsh_rr_32_random_r(struct pcg_state_64 *);
uint32_t pcg_mcg_64_xsh_rr_32_boundedrand_r(struct pcg_state_64 *rng,
                                            uint32_t bound) {
  uint32_t threshold = -bound % bound;
  for (;;) {
    uint32_t r = pcg_mcg_64_xsh_rr_32_random_r(rng);
    if (r >= threshold)
      return r % bound;
  }
}


x86 assembly (clang, -O0):
<pcg_mcg_64_xsh_rr_32_boundedrand_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
sub    -0xc(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pcg_mcg_64_xsh_rr_32_random_r@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     1152 <pcg_mcg_64_xsh_rr_32_boundedrand_r+0x42>
mov    -0x14(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%eax
add    $0x20,%rsp
pop    %rbp
ret
jmp    112b <pcg_mcg_64_xsh_rr_32_boundedrand_r+0x1b>

x86 assembly (clang, -O2):
<pcg_mcg_64_xsh_rr_32_boundedrand_r>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <pcg_mcg_64_xsh_rr_32_random_r@plt>
test   %eax,%eax
js     1120 <pcg_mcg_64_xsh_rr_32_boundedrand_r+0x10>
cltd
idiv   %ebp
mov    %edx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
%struct.pcg_state_64 = type { i32 }
define i32 @pcg_mcg_64_xsh_rr_32_boundedrand_r(%struct.pcg_state_64* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 @pcg_mcg_64_xsh_rr_32_random_r(%struct.pcg_state_64* %0)
%5 = icmp sgt i32 %4, -1
br i1 %5, label %6, label %3
6: ; preds = %3
%7 = srem i32 %4, %1
ret i32 %7
}
/* Type definitions */
struct link {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct link *);
int /*<<< orphan*/ list_destroy(struct link *, void (*)(struct link *));
void list_delete(struct link *__restrict list,
                 void (*data_delete)(struct link *)) {
  list_destroy(list, data_delete);
  free(list);
}


x86 assembly (clang, -O0):
<list_delete>:
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 <list_destroy@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_delete>:
push   %rbx
mov    %rdi,%rbx
call   1040 <list_destroy@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.link = type { i32 }
define void @list_delete(%struct.link* noalias %0, void (%struct.link*)* %1) {
%3 = alloca %struct.link*
%4 = alloca void (%struct.link*)*
store %struct.link* %0, %struct.link** %3
store void (%struct.link*)* %1, void (%struct.link*)** %4
%5 = load %struct.link*, %struct.link** %3
%6 = load void (%struct.link*)*, void (%struct.link*)** %4
%7 = call i32 @list_destroy(%struct.link* %5, void (%struct.link*)* %6)
%8 = load %struct.link*, %struct.link** %3
%9 = call i32 @free(%struct.link* %8)
ret void
}

LLVM IR (-O2):
%struct.link = type { i32 }
define void @list_delete(%struct.link* noalias %0, void (%struct.link*)* %1) {
%3 = tail call i32 @list_destroy(%struct.link* %0, void (%struct.link*)* %1)
%4 = tail call i32 @free(%struct.link* %0)
ret void
}
/* Variables and functions */
size_t cb_idx(size_t n) { return n & 0x3f; }


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

x86 assembly (clang, -O2):
<cb_idx>:
mov    %rdi,%rax
and    $0x3f,%eax
ret

LLVM IR (-O0):
define i64 @cb_idx(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 63
ret i64 %4
}

LLVM IR (-O2):
define i64 @cb_idx(i64 %0) {
%2 = and i64 %0, 63
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, float);
char *sample_pos_str(float sample_file_pos, char *buf) {
  snprintf(buf, 32, "@%fs", sample_file_pos);
  return buf;
}


x86 assembly (clang, -O0):
<sample_pos_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
movss  -0x4(%rbp),%xmm0
mov    $0x20,%esi
lea    0xeca(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sample_pos_str>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdx
mov    $0x20,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"@%fs\00"
define i8* @sample_pos_str(float %0, i8* returned %1) {
%3 = tail call i32 @snprintf(i8* %1, i32 32, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), float %0)
ret i8* %1
}
void defLast() {
  enum __attribute__((aligned(16))) T *p0;
  enum __attribute__((deprecated(""))) T { E0, E1 } * p1;
}


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

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

LLVM IR (-O0):
define void @defLast() {
%1 = alloca i32*
%2 = alloca i32*
ret void
}

LLVM IR (-O2):
define void @defLast() {
ret void
}
int search(int *array, int tam, int target) {
  int i;
  for (i = 0; i < tam; i++) {
    if (array[i] == target)
      break;
  }
  return i;
}


x86 assembly (clang, -O0):
<search>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    114d <search+0x4d>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x10(%rbp),%eax
jne    113a <search+0x3a>
jmp    114d <search+0x4d>
jmp    113f <search+0x3f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1115 <search+0x15>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<search>:
test   %esi,%esi
jle    1121 <search+0x21>
mov    %esi,%ecx
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
cmp    %edx,(%rdi,%rax,4)
je     1120 <search+0x20>
add    $0x1,%rax
cmp    %rax,%rcx
jne    1110 <search+0x10>
mov    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @search(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ 0, %5 ], [ %13, %12 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, %2
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %17, label %7
15: ; preds = %7
%16 = trunc i64 %8 to i32
br label %17
17: ; preds = %12, %15, %3
%18 = phi i32 [ 0, %3 ], [ %16, %15 ], [ %1, %12 ]
ret i32 %18
}
/* Variables and functions */
int _f(int /*<<< orphan*/, int, double const, double const *);
double _I_30(const double omega, const double vertices_omegas[4]) {
  return _f(0, 3, omega, vertices_omegas) / 3;
}


x86 assembly (clang, -O0):
<_I_30>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rdx
xor    %edi,%edi
mov    $0x3,%esi
call   1030 <_f@plt>
mov    $0x3,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_I_30>:
push   %rax
mov    %rdi,%rdx
xor    %edi,%edi
mov    $0x3,%esi
call   1030 <_f@plt>
cltq
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @_I_30(double %0, double* %1) {
%3 = alloca double
%4 = alloca double*
store double %0, double* %3
store double* %1, double** %4
%5 = load double, double* %3
%6 = load double*, double** %4
%7 = call i32 @_f(i32 0, i32 3, double %5, double* %6)
%8 = sdiv i32 %7, 3
%9 = sitofp i32 %8 to double
ret double %9
}

LLVM IR (-O2):
define double @_I_30(double %0, double* %1) {
%3 = tail call i32 @_f(i32 0, i32 3, double %0, double* %1)
%4 = sdiv i32 %3, 3
%5 = sitofp i32 %4 to double
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ Inst_Printf(char *, char *, char *, int);
void Move_Ret_To_Mem_L(char *name, int index) {
  Inst_Printf("sethi",
              "%%hi("
              "%s+%d),%%o1",
              name, index * 4);
  Inst_Printf("st",
              "%%o0,[%%o1+%%lo("
              "%s+%d)]",
              name, index * 4);
}


x86 assembly (clang, -O0):
<Move_Ret_To_Mem_L>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
shl    $0x2,%ecx
lea    0xed0(%rip),%rdi
lea    0xecf(%rip),%rsi
call   1030 <Inst_Printf@plt>
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
shl    $0x2,%ecx
lea    0xeca(%rip),%rdi
lea    0xec6(%rip),%rsi
call   1030 <Inst_Printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Move_Ret_To_Mem_L>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0x0(,%rsi,4),%ebp
lea    0xedc(%rip),%rdi
lea    0xedb(%rip),%rsi
mov    %rbx,%rdx
mov    %ebp,%ecx
call   1030 <Inst_Printf@plt>
lea    0xedb(%rip),%rdi
lea    0xed7(%rip),%rsi
mov    %rbx,%rdx
mov    %ebp,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <Inst_Printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"sethi\00"
@.str.1 = [17 x i8] c"%%hi(%s+%d),%%o1\00"
@.str.2 = [3 x i8] c"st\00"
@.str.3 = [24 x i8] c"%%o0,[%%o1+%%lo(%s+%d)]\00"
define void @Move_Ret_To_Mem_L(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = mul nsw i32 %6, 4
%8 = call i32 @Inst_Printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %5, i32 %7)
%9 = load i8*, i8** %3
%10 = load i32, i32* %4
%11 = mul nsw i32 %10, 4
%12 = call i32 @Inst_Printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i8* %9, i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"sethi\00"
@.str.1 = [17 x i8] c"%%hi(%s+%d),%%o1\00"
@.str.2 = [3 x i8] c"st\00"
@.str.3 = [24 x i8] c"%%o0,[%%o1+%%lo(%s+%d)]\00"
define void @Move_Ret_To_Mem_L(i8* %0, i32 %1) {
%3 = shl nsw i32 %1, 2
%4 = tail call i32 @Inst_Printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %0, i32 %3)
%5 = tail call i32 @Inst_Printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i8* %0, i32 %3)
ret void
}
int csend(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @csend() {
ret i32 0
}
int isTitleTag(int *tag) {
  if (tag[0] == 't' && tag[1] == 'i' && tag[2] == 't')
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<isTitleTag>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x74,(%rax)
jne    113d <isTitleTag+0x3d>
mov    -0x10(%rbp),%rax
cmpl   $0x69,0x4(%rax)
jne    113d <isTitleTag+0x3d>
mov    -0x10(%rbp),%rax
cmpl   $0x74,0x8(%rax)
jne    113d <isTitleTag+0x3d>
movl   $0x1,-0x4(%rbp)
jmp    1144 <isTitleTag+0x44>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isTitleTag>:
cmpl   $0x74,(%rdi)
jne    1116 <isTitleTag+0x16>
cmpl   $0x69,0x4(%rdi)
jne    1116 <isTitleTag+0x16>
mov    $0x1,%eax
cmpl   $0x74,0x8(%rdi)
je     1118 <isTitleTag+0x18>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @isTitleTag(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 116
br i1 %3, label %4, label %12
4: ; preds = %1
%5 = getelementptr inbounds i32, i32* %0, i64 1
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 105
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = getelementptr inbounds i32, i32* %0, i64 2
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, 116
br i1 %11, label %13, label %12
12: ; preds = %8, %4, %1
br label %13
13: ; preds = %8, %12
%14 = phi i32 [ 0, %12 ], [ 1, %8 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
char *strerror(int);
int main(int argc, char *argv[]) {
  int errnum;
  for (errnum = 0; errnum < 256; ++errnum) {
    printf("%3d: %s\n", errnum, strerror(errnum));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x100,-0x14(%rbp)
jge    1178 <main+0x58>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <strerror@plt>
mov    -0x18(%rbp),%esi
mov    %rax,%rdx
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xed3(%rip),%r14
nopl   (%rax)
mov    %ebx,%edi
call   1040 <strerror@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %rax,%rdx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x100,%ebx
jne    1130 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"%3d: %s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i32 [ 0, %2 ], [ %7, %3 ]
%5 = tail call i8* @strerror(i32 %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %4, i8* %5)
%7 = add nuw nsw i32 %4, 1
%8 = icmp eq i32 %7, 256
br i1 %8, label %9, label %3
9: ; preds = %3
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ send_command(int);
void SetPageStart(unsigned int x) { send_command(0xB0 | (x & 0x07)); }


x86 assembly (clang, -O0):
<SetPageStart>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
and    $0x7,%edi
or     $0xb0,%edi
call   1030 <send_command@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetPageStart>:
and    $0x7,%edi
or     $0xb0,%edi
jmp    1030 <send_command@plt>

LLVM IR (-O0):
define void @SetPageStart(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 7
%5 = or i32 176, %4
%6 = call i32 @send_command(i32 %5)
ret void
}

LLVM IR (-O2):
define void @SetPageStart(i32 %0) {
%2 = and i32 %0, 7
%3 = or i32 %2, 176
%4 = tail call i32 @send_command(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setgrent_r();
int main(int argc, char *argv[]) { setgrent_r(); }


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @setgrent_r()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
char *stringAllocate(int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
char *stringWrite(char *src) {
  char *string = stringAllocate(strlen(src));
  strcpy(string, src);
  return string;
}


x86 assembly (clang, -O0):
<stringWrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,%edi
call   1040 <stringAllocate@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringWrite>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1050 <strlen@plt>
mov    %eax,%edi
call   1040 <stringAllocate@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @stringWrite(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i8* @stringAllocate(i32 %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = load i8*, i8** %2
%9 = call i32 @strcpy(i8* %7, i8* %8)
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
define i8* @stringWrite(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i8* @stringAllocate(i32 %2)
%4 = tail call i32 @strcpy(i8* %3, i8* %0)
ret i8* %3
}
/* Variables and functions */
double MBtoPSI(double);
double HPAtoPSI(double HPA) {
  double PSI = MBtoPSI(HPA);
  return PSI;
}


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

x86 assembly (clang, -O2):
<HPAtoPSI>:
jmp    1030 <MBtoPSI@plt>

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

LLVM IR (-O2):
define double @HPAtoPSI(double %0) {
%2 = tail call double @MBtoPSI(double %0)
ret double %2
}
double c_sin(ang)
double ang;
{ return sin(ang); }


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

x86 assembly (clang, -O2):
<c_sin>:
jmp    1030 <sin@plt>

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

LLVM IR (-O2):
define double @c_sin(double %0) {
%2 = tail call double @sin(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void sched_print_tasks(void) { assert(0 && "Please fill me!"); }


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

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

LLVM IR (-O0):
define void @sched_print_tasks() {
%1 = call i32 @assert(i32 0)
ret void
}

LLVM IR (-O2):
define void @sched_print_tasks() {
%1 = tail call i32 @assert(i32 0)
ret void
}
int int_cmp(const int *p, const int *q) { return *p != *q; }


x86 assembly (clang, -O0):
<int_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_cmp>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
setne  %al
ret

LLVM IR (-O0):
define i32 @int_cmp(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = icmp ne i32 %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @int_cmp(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = icmp ne i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
unsigned long ez_get_RGB(unsigned long, unsigned long, unsigned long);
unsigned long ez_get_grey(unsigned long g) { return ez_get_RGB(g, g, g); }


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

x86 assembly (clang, -O2):
<ez_get_grey>:
mov    %rdi,%rsi
mov    %rdi,%rdx
jmp    1030 <ez_get_RGB@plt>

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

LLVM IR (-O2):
define i64 @ez_get_grey(i64 %0) {
%2 = tail call i64 @ez_get_RGB(i64 %0, i64 %0, i64 %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ hello();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Your name: ");
  hello();
  return (0);
}


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"Your name: \00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @hello()
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Your name: \00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @hello()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("Usage: tftpd [options] [path]\nOptions:\n-d (debug mode)\n-h (help; "
         "this message)\n-P <port>\n-a <ack freqency. Default 1>\n-s <data "
         "chunk size in bytes. Default 512>\n");
  return;
}


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

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

LLVM IR (-O0):
@.str = [162 x i8] c"Usage: tftpd [options] [path]\0AOptions:\0A-d (debug mode)\0A-h (help; this message)\0A-P <port>\0A-a <ack freqency. Default 1>\0A-s <data chunk size in bytes. Default 512>\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [161 x i8] c"Usage: tftpd [options] [path]\0AOptions:\0A-d (debug mode)\0A-h (help; this message)\0A-P <port>\0A-a <ack freqency. Default 1>\0A-s <data chunk size in bytes. Default 512>\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([161 x i8], [161 x i8]* @str, i64 0, i64 0))
ret void
}
int get_wave_status(struct NETWORK *NTW, int fiber, int wave,
                    struct SPARAMETERS *SM_Parameters, int dest, int ndr) {
  int jj, wave_status, INITIAL_FIBER;
  wave_status = 0;
  return wave_status;
}


x86 assembly (clang, -O0):
<get_wave_status>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.NETWORK = type opaque
%struct.SPARAMETERS = type opaque
define i32 @get_wave_status(%struct.NETWORK* %0, i32 %1, i32 %2, %struct.SPARAMETERS* %3, i32 %4, i32 %5) {
%7 = alloca %struct.NETWORK*
%8 = alloca i32
%9 = alloca i32
%10 = alloca %struct.SPARAMETERS*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
store %struct.NETWORK* %0, %struct.NETWORK** %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store %struct.SPARAMETERS* %3, %struct.SPARAMETERS** %10
store i32 %4, i32* %11
store i32 %5, i32* %12
store i32 0, i32* %14
%16 = load i32, i32* %14
ret i32 %16
}

LLVM IR (-O2):
%struct.NETWORK = type opaque
%struct.SPARAMETERS = type opaque
define i32 @get_wave_status(%struct.NETWORK* nocapture readnone %0, i32 %1, i32 %2, %struct.SPARAMETERS* nocapture readnone %3, i32 %4, i32 %5) {
ret i32 0
}