xunge/DecIR huggingface dataset:
/* Variables and functions */
double Slater_3S_6S(double, double, double);
double Slater_6S_3S(double rij, double xii, double xij) {
  return Slater_3S_6S(rij, xij, xii);
}


x86 assembly (clang, -O0):
<Slater_6S_3S>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
call   1030 <Slater_3S_6S@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Slater_6S_3S>:
movaps %xmm1,%xmm3
movaps %xmm2,%xmm1
movaps %xmm3,%xmm2
jmp    1030 <Slater_3S_6S@plt>

LLVM IR (-O0):
define double @Slater_6S_3S(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 = load double, double* %5
%10 = call double @Slater_3S_6S(double %7, double %8, double %9)
ret double %10
}

LLVM IR (-O2):
define double @Slater_6S_3S(double %0, double %1, double %2) {
%4 = tail call double @Slater_3S_6S(double %0, double %2, double %1)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ clear_spreadsheet();
int /*<<< orphan*/ io_repaint();
void kill_all_cmd(void) {
  clear_spreadsheet();
  io_repaint();
}


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

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

LLVM IR (-O0):
define void @kill_all_cmd() {
%1 = call i32 (...) @clear_spreadsheet()
%2 = call i32 (...) @io_repaint()
ret void
}

LLVM IR (-O2):
define void @kill_all_cmd() {
%1 = tail call i32 (...) @clear_spreadsheet()
%2 = tail call i32 (...) @io_repaint()
ret void
}
void wifidbg_dispatch() {}


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

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

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

LLVM IR (-O2):
define void @wifidbg_dispatch() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pr_info(char *);
void cleanup_module(void) { pr_info("cleanup_module\n"); }


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"cleanup_module\0A\00"
define void @cleanup_module() {
%1 = call i32 @pr_info(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"cleanup_module\0A\00"
define void @cleanup_module() {
%1 = tail call i32 @pr_info(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}
unsigned xrop3_166_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~T;
  stk2 = S & stk3;
  stk1 = D ^ stk2;
  return stk1;
}


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

x86 assembly (clang, -O2):
<xrop3_166_0_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
not    %eax
and    %ecx,%eax
xor    $0xff,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_166_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %6, -1
%8 = and i32 %4, %7
%9 = xor i32 %8, 255
ret i32 %9
}
void vfddRefresh() {}


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

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

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

LLVM IR (-O2):
define void @vfddRefresh() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stdout;
void greatest_usage(const char *name) {
  fprintf(stdout,
          "Usage: %s [-hlfavex] [-s SUITE] [-t TEST] [-x EXCLUDE]\n"
          "  -h, --help  print this Help\n"
          "  -l          List suites and tests, then exit (dry run)\n"
          "  -f          Stop runner after first failure\n"
          "  -a          Abort on first failure (implies -f)\n"
          "  -v          Verbose output\n"
          "  -s SUITE    only run suites containing substring SUITE\n"
          "  -t TEST     only run tests containing substring TEST\n"
          "  -e          only run exact name match for -s or -t\n"
          "  -x EXCLUDE  exclude tests containing substring EXCLUDE\n",
          name);
}


x86 assembly (clang, -O0):
<greatest_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<greatest_usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [490 x i8] c"Usage: %s [-hlfavex] [-s SUITE] [-t TEST] [-x EXCLUDE]\0A -h, --help print this Help\0A -l List suites and tests, then exit (dry run)\0A -f Stop runner after first failure\0A -a Abort on first failure (implies -f)\0A -v Verbose output\0A -s SUITE only run suites containing substring SUITE\0A -t TEST only run tests containing substring TEST\0A -e only run exact name match for -s or -t\0A -x EXCLUDE exclude tests containing substring EXCLUDE\0A\00"
define void @greatest_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([490 x i8], [490 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [490 x i8] c"Usage: %s [-hlfavex] [-s SUITE] [-t TEST] [-x EXCLUDE]\0A -h, --help print this Help\0A -l List suites and tests, then exit (dry run)\0A -f Stop runner after first failure\0A -a Abort on first failure (implies -f)\0A -v Verbose output\0A -s SUITE only run suites containing substring SUITE\0A -t TEST only run tests containing substring TEST\0A -e only run exact name match for -s or -t\0A -x EXCLUDE exclude tests containing substring EXCLUDE\0A\00"
define void @greatest_usage(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([490 x i8], [490 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ post_calc_afr();
int /*<<< orphan*/ post_calc_blm();
void post_calc(void) {
  post_calc_blm();
  post_calc_afr();
}


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

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

LLVM IR (-O0):
define void @post_calc() {
%1 = call i32 (...) @post_calc_blm()
%2 = call i32 (...) @post_calc_afr()
ret void
}

LLVM IR (-O2):
define void @post_calc() {
%1 = tail call i32 (...) @post_calc_blm()
%2 = tail call i32 (...) @post_calc_afr()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
double my_sqrt(double);
int /*<<< orphan*/ printf(char *, double);
int main() {
  printf("sqrt +2 = %g\n", my_sqrt(2.0));
  printf("sqrt -2 = %g\n", my_sqrt(-2.0));
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xec1(%rip),%xmm0
call   1040 <my_sqrt@plt>
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
movsd  0xea0(%rip),%xmm0
call   1040 <my_sqrt@plt>
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xec7(%rip),%xmm0
call   1040 <my_sqrt@plt>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
movsd  0xeb6(%rip),%xmm0
call   1040 <my_sqrt@plt>
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"sqrt +2 = %g\0A\00"
@.str.1 = [14 x i8] c"sqrt -2 = %g\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call double @my_sqrt(double 2.000000e+00)
%3 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), double %2)
%4 = call double @my_sqrt(double -2.000000e+00)
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), double %4)
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [14 x i8] c"sqrt +2 = %g\0A\00"
@.str.1 = [14 x i8] c"sqrt -2 = %g\0A\00"
define i32 @main() {
%1 = tail call double @my_sqrt(double 2.000000e+00)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), double %1)
%3 = tail call double @my_sqrt(double -2.000000e+00)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), double %3)
%5 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
void *queue_get(int /*<<< orphan*/);
void *queue_get_first() { return queue_get(0); }


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

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

LLVM IR (-O0):
define i8* @queue_get_first() {
%1 = call i8* @queue_get(i32 0)
ret i8* %1
}

LLVM IR (-O2):
define i8* @queue_get_first() {
%1 = tail call i8* @queue_get(i32 0)
ret i8* %1
}
void reb_integrator_wh_synchronize(struct reb_simulation *r) {}


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

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

LLVM IR (-O0):
%struct.reb_simulation = type opaque
define void @reb_integrator_wh_synchronize(%struct.reb_simulation* %0) {
%2 = alloca %struct.reb_simulation*
store %struct.reb_simulation* %0, %struct.reb_simulation** %2
ret void
}

LLVM IR (-O2):
%struct.reb_simulation = type opaque
define void @reb_integrator_wh_synchronize(%struct.reb_simulation* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *stdout;
FILE *get_std_stream() { return stdout; }


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

x86 assembly (clang, -O2):
<get_std_stream>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%rax
ret

LLVM IR (-O0):
@stdout = global i32* null
define i32* @get_std_stream() {
%1 = load i32*, i32** @stdout
ret i32* %1
}

LLVM IR (-O2):
@stdout = global i32* null
define i32* @get_std_stream() {
%1 = load i32*, i32** @stdout
ret i32* %1
}
void EVP_sha1(void) {}


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

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

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

LLVM IR (-O2):
define void @EVP_sha1() {
ret void
}
__attribute__((always_)) void
register_page_bootmem_info_node(struct pglist_data *pgdat) {}


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

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

LLVM IR (-O0):
%struct.pglist_data = type opaque
define void @register_page_bootmem_info_node(%struct.pglist_data* %0) {
%2 = alloca %struct.pglist_data*
store %struct.pglist_data* %0, %struct.pglist_data** %2
ret void
}

LLVM IR (-O2):
%struct.pglist_data = type opaque
define void @register_page_bootmem_info_node(%struct.pglist_data* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printCompilationInfo() { printf("test\n"); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"test\0A\00"
define void @printCompilationInfo() {
%1 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [5 x i8] c"test\00"
define void @printCompilationInfo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct socket {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ panic(char *);
int sock_create_kern(int family, int type, int proto, struct socket **res) {
  panic("sock_create_kern() not implemented\n");
  return 0;
}


x86 assembly (clang, -O0):
<sock_create_kern>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
lea    0xed4(%rip),%rdi
call   1030 <panic@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sock_create_kern>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <panic@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.socket = type { i32 }
@.str = [36 x i8] c"sock_create_kern() not implemented\0A\00"
define i32 @sock_create_kern(i32 %0, i32 %1, i32 %2, %struct.socket** %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca %struct.socket**
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store %struct.socket** %3, %struct.socket*** %8
%9 = call i32 @panic(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
%struct.socket = type { i32 }
@.str = [36 x i8] c"sock_create_kern() not implemented\0A\00"
define i32 @sock_create_kern(i32 %0, i32 %1, i32 %2, %struct.socket** nocapture readnone %3) {
%5 = tail call i32 @panic(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ aa_endconv_st_le(void *, double *, int);
void aa_endconv_st_le_d(void *dst, double src) {
  aa_endconv_st_le(dst, &src, sizeof(double));
}


x86 assembly (clang, -O0):
<aa_endconv_st_le_d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x8,%edx
call   1030 <aa_endconv_st_le@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aa_endconv_st_le_d>:
push   %rax
movsd  %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x8,%edx
call   1030 <aa_endconv_st_le@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @aa_endconv_st_le_d(i8* %0, double %1) {
%3 = alloca i8*
%4 = alloca double
store i8* %0, i8** %3
store double %1, double* %4
%5 = load i8*, i8** %3
%6 = call i32 @aa_endconv_st_le(i8* %5, double* %4, i32 8)
ret void
}

LLVM IR (-O2):
define void @aa_endconv_st_le_d(i8* %0, double %1) {
%3 = alloca double
store double %1, double* %3
%4 = call i32 @aa_endconv_st_le(i8* %0, double* %3, i32 8)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
FILE *re_open(char *name) {
  FILE *f = fopen(name, "w");
  if (f == NULL)
    printf("Error! Unable to open file %s\n", name);
  return f;
}


x86 assembly (clang, -O0):
<re_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115b <re_open+0x3b>
mov    -0x8(%rbp),%rsi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<re_open>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0xed2(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114a <re_open+0x2a>
lea    0xec0(%rip),%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [2 x i8] c"w\00"
@.str.1 = [31 x i8] c"Error! Unable to open file %s\0A\00"
define i32* @re_open(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = icmp eq i32* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %8, %1
%12 = load i32*, i32** %3
ret i32* %12
}

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
@.str.1 = [31 x i8] c"Error! Unable to open file %s\0A\00"
define noalias i32* @re_open(i8* %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %4, %1
ret i32* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_cmpeq_sd(int /*<<< orphan*/, int /*<<< orphan*/);
__m128d test_mm_cmpeq_sd(__m128d A, __m128d B) { return _mm_cmpeq_sd(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_cmpeq_sd>:
jmp    1030 <_mm_cmpeq_sd@plt>

LLVM IR (-O0):
define i32 @test_mm_cmpeq_sd(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 @_mm_cmpeq_sd(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_mm_cmpeq_sd(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cmpeq_sd(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int getch();
int /*<<< orphan*/ putchar(int);
int getchar(void) {
  int c = getch();
  putchar(c);
  return c;
}


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

x86 assembly (clang, -O2):
<getchar>:
push   %rbx
xor    %eax,%eax
call   1040 <getch@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1030 <putchar@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @getchar() {
%1 = alloca i32
%2 = call i32 (...) @getch()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @putchar(i32 %3)
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
define i32 @getchar() {
%1 = tail call i32 (...) @getch()
%2 = tail call i32 @putchar(i32 %1)
ret i32 %1
}
/* Variables and functions */
scalar_t__ RAND_MAX;
scalar_t__ rand();
double drand(double low, double high) {
  return low + ((high - low) * ((double)rand() / (double)RAND_MAX));
}


x86 assembly (clang, -O0):
<drand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
movsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
cvtsi2sd %rax,%xmm2
mov    0x2e90(%rip),%rax
cvtsi2sdq (%rax),%xmm3
divsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drand>:
sub    $0x18,%rsp
movsd  %xmm0,0x10(%rsp)
subsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
mov    0x2eae(%rip),%rax
xorps  %xmm1,%xmm1
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
mulsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define double @drand(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = load double, double* %3
%8 = fsub double %6, %7
%9 = call i64 (...) @rand()
%10 = sitofp i64 %9 to double
%11 = load i64, i64* @RAND_MAX
%12 = sitofp i64 %11 to double
%13 = fdiv double %10, %12
%14 = call double @llvm.fmuladd.f64(double %8, double %13, double %5)
ret double %14
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define double @drand(double %0, double %1) {
%3 = fsub double %1, %0
%4 = tail call i64 (...) @rand()
%5 = sitofp i64 %4 to double
%6 = load i64, i64* @RAND_MAX
%7 = sitofp i64 %6 to double
%8 = fdiv double %5, %7
%9 = tail call double @llvm.fmuladd.f64(double %3, double %8, double %0)
ret double %9
}
/* Variables and functions */
unsigned int ffs(unsigned int);
unsigned int ctz(unsigned int x) { return (x > 0) ? ffs(x) - 1 : 32; }


x86 assembly (clang, -O0):
<ctz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jbe    1138 <ctz+0x28>
mov    -0x4(%rbp),%edi
call   1030 <ffs@plt>
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1145 <ctz+0x35>
mov    $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    1145 <ctz+0x35>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctz>:
test   %edi,%edi
je     1108 <ctz+0x8>
bsf    %edi,%eax
ret
mov    $0x20,%eax
ret

LLVM IR (-O0):
define i32 @ctz(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ugt i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 @ffs(i32 %6)
%8 = sub i32 %7, 1
br label %10
9: ; preds = %1
br label %10
10: ; preds = %9, %5
%11 = phi i32 [ %8, %5 ], [ 32, %9 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @ctz(i32 %0) {
%2 = tail call i32 @llvm.cttz.i32(i32 %0, i1 false)
ret i32 %2
}
/* Type definitions */
struct crumbwrap_ctx {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fix_ld_preload(struct crumbwrap_ctx *);
int /*<<< orphan*/ set_server_path(struct crumbwrap_ctx *);
void fn(void *data) {
  struct crumbwrap_ctx *ctx = data;
  fix_ld_preload(ctx);
  set_server_path(ctx);
}


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

x86 assembly (clang, -O2):
<fn>:
push   %rbx
mov    %rdi,%rbx
call   1030 <fix_ld_preload@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <set_server_path@plt>

LLVM IR (-O0):
%struct.crumbwrap_ctx = type { i32 }
define void @fn(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.crumbwrap_ctx*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.crumbwrap_ctx*
store %struct.crumbwrap_ctx* %5, %struct.crumbwrap_ctx** %3
%6 = load %struct.crumbwrap_ctx*, %struct.crumbwrap_ctx** %3
%7 = call i32 @fix_ld_preload(%struct.crumbwrap_ctx* %6)
%8 = load %struct.crumbwrap_ctx*, %struct.crumbwrap_ctx** %3
%9 = call i32 @set_server_path(%struct.crumbwrap_ctx* %8)
ret void
}

LLVM IR (-O2):
%struct.crumbwrap_ctx = type { i32 }
define void @fn(i8* %0) {
%2 = bitcast i8* %0 to %struct.crumbwrap_ctx*
%3 = tail call i32 @fix_ld_preload(%struct.crumbwrap_ctx* %2)
%4 = tail call i32 @set_server_path(%struct.crumbwrap_ctx* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fr_chip_write(unsigned long, int);
int /*<<< orphan*/ fr_wait_toggle_bit(unsigned long);
void fr_sector_erase(unsigned long address) {
  fr_chip_write(0x5555, 0xAA);
  fr_chip_write(0x2AAA, 0x55);
  fr_chip_write(0x5555, 0x80);
  fr_chip_write(0x5555, 0xAA);
  fr_chip_write(0x2AAA, 0x55);
  fr_chip_write(address, 0x30);
  fr_wait_toggle_bit(address);
}


x86 assembly (clang, -O0):
<fr_sector_erase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x5555,%edi
mov    $0xaa,%esi
call   1040 <fr_chip_write@plt>
mov    $0x2aaa,%edi
mov    $0x55,%esi
call   1040 <fr_chip_write@plt>
mov    $0x5555,%edi
mov    $0x80,%esi
call   1040 <fr_chip_write@plt>
mov    $0x5555,%edi
mov    $0xaa,%esi
call   1040 <fr_chip_write@plt>
mov    $0x2aaa,%edi
mov    $0x55,%esi
call   1040 <fr_chip_write@plt>
mov    -0x8(%rbp),%rdi
mov    $0x30,%esi
call   1040 <fr_chip_write@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fr_wait_toggle_bit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fr_sector_erase>:
push   %rbx
mov    %rdi,%rbx
mov    $0x5555,%edi
mov    $0xaa,%esi
call   1040 <fr_chip_write@plt>
mov    $0x2aaa,%edi
mov    $0x55,%esi
call   1040 <fr_chip_write@plt>
mov    $0x5555,%edi
mov    $0x80,%esi
call   1040 <fr_chip_write@plt>
mov    $0x5555,%edi
mov    $0xaa,%esi
call   1040 <fr_chip_write@plt>
mov    $0x2aaa,%edi
mov    $0x55,%esi
call   1040 <fr_chip_write@plt>
mov    %rbx,%rdi
mov    $0x30,%esi
call   1040 <fr_chip_write@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fr_wait_toggle_bit@plt>

LLVM IR (-O0):
define void @fr_sector_erase(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 @fr_chip_write(i64 21845, i32 170)
%4 = call i32 @fr_chip_write(i64 10922, i32 85)
%5 = call i32 @fr_chip_write(i64 21845, i32 128)
%6 = call i32 @fr_chip_write(i64 21845, i32 170)
%7 = call i32 @fr_chip_write(i64 10922, i32 85)
%8 = load i64, i64* %2
%9 = call i32 @fr_chip_write(i64 %8, i32 48)
%10 = load i64, i64* %2
%11 = call i32 @fr_wait_toggle_bit(i64 %10)
ret void
}

LLVM IR (-O2):
define void @fr_sector_erase(i64 %0) {
%2 = tail call i32 @fr_chip_write(i64 21845, i32 170)
%3 = tail call i32 @fr_chip_write(i64 10922, i32 85)
%4 = tail call i32 @fr_chip_write(i64 21845, i32 128)
%5 = tail call i32 @fr_chip_write(i64 21845, i32 170)
%6 = tail call i32 @fr_chip_write(i64 10922, i32 85)
%7 = tail call i32 @fr_chip_write(i64 %0, i32 48)
%8 = tail call i32 @fr_wait_toggle_bit(i64 %0)
ret void
}
/* Type definitions */
typedef void radix_tree;

/* Variables and functions */
void *radix_tree_create();
int /*<<< orphan*/ test_fail(char *, char *);
void *rt_init(void) {
  struct radix_tree *rt = radix_tree_create();
  do {
    if (!(rt)) {
      test_fail("assertion failed: '%s'", "rt");
    }
  } while (0);
  return rt;
}


x86 assembly (clang, -O0):
<rt_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <radix_tree_create@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1151 <rt_init+0x31>
lea    0xebb(%rip),%rdi
lea    0xecb(%rip),%rsi
call   1040 <test_fail@plt>
jmp    1156 <rt_init+0x36>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rt_init>:
push   %rbx
xor    %eax,%eax
call   1030 <radix_tree_create@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <rt_init+0x23>
lea    0xec9(%rip),%rdi
lea    0xed9(%rip),%rsi
call   1040 <test_fail@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.radix_tree = type opaque
@.str = [23 x i8] c"assertion failed: '%s'\00"
@.str.1 = [3 x i8] c"rt\00"
define i8* @rt_init() {
%1 = alloca %struct.radix_tree*
%2 = call i8* (...) @radix_tree_create()
%3 = bitcast i8* %2 to %struct.radix_tree*
store %struct.radix_tree* %3, %struct.radix_tree** %1
br label %4
4: ; preds = %0
%5 = load %struct.radix_tree*, %struct.radix_tree** %1
%6 = icmp ne %struct.radix_tree* %5, null
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = call i32 @test_fail(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %4
br label %10
10: ; preds = %9
%11 = load %struct.radix_tree*, %struct.radix_tree** %1
%12 = bitcast %struct.radix_tree* %11 to i8*
ret i8* %12
}

LLVM IR (-O2):
@.str = [23 x i8] c"assertion failed: '%s'\00"
@.str.1 = [3 x i8] c"rt\00"
define i8* @rt_init() {
%1 = tail call i8* (...) @radix_tree_create()
%2 = icmp eq i8* %1, null
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @test_fail(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret i8* %1
}
/* Variables and functions */
double cos(double);
double sin(double);
extern void sincos(double t, double *s, double *c) {
  *s = sin(t);
  *c = cos(t);
}


x86 assembly (clang, -O0):
<sincos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x8(%rbp),%xmm0
call   1040 <cos@plt>
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sincos>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  %xmm0,(%rsp)
call   1030 <sin@plt>
movsd  %xmm0,(%rbx)
movsd  (%rsp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @sincos(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 = call double @sin(double %7)
%9 = load double*, double** %5
store double %8, double* %9
%10 = load double, double* %4
%11 = call double @cos(double %10)
%12 = load double*, double** %6
store double %11, double* %12
ret void
}

LLVM IR (-O2):
define void @sincos(double %0, double* nocapture writeonly %1, double* nocapture writeonly %2) {
%4 = tail call double @sin(double %0)
store double %4, double* %1
%5 = tail call double @cos(double %0)
store double %5, double* %2
ret void
}
void foo478(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo478(i32 %0) {
ret void
}
void outw_p(unsigned short value, unsigned short port) {
  asm volatile("out"
               "w"
               " %"
               "w"
               "0,%"
               "w"
               "1"
               :
               : "a"(value), "Nd"(port));
  slow_down_io();
}


x86 assembly (clang, -O0):
<outw_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x2(%rbp),%ax
mov    -0x4(%rbp),%dx
out    %ax,(%dx)
mov    $0x0,%al
call   1030 <slow_down_io@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outw_p>:
mov    %esi,%edx
mov    %edi,%eax
out    %ax,(%dx)
xor    %eax,%eax
jmp    1030 <slow_down_io@plt>

LLVM IR (-O0):
define void @outw_p(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = load i16, i16* %4
%7 = call i32 (...) @slow_down_io()
ret void
}

LLVM IR (-O2):
define void @outw_p(i16 zeroext %0, i16 zeroext %1) {
tail call void asm sideeffect "outw ${0:w},${1:w}", "{ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0, i16 %1)
%3 = tail call i32 (...) @slow_down_io()
ret void
}
void ADCTimerEnable(unsigned long ulBase) {
  (*((volatile unsigned long *)(ulBase + 0x00000068))) |= (1 << 25);
}


x86 assembly (clang, -O0):
<ADCTimerEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x68(%rax),%rcx
or     $0x2000000,%rcx
mov    %rcx,0x68(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADCTimerEnable>:
orq    $0x2000000,0x68(%rdi)
02
ret

LLVM IR (-O0):
define void @ADCTimerEnable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 104
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = or i64 %6, 33554432
store volatile i64 %7, i64* %5
ret void
}

LLVM IR (-O2):
define void @ADCTimerEnable(i64 %0) {
%2 = add i64 %0, 104
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = or i64 %4, 33554432
store volatile i64 %5, i64* %3
ret void
}
unsigned int hash(int key) {
  int retval = 0;
  while (key > 0) {
    retval *= 37;
    retval += key % 10;
    key = key / 10;
  }
  return retval;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1143 <hash+0x43>
imul   $0x25,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
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 <hash+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
xor    %eax,%eax
test   %edi,%edi
jle    1133 <hash+0x33>
mov    $0xcccccccd,%r8d
nopl   0x0(%rax)
lea    (%rax,%rax,8),%edx
lea    (%rax,%rdx,4),%edx
mov    %edi,%esi
imul   %r8,%rsi
shr    $0x23,%rsi
lea    (%rsi,%rsi,1),%eax
lea    (%rax,%rax,4),%ecx
mov    %edi,%eax
sub    %ecx,%eax
add    %edx,%eax
cmp    $0x9,%edi
mov    %esi,%edi
ja     1110 <hash+0x10>
ret

LLVM IR (-O0):
define i32 @hash(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %7, %1
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %16
7: ; preds = %4
%8 = load i32, i32* %3
%9 = mul nsw i32 %8, 37
store i32 %9, i32* %3
%10 = load i32, i32* %2
%11 = srem i32 %10, 10
%12 = load i32, i32* %3
%13 = add nsw i32 %12, %11
store i32 %13, i32* %3
%14 = load i32, i32* %2
%15 = sdiv i32 %14, 10
store i32 %15, i32* %2
br label %4
16: ; preds = %4
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @hash(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %11
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %9, %3 ], [ %0, %1 ]
%6 = mul nsw i32 %4, 37
%7 = urem i32 %5, 10
%8 = add nsw i32 %6, %7
%9 = udiv i32 %5, 10
%10 = icmp ult i32 %5, 10
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %12
}
void inslash2rv() {}


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

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

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

LLVM IR (-O2):
define void @inslash2rv() {
ret void
}
void f(char *s, int i) { *(s + i) = '\0'; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movslq %esi,%rax
movb   $0x0,(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @f(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
store i8 0, i8* %8
ret void
}

LLVM IR (-O2):
define void @f(i8* nocapture writeonly %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
store i8 0, i8* %4
ret void
}
void RTDbgModCreate(void) {}


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

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

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

LLVM IR (-O2):
define void @RTDbgModCreate() {
ret void
}
int sra(int x, int k) {
  int xsrl = (unsigned)x >> k;
  int mask = ~((1 << (8 * sizeof(int) - k)) - 1);
  return (x < 0) ? mask | xsrl : xsrl;
}


x86 assembly (clang, -O0):
<sra>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
mov    %eax,-0xc(%rbp)
movslq -0x8(%rbp),%rcx
mov    $0x20,%eax
sub    %rcx,%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
xor    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    114b <sra+0x4b>
mov    -0x10(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1151 <sra+0x51>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sra>:
mov    %edi,%eax
mov    %edi,%edx
sar    $0x1f,%edx
mov    %esi,%ecx
neg    %cl
shr    %cl,%edx
mov    %esi,%ecx
shrd   %cl,%edx,%eax
ret

LLVM IR (-O0):
define i32 @sra(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = lshr i32 %7, %8
store i32 %9, i32* %5
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = sub i64 32, %11
%13 = trunc i64 %12 to i32
%14 = shl i32 1, %13
%15 = sub nsw i32 %14, 1
%16 = xor i32 %15, -1
store i32 %16, i32* %6
%17 = load i32, i32* %3
%18 = icmp slt i32 %17, 0
br i1 %18, label %19, label %23
19: ; preds = %2
%20 = load i32, i32* %6
%21 = load i32, i32* %5
%22 = or i32 %20, %21
br label %25
23: ; preds = %2
%24 = load i32, i32* %5
br label %25
25: ; preds = %23, %19
%26 = phi i32 [ %22, %19 ], [ %24, %23 ]
ret i32 %26
}

LLVM IR (-O2):
define i32 @sra(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = sub i32 32, %1
%5 = shl nsw i32 -1, %4
%6 = icmp slt i32 %0, 0
%7 = select i1 %6, i32 %5, i32 0
%8 = or i32 %7, %3
ret i32 %8
}
/* Variables and functions */
int gprc_equation_instruction_set(int *);
int gprcm_equation_instruction_set(int *instruction_set) {
  return gprc_equation_instruction_set(instruction_set);
}


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

x86 assembly (clang, -O2):
<gprcm_equation_instruction_set>:
jmp    1030 <gprc_equation_instruction_set@plt>

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

LLVM IR (-O2):
define i32 @gprcm_equation_instruction_set(i32* %0) {
%2 = tail call i32 @gprc_equation_instruction_set(i32* %0)
ret i32 %2
}
/* Variables and functions */
char *lp_internal_sconfig(int, char *);
char *lp_chn_cwit(int chn) { return lp_internal_sconfig(chn, "cwit"); }


x86 assembly (clang, -O0):
<lp_chn_cwit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xedb(%rip),%rsi
call   1030 <lp_internal_sconfig@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lp_chn_cwit>:
lea    0xee9(%rip),%rsi
jmp    1030 <lp_internal_sconfig@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"cwit\00"
define i8* @lp_chn_cwit(i32 %0) {
%2 = tail call i8* @lp_internal_sconfig(i32 %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
int big_endian() {
  union {
    int indian;
    char bytes[sizeof(int)];
  } endian;
  endian.indian = 1;
  if (endian.bytes[0] == 1)
    return (0);
  else
    return (1);
}


x86 assembly (clang, -O0):
<big_endian>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x8(%rbp)
movsbl -0x8(%rbp),%eax
cmp    $0x1,%eax
jne    1124 <big_endian+0x24>
movl   $0x0,-0x4(%rbp)
jmp    112b <big_endian+0x2b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.anon = type { i32 }
define i32 @big_endian() {
%1 = alloca i32
%2 = alloca %union.anon
%3 = bitcast %union.anon* %2 to i32*
store i32 1, i32* %3
%4 = bitcast %union.anon* %2 to [4 x i8]*
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %10
9: ; preds = %0
store i32 0, i32* %1
br label %11
10: ; preds = %0
store i32 1, i32* %1
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
define i32 @big_endian() {
ret i32 0
}
/* Variables and functions */
int binary_search(int *, int /*<<< orphan*/, int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a[8] = {1, 2, 3, 7, 8, 11, 13, 19};
  int v = 8;
  printf("%d", binary_search(a, 0, 7, v));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec1(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x8,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%ecx
xor    %esi,%esi
mov    $0x7,%edx
call   1040 <binary_search@plt>
mov    %eax,%esi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x7,%edx
mov    $0x8,%ecx
call   1040 <binary_search@plt>
lea    0xeca(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [8 x i32] [i32 1, i32 2, i32 3, i32 7, i32 8, i32 11, i32 13, i32 19]
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [8 x i32]* %2 to i8*
store i32 8, i32* %3
%5 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%6 = load i32, i32* %3
%7 = call i32 @binary_search(i32* %5, i32 0, i32 7, i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [8 x i32] [i32 1, i32 2, i32 3, i32 7, i32 8, i32 11, i32 13, i32 19]
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [8 x i32]
%2 = bitcast [8 x i32]* %1 to i8*
%3 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%4 = call i32 @binary_search(i32* %3, i32 0, i32 7, i32 8)
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
char *OpenAPI_base64encode(const void *b64_encode_this,
                           int encode_this_many_bytes) {
  return NULL;
}


x86 assembly (clang, -O0):
<OpenAPI_base64encode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i8* @OpenAPI_base64encode(i8* nocapture readnone %0, i32 %1) {
ret i8* null
}
char *getClassicArtworkSet(int type) {
  return (type == 0   ? "gfx_classic"
          : type == 1 ? "snd_classic"
          : type == 2 ? "mus_classic"
                      : "");
}


x86 assembly (clang, -O0):
<getClassicArtworkSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1121 <getClassicArtworkSet+0x21>
lea    0xee8(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    115f <getClassicArtworkSet+0x5f>
cmpl   $0x1,-0x4(%rbp)
jne    113b <getClassicArtworkSet+0x3b>
lea    0xeda(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1157 <getClassicArtworkSet+0x57>
mov    -0x4(%rbp),%edx
lea    0xed2(%rip),%rax
lea    0xecc(%rip),%rcx
cmp    $0x2,%edx
cmove  %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getClassicArtworkSet>:
test   %edi,%edi
je     1111 <getClassicArtworkSet+0x11>
cmp    $0x1,%edi
jne    1119 <getClassicArtworkSet+0x19>
lea    0xefc(%rip),%rax
ret
lea    0xee8(%rip),%rax
ret
cmp    $0x2,%edi
lea    0xef5(%rip),%rcx
lea    0xeed(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [12 x i8] c"gfx_classic\00"
@.str.1 = [12 x i8] c"snd_classic\00"
@.str.2 = [12 x i8] c"mus_classic\00"
@.str.3 = [1 x i8] zeroinitializer
define i8* @getClassicArtworkSet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %17
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %10
9: ; preds = %6
br label %15
10: ; preds = %6
%11 = load i32, i32* %2
%12 = icmp eq i32 %11, 2
%13 = zext i1 %12 to i64
%14 = select i1 %12, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0)
br label %15
15: ; preds = %10, %9
%16 = phi i8* [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), %9 ], [ %14, %10 ]
br label %17
17: ; preds = %15, %5
%18 = phi i8* [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), %5 ], [ %16, %15 ]
ret i8* %18
}

LLVM IR (-O2):
@.str = [12 x i8] c"gfx_classic\00"
@.str.1 = [12 x i8] c"snd_classic\00"
@.str.2 = [12 x i8] c"mus_classic\00"
@.str.3 = [1 x i8] zeroinitializer
define i8* @getClassicArtworkSet(i32 %0) {
switch i32 %0, label %2 [
i32 0, label %6
i32 1, label %5
]
2: ; preds = %1
%3 = icmp eq i32 %0, 2
%4 = select i1 %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0)
br label %6
5: ; preds = %1
br label %6
6: ; preds = %1, %5, %2
%7 = phi i8* [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), %1 ], [ %4, %2 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), %5 ]
ret i8* %7
}