xunge/DecIR huggingface dataset:
void simtec_heartbeat_timer_ack() {}


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

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

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

LLVM IR (-O2):
define void @simtec_heartbeat_timer_ack() {
ret void
}
void cgi_init() {}


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

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

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

LLVM IR (-O2):
define void @cgi_init() {
ret void
}
void *_sl4_hash_key_copy_str(const void *key) {
  char *ret, *k;
  k = (char *)key;
  ret = (char *)malloc(strlen(k) + 1);
  if (ret)
    strcpy(ret, k);
  return ret;
}


x86 assembly (clang, -O0):
<_sl4_hash_key_copy_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1175 <_sl4_hash_key_copy_str+0x45>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_sl4_hash_key_copy_str>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1158 <_sl4_hash_key_copy_str+0x28>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @_sl4_hash_key_copy_str(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i8* @strcpy(i8* %4, i8* dereferenceable(1) %0)
br label %8
8: ; preds = %6, %1
ret i8* %4
}
void foo274(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo274(i32 %0) {
ret void
}
int drv_attribute_open_recover(int p, char *suri, char *sname) { return p; }


x86 assembly (clang, -O0):
<drv_attribute_open_recover>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @drv_attribute_open_recover(i32 returned %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ memcmp(char *, char *, int /*<<< orphan*/);
int main() {
  char *str1 = "Hello World";
  char *str2 = "Hello Dave";
  return !memcmp(str1, str2, 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xedb(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
xor    %edx,%edx
call   1030 <memcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xeed(%rip),%rsi
xor    %edx,%edx
call   1030 <memcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Hello World\00"
@.str.1 = [11 x i8] c"Hello Dave\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8** %3
%4 = load i8*, i8** %2
%5 = load i8*, i8** %3
%6 = call i32 @memcmp(i8* %4, i8* %5, i32 0)
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
@.str = [12 x i8] c"Hello World\00"
@.str.1 = [11 x i8] c"Hello Dave\00"
define i32 @main() {
%1 = tail call i32 @memcmp(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 0)
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
int mult(int x, int y) { return (x * y); }


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

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

LLVM IR (-O0):
define i32 @mult(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
ret i32 %7
}

LLVM IR (-O2):
define i32 @mult(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
void g_io_channel_unix_get_fd() {}


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

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

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

LLVM IR (-O2):
define void @g_io_channel_unix_get_fd() {
ret void
}
void ltol3(cp, lp, n) char *cp;
long *lp;
int n;
{
  register i;
  register char *a, *b;
  a = cp;
  b = (char *)lp;
  for (i = 0; i < n; ++i) {
  }
}


x86 assembly (clang, -O0):
<ltol3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1145 <ltol3+0x45>
jmp    1137 <ltol3+0x37>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1126 <ltol3+0x26>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @ltol3(i8* nocapture %0, i64* nocapture %1, i32 %2) {
ret void
}
/* Type definitions */
struct feed_text {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ feed_text_cleanup(struct feed_text *const);
void feed_text_cleanup_cb(void *const p_object) {
  struct feed_text *const p_text = (struct feed_text *)(p_object);
  feed_text_cleanup(p_text);
}


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

x86 assembly (clang, -O2):
<feed_text_cleanup_cb>:
jmp    1030 <feed_text_cleanup@plt>

LLVM IR (-O0):
%struct.feed_text = type { i32 }
define void @feed_text_cleanup_cb(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.feed_text*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.feed_text*
store %struct.feed_text* %5, %struct.feed_text** %3
%6 = load %struct.feed_text*, %struct.feed_text** %3
%7 = call i32 @feed_text_cleanup(%struct.feed_text* %6)
ret void
}

LLVM IR (-O2):
%struct.feed_text = type { i32 }
define void @feed_text_cleanup_cb(i8* %0) {
%2 = bitcast i8* %0 to %struct.feed_text*
%3 = tail call i32 @feed_text_cleanup(%struct.feed_text* %2)
ret void
}
int test_imm_B4int32_mem(int *val) {
  return ((*val) & (0xB4 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_B4int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 180
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
size_t CombinationSimpleR(int /*<<< orphan*/, int *, int *, size_t, size_t,
                          int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ free(int *);
scalar_t__ malloc(size_t);
size_t CombinationSimple(int *val, size_t n, size_t k) {
  size_t count;
  int *sol = (int *)malloc(k * sizeof(int));
  count = CombinationSimpleR(0, val, sol, n, k, 0, 0);
  free(sol);
  return (count);
}


x86 assembly (clang, -O0):
<CombinationSimple>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
shl    $0x2,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
xor    %r9d,%r9d
mov    %r9d,%edi
movl   $0x0,(%rsp)
call   1040 <CombinationSimpleR@plt>
mov    %rax,-0x20(%rbp)
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CombinationSimple>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r12
mov    %rsi,%r14
mov    %rdi,%r15
lea    0x0(,%rdx,4),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
movl   $0x0,(%rsp)
xor    %edi,%edi
mov    %r15,%rsi
mov    %rax,%rdx
mov    %r14,%rcx
mov    %r12,%r8
xor    %r9d,%r9d
call   1040 <CombinationSimpleR@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @CombinationSimple(i32* %0, i64 %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32*
store i32* %0, i32** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%9 = load i64, i64* %6
%10 = mul i64 %9, 4
%11 = call i64 @malloc(i64 %10)
%12 = inttoptr i64 %11 to i32*
store i32* %12, i32** %8
%13 = load i32*, i32** %4
%14 = load i32*, i32** %8
%15 = load i64, i64* %5
%16 = load i64, i64* %6
%17 = call i64 @CombinationSimpleR(i32 0, i32* %13, i32* %14, i64 %15, i64 %16, i32 0, i32 0)
store i64 %17, i64* %7
%18 = load i32*, i32** %8
%19 = call i32 @free(i32* %18)
%20 = load i64, i64* %7
ret i64 %20
}

LLVM IR (-O2):
define i64 @CombinationSimple(i32* %0, i64 %1, i64 %2) {
%4 = shl i64 %2, 2
%5 = tail call i64 @malloc(i64 %4)
%6 = inttoptr i64 %5 to i32*
%7 = tail call i64 @CombinationSimpleR(i32 0, i32* %0, i32* %6, i64 %1, i64 %2, i32 0, i32 0)
%8 = tail call i32 @free(i32* %6)
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_cvolume_channels_equal_to() {
  printf("NOT IMPLEMENTED:"
         "pa_cvolume_channels_equal_to"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [45 x i8] c"NOT IMPLEMENTED:pa_cvolume_channels_equal_to\00"
define i32 @pa_cvolume_channels_equal_to() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int test_imm_25uint32_mem(unsigned int *val) {
  return ((*val) & (0x25 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_25uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 37
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ msort_nnt(unsigned int *, int /*<<< orphan*/, unsigned int,
                             unsigned int, int (*)(void *, void *));
int mergesort(unsigned int *arr, unsigned int size,
              int (*cmpFunc)(void *a, void *b)) {
  msort_nnt(arr, 0, size - 1, size, cmpFunc);
  return 0;
}


x86 assembly (clang, -O0):
<mergesort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%r8
xor    %esi,%esi
call   1030 <msort_nnt@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mergesort>:
push   %rax
mov    %rdx,%r8
mov    %esi,%ecx
lea    -0x1(%rcx),%edx
xor    %esi,%esi
call   1030 <msort_nnt@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @mergesort(i32* %0, i32 %1, i32 (i8*, i8*)* %2) {
%4 = add i32 %1, -1
%5 = tail call i32 @msort_nnt(i32* %0, i32 0, i32 %4, i32 %1, i32 (i8*, i8*)* %2)
ret i32 0
}
/* Variables and functions */
size_t cgc_strlen(const char *str) {
  size_t len = 0;
  while (*str++ != '\0')
    len++;
  return len;
}


x86 assembly (clang, -O0):
<cgc_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 <cgc_strlen+0x3c>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <cgc_strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgc_strlen>:
cmpb   $0x0,(%rdi)
je     111f <cgc_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 <cgc_strlen+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @cgc_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 @cgc_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
}
/* Variables and functions */
int WEXITSTATUS(int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, int, int);
int /*<<< orphan*/ system(char *);
int send_sig(int pid, int sig) {
  char exec_str[128];
  sprintf(exec_str, "kill -%d %d >/dev/null 2>&1", sig, pid);
  int result = WEXITSTATUS(system(exec_str));
  if (result == 0)
    return 0;
  else
    return -1;
}


x86 assembly (clang, -O0):
<send_sig>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xeab(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x90(%rbp),%rdi
call   1030 <system@plt>
mov    %eax,%edi
call   1040 <WEXITSTATUS@plt>
mov    %eax,-0x94(%rbp)
cmpl   $0x0,-0x94(%rbp)
jne    118c <send_sig+0x5c>
movl   $0x0,-0x4(%rbp)
jmp    1193 <send_sig+0x63>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_sig>:
push   %rbx
sub    $0x80,%rsp
mov    %esi,%edx
mov    %edi,%ecx
lea    0xebd(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    %eax,%edi
call   1040 <WEXITSTATUS@plt>
neg    %eax
sbb    %eax,%eax
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"kill -%d %d >/dev/null 2>&1\00"
define i32 @send_sig(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [128 x i8]
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%8 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10)
%12 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%13 = call i32 @system(i8* %12)
%14 = call i32 @WEXITSTATUS(i32 %13)
store i32 %14, i32* %7
%15 = load i32, i32* %7
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 0, i32* %3
br label %19
18: ; preds = %2
store i32 -1, i32* %3
br label %19
19: ; preds = %18, %17
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@.str = [28 x i8] c"kill -%d %d >/dev/null 2>&1\00"
define i32 @send_sig(i32 %0, i32 %1) {
%3 = alloca [128 x i8]
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0)
%6 = call i32 @system(i8* %4)
%7 = tail call i32 @WEXITSTATUS(i32 %6)
%8 = icmp ne i32 %7, 0
%9 = sext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, size_t);
void __aeabi_memcpy(void *dest, const void *src, size_t size) {
  memcpy(dest, src, size);
}


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

x86 assembly (clang, -O2):
<__aeabi_memcpy>:
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @__aeabi_memcpy(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @memcpy(i8* %7, i8* %8, i64 %9)
ret void
}

LLVM IR (-O2):
define void @__aeabi_memcpy(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %2)
ret void
}
__attribute__((always_)) int unregister_trace_kmem_cache_free(
    void (*probe)(void *__data, unsigned long call_site, const void *ptr),
    void *data) {
  return -38;
}


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

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

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

LLVM IR (-O2):
define i32 @unregister_trace_kmem_cache_free(void (i8*, i64, i8*)* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 -38
}
char *R2Settings_getFullHelp() {
  return "--enable-colors\t\tEnable the use of colors by the terminal\n"
         "--disable-colors\tDisable the use of colors by the terminal\n";
}


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

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

LLVM IR (-O0):
@.str = [118 x i8] c"--enable-colors\09\09Enable the use of colors by the terminal\0A--disable-colors\09Disable the use of colors by the terminal\0A\00"
define i8* @R2Settings_getFullHelp() {
ret i8* getelementptr inbounds ([118 x i8], [118 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [118 x i8] c"--enable-colors\09\09Enable the use of colors by the terminal\0A--disable-colors\09Disable the use of colors by the terminal\0A\00"
define i8* @R2Settings_getFullHelp() {
ret i8* getelementptr inbounds ([118 x i8], [118 x i8]* @.str, i64 0, i64 0)
}
long hash(char *word) {
  long count_ascii = 42;
  long counter = 0;
  while (word[counter] != '\0') {
    count_ascii = count_ascii + (word[counter] * (counter + 1));
    counter++;
  }
  return count_ascii;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x2a,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1162 <hash+0x62>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    -0x18(%rbp),%rdx
movsbq (%rcx,%rdx,1),%rcx
mov    -0x18(%rbp),%rdx
add    $0x1,%rdx
imul   %rdx,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1118 <hash+0x18>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%dl
mov    $0x2a,%eax
test   %dl,%dl
je     1127 <hash+0x27>
mov    $0x1,%ecx
movsbq %dl,%rdx
imul   %rcx,%rdx
add    %rdx,%rax
movzbl (%rdi,%rcx,1),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <hash+0x10>
ret

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

LLVM IR (-O2):
define i64 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %13, %4 ], [ %2, %1 ]
%6 = phi i64 [ %9, %4 ], [ 0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 42, %1 ]
%8 = sext i8 %5 to i64
%9 = add nuw nsw i64 %6, 1
%10 = mul nsw i64 %9, %8
%11 = add nsw i64 %10, %7
%12 = getelementptr inbounds i8, i8* %0, i64 %9
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i64 [ 42, %1 ], [ %11, %4 ]
ret i64 %16
}
void gtk_entry_completion_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_entry_completion_get_type() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SDL_FreeSurface(void *);
void lSDL_Surface_destroy(void *ptr) { SDL_FreeSurface(ptr); }


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

x86 assembly (clang, -O2):
<lSDL_Surface_destroy>:
jmp    1030 <SDL_FreeSurface@plt>

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

LLVM IR (-O2):
define void @lSDL_Surface_destroy(i8* %0) {
%2 = tail call i32 @SDL_FreeSurface(i8* %0)
ret void
}
int getdigit(int x, int d) {
  int a[] = {1, 1, 10, 100};
  return (x / a[d]) % 10;
}


x86 assembly (clang, -O0):
<getdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0xeef(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeec(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
movslq -0x8(%rbp),%rcx
cltd
idivl  -0x20(%rbp,%rcx,4)
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getdigit>:
mov    %edi,%eax
movslq %esi,%rcx
lea    0xef4(%rip),%rsi
cltd
idivl  (%rsi,%rcx,4)
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
@__const.getdigit.a = [4 x i32] [i32 1, i32 1, i32 10, i32 100]
define i32 @getdigit(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [4 x i32]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = bitcast [4 x i32]* %5 to i8*
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 %9
%11 = load i32, i32* %10
%12 = sdiv i32 %7, %11
%13 = srem i32 %12, 10
ret i32 %13
}

LLVM IR (-O2):
@__const.getdigit.a = [4 x i32] [i32 1, i32 1, i32 10, i32 100]
define i32 @getdigit(i32 %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds [4 x i32], [4 x i32]* @__const.getdigit.a, i64 0, i64 %3
%5 = load i32, i32* %4
%6 = sdiv i32 %0, %5
%7 = srem i32 %6, 10
ret i32 %7
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
uint8_t inc(uint8_t nvs, uint8_t ptr) {
  ptr += 1;
  while (ptr >= nvs)
    ptr -= nvs;
  return ptr;
}


x86 assembly (clang, -O0):
<inc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jl     113a <inc+0x3a>
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1118 <inc+0x18>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inc>:
lea    (%rsi,%rdi,1),%rax
add    $0x1,%rax
nopl   0x0(%rax,%rax,1)
sub    %rdi,%rax
cmp    %rdi,%rax
jge    1110 <inc+0x10>
ret

LLVM IR (-O0):
define i64 @inc(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 = add nsw i64 %5, 1
store i64 %6, i64* %4
br label %7
7: ; preds = %11, %2
%8 = load i64, i64* %4
%9 = load i64, i64* %3
%10 = icmp sge i64 %8, %9
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = load i64, i64* %3
%13 = load i64, i64* %4
%14 = sub nsw i64 %13, %12
store i64 %14, i64* %4
br label %7
15: ; preds = %7
%16 = load i64, i64* %4
ret i64 %16
}

LLVM IR (-O2):
define i64 @inc(i64 %0, i64 %1) {
%3 = add nsw i64 %1, 1
br label %4
4: ; preds = %4, %2
%5 = phi i64 [ %3, %2 ], [ %7, %4 ]
%6 = icmp slt i64 %5, %0
%7 = sub nsw i64 %5, %0
br i1 %6, label %8, label %4
8: ; preds = %4
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void gprsharp_inf_future() {
  fprintf(stderr, "Should never reach here");
  abort();
}


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

x86 assembly (clang, -O2):
<gprsharp_inf_future>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @gprsharp_inf_future() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @gprsharp_inf_future() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
void mvni_msl8(int *__restrict a) {
  int i;
  for (i = 0; i < 16; i++)
    a[i] = 0xffff5400;
}


x86 assembly (clang, -O0):
<mvni_msl8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x10,-0xc(%rbp)
jge    1136 <mvni_msl8+0x36>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0xffff5400,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <mvni_msl8+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mvni_msl8>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,(%rdi)
movups %xmm0,0x10(%rdi)
movups %xmm0,0x20(%rdi)
movups %xmm0,0x30(%rdi)
ret

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

LLVM IR (-O2):
define void @mvni_msl8(i32* noalias nocapture writeonly %0) {
%2 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> <i32 -44032, i32 -44032, i32 -44032, i32 -44032>, <4 x i32>* %2
%3 = getelementptr inbounds i32, i32* %0, i64 4
%4 = bitcast i32* %3 to <4 x i32>*
store <4 x i32> <i32 -44032, i32 -44032, i32 -44032, i32 -44032>, <4 x i32>* %4
%5 = getelementptr inbounds i32, i32* %0, i64 8
%6 = bitcast i32* %5 to <4 x i32>*
store <4 x i32> <i32 -44032, i32 -44032, i32 -44032, i32 -44032>, <4 x i32>* %6
%7 = getelementptr inbounds i32, i32* %0, i64 12
%8 = bitcast i32* %7 to <4 x i32>*
store <4 x i32> <i32 -44032, i32 -44032, i32 -44032, i32 -44032>, <4 x i32>* %8
ret void
}
/* Variables and functions */
int fastrand();
int M_RandomInt(int lower, int upper) {
  return (fastrand() % (upper - lower + 1) + lower);
}


x86 assembly (clang, -O0):
<M_RandomInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <fastrand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M_RandomInt>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <fastrand@plt>
sub    %ebp,%ebx
add    $0x1,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @M_RandomInt(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @fastrand()
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = add nsw i32 %8, 1
%10 = srem i32 %5, %9
%11 = load i32, i32* %3
%12 = add nsw i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @M_RandomInt(i32 %0, i32 %1) {
%3 = tail call i32 (...) @fastrand()
%4 = sub i32 1, %0
%5 = add i32 %4, %1
%6 = srem i32 %3, %5
%7 = add nsw i32 %6, %0
ret i32 %7
}
unsigned short ip_csum(unsigned char *cp, int len) {
  return ~ip_csum_cont(0, cp, len);
}


x86 assembly (clang, -O0):
<ip_csum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
xor    %edi,%edi
mov    $0x0,%al
call   1030 <ip_csum_cont@plt>
xor    $0xffffffff,%eax
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i16 @ip_csum(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @ip_csum_cont to i32 (i32, i8*, i32, ...)*)(i32 0, i8* %5, i32 %6)
%8 = xor i32 %7, -1
%9 = trunc i32 %8 to i16
ret i16 %9
}

LLVM IR (-O2):
define zeroext i16 @ip_csum(i8* %0, i32 %1) {
%3 = tail call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @ip_csum_cont to i32 (i32, i8*, i32, ...)*)(i32 0, i8* %0, i32 %1)
%4 = trunc i32 %3 to i16
%5 = xor i16 %4, -1
ret i16 %5
}
void encodesteer(char *target, unsigned short index, unsigned short tickdelta,
                 unsigned char turnchange) {
  target[0] = 7 & index;
  target[0] |= (1 & turnchange) << 3;
  target[0] |= (16 + 32 + 64) & (tickdelta << 4);
  target[1] = 127 & (tickdelta >> 3);
}


x86 assembly (clang, -O0):
<encodesteer>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %dx,%cx
mov    %si,%dx
mov    %rdi,-0x8(%rbp)
mov    %dx,-0xa(%rbp)
mov    %cx,-0xc(%rbp)
mov    %al,-0xd(%rbp)
movzwl -0xa(%rbp),%eax
and    $0x7,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
movzbl -0xd(%rbp),%edx
and    $0x1,%edx
shl    $0x3,%edx
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
or     %edx,%ecx
mov    %cl,(%rax)
movzwl -0xc(%rbp),%edx
shl    $0x4,%edx
and    $0x70,%edx
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
or     %edx,%ecx
mov    %cl,(%rax)
movzwl -0xc(%rbp),%eax
sar    $0x3,%eax
and    $0x7f,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<encodesteer>:
and    $0x7,%sil
shl    $0x3,%cl
and    $0x8,%cl
or     %sil,%cl
mov    %edx,%eax
shl    $0x4,%al
and    $0x70,%al
or     %cl,%al
mov    %al,(%rdi)
shr    $0x3,%edx
and    $0x7f,%dl
mov    %dl,0x1(%rdi)
ret

LLVM IR (-O0):
define void @encodesteer(i8* %0, i16 zeroext %1, i16 zeroext %2, i8 zeroext %3) {
%5 = alloca i8*
%6 = alloca i16
%7 = alloca i16
%8 = alloca i8
store i8* %0, i8** %5
store i16 %1, i16* %6
store i16 %2, i16* %7
store i8 %3, i8* %8
%9 = load i16, i16* %6
%10 = zext i16 %9 to i32
%11 = and i32 7, %10
%12 = trunc i32 %11 to i8
%13 = load i8*, i8** %5
%14 = getelementptr inbounds i8, i8* %13, i64 0
store i8 %12, i8* %14
%15 = load i8, i8* %8
%16 = zext i8 %15 to i32
%17 = and i32 1, %16
%18 = shl i32 %17, 3
%19 = load i8*, i8** %5
%20 = getelementptr inbounds i8, i8* %19, i64 0
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = or i32 %22, %18
%24 = trunc i32 %23 to i8
store i8 %24, i8* %20
%25 = load i16, i16* %7
%26 = zext i16 %25 to i32
%27 = shl i32 %26, 4
%28 = and i32 112, %27
%29 = load i8*, i8** %5
%30 = getelementptr inbounds i8, i8* %29, i64 0
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = or i32 %32, %28
%34 = trunc i32 %33 to i8
store i8 %34, i8* %30
%35 = load i16, i16* %7
%36 = zext i16 %35 to i32
%37 = ashr i32 %36, 3
%38 = and i32 127, %37
%39 = trunc i32 %38 to i8
%40 = load i8*, i8** %5
%41 = getelementptr inbounds i8, i8* %40, i64 1
store i8 %39, i8* %41
ret void
}

LLVM IR (-O2):
define void @encodesteer(i8* nocapture writeonly %0, i16 zeroext %1, i16 zeroext %2, i8 zeroext %3) {
%5 = trunc i16 %1 to i8
%6 = and i8 %5, 7
%7 = shl i8 %3, 3
%8 = and i8 %7, 8
%9 = or i8 %8, %6
%10 = trunc i16 %2 to i8
%11 = shl i8 %10, 4
%12 = and i8 %11, 112
%13 = or i8 %9, %12
store i8 %13, i8* %0
%14 = lshr i16 %2, 3
%15 = trunc i16 %14 to i8
%16 = and i8 %15, 127
%17 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %16, i8* %17
ret void
}
double F(double rho_) { return 0.; }


x86 assembly (clang, -O0):
<F>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<F>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @F(double %0) {
%2 = alloca double
store double %0, double* %2
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @F(double %0) {
ret double 0.000000e+00
}
int ord(int *l, int *r) {
  if (*l < *r) {
    return (-1);
  } else if (*l == *r) {
    return (0);
  } else {
    return (1);
  }
}


x86 assembly (clang, -O0):
<ord>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jge    112a <ord+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    114f <ord+0x4f>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jne    1148 <ord+0x48>
movl   $0x0,-0x4(%rbp)
jmp    114f <ord+0x4f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ord>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setne  %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @ord(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %3, %4
%6 = icmp ne i32 %3, %4
%7 = zext i1 %6 to i32
%8 = select i1 %5, i32 -1, i32 %7
ret i32 %8
}
int to_viterbi(int x) { return (128 - 1) + 2 * x; }


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

x86 assembly (clang, -O2):
<to_viterbi>:
lea    (%rdi,%rdi,1),%eax
add    $0x7f,%eax
ret

LLVM IR (-O0):
define i32 @to_viterbi(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 2, %3
%5 = add nsw i32 127, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @to_viterbi(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = add nsw i32 %2, 127
ret i32 %3
}
/* Variables and functions */
void *ec_malloc(size_t);
void *realloc(void *, size_t);
void *ec_realloc(void *ptr, size_t size) {
  void *mem = NULL;
  if (!ptr)
    mem = ec_malloc(size);
  else
    mem = realloc(mem, size);
  return mem;
}


x86 assembly (clang, -O0):
<ec_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1155 <ec_realloc+0x35>
mov    -0x10(%rbp),%rdi
call   1030 <ec_malloc@plt>
mov    %rax,-0x18(%rbp)
jmp    1166 <ec_realloc+0x46>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ec_realloc>:
test   %rdi,%rdi
je     112d <ec_realloc+0xd>
mov    %rsi,%rdi
jmp    1040 <malloc@plt>
mov    %rsi,%rdi
jmp    1030 <ec_malloc@plt>

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

LLVM IR (-O2):
define i8* @ec_realloc(i8* readnone %0, i64 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i8* @ec_malloc(i64 %1)
br label %8
6: ; preds = %2
%7 = tail call i8* @malloc(i64 %1)
br label %8
8: ; preds = %6, %4
%9 = phi i8* [ %7, %6 ], [ %5, %4 ]
ret i8* %9
}
/* Variables and functions */
int S_ISDIR(int);
int st_is_dir(int st_mode) { return S_ISDIR(st_mode); }


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

x86 assembly (clang, -O2):
<st_is_dir>:
jmp    1030 <S_ISDIR@plt>

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

LLVM IR (-O2):
define i32 @st_is_dir(i32 %0) {
%2 = tail call i32 @S_ISDIR(i32 %0)
ret i32 %2
}
/* Variables and functions */
char *ERR_error_string(unsigned long, int /*<<< orphan*/);
unsigned long ERR_get_error();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
int rsa_err(const char *msg) {
  unsigned long sslErr = ERR_get_error();
  fprintf(stderr, "%s", msg);
  fprintf(stderr, ": %s\n", ERR_error_string(sslErr, 0));
  return -1;
}


x86 assembly (clang, -O0):
<rsa_err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <ERR_get_error@plt>
mov    %rax,-0x10(%rbp)
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xea5(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1040 <ERR_error_string@plt>
mov    -0x14(%rbp),%edi
mov    %rax,%rdx
lea    0xe7f(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rsa_err>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
xor    %eax,%eax
call   1050 <ERR_get_error@plt>
mov    %rax,%rbx
mov    0x2e98(%rip),%rbp
mov    0x0(%rbp),%edi
lea    0xeae(%rip),%rsi
mov    %r14,%rdx
call   1030 <fprintf@plt>
mov    0x0(%rbp),%ebp
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <ERR_error_string@plt>
lea    0xe95(%rip),%rsi
mov    %ebp,%edi
mov    %rax,%rdx
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
@.str.1 = [6 x i8] c": %s\0A\00"
define i32 @rsa_err(i8* %0) {
%2 = tail call i64 (...) @ERR_get_error()
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = load i32, i32* @stderr
%6 = tail call i8* @ERR_error_string(i64 %2, i32 0)
%7 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %6)
ret i32 -1
}
int iscntrl(int c) { return (c >= 1 && c <= 31); }


x86 assembly (clang, -O0):
<iscntrl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x1,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <iscntrl+0x20>
cmpl   $0x1f,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iscntrl>:
add    $0xffffffff,%edi
xor    %eax,%eax
cmp    $0x1f,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @iscntrl(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 31
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int subroutine();
int first() { return subroutine(); }


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

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

LLVM IR (-O0):
define i32 @first() {
%1 = call i32 (...) @subroutine()
ret i32 %1
}

LLVM IR (-O2):
define i32 @first() {
%1 = tail call i32 (...) @subroutine()
ret i32 %1
}
int ExtMcd(int num1, int num2) {
  if (num2 % num1 == 0)
    return num1;
  else
    return ExtMcd(num2 % num1, num1);
}


x86 assembly (clang, -O0):
<ExtMcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
jne    1139 <ExtMcd+0x29>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114d <ExtMcd+0x3d>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%edi
mov    -0x8(%rbp),%esi
call   1030 <ExtMcd@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ExtMcd>:
mov    %edi,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %esi,%eax
mov    %edx,%esi
cltd
idiv   %esi
test   %edx,%edx
jne    1110 <ExtMcd+0x10>
mov    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @ExtMcd(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ %0, %2 ], [ %6, %3 ]
%5 = phi i32 [ %1, %2 ], [ %4, %3 ]
%6 = srem i32 %5, %4
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3
ret i32 %4
}