xunge/DecIR huggingface dataset:
void fmatrix_all_free(float **m) {
  float *a;
  a = m[0];
  free(m);
  free(a);
  return;
}


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

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

LLVM IR (-O0):
define void @fmatrix_all_free(float** %0) {
%2 = alloca float**
%3 = alloca float*
store float** %0, float*** %2
%4 = load float**, float*** %2
%5 = getelementptr inbounds float*, float** %4, i64 0
%6 = load float*, float** %5
store float* %6, float** %3
%7 = load float**, float*** %2
%8 = bitcast float** %7 to i8*
%9 = load float*, float** %3
%10 = bitcast float* %9 to i8*
ret void
}

LLVM IR (-O2):
define void @fmatrix_all_free(float** nocapture %0) {
%2 = bitcast float** %0 to i8**
%3 = load i8*, i8** %2
%4 = bitcast float** %0 to i8*
tail call void @free(i8* %4)
tail call void @free(i8* %3)
ret void
}
/* Type definitions */
typedef size_t uint32_t;

/* Variables and functions */
void store_FLOAT(float *arr, uint32_t idx, float value) { arr[idx] = value; }


x86 assembly (clang, -O0):
<store_FLOAT>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<store_FLOAT>:
movss  %xmm0,(%rdi,%rsi,4)
ret

LLVM IR (-O0):
define void @store_FLOAT(float* %0, i64 %1, float %2) {
%4 = alloca float*
%5 = alloca i64
%6 = alloca float
store float* %0, float** %4
store i64 %1, i64* %5
store float %2, float* %6
%7 = load float, float* %6
%8 = load float*, float** %4
%9 = load i64, i64* %5
%10 = getelementptr inbounds float, float* %8, i64 %9
store float %7, float* %10
ret void
}

