xunge/DecIR huggingface dataset:
int test_imm_25int16_reg(short val) {
  return ((val) & (0x25 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_25int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%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_25int16_reg>:
test   $0x25,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_25int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%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_25int16_reg(i16 signext %0) {
%2 = and i16 %0, 37
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_help() {
  printf("test_udp < echo_server | echo_client | echo_thread_client > [ "
         "server_ip ]\n");
}


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

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

LLVM IR (-O0):
@.str = [75 x i8] c"test_udp < echo_server | echo_client | echo_thread_client > [ server_ip ]\0A\00"
define void @print_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [74 x i8] c"test_udp < echo_server | echo_client | echo_thread_client > [ server_ip ]\00"
define void @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([74 x i8], [74 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int has_colors();
int wrap_has_colors(void) { return has_colors(); }


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

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

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

LLVM IR (-O2):
define i32 @wrap_has_colors() {
%1 = tail call i32 (...) @has_colors()
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
float uint_as_float(uint32_t i) {
  static union {
    uint32_t i;
    float f;
  } _box;
  _box.i = i;
  return _box.f;
}


x86 assembly (clang, -O0):
<uint_as_float>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,0x2f14(%rip)
movss  0x2f0c(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<uint_as_float>:
movd   %edi,%xmm0
ret

LLVM IR (-O0):
%union.anon = type { i32 }
@uint_as_float._box = internal global %union.anon zeroinitializer
define float @uint_as_float(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
store i32 %3, i32* getelementptr inbounds (%union.anon, %union.anon* @uint_as_float._box, i32 0, i32 0)
%4 = load float, float* bitcast (%union.anon* @uint_as_float._box to float*)
ret float %4
}

LLVM IR (-O2):
define float @uint_as_float(i32 %0) {
%2 = bitcast i32 %0 to float
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ fftwf_kernel_free(void *);
void fftwf_ifree(void *p) { fftwf_kernel_free(p); }


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

x86 assembly (clang, -O2):
<fftwf_ifree>:
jmp    1030 <fftwf_kernel_free@plt>

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

LLVM IR (-O2):
define void @fftwf_ifree(i8* %0) {
%2 = tail call i32 @fftwf_kernel_free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void err(char *e_msg, int e_no) {
  printf("\n%s\n", e_msg);
  exit(e_no);
}


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

x86 assembly (clang, -O2):
<err>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rsi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"\0A%s\0A\00"
define void @err(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 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i32, i32* %4
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
@.str = [5 x i8] c"\0A%s\0A\00"
define void @err(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 %1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ ensbox_main(int, char **);
int /*<<< orphan*/ ensbox_start(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void init_ensbox() {
  printf("Called into C to initialize and start vxpcdsystem\n");
  static char *argv[2] = {"", 0};
  int argc = 1;
  ensbox_main(argc, argv);
  ensbox_start(0);
}


x86 assembly (clang, -O0):
<init_ensbox>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0x2eeb(%rip),%rsi
call   1040 <ensbox_main@plt>
xor    %edi,%edi
call   1050 <ensbox_start@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_ensbox>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
lea    0x2efc(%rip),%rsi
mov    $0x1,%edi
call   1040 <ensbox_main@plt>
xor    %edi,%edi
pop    %rax
jmp    1050 <ensbox_start@plt>

LLVM IR (-O0):
@.str = [51 x i8] c"Called into C to initialize and start vxpcdsystem\0A\00"
@init_ensbox.argv = internal global [2 x i8*] [i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i32 0, i32 0), i8* null]
@.str.1 = [1 x i8] zeroinitializer
define void @init_ensbox() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @ensbox_main(i32 %3, i8** getelementptr inbounds ([2 x i8*], [2 x i8*]* @init_ensbox.argv, i64 0, i64 0))
%5 = call i32 @ensbox_start(i32 0)
ret void
}

LLVM IR (-O2):
@init_ensbox.argv = internal global [2 x i8*] [i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i32 0, i32 0), i8* null]
@.str.1 = [1 x i8] zeroinitializer
@str = [50 x i8] c"Called into C to initialize and start vxpcdsystem\00"
define void @init_ensbox() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @ensbox_main(i32 1, i8** getelementptr inbounds ([2 x i8*], [2 x i8*]* @init_ensbox.argv, i64 0, i64 0))
%3 = tail call i32 @ensbox_start(i32 0)
ret void
}
void ignore_result_helper(int __attribute__((unused)) dummy, ...) {}


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

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

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

LLVM IR (-O2):
define void @ignore_result_helper(i32 %0, ...) {
ret void
}
int oops(s, x) {
  perror(s);
  exit(x);
}


x86 assembly (clang, -O0):
<oops>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1030 <perror@plt>
mov    -0x8(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<oops>:
push   %rbx
mov    %esi,%ebx
xor    %eax,%eax
call   1030 <perror@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @oops(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 = call i32 (i32, ...) bitcast (i32 (...)* @perror to i32 (i32, ...)*)(i32 %5)
%7 = load i32, i32* %4
unreachable
}

LLVM IR (-O2):
define i32 @oops(i32 %0, i32 %1) {
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @perror to i32 (i32, ...)*)(i32 %0)
tail call void @exit(i32 %1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ dump_trace_header();
int /*<<< orphan*/ init_trace_events();
int main(int argc, char **argv) {
  init_trace_events();
  dump_trace_header();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @init_trace_events()
%4 = tail call i32 (...) @dump_trace_header()
ret i32 0
}
float Quart__easeIn(float t, float b, float c, float d, float p0, float p1) {
  return c * (t /= d) * t * t * t + b;
}


x86 assembly (clang, -O0):
<Quart__easeIn>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  %xmm5,-0x18(%rbp)
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm2
movss  -0x4(%rbp),%xmm1
divss  %xmm2,%xmm1
movss  %xmm1,-0x4(%rbp)
mulss  %xmm1,%xmm0
mulss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movss  -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Quart__easeIn>:
divss  %xmm3,%xmm0
mulss  %xmm0,%xmm2
mulss  %xmm0,%xmm2
mulss  %xmm0,%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @Quart__easeIn(float %0, float %1, float %2, float %3, float %4, float %5) {
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
store float %0, float* %7
store float %1, float* %8
store float %2, float* %9
store float %3, float* %10
store float %4, float* %11
store float %5, float* %12
%13 = load float, float* %9
%14 = load float, float* %10
%15 = load float, float* %7
%16 = fdiv float %15, %14
store float %16, float* %7
%17 = fmul float %13, %16
%18 = load float, float* %7
%19 = fmul float %17, %18
%20 = load float, float* %7
%21 = fmul float %19, %20
%22 = load float, float* %7
%23 = load float, float* %8
%24 = call float @llvm.fmuladd.f32(float %21, float %22, float %23)
ret float %24
}

LLVM IR (-O2):
define float @Quart__easeIn(float %0, float %1, float %2, float %3, float %4, float %5) {
%7 = fdiv float %0, %3
%8 = fmul float %7, %2
%9 = fmul float %7, %8
%10 = fmul float %7, %9
%11 = tail call float @llvm.fmuladd.f32(float %10, float %7, float %1)
ret float %11
}
/* Type definitions */
struct fh_p_expr {
  int dummy;
};
struct fh_ast {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ dump_expr(struct fh_ast *, int /*<<< orphan*/,
                             struct fh_p_expr *);
void fh_dump_expr(struct fh_ast *ast, struct fh_p_expr *expr) {
  dump_expr(ast, 0, expr);
}


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

x86 assembly (clang, -O2):
<fh_dump_expr>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <dump_expr@plt>

LLVM IR (-O0):
%struct.fh_ast = type { i32 }
%struct.fh_p_expr = type { i32 }
define void @fh_dump_expr(%struct.fh_ast* %0, %struct.fh_p_expr* %1) {
%3 = alloca %struct.fh_ast*
%4 = alloca %struct.fh_p_expr*
store %struct.fh_ast* %0, %struct.fh_ast** %3
store %struct.fh_p_expr* %1, %struct.fh_p_expr** %4
%5 = load %struct.fh_ast*, %struct.fh_ast** %3
%6 = load %struct.fh_p_expr*, %struct.fh_p_expr** %4
%7 = call i32 @dump_expr(%struct.fh_ast* %5, i32 0, %struct.fh_p_expr* %6)
ret void
}

LLVM IR (-O2):
%struct.fh_ast = type { i32 }
%struct.fh_p_expr = type { i32 }
define void @fh_dump_expr(%struct.fh_ast* %0, %struct.fh_p_expr* %1) {
%3 = tail call i32 @dump_expr(%struct.fh_ast* %0, i32 0, %struct.fh_p_expr* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t arm_random_seed_get(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @arm_random_seed_get() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr, "usage: wall [-g group] [file]\n");
  exit(1);
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [31 x i8] c"usage: wall [-g group] [file]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [31 x i8] c"usage: wall [-g group] [file]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
void ctors1(void) {
  printf("ctors1\n");
  fflush(stdout);
}


x86 assembly (clang, -O0):
<ctors1>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctors1>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"ctors1\0A\00"
@stdout = global i32 0
define void @ctors1() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = call i32 @fflush(i32 %2)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@str = [7 x i8] c"ctors1\00"
define void @ctors1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
ret void
}
/* Type definitions */
typedef int gid_t;

/* Variables and functions */
gid_t getegid(void) { return 42; }


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

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

LLVM IR (-O0):
define i32 @getegid() {
ret i32 42
}

LLVM IR (-O2):
define i32 @getegid() {
ret i32 42
}
/* Variables and functions */
void *memcpy(void *dest, const void *src, size_t count) {
  unsigned char *tempd = (unsigned char *)dest;
  unsigned char *temps = (unsigned char *)src;
  for (unsigned int i = 0; i < count; i++) {
    tempd[i] = temps[i];
  }
  return dest;
}


x86 assembly (clang, -O0):
<memcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x18(%rbp),%rax
jae    1156 <memcpy+0x56>
mov    -0x28(%rbp),%rax
mov    -0x2c(%rbp),%ecx
mov    (%rax,%rcx,1),%dl
mov    -0x20(%rbp),%rax
mov    -0x2c(%rbp),%ecx
mov    %dl,(%rax,%rcx,1)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1127 <memcpy+0x27>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memcpy>:
mov    %rdi,%rax
test   %rdx,%rdx
je     111f <memcpy+0x1f>
xor    %edi,%edi
nopw   0x0(%rax,%rax,1)
movzbl (%rsi,%rdi,1),%ecx
mov    %cl,(%rax,%rdi,1)
add    $0x1,%edi
cmp    %rdx,%rdi
jb     1110 <memcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @memcpy(i8* returned writeonly %0, i8* nocapture %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %5, label %6
5: ; preds = %6, %3
ret i8* %0
6: ; preds = %3, %6
%7 = phi i64 [ %12, %6 ], [ 0, %3 ]
%8 = getelementptr inbounds i8, i8* %1, i64 %7
%9 = load i8, i8* %8
%10 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 %9, i8* %10
%11 = add nuw nsw i64 %7, 1
%12 = and i64 %11, 4294967295
%13 = icmp ult i64 %12, %2
br i1 %13, label %6, label %5
}
void foo097(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo097(i32 %0) {
ret void
}
/* Variables and functions */
double cos(double);
double sin(double);
double toX(double r, double theta, double phi) {
  return r * cos(phi) * sin(theta);
}


x86 assembly (clang, -O0):
<toX>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toX>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
movapd %xmm2,%xmm0
call   1040 <cos@plt>
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <sin@plt>
mulsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @toX(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %6
%9 = call double @cos(double %8)
%10 = fmul double %7, %9
%11 = load double, double* %5
%12 = call double @sin(double %11)
%13 = fmul double %10, %12
ret double %13
}

LLVM IR (-O2):
define double @toX(double %0, double %1, double %2) {
%4 = tail call double @cos(double %2)
%5 = fmul double %4, %0
%6 = tail call double @sin(double %1)
%7 = fmul double %5, %6
ret double %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fread(int *, int, int, int /*<<< orphan*/ *);
int ntohl(int);
char svd_readBinInt(FILE *file, int *val) {
  int x;
  if (fread(&x, sizeof(int), 1, file) == 1) {
    *val = ntohl(x);
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<svd_readBinInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rcx
lea    -0x1c(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
cmp    $0x1,%eax
jne    1169 <svd_readBinInt+0x49>
mov    -0x1c(%rbp),%edi
call   1040 <ntohl@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movb   $0x0,-0x1(%rbp)
jmp    116d <svd_readBinInt+0x4d>
movb   $0x1,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<svd_readBinInt>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %rdi,%rcx
lea    0xc(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x1,%ecx
jne    1155 <svd_readBinInt+0x35>
mov    0xc(%rsp),%edi
call   1040 <ntohl@plt>
mov    %eax,(%rbx)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define signext i8 @svd_readBinInt(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @fread(i32* %3, i32 4, i32 1, i32* %0)
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %3
%9 = tail call i32 @ntohl(i32 %8)
store i32 %9, i32* %1
br label %10
10: ; preds = %2, %7
%11 = phi i8 [ 0, %7 ], [ 1, %2 ]
ret i8 %11
}
/* Variables and functions */
float __rcosd(float);
float r_cosd(float *x) { return __rcosd(*x); }


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

x86 assembly (clang, -O2):
<r_cosd>:
movss  (%rdi),%xmm0
jmp    1030 <__rcosd@plt>

LLVM IR (-O0):
define float @r_cosd(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = load float, float* %3
%5 = call float @__rcosd(float %4)
ret float %5
}

LLVM IR (-O2):
define float @r_cosd(float* nocapture %0) {
%2 = load float, float* %0
%3 = tail call float @__rcosd(float %2)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ dotest1(char *, int);
int /*<<< orphan*/ dotest2(char *, double);
int main() {
  dotest1("London", 51.199999999999996);
  dotest1("Beijing", 52.416666666666664);
  dotest1("ouoeu", -1);
  dotest2("London", 57.42833333333374);
  dotest2("Beijing", 4808.37138888889);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x33,%esi
call   1030 <dotest1@plt>
lea    0xed0(%rip),%rdi
mov    $0x34,%esi
call   1030 <dotest1@plt>
lea    0xec7(%rip),%rdi
mov    $0xffffffff,%esi
call   1030 <dotest1@plt>
lea    0xea7(%rip),%rdi
movsd  0xe97(%rip),%xmm0
call   1040 <dotest2@plt>
lea    0xe9a(%rip),%rdi
movsd  0xe7b(%rip),%xmm0
call   1040 <dotest2@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xee5(%rip),%r14
mov    %r14,%rdi
mov    $0x33,%esi
call   1030 <dotest1@plt>
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x34,%esi
call   1030 <dotest1@plt>
lea    0xecc(%rip),%rdi
mov    $0xffffffff,%esi
call   1030 <dotest1@plt>
movsd  0xe9b(%rip),%xmm0
mov    %r14,%rdi
call   1040 <dotest2@plt>
movsd  0xe93(%rip),%xmm0
mov    %rbx,%rdi
call   1040 <dotest2@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [7 x i8] c"London\00"
@.str.1 = [8 x i8] c"Beijing\00"
@.str.2 = [6 x i8] c"ouoeu\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @dotest1(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 51)
%3 = call i32 @dotest1(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 52)
%4 = call i32 @dotest1(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 -1)
%5 = call i32 @dotest2(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double 0x404CB6D3A06D3A40)
%6 = call i32 @dotest2(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double 0x40B2C85F13579BE1)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"London\00"
@.str.1 = [8 x i8] c"Beijing\00"
@.str.2 = [6 x i8] c"ouoeu\00"
define i32 @main() {
%1 = tail call i32 @dotest1(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 51)
%2 = tail call i32 @dotest1(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 52)
%3 = tail call i32 @dotest1(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 -1)
%4 = tail call i32 @dotest2(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double 0x404CB6D3A06D3A40)
%5 = tail call i32 @dotest2(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double 0x40B2C85F13579BE1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ print_strings(char *, int, char *, char *);
int main(void) {
  print_strings(", ", 2, "Jay", "Django");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x2,%esi
lea    0xed1(%rip),%rdx
lea    0xece(%rip),%rcx
call   1030 <print_strings@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c", \00"
@.str.1 = [4 x i8] c"Jay\00"
@.str.2 = [7 x i8] c"Django\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @print_strings(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c", \00"
@.str.1 = [4 x i8] c"Jay\00"
@.str.2 = [7 x i8] c"Django\00"
define i32 @main() {
%1 = tail call i32 @print_strings(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
void dumpRAM(void) {
  char *IO = (char *)(0x3c000000 + 4 * 0x00000020);
  *(IO + 7) = 1;
}


x86 assembly (clang, -O0):
<dumpRAM>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3c000080,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x1,0x7(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<dumpRAM>:
movb   $0x1,0x3c000087
01
ret

LLVM IR (-O0):
define void @dumpRAM() {
%1 = alloca i8*
store i8* inttoptr (i64 1006633088 to i8*), i8** %1
%2 = load i8*, i8** %1
%3 = getelementptr inbounds i8, i8* %2, i64 7
store i8 1, i8* %3
ret void
}

LLVM IR (-O2):
define void @dumpRAM() {
store i8 1, i8* inttoptr (i64 1006633095 to i8*)
ret void
}
double sunmodel_eccentricity_earth_orbit(double t) {
  double e;
  e = 0.016708634 - t * (0.000042037 + 0.0000001267 * t);
  return e;
}


x86 assembly (clang, -O0):
<sunmodel_eccentricity_earth_orbit>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xeed(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xee9(%rip),%xmm2
addsd  %xmm2,%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xeb2(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sunmodel_eccentricity_earth_orbit>:
movsd  0xef8(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xef4(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  0xef0(%rip),%xmm0
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @sunmodel_eccentricity_earth_orbit(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = load double, double* %2
%6 = call double @llvm.fmuladd.f64(double 1.267000e-07, double %5, double 4.203700e-05)
%7 = fneg double %4
%8 = call double @llvm.fmuladd.f64(double %7, double %6, double 0x3F911C11725D0380)
store double %8, double* %3
%9 = load double, double* %3
ret double %9
}

LLVM IR (-O2):
define double @sunmodel_eccentricity_earth_orbit(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double 1.267000e-07, double 4.203700e-05)
%3 = fneg double %0
%4 = tail call double @llvm.fmuladd.f64(double %3, double %2, double 0x3F911C11725D0380)
ret double %4
}
char *get_gpio_module_address(int module_number) {
  int r;
  switch (module_number) {
  case 0:
    r = 0x44e07000;
    break;
  case 1:
    r = 0x4804c000;
    break;
  case 2:
    r = 0x481ac000;
    break;
  case 3:
    r = 0x481ae000;
    break;
  }
  return (char *)r;
}


x86 assembly (clang, -O0):
<get_gpio_module_address>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x3,%rax
ja     1157 <get_gpio_module_address+0x57>
mov    -0x10(%rbp),%rax
lea    0xedd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x44e07000,-0x8(%rbp)
jmp    1157 <get_gpio_module_address+0x57>
movl   $0x4804c000,-0x8(%rbp)
jmp    1157 <get_gpio_module_address+0x57>
movl   $0x481ac000,-0x8(%rbp)
jmp    1157 <get_gpio_module_address+0x57>
movl   $0x481ae000,-0x8(%rbp)
movslq -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_gpio_module_address>:
cmp    $0x3,%edi
ja     111d <get_gpio_module_address+0x1d>
mov    %edi,%eax
lea    0xef2(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x44e07000,%eax
ret
xor    %eax,%eax
ret
mov    $0x4804c000,%eax
ret
mov    $0x481ac000,%eax
ret
mov    $0x481ae000,%eax
ret

LLVM IR (-O0):
define i8* @get_gpio_module_address(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
switch i32 %4, label %9 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
i32 3, label %8
]
5: ; preds = %1
store i32 1155559424, i32* %3
br label %9
6: ; preds = %1
store i32 1208270848, i32* %3
br label %9
7: ; preds = %1
store i32 1209712640, i32* %3
br label %9
8: ; preds = %1
store i32 1209720832, i32* %3
br label %9
9: ; preds = %1, %8, %7, %6, %5
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i8*
ret i8* %12
}

LLVM IR (-O2):
define i8* @get_gpio_module_address(i32 %0) {
switch i32 %0, label %6 [
i32 0, label %2
i32 1, label %3
i32 2, label %4
i32 3, label %5
]
2: ; preds = %1
br label %6
3: ; preds = %1
br label %6
4: ; preds = %1
br label %6
5: ; preds = %1
br label %6
6: ; preds = %1, %5, %4, %3, %2
%7 = phi i8* [ null, %1 ], [ inttoptr (i64 1209720832 to i8*), %5 ], [ inttoptr (i64 1209712640 to i8*), %4 ], [ inttoptr (i64 1208270848 to i8*), %3 ], [ inttoptr (i64 1155559424 to i8*), %2 ]
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ atomic_set_int(int *, int);
void atomic_integer_set(int *i, int v) {
  ;
  atomic_set_int(i, v);
}


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

x86 assembly (clang, -O2):
<atomic_integer_set>:
jmp    1030 <atomic_set_int@plt>

LLVM IR (-O0):
define void @atomic_integer_set(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 = call i32 @atomic_set_int(i32* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @atomic_integer_set(i32* %0, i32 %1) {
%3 = tail call i32 @atomic_set_int(i32* %0, i32 %1)
ret void
}
/* Type definitions */
typedef unsigned long off_t;

/* Variables and functions */
off_t letoaddr(unsigned char *buf) {
  off_t result = 0;
  int i;
  for (i = 0; i < 4; i++) {
    result |= (unsigned long)(*(buf + i)) << (i * 8);
  }
  return result;
}


x86 assembly (clang, -O0):
<letoaddr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    114e <letoaddr+0x4e>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
mov    -0x14(%rbp),%ecx
shl    $0x3,%ecx
mov    %ecx,%ecx
shl    %cl,%rax
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <letoaddr+0x17>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @letoaddr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i64
%7 = shl nuw nsw i64 %6, 8
%8 = or i64 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i64
%12 = shl nuw nsw i64 %11, 16
%13 = or i64 %12, %8
%14 = getelementptr inbounds i8, i8* %0, i64 3
%15 = load i8, i8* %14
%16 = zext i8 %15 to i64
%17 = shl nuw nsw i64 %16, 24
%18 = or i64 %17, %13
ret i64 %18
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ memcpy(char *, char *, int);
char *FilterCreate(void *arg, const char *const *key_array,
                   const size_t *key_length_array, int num_keys,
                   size_t *filter_length) {
  *filter_length = 4;
  char *result = (char *)malloc(4);
  memcpy(result, "fake", 4);
  return result;
}


x86 assembly (clang, -O0):
<FilterCreate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movq   $0x4,(%rax)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
lea    0xea1(%rip),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0x30(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FilterCreate>:
push   %rbx
movq   $0x4,(%r8)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xec4(%rip),%rsi
mov    %rax,%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"fake\00"
define i8* @FilterCreate(i8* %0, i8** %1, i64* %2, i32 %3, i64* %4) {
%6 = alloca i8*
%7 = alloca i8**
%8 = alloca i64*
%9 = alloca i32
%10 = alloca i64*
%11 = alloca i8*
store i8* %0, i8** %6
store i8** %1, i8*** %7
store i64* %2, i64** %8
store i32 %3, i32* %9
store i64* %4, i64** %10
%12 = load i64*, i64** %10
store i64 4, i64* %12
%13 = call i64 @malloc(i32 4)
%14 = inttoptr i64 %13 to i8*
store i8* %14, i8** %11
%15 = load i8*, i8** %11
%16 = call i32 @memcpy(i8* %15, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%17 = load i8*, i8** %11
ret i8* %17
}

LLVM IR (-O2):
@.str = [5 x i8] c"fake\00"
define i8* @FilterCreate(i8* nocapture readnone %0, i8** nocapture readnone %1, i64* nocapture readnone %2, i32 %3, i64* nocapture writeonly %4) {
store i64 4, i64* %4
%6 = tail call i64 @malloc(i32 4)
%7 = inttoptr i64 %6 to i8*
%8 = tail call i32 @memcpy(i8* %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
ret i8* %7
}
void ExttIndexTypeAuxTable(void) {}


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

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

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

LLVM IR (-O2):
define void @ExttIndexTypeAuxTable() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char, int);
int /*<<< orphan*/ stderr;
void s(int x) { fprintf(stderr, "%c%d\n", 's', x); }


x86 assembly (clang, -O0):

:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%ecx
lea    0xed2(%rip),%rsi
mov    $0x73,%edx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):

:
mov    %edi,%ecx
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
lea    0xede(%rip),%rsi
mov    $0x73,%edx
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [6 x i8] c"%c%d\0A\00"
define void @s(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext 115, i32 %0)
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ _SC_PAGESIZE;
int /*<<< orphan*/ _SC_PHYS_PAGES;
long sysconf(int /*<<< orphan*/);
uint64_t getAvailableMemory() {
  static uint64_t size = 0;
  if (size == 0) {
    long page_size = 0;
    long page_count = 0;
    page_size = sysconf(_SC_PAGESIZE);
    page_count = sysconf(_SC_PHYS_PAGES);
    size = page_size * page_count;
  }
  return size;
}


x86 assembly (clang, -O0):
<getAvailableMemory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
cmpq   $0x0,0x2f10(%rip)
jne    116a <getAvailableMemory+0x5a>
movq   $0x0,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
mov    %rax,-0x8(%rbp)
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %rax,0x2ec6(%rip)
mov    0x2ebf(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getAvailableMemory>:
push   %rbx
mov    0x2f18(%rip),%rax
test   %rax,%rax
je     111f <getAvailableMemory+0xf>
pop    %rbx
ret
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
mov    %rax,%rbx
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
imul   %rbx,%rax
mov    %rax,0x2ee7(%rip)
pop    %rbx
ret

LLVM IR (-O0):
@getAvailableMemory.size = internal global i64 0
@_SC_PAGESIZE = global i32 0
@_SC_PHYS_PAGES = global i32 0
define i64 @getAvailableMemory() {
%1 = alloca i64
%2 = alloca i64
%3 = load i64, i64* @getAvailableMemory.size
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %13
5: ; preds = %0
store i64 0, i64* %1
store i64 0, i64* %2
%6 = load i32, i32* @_SC_PAGESIZE
%7 = call i64 @sysconf(i32 %6)
store i64 %7, i64* %1
%8 = load i32, i32* @_SC_PHYS_PAGES
%9 = call i64 @sysconf(i32 %8)
store i64 %9, i64* %2
%10 = load i64, i64* %1
%11 = load i64, i64* %2
%12 = mul nsw i64 %10, %11
store i64 %12, i64* @getAvailableMemory.size
br label %13
13: ; preds = %5, %0
%14 = load i64, i64* @getAvailableMemory.size
ret i64 %14
}

LLVM IR (-O2):
@getAvailableMemory.size = internal unnamed_addr global i64 0
@_SC_PAGESIZE = global i32 0
@_SC_PHYS_PAGES = global i32 0
define i64 @getAvailableMemory() {
%1 = load i64, i64* @getAvailableMemory.size
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %9
3: ; preds = %0
%4 = load i32, i32* @_SC_PAGESIZE
%5 = tail call i64 @sysconf(i32 %4)
%6 = load i32, i32* @_SC_PHYS_PAGES
%7 = tail call i64 @sysconf(i32 %6)
%8 = mul nsw i64 %7, %5
store i64 %8, i64* @getAvailableMemory.size
br label %9
9: ; preds = %3, %0
%10 = phi i64 [ %8, %3 ], [ %1, %0 ]
ret i64 %10
}
int reverse(int x) {
  int res = 0;
  int neg = 0;
  if (x < 0) {
    x *= -1;
    neg = 1;
  }
  while (x > 0) {
    res = (x % 10) + (res * 10);
    x = x / 10;
  }
  if (neg)
    res *= -1;
  return res;
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    112d <reverse+0x2d>
imul   $0xffffffff,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
jmp    1132 <reverse+0x32>
cmpl   $0x0,-0x4(%rbp)
jle    1163 <reverse+0x63>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
imul   $0xa,-0x8(%rbp),%eax
add    %eax,%edx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    1132 <reverse+0x32>
cmpl   $0x0,-0xc(%rbp)
je     1174 <reverse+0x74>
imul   $0xffffffff,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
xor    %edx,%edx
test   %eax,%eax
je     1143 <reverse+0x43>
mov    $0xcccccccd,%r8d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    (%rdx,%rdx,4),%r9d
mov    %eax,%esi
imul   %r8,%rsi
shr    $0x23,%rsi
lea    (%rsi,%rsi,1),%ecx
lea    (%rcx,%rcx,4),%ecx
mov    %eax,%edx
sub    %ecx,%edx
lea    (%rdx,%r9,2),%edx
cmp    $0x9,%eax
mov    %esi,%eax
ja     1120 <reverse+0x20>
mov    %edx,%eax
neg    %eax
test   %edi,%edi
cmovns %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @reverse(i32 %0) {
%2 = icmp slt i32 %0, 0
%3 = sub nsw i32 0, %0
%4 = select i1 %2, i32 %3, i32 %0
%5 = icmp eq i32 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %1, %6
%7 = phi i32 [ %11, %6 ], [ 0, %1 ]
%8 = phi i32 [ %12, %6 ], [ %4, %1 ]
%9 = urem i32 %8, 10
%10 = mul nsw i32 %7, 10
%11 = add nsw i32 %10, %9
%12 = udiv i32 %8, 10
%13 = icmp ult i32 %8, 10
br i1 %13, label %14, label %6
14: ; preds = %6, %1
%15 = phi i32 [ 0, %1 ], [ %11, %6 ]
%16 = sub nsw i32 0, %15
%17 = select i1 %2, i32 %16, i32 %15
ret i32 %17
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, int);
void print_addr_dec(uint8_t *addr) {
  printf("%d.%d.%d.%d\n", addr[0], addr[1], addr[2], addr[3]);
}


x86 assembly (clang, -O0):
<print_addr_dec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%edx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%r8d
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_addr_dec>:
mov    (%rdi),%esi
mov    0x4(%rdi),%edx
mov    0x8(%rdi),%ecx
mov    0xc(%rdi),%r8d
lea    0xedd(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [13 x i8] c"%d.%d.%d.%d\0A\00"
define void @print_addr_dec(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = getelementptr inbounds i32, i32* %0, i64 2
%6 = load i32, i32* %5
%7 = getelementptr inbounds i32, i32* %0, i64 3
%8 = load i32, i32* %7
%9 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %4, i32 %6, i32 %8)
ret void
}
/* Variables and functions */
#define GLUT_KEY_DOWN 132
#define GLUT_KEY_HOME 131
#define GLUT_KEY_LEFT 130
#define GLUT_KEY_RIGHT 129
#define GLUT_KEY_UP 128
void specialKeyPressed(int key, int x, int y) {
  switch (key) {
  case GLUT_KEY_UP:
    break;
  case GLUT_KEY_DOWN:
    break;
  case GLUT_KEY_LEFT:
    break;
  case GLUT_KEY_RIGHT:
    break;
  case GLUT_KEY_HOME:
    break;
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<specialKeyPressed>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffff80,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x4,%eax
ja     114f <specialKeyPressed+0x4f>
mov    -0x18(%rbp),%rax
lea    0xed3(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
jmp    1154 <specialKeyPressed+0x54>
jmp    1154 <specialKeyPressed+0x54>
jmp    1154 <specialKeyPressed+0x54>
jmp    1154 <specialKeyPressed+0x54>
jmp    1154 <specialKeyPressed+0x54>
jmp    1154 <specialKeyPressed+0x54>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @specialKeyPressed(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
switch i32 %7, label %13 [
i32 128, label %8
i32 132, label %9
i32 130, label %10
i32 129, label %11
i32 131, label %12
]
8: ; preds = %3
br label %14
9: ; preds = %3
br label %14
10: ; preds = %3
br label %14
11: ; preds = %3
br label %14
12: ; preds = %3
br label %14
13: ; preds = %3
br label %14
14: ; preds = %13, %12, %11, %10, %9, %8
ret void
}

LLVM IR (-O2):
define void @specialKeyPressed(i32 %0, i32 %1, i32 %2) {
ret void
}