xunge/DecIR huggingface dataset:
int hash_index(char *text) {
  int i, h = 0;
  for (i = 0; text[i] != '\0'; i++)
    h = (h * 36 + text[i]) % 317;
  return h;
}


x86 assembly (clang, -O0):
<hash_index>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1156 <hash_index+0x56>
imul   $0x24,-0x10(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
mov    $0x13d,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <hash_index+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_index>:
mov    (%rdi),%cl
test   %cl,%cl
je     1143 <hash_index+0x43>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
lea    (%rax,%rax,8),%eax
lea    (%rcx,%rax,4),%eax
cltq
imul   $0x33af3e2f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
imul   $0x13d,%ecx,%ecx
sub    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash_index+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash_index(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %12, %4 ], [ 0, %1 ]
%6 = phi i8 [ %14, %4 ], [ %2, %1 ]
%7 = phi i32 [ %11, %4 ], [ 0, %1 ]
%8 = sext i8 %6 to i32
%9 = mul nsw i32 %7, 36
%10 = add nsw i32 %9, %8
%11 = srem i32 %10, 317
%12 = add nuw nsw i64 %5, 1
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %4, %1
%17 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ cmdline(int, char **);
int /*<<< orphan*/ cpus_init();
int /*<<< orphan*/ help();
int /*<<< orphan*/ start_worker_threads();
int /*<<< orphan*/ verify_param();
int main(int argc, char *argv[]) {
  cmdline(argc, argv);
  cpus_init();
  if (!verify_param()) {
    help();
    return -1;
  }
  start_worker_threads();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1070 <cmdline@plt>
mov    $0x0,%al
call   1030 <cpus_init@plt>
mov    $0x0,%al
call   1050 <verify_param@plt>
cmp    $0x0,%eax
jne    119c <main+0x4c>
mov    $0x0,%al
call   1060 <help@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    11aa <main+0x5a>
mov    $0x0,%al
call   1040 <start_worker_threads@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
call   1070 <cmdline@plt>
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <cpus_init@plt>
xor    %eax,%eax
call   1050 <verify_param@plt>
test   %eax,%eax
je     1173 <main+0x23>
xor    %eax,%eax
call   1040 <start_worker_threads@plt>
jmp    117f <main+0x2f>
xor    %eax,%eax
call   1060 <help@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @cmdline(i32 %0, i8** %1)
%4 = tail call i32 (...) @cpus_init()
%5 = tail call i32 (...) @verify_param()
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 (...) @help()
br label %11
9: ; preds = %2
%10 = tail call i32 (...) @start_worker_threads()
br label %11
11: ; preds = %9, %7
%12 = phi i32 [ 0, %9 ], [ -1, %7 ]
ret i32 %12
}
/* Type definitions */
struct pkt_buff {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ tprintf(char *);
void none_less(struct pkt_buff *pkt) { tprintf("\n"); }


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

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

LLVM IR (-O0):
%struct.pkt_buff = type { i32 }
@.str = [2 x i8] c"\0A\00"
define void @none_less(%struct.pkt_buff* %0) {
%2 = alloca %struct.pkt_buff*
store %struct.pkt_buff* %0, %struct.pkt_buff** %2
%3 = call i32 @tprintf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.pkt_buff = type { i32 }
@.str = [2 x i8] c"\0A\00"
define void @none_less(%struct.pkt_buff* nocapture readnone %0) {
%2 = tail call i32 @tprintf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
long TRUNC(fd)
long *fd;
{ return ((long)trunc(*fd)); }


x86 assembly (clang, -O0):
<TRUNC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2sdq (%rax),%xmm0
call   1030 <trunc@plt>
cvttsd2si %xmm0,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TRUNC>:
cvtsi2sdq (%rdi),%xmm0
cvttsd2si %xmm0,%rax
ret

LLVM IR (-O0):
define i64 @TRUNC(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = sitofp i64 %4 to double
%6 = call double @llvm.trunc.f64(double %5)
%7 = fptosi double %6 to i64
ret i64 %7
}

LLVM IR (-O2):
define i64 @TRUNC(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = sitofp i64 %2 to double
%4 = fptosi double %3 to i64
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ assessSpaceshipCapacity();
int /*<<< orphan*/ estimateWaitingVisitors();
int /*<<< orphan*/ generateReport();
int /*<<< orphan*/ processData();
int main(void) {
  assessSpaceshipCapacity();
  estimateWaitingVisitors();
  processData();
  generateReport();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <assessSpaceshipCapacity@plt>
mov    $0x0,%al
call   1060 <estimateWaitingVisitors@plt>
mov    $0x0,%al
call   1040 <processData@plt>
mov    $0x0,%al
call   1030 <generateReport@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <assessSpaceshipCapacity@plt>
xor    %eax,%eax
call   1060 <estimateWaitingVisitors@plt>
xor    %eax,%eax
call   1040 <processData@plt>
xor    %eax,%eax
call   1030 <generateReport@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @assessSpaceshipCapacity()
%2 = call i32 (...) @estimateWaitingVisitors()
%3 = call i32 (...) @processData()
%4 = call i32 (...) @generateReport()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @assessSpaceshipCapacity()
%2 = tail call i32 (...) @estimateWaitingVisitors()
%3 = tail call i32 (...) @processData()
%4 = tail call i32 (...) @generateReport()
ret i32 0
}
int fun497() { return 497; }


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

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

LLVM IR (-O0):
define i32 @fun497() {
ret i32 497
}

LLVM IR (-O2):
define i32 @fun497() {
ret i32 497
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char const *);
void err_quit(const char *err) {
  printf(err);
  exit(1);
}


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

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

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

LLVM IR (-O2):
define void @err_quit(i8* nocapture %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ Sys_failure(char *);
int kill(int /*<<< orphan*/, int);
void Kill(pid_t pid, int sig) {
  int retval;
  retval = kill(pid, sig);
  if (retval == -1)
    Sys_failure("kill");
}


x86 assembly (clang, -O0):
<Kill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <kill@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    1152 <Kill+0x32>
lea    0xeb3(%rip),%rdi
call   1040 <Sys_failure@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Kill>:
push   %rax
call   1030 <kill@plt>
cmp    $0xffffffff,%eax
je     112d <Kill+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1040 <Sys_failure@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"kill\00"
define void @Kill(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @kill(i32 %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @Sys_failure(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %2
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"kill\00"
define void @Kill(i32 %0, i32 %1) {
%3 = tail call i32 @kill(i32 %0, i32 %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @Sys_failure(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OpenSSL_add_all_algorithms();
int /*<<< orphan*/ SSL_library_init();
int /*<<< orphan*/ SSL_load_error_strings();
void lib_init() {
  SSL_library_init();
  OpenSSL_add_all_algorithms();
  SSL_load_error_strings();
}


x86 assembly (clang, -O0):
<lib_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <SSL_library_init@plt>
mov    $0x0,%al
call   1040 <OpenSSL_add_all_algorithms@plt>
mov    $0x0,%al
call   1050 <SSL_load_error_strings@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lib_init>:
push   %rax
xor    %eax,%eax
call   1030 <SSL_library_init@plt>
xor    %eax,%eax
call   1040 <OpenSSL_add_all_algorithms@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <SSL_load_error_strings@plt>

LLVM IR (-O0):
define void @lib_init() {
%1 = call i32 (...) @SSL_library_init()
%2 = call i32 (...) @OpenSSL_add_all_algorithms()
%3 = call i32 (...) @SSL_load_error_strings()
ret void
}

LLVM IR (-O2):
define void @lib_init() {
%1 = tail call i32 (...) @SSL_library_init()
%2 = tail call i32 (...) @OpenSSL_add_all_algorithms()
%3 = tail call i32 (...) @SSL_load_error_strings()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gen(char *);
void cgscale(void) { gen("shl\tax,1"); }


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"shl\09ax,1\00"
define void @cgscale() {
%1 = call i32 @gen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"shl\09ax,1\00"
define void @cgscale() {
%1 = tail call i32 @gen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
size_t strlen(const char *s) {
  size_t cnt = 0;
  while (*s++ != '\0') {
    cnt++;
  }
  return cnt;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     113c <strlen+0x3c>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111f <strlen+0x1f>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rcx),%rax
cmpb   $0x0,0x1(%rdi,%rcx,1)
mov    %rax,%rcx
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add i64 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i64 [ 0, %1 ], [ %8, %4 ]
ret i64 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile uint16_t;

/* Variables and functions */
uint16_t direct_set16(volatile uint16_t *addr, uint16_t dat) {
  *addr |= dat;
  return dat;
}


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

x86 assembly (clang, -O2):
<direct_set16>:
mov    %esi,-0x4(%rsp)
mov    -0x4(%rsp),%eax
or     %eax,(%rdi)
mov    -0x4(%rsp),%eax
ret

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

LLVM IR (-O2):
define i32 @direct_set16(i32* %0, i32 %1) {
%3 = alloca i32
store volatile i32 %1, i32* %3
%4 = load volatile i32, i32* %3
%5 = load volatile i32, i32* %0
%6 = or i32 %5, %4
store volatile i32 %6, i32* %0
%7 = load volatile i32, i32* %3
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite_repr(char *, int, int /*<<< orphan*/ *);
int string_val(void *ctx, char *val, int vallen) {
  FILE *fp = ctx;
  fwrite_repr(val, vallen, fp);
  return 0;
}


x86 assembly (clang, -O0):
<string_val>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
call   1030 <fwrite_repr@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_val>:
push   %rax
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %edx,%esi
mov    %rax,%rdx
call   1030 <fwrite_repr@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @string_val(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
store i32* %9, i32** %7
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = load i32*, i32** %7
%13 = call i32 @fwrite_repr(i8* %10, i32 %11, i32* %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @string_val(i8* %0, i8* %1, i32 %2) {
%4 = bitcast i8* %0 to i32*
%5 = tail call i32 @fwrite_repr(i8* %1, i32 %2, i32* %4)
ret i32 0
}
int fun2(int x) {
  ;
  return x;
}


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

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

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

LLVM IR (-O2):
define i32 @fun2(i32 returned %0) {
ret i32 %0
}
int util_isupper(char c) { return (c >= 'A' && c <= 'Z'); }


x86 assembly (clang, -O0):
<util_isupper>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <util_isupper+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_isupper>:
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @util_isupper(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 90
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @util_isupper(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
unsigned long getu32(addr)
unsigned char *addr;
{
  return (((((unsigned long)addr[3] << 8) | addr[2]) << 8) | addr[1]) << 8 |
         addr[0];
}


x86 assembly (clang, -O0):
<getu32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%eax
shl    $0x8,%rax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
or     %rcx,%rax
shl    $0x8,%rax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
or     %rcx,%rax
shl    $0x8,%rax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
or     %rcx,%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @getu32(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = zext i8 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 2
%6 = load i8, i8* %5
%7 = zext i8 %6 to i64
%8 = shl nuw nsw i64 %4, 16
%9 = shl nuw nsw i64 %7, 8
%10 = or i64 %9, %8
%11 = getelementptr inbounds i8, i8* %0, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i64
%14 = or i64 %10, %13
%15 = shl nuw nsw i64 %14, 8
%16 = load i8, i8* %0
%17 = zext i8 %16 to i64
%18 = or i64 %15, %17
ret i64 %18
}
/* Variables and functions */
int /*<<< orphan*/ set_f_variable(char *, int);
int /*<<< orphan*/ set_i_variable(char *, int);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
void main() {
  void read_eval_do();
  set_f_variable("mxdq", .05);
  set_f_variable("mxcut", 6.);
  set_i_variable("nostep", 1);
  read_eval_do(stdin, stdout);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
xor    %esi,%esi
call   1040 <set_f_variable@plt>
lea    0xebc(%rip),%rdi
mov    $0x6,%esi
call   1040 <set_f_variable@plt>
lea    0xeb1(%rip),%rdi
mov    $0x1,%esi
call   1050 <set_i_variable@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
mov    0x2e64(%rip),%rax
mov    (%rax),%esi
mov    $0x0,%al
call   1030 <read_eval_do@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %esi,%esi
call   1040 <set_f_variable@plt>
lea    0xebf(%rip),%rdi
mov    $0x6,%esi
call   1040 <set_f_variable@plt>
lea    0xeb4(%rip),%rdi
mov    $0x1,%esi
call   1050 <set_i_variable@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
mov    0x2e67(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
pop    %rcx
jmp    1030 <read_eval_do@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"mxdq\00"
@.str.1 = [6 x i8] c"mxcut\00"
@.str.2 = [7 x i8] c"nostep\00"
@stdin = global i32 0
@stdout = global i32 0
define void @main() {
%1 = call i32 @set_f_variable(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = call i32 @set_f_variable(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 6)
%3 = call i32 @set_i_variable(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 1)
%4 = load i32, i32* @stdin
%5 = load i32, i32* @stdout
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"mxdq\00"
@.str.1 = [6 x i8] c"mxcut\00"
@.str.2 = [7 x i8] c"nostep\00"
@stdin = global i32 0
@stdout = global i32 0
define void @main() {
%1 = tail call i32 @set_f_variable(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = tail call i32 @set_f_variable(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 6)
%3 = tail call i32 @set_i_variable(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 1)
%4 = load i32, i32* @stdin
%5 = load i32, i32* @stdout
tail call void (i32, i32, ...) bitcast (void (...)* @read_eval_do to void (i32, i32, ...)*)(i32 %4, i32 %5)
ret void
}
/* Variables and functions */
scalar_t__ access(char const *, int /*<<< orphan*/);
int rename(char const *, char const *);
int optk_rename(const char *src_path, const char *dest_path, int clobber) {
  if (!clobber) {
    if (access(dest_path, 0) >= 0)
      return -1;
  }
  return rename(src_path, dest_path);
}


x86 assembly (clang, -O0):
<optk_rename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    1163 <optk_rename+0x43>
mov    -0x18(%rbp),%rdi
xor    %esi,%esi
call   1030 <access@plt>
cmp    $0x0,%rax
jl     115e <optk_rename+0x3e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1173 <optk_rename+0x53>
jmp    1163 <optk_rename+0x43>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <rename@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<optk_rename>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
test   %edx,%edx
je     1140 <optk_rename+0x20>
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <rename@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <access@plt>
test   %rax,%rax
js     112e <optk_rename+0xe>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @optk_rename(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = tail call i64 @access(i8* %1, i32 0)
%7 = icmp sgt i64 %6, -1
br i1 %7, label %10, label %8
8: ; preds = %5, %3
%9 = tail call i32 @rename(i8* %0, i8* %1)
br label %10
10: ; preds = %5, %8
%11 = phi i32 [ %9, %8 ], [ -1, %5 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ steer(int);
void steer_left() { steer(620); }


x86 assembly (clang, -O0):
<steer_left>:
push   %rbp
mov    %rsp,%rbp
mov    $0x26c,%edi
call   1030 <steer@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<steer_left>:
mov    $0x26c,%edi
jmp    1030 <steer@plt>

LLVM IR (-O0):
define void @steer_left() {
%1 = call i32 @steer(i32 620)
ret void
}

LLVM IR (-O2):
define void @steer_left() {
%1 = tail call i32 @steer(i32 620)
ret void
}
void UARTIntEnable(unsigned long ulBase, unsigned long ulIntFlags) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000038))) |= ulIntFlags;
}


x86 assembly (clang, -O0):
<UARTIntEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    0x38(%rax),%rcx
or     %rdx,%rcx
mov    %rcx,0x38(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTIntEnable>:
or     %rsi,0x38(%rdi)
ret

LLVM IR (-O0):
define void @UARTIntEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %6, 56
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, %5
store volatile i64 %10, i64* %8
ret void
}

LLVM IR (-O2):
define void @UARTIntEnable(i64 %0, i64 %1) {
%3 = add i64 %0, 56
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
%6 = or i64 %5, %1
store volatile i64 %6, i64* %4
ret void
}
long double nearbyintl(long double x) {}


x86 assembly (clang, -O0):
<nearbyintl>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define x86_fp80 @nearbyintl(x86_fp80 %0) {
ret x86_fp80 undef
}
unsigned xrop3_108_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D & T;
  stk1 = S ^ stk2;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_108_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_108_0_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
xor    %esi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_108_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %7
%24 = and i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %6
%26 = load i32, i32* %9
%27 = xor i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
ret i32 %28
}

LLVM IR (-O2):
define i32 @xrop3_108_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = xor i32 %4, %5
ret i32 %6
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void TtlUnmarshal_uint16_t(uint8_t **cursor, uint16_t *x) {
  uint8_t *buffer = *cursor;
  *x = ((buffer[0] << 8) | (buffer[1] << 0));
  *cursor += 2;
}


x86 assembly (clang, -O0):
<TtlUnmarshal_uint16_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
shl    $0x8,%ecx
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%eax
shl    $0x0,%eax
or     %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x8,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<TtlUnmarshal_uint16_t>:
mov    (%rdi),%rax
mov    (%rax),%ecx
shl    $0x8,%ecx
or     0x4(%rax),%ecx
mov    %ecx,(%rsi)
add    $0x8,%rax
mov    %rax,(%rdi)
ret

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

LLVM IR (-O2):
define void @TtlUnmarshal_uint16_t(i32** nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32*, i32** %0
%4 = load i32, i32* %3
%5 = shl i32 %4, 8
%6 = getelementptr inbounds i32, i32* %3, i64 1
%7 = load i32, i32* %6
%8 = or i32 %5, %7
store i32 %8, i32* %1
%9 = getelementptr inbounds i32, i32* %3, i64 2
store i32* %9, i32** %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ header;

/* Variables and functions */
int /*<<< orphan*/ kannotate_write(char const *, int);
int strlen(char const *);
void gator_annotate_name_group(int group, const char *str) {
  int str_size = strlen(str) & 0xffff;
  long long header =
      0x1c | (0x08 << 8) | (group << 16) | ((long long)str_size << 48);
  kannotate_write((char *)&header, sizeof(header));
  kannotate_write(str, str_size);
}


x86 assembly (clang, -O0):
<gator_annotate_name_group>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
and    $0xffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x10,%eax
or     $0x81c,%eax
cltq
movslq -0x14(%rbp),%rcx
shl    $0x30,%rcx
or     %rcx,%rax
mov    %rax,-0x20(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x8,%esi
call   1040 <kannotate_write@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <kannotate_write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gator_annotate_name_group>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1030 <strlen@plt>
movzwl %ax,%r14d
shl    $0x10,%ebp
or     $0x81c,%ebp
movslq %ebp,%rcx
shl    $0x30,%rax
or     %rcx,%rax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
mov    $0x8,%esi
call   1040 <kannotate_write@plt>
mov    %rbx,%rdi
mov    %r14d,%esi
call   1040 <kannotate_write@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @gator_annotate_name_group(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i64
store i32 %0, i32* %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = and i32 %8, 65535
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = shl i32 %10, 16
%12 = or i32 2076, %11
%13 = sext i32 %12 to i64
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = shl i64 %15, 48
%17 = or i64 %13, %16
store i64 %17, i64* %6
%18 = bitcast i64* %6 to i8*
%19 = call i32 @kannotate_write(i8* %18, i32 8)
%20 = load i8*, i8** %4
%21 = load i32, i32* %5
%22 = call i32 @kannotate_write(i8* %20, i32 %21)
ret void
}

LLVM IR (-O2):
define void @gator_annotate_name_group(i32 %0, i8* %1) {
%3 = alloca i64
%4 = tail call i32 @strlen(i8* %1)
%5 = and i32 %4, 65535
%6 = bitcast i64* %3 to i8*
%7 = shl i32 %0, 16
%8 = or i32 %7, 2076
%9 = sext i32 %8 to i64
%10 = zext i32 %4 to i64
%11 = shl i64 %10, 48
%12 = or i64 %11, %9
store i64 %12, i64* %3
%13 = call i32 @kannotate_write(i8* %6, i32 8)
%14 = call i32 @kannotate_write(i8* %1, i32 %5)
ret void
}
/* Variables and functions */
void stats_expire(size_t sz) {}


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

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

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

LLVM IR (-O2):
define void @stats_expire(i64 %0) {
ret void
}
char lower(char c) { return c >= 'A' && c <= 'Z' ? c + 'a' - 'A' : c; }


x86 assembly (clang, -O0):
<lower>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1136 <lower+0x36>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
jg     1136 <lower+0x36>
movsbl -0x1(%rbp),%eax
add    $0x61,%eax
sub    $0x41,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <lower+0x3d>
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lower>:
lea    -0x41(%rdi),%eax
lea    0x20(%rdi),%ecx
cmp    $0x1a,%al
movzbl %cl,%eax
cmovae %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @lower(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %15
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 90
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = add nsw i32 %12, 97
%14 = sub nsw i32 %13, 65
br label %18
15: ; preds = %6, %1
%16 = load i8, i8* %2
%17 = sext i8 %16 to i32
br label %18
18: ; preds = %15, %10
%19 = phi i32 [ %14, %10 ], [ %17, %15 ]
%20 = trunc i32 %19 to i8
ret i8 %20
}

LLVM IR (-O2):
define signext i8 @lower(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, 32
%5 = select i1 %3, i8 %4, i8 %0
ret i8 %5
}
/* Type definitions */
typedef char wchar_t;

/* Variables and functions */
int /*<<< orphan*/ wprintf(char const *, ...);
void uninitvar_wprintf(wchar_t *Format, int Argument) {
  const wchar_t *format1, *format2, *format3;
  int argument1, argument2;
  (void)wprintf(format1, argument1);
  (void)wprintf(format2);
  (void)wprintf(Format, argument2);
  (void)wprintf(format3, Argument);
  (void)wprintf(Format, Argument);
  (void)wprintf(Format);
}


x86 assembly (clang, -O0):
<uninitvar_wprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    $0x0,%al
call   1030 <wprintf@plt>
mov    -0x20(%rbp),%rdi
mov    $0x0,%al
call   1030 <wprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x30(%rbp),%esi
mov    $0x0,%al
call   1030 <wprintf@plt>
mov    -0x28(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x0,%al
call   1030 <wprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x0,%al
call   1030 <wprintf@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <wprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_wprintf>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <wprintf@plt>
xor    %eax,%eax
call   1030 <wprintf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <wprintf@plt>
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <wprintf@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <wprintf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <wprintf@plt>

LLVM IR (-O0):
define void @uninitvar_wprintf(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%10 = load i8*, i8** %5
%11 = load i32, i32* %8
%12 = call i32 (i8*, ...) @wprintf(i8* %10, i32 %11)
%13 = load i8*, i8** %6
%14 = call i32 (i8*, ...) @wprintf(i8* %13)
%15 = load i8*, i8** %3
%16 = load i32, i32* %9
%17 = call i32 (i8*, ...) @wprintf(i8* %15, i32 %16)
%18 = load i8*, i8** %7
%19 = load i32, i32* %4
%20 = call i32 (i8*, ...) @wprintf(i8* %18, i32 %19)
%21 = load i8*, i8** %3
%22 = load i32, i32* %4
%23 = call i32 (i8*, ...) @wprintf(i8* %21, i32 %22)
%24 = load i8*, i8** %3
%25 = call i32 (i8*, ...) @wprintf(i8* %24)
ret void
}

LLVM IR (-O2):
define void @uninitvar_wprintf(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @wprintf(i8* undef, i32 undef)
%4 = tail call i32 (i8*, ...) @wprintf(i8* undef)
%5 = tail call i32 (i8*, ...) @wprintf(i8* %0, i32 undef)
%6 = tail call i32 (i8*, ...) @wprintf(i8* undef, i32 %1)
%7 = tail call i32 (i8*, ...) @wprintf(i8* %0, i32 %1)
%8 = tail call i32 (i8*, ...) @wprintf(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void banner(void) {
  puts("\x1b[32m"
       "\n\n"
       " ********************************* \n"
       "*"
       "\x1b[0m"
       "                 _           _   "
       "\x1b[32m"
       "*\n"
       "*"
       "\x1b[0m"
       "                (_)         | |  "
       "\x1b[32m"
       "*\n"
       "*"
       "\x1b[0m"
       "   ___ _ __ ___  _ _ __   __| |  "
       "\x1b[32m"
       "*\n"
       "*"
       "\x1b[0m"
       "  / __| '_ ` _ \\| | '_ \\ / _` |"
       "\x1b[32m"
       "  *\n"
       "*"
       "\x1b[0m"
       " | (__| | | | | | | | | | (_| |  "
       "\x1b[32m"
       "*\n"
       "*"
       "\x1b[0m"
       "  \\___|_| |_| |_|_|_| |_|\\__,_|"
       "\x1b[32m"
       "  *\n"
       "*"
       "\x1b[0m"
       "                                 "
       "\x1b[32m"
       "*\n"
       " ********************************* \n");
}


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

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

LLVM IR (-O0):
@.str = [395 x i8] c"\1B[32m\0A\0A ********************************* \0A*\1B[0m _ _ \1B[32m*\0A*\1B[0m (_) | | \1B[32m*\0A*\1B[0m ___ _ __ ___ _ _ __ __| | \1B[32m*\0A*\1B[0m / __| '_ ` _ \\| | '_ \\ / _` |\1B[32m *\0A*\1B[0m | (__| | | | | | | | | | (_| | \1B[32m*\0A*\1B[0m \\___|_| |_| |_|_|_| |_|\\__,_|\1B[32m *\0A*\1B[0m \1B[32m*\0A ********************************* \0A\00"
define void @banner() {
%1 = call i32 @puts(i8* getelementptr inbounds ([395 x i8], [395 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [395 x i8] c"\1B[32m\0A\0A ********************************* \0A*\1B[0m _ _ \1B[32m*\0A*\1B[0m (_) | | \1B[32m*\0A*\1B[0m ___ _ __ ___ _ _ __ __| | \1B[32m*\0A*\1B[0m / __| '_ ` _ \\| | '_ \\ / _` |\1B[32m *\0A*\1B[0m | (__| | | | | | | | | | (_| | \1B[32m*\0A*\1B[0m \\___|_| |_| |_|_|_| |_|\\__,_|\1B[32m *\0A*\1B[0m \1B[32m*\0A ********************************* \0A\00"
define void @banner() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([395 x i8], [395 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
size_t ft_strlen(const char *s) {
  size_t i;
  i = 0;
  while (s[i])
    i++;
  return (i);
}


x86 assembly (clang, -O0):
<ft_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1133 <ft_strlen+0x33>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <ft_strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <ft_strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @ft_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
int smooth(int data, float filterVal, float smoothedVal) {
  if (filterVal > 1) {
    filterVal = .99;
  } else if (filterVal <= 0) {
    filterVal = 0;
  }
  smoothedVal = (data * (1 - filterVal)) + (smoothedVal * filterVal);
  return (int)smoothedVal;
}


x86 assembly (clang, -O0):
<smooth>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0xee2(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1139 <smooth+0x39>
movss  0xed5(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    1153 <smooth+0x53>
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     114e <smooth+0x4e>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    1153 <smooth+0x53>
cvtsi2ssl -0x4(%rbp),%xmm0
movss  0xea0(%rip),%xmm2
subss  -0x8(%rbp),%xmm2
movss  -0xc(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
cvttss2si -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<smooth>:
ucomiss 0xefd(%rip),%xmm0
jbe    1113 <smooth+0x13>
movss  0xeef(%rip),%xmm0
jmp    111e <smooth+0x1e>
xorps  %xmm2,%xmm2
ucomiss %xmm0,%xmm2
jb     111e <smooth+0x1e>
xorps  %xmm0,%xmm0
xorps  %xmm2,%xmm2
cvtsi2ss %edi,%xmm2
movss  0xed7(%rip),%xmm3
subss  %xmm0,%xmm3
mulss  %xmm2,%xmm3
mulss  %xmm0,%xmm1
addss  %xmm3,%xmm1
cvttss2si %xmm1,%eax
ret

LLVM IR (-O0):
define i32 @smooth(i32 %0, float %1, float %2) {
%4 = alloca i32
%5 = alloca float
%6 = alloca float
store i32 %0, i32* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %5
%8 = fcmp ogt float %7, 1.000000e+00
br i1 %8, label %9, label %10
9: ; preds = %3
store float 0x3FEFAE1480000000, float* %5
br label %15
10: ; preds = %3
%11 = load float, float* %5
%12 = fcmp ole float %11, 0.000000e+00
br i1 %12, label %13, label %14
13: ; preds = %10
store float 0.000000e+00, float* %5
br label %14
14: ; preds = %13, %10
br label %15
15: ; preds = %14, %9
%16 = load i32, i32* %4
%17 = sitofp i32 %16 to float
%18 = load float, float* %5
%19 = fsub float 1.000000e+00, %18
%20 = load float, float* %6
%21 = load float, float* %5
%22 = fmul float %20, %21
%23 = call float @llvm.fmuladd.f32(float %17, float %19, float %22)
store float %23, float* %6
%24 = load float, float* %6
%25 = fptosi float %24 to i32
ret i32 %25
}

LLVM IR (-O2):
define i32 @smooth(i32 %0, float %1, float %2) {
%4 = fcmp ogt float %1, 1.000000e+00
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = fcmp ugt float %1, 0.000000e+00
br i1 %6, label %8, label %7
7: ; preds = %5
br label %8
8: ; preds = %3, %5, %7
%9 = phi float [ 0.000000e+00, %7 ], [ %1, %5 ], [ 0x3FEFAE1480000000, %3 ]
%10 = sitofp i32 %0 to float
%11 = fsub float 1.000000e+00, %9
%12 = fmul float %9, %2
%13 = tail call float @llvm.fmuladd.f32(float %10, float %11, float %12)
%14 = fptosi float %13 to i32
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ print_f(char *, long);
void sendint(long value) { print_f("%l", value); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%l\00"
define void @sendint(i64 %0) {
%2 = tail call i32 @print_f(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  printf("hello, world!!");
  int a = 0;
  int i;
  for (i = 0; i < 100; i++) {
    a += i;
  }
  printf("%d", a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x64,-0xc(%rbp)
jge    115c <main+0x4c>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113b <main+0x2b>
mov    -0x8(%rbp),%esi
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [15 x i8] c"hello, world!!\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 4950)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_cond_t;

/* Variables and functions */
int cond_signal(int /*<<< orphan*/ *);
int pthread_cond_signal(pthread_cond_t *cond) { return cond_signal(cond); }


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

x86 assembly (clang, -O2):
<pthread_cond_signal>:
jmp    1030 <cond_signal@plt>

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

LLVM IR (-O2):
define i32 @pthread_cond_signal(i32* %0) {
%2 = tail call i32 @cond_signal(i32* %0)
ret i32 %2
}