LLVM IR (-O2):
define void @store_FLOAT(float* nocapture writeonly %0, i64 %1, float %2) {
%4 = getelementptr inbounds float, float* %0, i64 %1
store float %2, float* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
char *getprogname();
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr, "Usage: %s [-aHq]\n", getprogname());
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getprogname@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rdx
lea    0xea8(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ea8(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1030 <getprogname@plt>
lea    0xeb8(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"Usage: %s [-aHq]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i8* (...) @getprogname()
%3 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @exit(i32 1)
unreachable
}
int some_func() {
  static int some_static;
  return some_static;
}


x86 assembly (clang, -O0):
<some_func>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1a(%rip),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@some_func.some_static = internal global i32 0
define i32 @some_func() {
%1 = load i32, i32* @some_func.some_static
ret i32 %1
}

LLVM IR (-O2):
define i32 @some_func() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ osAbortSystem(int);
void osUnhandledException(void) { osAbortSystem(0x2801U); }


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

x86 assembly (clang, -O2):
<osUnhandledException>:
mov    $0x2801,%edi
jmp    1030 <osAbortSystem@plt>

LLVM IR (-O0):
define void @osUnhandledException() {
%1 = call i32 @osAbortSystem(i32 10241)
ret void
}

LLVM IR (-O2):
define void @osUnhandledException() {
%1 = tail call i32 @osAbortSystem(i32 10241)
ret void
}
/* Variables and functions */
scalar_t__ listdir(char *, char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  if (listdir(".", "svg")) {
    printf("OK\n");
  }
  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)
lea    0xec3(%rip),%rdi
lea    0xebe(%rip),%rsi
call   1030 <listdir@plt>
cmp    $0x0,%rax
je     115f <main+0x3f>
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed3(%rip),%rsi
call   1040 <listdir@plt>
test   %rax,%rax
je     1145 <main+0x25>
lea    0xec6(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c".\00"
@.str.1 = [4 x i8] c"svg\00"
@.str.2 = [4 x i8] c"OK\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i64 @listdir(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c".\00"
@.str.1 = [4 x i8] c"svg\00"
@str = [3 x i8] c"OK\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @listdir(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i32 0
}
int test_imm_22int64_lowword_mem(long long *val) {
  return ((*val) & (0x22 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_22int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 34
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ mem_assert(char *);
char *str_malloc(size_t size) {
  char *mem = malloc(sizeof(char) * (size + 1));
  mem_assert(mem);
  mem[size] = '\0';
  return mem;
}


x86 assembly (clang, -O0):
<str_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <mem_assert@plt>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_malloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
add    $0x1,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <mem_assert@plt>
movb   $0x0,(%rbx,%r14,1)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @str_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = add i64 %4, 1
%6 = mul i64 1, %5
%7 = trunc i64 %6 to i32
%8 = call i8* @malloc(i32 %7)
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = call i32 @mem_assert(i8* %9)
%11 = load i8*, i8** %3
%12 = load i64, i64* %2
%13 = getelementptr inbounds i8, i8* %11, i64 %12
store i8 0, i8* %13
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
define i8* @str_malloc(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = add i32 %2, 1
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 @mem_assert(i8* %4)
%6 = getelementptr inbounds i8, i8* %4, i64 %0
store i8 0, i8* %6
ret i8* %4
}
int fun541() { return 541; }


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

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

LLVM IR (-O0):
define i32 @fun541() {
ret i32 541
}

LLVM IR (-O2):
define i32 @fun541() {
ret i32 541
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void exit_with_error(char *err_msg) {
  printf("%s\n", err_msg);
  exit(1);
}


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

x86 assembly (clang, -O2):
<exit_with_error>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @exit_with_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @exit_with_error(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
long double expl(long double);
long double coshl(long double x) { return .5L * (expl(x) + expl(-x)); }


x86 assembly (clang, -O0):
<coshl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <expl@plt>
fstpt  -0x1c(%rbp)
fldt   -0x10(%rbp)
fchs
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <expl@plt>
fldt   -0x1c(%rbp)
faddp  %st,%st(1)
flds   0xeb8(%rip)
fmulp  %st,%st(1)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<coshl>:
sub    $0x28,%rsp
fldt   0x30(%rsp)
fld    %st(0)
fstpt  0x10(%rsp)
fstpt  (%rsp)
call   1030 <expl@plt>
fstpt  0x1c(%rsp)
fldt   0x10(%rsp)
fchs
fstpt  (%rsp)
call   1030 <expl@plt>
fldt   0x1c(%rsp)
faddp  %st,%st(1)
fmuls  0xebc(%rip)
add    $0x28,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @coshl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call x86_fp80 @expl(x86_fp80 %3)
%5 = load x86_fp80, x86_fp80* %2
%6 = fneg x86_fp80 %5
%7 = call x86_fp80 @expl(x86_fp80 %6)
%8 = fadd x86_fp80 %4, %7
%9 = fmul x86_fp80 0xK3FFE8000000000000000, %8
ret x86_fp80 %9
}

LLVM IR (-O2):
define x86_fp80 @coshl(x86_fp80 %0) {
%2 = tail call x86_fp80 @expl(x86_fp80 %0)
%3 = fneg x86_fp80 %0
%4 = tail call x86_fp80 @expl(x86_fp80 %3)
%5 = fadd x86_fp80 %2, %4
%6 = fmul x86_fp80 %5, 0xK3FFE8000000000000000
ret x86_fp80 %6
}
void *kmemset(void *s, int c, int n) {
  int i;
  for (i = 0; i < n; i++)
    ((char *)s)[i] = c;
  return s;
}


x86 assembly (clang, -O0):
<kmemset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    113f <kmemset+0x3f>
mov    -0xc(%rbp),%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1115 <kmemset+0x15>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kmemset>:
push   %rbx
mov    %rdi,%rbx
test   %edx,%edx
jle    1122 <kmemset+0x12>
mov    %edx,%edx
mov    %rbx,%rdi
call   1030 <memset@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @kmemset(i8* returned writeonly %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = trunc i32 %1 to i8
%7 = zext i32 %2 to i64
br label %8
8: ; preds = %5, %3
ret i8* %0
}
/* Variables and functions */
long long fib2(int, int /*<<< orphan*/, int);
long long fib(int n) { return fib2(n, 0, 1); }


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <fib2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
xor    %esi,%esi
mov    $0x1,%edx
jmp    1030 <fib2@plt>

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

LLVM IR (-O2):
define i64 @fib(i32 %0) {
%2 = tail call i64 @fib2(i32 %0, i32 0, i32 1)
ret i64 %2
}
/* Variables and functions */
bool is_offset_in_branch_range(long offset) {
  return (offset >= -0x2000000 && offset <= 0x1fffffc && !(offset & 0x3));
}


x86 assembly (clang, -O0):
<is_offset_in_branch_range>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0xfffffffffe000000,-0x8(%rbp)
fe
mov    %al,-0x9(%rbp)
jl     1142 <is_offset_in_branch_range+0x42>
xor    %eax,%eax
cmpq   $0x1fffffc,-0x8(%rbp)
01
mov    %al,-0x9(%rbp)
jg     1142 <is_offset_in_branch_range+0x42>
mov    -0x8(%rbp),%rax
and    $0x3,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_offset_in_branch_range>:
lea    0x2000000(%rdi),%rax
cmp    $0x3fffffd,%rax
setb   %al
test   $0x3,%dil
sete   %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_offset_in_branch_range(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp sge i64 %3, -33554432
br i1 %4, label %5, label %13
5: ; preds = %1
%6 = load i64, i64* %2
%7 = icmp sle i64 %6, 33554428
br i1 %7, label %8, label %13
8: ; preds = %5
%9 = load i64, i64* %2
%10 = and i64 %9, 3
%11 = icmp ne i64 %10, 0
%12 = xor i1 %11, true
br label %13
13: ; preds = %8, %5, %1
%14 = phi i1 [ false, %5 ], [ false, %1 ], [ %12, %8 ]
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @is_offset_in_branch_range(i64 %0) {
%2 = add i64 %0, 33554432
%3 = icmp ult i64 %2, 67108861
%4 = and i64 %0, 3
%5 = icmp eq i64 %4, 0
%6 = and i1 %3, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int roll();
int main() {
  printf("You roll [%d] [%d]\n", roll(), roll());
  printf("PC rolls [%d] [%d]\n", roll(), roll());
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <roll@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <roll@plt>
lea    0xec8(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <roll@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <roll@plt>
lea    0xebc(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"You roll [%d] [%d]\0A\00"
@.str.1 = [20 x i8] c"PC rolls [%d] [%d]\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @roll()
%3 = call i32 (...) @roll()
%4 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3)
%5 = call i32 (...) @roll()
%6 = call i32 (...) @roll()
%7 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"You roll [%d] [%d]\0A\00"
@.str.1 = [20 x i8] c"PC rolls [%d] [%d]\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @roll()
%2 = tail call i32 (...) @roll()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
%4 = tail call i32 (...) @roll()
%5 = tail call i32 (...) @roll()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %4, i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ lock();
int rand();
int g() {
  if (rand() % 2 == 0) {
    g();
  } else {
    lock();
  }
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <rand@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    115a <g+0x2a>
call   1040 <g@plt>
jmp    1161 <g+0x31>
mov    $0x0,%al
call   1030 <lock@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <rand@plt>
test   $0x1,%al
je     1130 <g+0x10>
xor    %eax,%eax
pop    %rcx
jmp    1030 <lock@plt>

LLVM IR (-O0):
define i32 @g() {
%1 = alloca i32
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @g()
br label %9
7: ; preds = %0
%8 = call i32 (...) @lock()
br label %9
9: ; preds = %7, %5
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @g() {
%1 = tail call i32 (...) @rand()
%2 = and i32 %1, 1
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %0, %4
%5 = tail call i32 (...) @rand()
%6 = and i32 %5, 1
%7 = icmp eq i32 %6, 0
br i1 %7, label %4, label %8
8: ; preds = %4, %0
%9 = tail call i32 (...) @lock()
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ in_port_t;
typedef int /*<<< orphan*/ in_addr_t;

/* Variables and functions */
char should_apply_synack(in_addr_t addr, in_port_t port) { return 1; }


x86 assembly (clang, -O0):
<should_apply_synack>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x1,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<should_apply_synack>:
mov    $0x1,%al
ret

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

LLVM IR (-O2):
define signext i8 @should_apply_synack(i32 %0, i32 %1) {
ret i8 1
}
void recursive(int i) {
  if (i > 0) {
    i--;
    recursive(i);
  }
}


x86 assembly (clang, -O0):
<recursive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1136 <recursive+0x26>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <recursive@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @recursive(i32 %0) {
ret void
}
int my_str_isprintable(char *str) {
  int i;
  for (i = 0; str[i]; i++) {
    if (str[i] < 32 || str[i] > 126)
      return (0);
  }
  return (1);
}


x86 assembly (clang, -O0):
<my_str_isprintable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     116a <my_str_isprintable+0x6a>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
jl     114b <my_str_isprintable+0x4b>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x7e,%eax
jle    1157 <my_str_isprintable+0x57>
movl   $0x0,-0x4(%rbp)
jmp    1171 <my_str_isprintable+0x71>
jmp    115c <my_str_isprintable+0x5c>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <my_str_isprintable+0xf>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_str_isprintable>:
mov    (%rdi),%cl
mov    $0x1,%eax
test   %cl,%cl
je     1123 <my_str_isprintable+0x23>
add    $0x1,%rdi
nop
add    $0x81,%cl
cmp    $0xa0,%cl
jbe    1124 <my_str_isprintable+0x24>
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <my_str_isprintable+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @my_str_isprintable(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %8
4: ; preds = %8
%5 = getelementptr inbounds i8, i8* %0, i64 %13
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %1, %4
%9 = phi i64 [ %13, %4 ], [ 0, %1 ]
%10 = phi i8 [ %6, %4 ], [ %2, %1 ]
%11 = add i8 %10, -127
%12 = icmp ult i8 %11, -95
%13 = add nuw i64 %9, 1
br i1 %12, label %14, label %4
14: ; preds = %8, %4, %1
%15 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %8 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ _IO(int, int /*<<< orphan*/);
int ioctl(int, int /*<<< orphan*/);
int pe_active(int handle) { return ioctl(handle, _IO(0xfe, 0)); }


x86 assembly (clang, -O0):
<pe_active>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0xfe,%edi
xor    %esi,%esi
call   1030 <_IO@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1040 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pe_active>:
push   %rbx
mov    %edi,%ebx
mov    $0xfe,%edi
xor    %esi,%esi
call   1030 <_IO@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
define i32 @pe_active(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_IO(i32 254, i32 0)
%5 = call i32 @ioctl(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @pe_active(i32 %0) {
%2 = tail call i32 @_IO(i32 254, i32 0)
%3 = tail call i32 @ioctl(i32 %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fun2();
int /*<<< orphan*/ puts(char *);
int main() {
  puts("This is main");
  fun2();
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"This is main\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @fun2()
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"This is main\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @fun2()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
scalar_t__ wcstoll(int /*<<< orphan*/ const *, int /*<<< orphan*/ **, int);
unsigned long long wcstoull(const wchar_t *str, wchar_t **endptr, int base) {
  return (unsigned long long)wcstoll(str, endptr, base);
}


x86 assembly (clang, -O0):
<wcstoull>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <wcstoll@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcstoull>:
jmp    1030 <wcstoll@plt>

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

LLVM IR (-O2):
define i64 @wcstoull(i32* %0, i32** %1, i32 %2) {
%4 = tail call i64 @wcstoll(i32* %0, i32** %1, i32 %2)
ret i64 %4
}
void actuators_pwm_arch_init(void) {}


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

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

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

LLVM IR (-O2):
define void @actuators_pwm_arch_init() {
ret void
}
int _sub(int a, int b) { return a - b; }


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

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

LLVM IR (-O0):
define i32 @_sub(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 = sub nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @_sub(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}
char *strcpy(char *restrict dest, const char *restrict src) {
  char *d = dest;
  while ((*d++ = *src++))
    ;
  return dest;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1143 <strcpy+0x43>
jmp    1114 <strcpy+0x14>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* noalias returned writeonly %0, i8* noalias nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}
void swab4(char *a) {
  char t;
  t = a[0];
  a[0] = a[3];
  a[3] = t;
  t = a[1];
  a[1] = a[2];
  a[2] = t;
}


x86 assembly (clang, -O0):
<swab4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%al
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swab4>:
mov    (%rdi),%al
mov    0x3(%rdi),%cl
mov    %cl,(%rdi)
mov    %al,0x3(%rdi)
rolw   $0x8,0x1(%rdi)
ret

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

LLVM IR (-O2):
define void @swab4(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 3
%4 = load i8, i8* %3
store i8 %4, i8* %0
store i8 %2, i8* %3
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %0, i64 2
%8 = load i8, i8* %7
store i8 %8, i8* %5
store i8 %6, i8* %7
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t digital_sum(uint64_t i) {
  uint64_t digital_sum = 0;
  for (; i; i /= 10) {
    digital_sum += i % 10;
  }
  return digital_sum;
}


x86 assembly (clang, -O0):
<digital_sum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     113c <digital_sum+0x3c>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    -0x8(%rbp),%edx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <digital_sum+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<digital_sum>:
xor    %eax,%eax
test   %edi,%edi
je     113b <digital_sum+0x3b>
cs nopw 0x0(%rax,%rax,1)
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
lea    (%rdi,%rdi,1),%edx
lea    (%rdx,%rdx,4),%edx
mov    %ecx,%esi
sub    %edx,%esi
add    %esi,%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <digital_sum+0x10>
ret

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

LLVM IR (-O2):
define i32 @digital_sum(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = srem i32 %5, 10
%7 = add nsw i32 %4, %6
%8 = sdiv i32 %5, 10
%9 = add i32 %5, 9
%10 = icmp ult i32 %9, 19
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %12
}
/* Type definitions */
struct fpga_bits {
  int dummy;
};

/* Variables and functions */
void frame_set_bit(scalar_t__, int);
scalar_t__ get_first_minor(struct fpga_bits *, int, int);
void set_bit(struct fpga_bits *bits, int row, int major, int minor, int bit_i) {
  return frame_set_bit(get_first_minor(bits, row, major) + minor * (65 * 2),
                       bit_i);
}


x86 assembly (clang, -O0):
<set_bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <get_first_minor@plt>
mov    %rax,%rdi
imul   $0x82,-0x14(%rbp),%eax
cltq
add    %rax,%rdi
mov    -0x18(%rbp),%esi
call   1040 <frame_set_bit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_bit>:
push   %rbp
push   %rbx
push   %rax
mov    %r8d,%ebp
mov    %ecx,%ebx
call   1030 <get_first_minor@plt>
mov    %ebx,%ecx
shl    $0x7,%ecx
lea    (%rcx,%rbx,2),%ecx
movslq %ecx,%rdi
add    %rax,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <frame_set_bit@plt>

LLVM IR (-O0):
%struct.fpga_bits = type { i32 }
define void @set_bit(%struct.fpga_bits* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca %struct.fpga_bits*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store %struct.fpga_bits* %0, %struct.fpga_bits** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load %struct.fpga_bits*, %struct.fpga_bits** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call i64 @get_first_minor(%struct.fpga_bits* %11, i32 %12, i32 %13)
%15 = load i32, i32* %9
%16 = mul nsw i32 %15, 130
%17 = sext i32 %16 to i64
%18 = add nsw i64 %14, %17
%19 = load i32, i32* %10
ret void
}

LLVM IR (-O2):
%struct.fpga_bits = type { i32 }
define void @set_bit(%struct.fpga_bits* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i64 @get_first_minor(%struct.fpga_bits* %0, i32 %1, i32 %2)
%7 = mul nsw i32 %3, 130
%8 = sext i32 %7 to i64
%9 = add nsw i64 %6, %8
tail call void @frame_set_bit(i64 %9, i32 %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ paths(int /*<<< orphan*/, int /*<<< orphan*/, int, int);
int /*<<< orphan*/ printf(char *, int, int, int /*<<< orphan*/);
int main() {
  for (int i = 0; i < 21; i++) {
    uint64_t count = paths(0, 0, i, i);
    printf("%dx%d: %llu\n", i, i, count);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x15,-0x8(%rbp)
jge    1175 <main+0x55>
mov    -0x8(%rbp),%edx
mov    -0x8(%rbp),%ecx
xor    %esi,%esi
mov    %esi,%edi
call   1040 <paths@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"%dx%d: %llu\0A\00"
define i32 @main() {
br label %2
1: ; preds = %2
ret i32 0
2: ; preds = %0, %2
%3 = phi i32 [ 0, %0 ], [ %6, %2 ]
%4 = tail call i32 @paths(i32 0, i32 0, i32 %3, i32 %3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %3, i32 %4)
%6 = add nuw nsw i32 %3, 1
%7 = icmp eq i32 %6, 21
br i1 %7, label %1, label %2
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int gt_requiredUInt32Bits(int /*<<< orphan*/);
int gt_requiredUInt8Bits(uint8_t v) {
  return gt_requiredUInt32Bits((uint32_t)v);
}


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

x86 assembly (clang, -O2):
<gt_requiredUInt8Bits>:
jmp    1030 <gt_requiredUInt32Bits@plt>

LLVM IR (-O0):
define i32 @gt_requiredUInt8Bits(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = call i32 @gt_requiredUInt32Bits(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @gt_requiredUInt8Bits(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = tail call i32 @gt_requiredUInt32Bits(i32 %2)
ret i32 %3
}
void RTZipCompCreate(void) {}


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

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

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

LLVM IR (-O2):
define void @RTZipCompCreate() {
ret void
}
void XUnsetICFocus() {}


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

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

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

LLVM IR (-O2):
define void @XUnsetICFocus() {
ret void
}
/* Type definitions */
struct stat64 {
  int dummy;
};

/* Variables and functions */
int __xstat64(int, char const *, struct stat64 *);
int ___xstat64(int ver, const char *path, struct stat64 *sb) {
  return __xstat64(ver, path, sb);
}


x86 assembly (clang, -O0):
<___xstat64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <__xstat64@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<___xstat64>:
jmp    1030 <__xstat64@plt>

LLVM IR (-O0):
%struct.stat64 = type { i32 }
define i32 @___xstat64(i32 %0, i8* %1, %struct.stat64* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca %struct.stat64*
store i32 %0, i32* %4
store i8* %1, i8** %5
store %struct.stat64* %2, %struct.stat64** %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load %struct.stat64*, %struct.stat64** %6
%10 = call i32 @__xstat64(i32 %7, i8* %8, %struct.stat64* %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.stat64 = type { i32 }
define i32 @___xstat64(i32 %0, i8* %1, %struct.stat64* %2) {
%4 = tail call i32 @__xstat64(i32 %0, i8* %1, %struct.stat64* %2)
ret i32 %4
}
int vector_sum(int *result, int size) {
  int i, sum;
  sum = 0;
  for (i = 0; i < size; i++) {
    if (result[i] < 0) {
      return -1;
    }
    sum += result[i];
  }
  return sum;
}


x86 assembly (clang, -O0):
<vector_sum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1162 <vector_sum+0x62>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jge    1143 <vector_sum+0x43>
movl   $0xffffffff,-0x4(%rbp)
jmp    1168 <vector_sum+0x68>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1119 <vector_sum+0x19>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vector_sum>:
test   %esi,%esi
jle    1123 <vector_sum+0x23>
mov    %esi,%ecx
xor    %edx,%edx
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
mov    (%rdi,%rdx,4),%esi
test   %esi,%esi
js     1126 <vector_sum+0x26>
add    %esi,%eax
add    $0x1,%rdx
cmp    %rdx,%rcx
jne    1110 <vector_sum+0x10>
ret
xor    %eax,%eax
ret
mov    $0xffffffff,%eax
ret

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

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


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

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

LLVM IR (-O0):
define void @opcode_ee() {
%1 = call i32 (...) @xor_n()
ret void
}

LLVM IR (-O2):
define void @opcode_ee() {
%1 = tail call i32 (...) @xor_n()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ uint16_t;
struct sockaddr_in {
  int dummy;
};
struct sockaddr {
  int dummy;
};

/* Variables and functions */
int bind(int, struct sockaddr *, int);
int /*<<< orphan*/ sockaddrnumfill(struct sockaddr_in *, int /*<<< orphan*/,
                                   int /*<<< orphan*/);
int udpnumlisten(int sock, uint32_t ip, uint16_t port) {
  struct sockaddr_in sa;
  sockaddrnumfill(&sa, ip, port);
  return bind(sock, (struct sockaddr *)&sa, sizeof(struct sockaddr_in));
}


x86 assembly (clang, -O0):
<udpnumlisten>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    -0x10(%rbp),%rdi
call   1030 <sockaddrnumfill@plt>
mov    -0x4(%rbp),%edi
lea    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1040 <bind@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<udpnumlisten>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    %rsp,%r14
mov    %r14,%rdi
call   1030 <sockaddrnumfill@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x4,%edx
call   1040 <bind@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @udpnumlisten(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.sockaddr_in
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @sockaddrnumfill(%struct.sockaddr_in* %7, i32 %8, i32 %9)
%11 = load i32, i32* %4
%12 = bitcast %struct.sockaddr_in* %7 to %struct.sockaddr*
%13 = call i32 @bind(i32 %11, %struct.sockaddr* %12, i32 4)
ret i32 %13
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @udpnumlisten(i32 %0, i32 %1, i32 %2) {
%4 = alloca %struct.sockaddr_in
%5 = bitcast %struct.sockaddr_in* %4 to i8*
%6 = call i32 @sockaddrnumfill(%struct.sockaddr_in* %4, i32 %1, i32 %2)
%7 = bitcast %struct.sockaddr_in* %4 to %struct.sockaddr*
%8 = call i32 @bind(i32 %0, %struct.sockaddr* %7, i32 4)
ret i32 %8
}
__attribute((always_)) float glm_lerp(float from, float to, float t) {
  return from + t * (to - from);
}


x86 assembly (clang, -O0):
<glm_lerp>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
movss  -0x8(%rbp),%xmm2
subss  -0x4(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<glm_lerp>:
subss  %xmm0,%xmm1
mulss  %xmm2,%xmm1
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @glm_lerp(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %6
%9 = load float, float* %5
%10 = load float, float* %4
%11 = fsub float %9, %10
%12 = call float @llvm.fmuladd.f32(float %8, float %11, float %7)
ret float %12
}

LLVM IR (-O2):
define float @glm_lerp(float %0, float %1, float %2) {
%4 = fsub float %1, %0
%5 = tail call float @llvm.fmuladd.f32(float %2, float %4, float %0)
ret float %5
}