xunge/DecIR huggingface dataset:
/* Variables and functions */
void *calloc(int, int);
int /*<<< orphan*/ zlog_fatal_output(int, char *, long, int);
void *zcalloc_20160308(int nmemb, int size) {
  void *r;
  if ((r = calloc(nmemb, size)) == 0) {
    {
      zlog_fatal_output(1, "zcalloc: insufficient memory for %ldx%ld bytes: %m",
                        (long)nmemb, size);
    };
  }
  return r;
}


x86 assembly (clang, -O0):
<zcalloc_20160308>:
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 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    115f <zcalloc_20160308+0x3f>
movslq -0x4(%rbp),%rdx
mov    -0x8(%rbp),%ecx
mov    $0x1,%edi
lea    0xea6(%rip),%rsi
call   1040 <zlog_fatal_output@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zcalloc_20160308>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebp
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114d <zcalloc_20160308+0x2d>
movslq %ebp,%rdx
lea    0xec0(%rip),%rsi
mov    $0x1,%edi
mov    %r14d,%ecx
call   1040 <zlog_fatal_output@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [51 x i8] c"zcalloc: insufficient memory for %ldx%ld bytes: %m\00"
define i8* @zcalloc_20160308(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i8* @calloc(i32 %6, i32 %7)
store i8* %8, i8** %5
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = load i32, i32* %4
%14 = call i32 @zlog_fatal_output(i32 1, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i64 %12, i32 %13)
br label %15
15: ; preds = %10, %2
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
@.str = [51 x i8] c"zcalloc: insufficient memory for %ldx%ld bytes: %m\00"
define noalias i8* @zcalloc_20160308(i32 %0, i32 %1) {
%3 = tail call i8* @calloc(i32 %0, i32 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = sext i32 %0 to i64
%7 = tail call i32 @zlog_fatal_output(i32 1, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i64 %6, i32 %1)
br label %8
8: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ dispAllPrintableChars();
main(void) { dispAllPrintableChars(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @dispAllPrintableChars()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @dispAllPrintableChars()
ret i32 0
}
float *vec4_negative(float *result, float *a) {
  result[0] = -a[0];
  result[1] = -a[1];
  result[2] = -a[2];
  result[3] = -a[3];
  return result;
}


x86 assembly (clang, -O0):
<vec4_negative>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movss  0xc(%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0xc(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec4_negative>:
mov    %rdi,%rax
movss  (%rsi),%xmm0
movaps 0xef2(%rip),%xmm1
xorps  %xmm1,%xmm0
movss  %xmm0,(%rdi)
movss  0x4(%rsi),%xmm0
xorps  %xmm1,%xmm0
movss  %xmm0,0x4(%rdi)
movss  0x8(%rsi),%xmm0
xorps  %xmm1,%xmm0
movss  %xmm0,0x8(%rdi)
movss  0xc(%rsi),%xmm0
xorps  %xmm1,%xmm0
movss  %xmm0,0xc(%rdi)
ret

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

LLVM IR (-O2):
define float* @vec4_negative(float* returned writeonly %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = fneg float %3
store float %4, float* %0
%5 = getelementptr inbounds float, float* %1, i64 1
%6 = load float, float* %5
%7 = fneg float %6
%8 = getelementptr inbounds float, float* %0, i64 1
store float %7, float* %8
%9 = getelementptr inbounds float, float* %1, i64 2
%10 = load float, float* %9
%11 = fneg float %10
%12 = getelementptr inbounds float, float* %0, i64 2
store float %11, float* %12
%13 = getelementptr inbounds float, float* %1, i64 3
%14 = load float, float* %13
%15 = fneg float %14
%16 = getelementptr inbounds float, float* %0, i64 3
store float %15, float* %16
ret float* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int raiseerr(int err_code) {
  printf("Error %d\n", err_code);
  return -1;
}


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

x86 assembly (clang, -O2):
<raiseerr>:
push   %rax
mov    %edi,%esi
lea    0xee6(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Error %d\0A\00"
define i32 @raiseerr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 -1
}

LLVM IR (-O2):
@.str = [10 x i8] c"Error %d\0A\00"
define i32 @raiseerr(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void msleep(int s) { usleep(1000 * s); }


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

x86 assembly (clang, -O2):
<msleep>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @msleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 1000, %3
%5 = call i32 @usleep(i32 %4)
ret void
}

LLVM IR (-O2):
define void @msleep(i32 %0) {
%2 = mul nsw i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
long read_number(int /*<<< orphan*/ *, int);
long testlib_read_longint(FILE *__stream) {
  return read_number(__stream, 2147483647);
}


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

x86 assembly (clang, -O2):
<testlib_read_longint>:
mov    $0x7fffffff,%esi
jmp    1030 <read_number@plt>

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

LLVM IR (-O2):
define i64 @testlib_read_longint(i32* %0) {
%2 = tail call i64 @read_number(i32* %0, i32 2147483647)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ arm_memio_immdh_op();
int /*<<< orphan*/ arm_memio_ldrsh(int /*<<< orphan*/);
void arm_ldrsh_imm() { arm_memio_ldrsh(arm_memio_immdh_op()); }


x86 assembly (clang, -O0):
<arm_ldrsh_imm>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <arm_memio_immdh_op@plt>
mov    %eax,%edi
call   1040 <arm_memio_ldrsh@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<arm_ldrsh_imm>:
push   %rax
xor    %eax,%eax
call   1030 <arm_memio_immdh_op@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <arm_memio_ldrsh@plt>

LLVM IR (-O0):
define void @arm_ldrsh_imm() {
%1 = call i32 (...) @arm_memio_immdh_op()
%2 = call i32 @arm_memio_ldrsh(i32 %1)
ret void
}

LLVM IR (-O2):
define void @arm_ldrsh_imm() {
%1 = tail call i32 (...) @arm_memio_immdh_op()
%2 = tail call i32 @arm_memio_ldrsh(i32 %1)
ret void
}
long long cpucycles_x86tscfreq(void) {
  long long result;
  asm volatile(".byte 15;.byte 49" : "=A"(result));
  return result;
}


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

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

LLVM IR (-O0):
define i64 @cpucycles_x86tscfreq() {
%1 = alloca i64
%2 = call i64 asm sideeffect ".byte 15;.byte 49", "=A,~{dirflag},~{fpsr},~{flags}"()
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @cpucycles_x86tscfreq() {
%1 = tail call i64 asm sideeffect ".byte 15;.byte 49", "=A,~{dirflag},~{fpsr},~{flags}"()
ret i64 %1
}
void bn_dup_expand(void) {}


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

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

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

LLVM IR (-O2):
define void @bn_dup_expand() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) { printf("Usage: dw -t template binfile\n"); }


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

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

LLVM IR (-O0):
@.str = [31 x i8] c"Usage: dw -t template binfile\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [30 x i8] c"Usage: dw -t template binfile\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
ret void
}
int mol(int val1, int val2) { return val1 * val2; }


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

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

LLVM IR (-O0):
define i32 @mol(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = mul nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @mol(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ DriveReg2_SaveConfig();
void DriveReg2_Sleep(void) { DriveReg2_SaveConfig(); }


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

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

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

LLVM IR (-O2):
define void @DriveReg2_Sleep() {
%1 = tail call i32 (...) @DriveReg2_SaveConfig()
ret void
}
/* Variables and functions */
double __builtin_wasm_min_f64(double, double);
double min_f64(double x, double y) { return __builtin_wasm_min_f64(x, y); }


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

x86 assembly (clang, -O2):
<min_f64>:
jmp    1030 <__builtin_wasm_min_f64@plt>

LLVM IR (-O0):
define double @min_f64(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 = call double @__builtin_wasm_min_f64(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @min_f64(double %0, double %1) {
%3 = tail call double @__builtin_wasm_min_f64(double %0, double %1)
ret double %3
}
/* Type definitions */
struct conn_info_st {
  int dummy;
};

/* Variables and functions */
int std_user(char const *, struct conn_info_st *, char *);
int std_user_split(const char *args, struct conn_info_st *conn_info) {
  return std_user(args, conn_info, "@,: \t");
}


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

x86 assembly (clang, -O2):
<std_user_split>:
lea    0xee9(%rip),%rdx
jmp    1030 <std_user@plt>

LLVM IR (-O0):
%struct.conn_info_st = type { i32 }
@.str = [6 x i8] c"@,: \09\00"
define i32 @std_user_split(i8* %0, %struct.conn_info_st* %1) {
%3 = alloca i8*
%4 = alloca %struct.conn_info_st*
store i8* %0, i8** %3
store %struct.conn_info_st* %1, %struct.conn_info_st** %4
%5 = load i8*, i8** %3
%6 = load %struct.conn_info_st*, %struct.conn_info_st** %4
%7 = call i32 @std_user(i8* %5, %struct.conn_info_st* %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 %7
}

LLVM IR (-O2):
%struct.conn_info_st = type { i32 }
@.str = [6 x i8] c"@,: \09\00"
define i32 @std_user_split(i8* %0, %struct.conn_info_st* %1) {
%3 = tail call i32 @std_user(i8* %0, %struct.conn_info_st* %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void perror(const char *s) { printf("perror: %s\n", s); }


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

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"perror: %s\0A\00"
define void @perror(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
scalar_t__ mrand48();
uint32_t rand_num(uint32_t range) { return (((uint32_t)mrand48()) % range); }


x86 assembly (clang, -O0):
<rand_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <mrand48@plt>
cltd
idivl  -0x4(%rbp)
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_num>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <mrand48@plt>
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @rand_num(i32 %0) {
%2 = tail call i64 (...) @mrand48()
%3 = trunc i64 %2 to i32
%4 = srem i32 %3, %0
ret i32 %4
}
void xive_smp_probe(void) {}


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

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

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

LLVM IR (-O2):
define void @xive_smp_probe() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mytimer_set_timer(int, void (*)(int));
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ switchThreads();
void handler(int signal) {
  mytimer_set_timer(1000, handler);
  switchThreads();
  printf("HANDLER\n");
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x3e8,%edi
mov    0x2ea1(%rip),%rsi
call   1040 <mytimer_set_timer@plt>
mov    $0x0,%al
call   1050 <switchThreads@plt>
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler>:
push   %rax
mov    0x2eb0(%rip),%rsi
mov    $0x3e8,%edi
call   1040 <mytimer_set_timer@plt>
xor    %eax,%eax
call   1050 <switchThreads@plt>
lea    0xeb0(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"HANDLER\0A\00"
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @mytimer_set_timer(i32 1000, void (i32)* @handler)
%4 = call i32 (...) @switchThreads()
%5 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [8 x i8] c"HANDLER\00"
define void @handler(i32 %0) {
%2 = tail call i32 @mytimer_set_timer(i32 1000, void (i32)* @handler)
%3 = tail call i32 (...) @switchThreads()
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fftss_plan_with_nthreads(int);
void fftss_plan_with_nthreads_(int *nthreads) {
  fftss_plan_with_nthreads(*nthreads);
}


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

x86 assembly (clang, -O2):
<fftss_plan_with_nthreads_>:
mov    (%rdi),%edi
jmp    1030 <fftss_plan_with_nthreads@plt>

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

LLVM IR (-O2):
define void @fftss_plan_with_nthreads_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @fftss_plan_with_nthreads(i32 %2)
ret void
}
void dsl_ld(char *dl) {}


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

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

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

LLVM IR (-O2):
define void @dsl_ld(i8* nocapture %0) {
ret void
}
/* Variables and functions */
double fabs(double);
int equals(double x, double y, double tolerance) {
  return fabs(x - y) < tolerance;
}


x86 assembly (clang, -O0):
<equals>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
movaps 0xedc(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<equals>:
subsd  %xmm1,%xmm0
andpd  0xef4(%rip),%xmm0
xor    %eax,%eax
ucomisd %xmm0,%xmm2
seta   %al
ret

LLVM IR (-O0):
define i32 @equals(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* %5
%9 = fsub double %7, %8
%10 = call double @llvm.fabs.f64(double %9)
%11 = load double, double* %6
%12 = fcmp olt double %10, %11
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @equals(double %0, double %1, double %2) {
%4 = fsub double %0, %1
%5 = tail call double @llvm.fabs.f64(double %4)
%6 = fcmp olt double %5, %2
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int __infer_nondet_int();
int setvbuf(FILE *__restrict stream, char *__restrict buf, int mode,
            size_t size) {
  int n;
  n = __infer_nondet_int();
  if (n)
    return 0;
  else
    return EOF;
}


x86 assembly (clang, -O0):
<setvbuf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %rcx,-0x28(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_int@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
je     1147 <setvbuf+0x37>
movl   $0x0,-0x4(%rbp)
jmp    1153 <setvbuf+0x43>
mov    0x2e9a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setvbuf>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <__infer_nondet_int@plt>
test   %eax,%eax
jne    1127 <setvbuf+0x17>
mov    0x2ec3(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @setvbuf(i32* noalias %0, i8* noalias %1, i32 %2, i64 %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i64
%10 = alloca i32
store i32* %0, i32** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i64 %3, i64* %9
%11 = call i32 (...) @__infer_nondet_int()
store i32 %11, i32* %10
%12 = load i32, i32* %10
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %4
store i32 0, i32* %5
br label %17
15: ; preds = %4
%16 = load i32, i32* @EOF
store i32 %16, i32* %5
br label %17
17: ; preds = %15, %14
%18 = load i32, i32* %5
ret i32 %18
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @setvbuf(i32* noalias nocapture readnone %0, i8* noalias nocapture readnone %1, i32 %2, i64 %3) {
%5 = tail call i32 (...) @__infer_nondet_int()
%6 = icmp eq i32 %5, 0
%7 = load i32, i32* @EOF
%8 = select i1 %6, i32 %7, i32 0
ret i32 %8
}
double rpp_cp_N2(double T) {
  double y = T / 1;
  double cp0bar = 3.115e1 + y * (-1.357e-2 + y * (2.680e-5 + y * -1.168e-8));
  return cp0bar / 28.013 * 1000;
}


x86 assembly (clang, -O0):
<rpp_cp_N2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xf1a(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
movsd  0xeea(%rip),%xmm3
mulsd  %xmm3,%xmm2
movsd  0xee6(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xec6(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeae(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xe90(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe7c(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @rpp_cp_N2(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
%5 = load double, double* %2
%6 = fdiv double %5, 1.000000e+00
store double %6, double* %3
%7 = load double, double* %3
%8 = load double, double* %3
%9 = load double, double* %3
%10 = call double @llvm.fmuladd.f64(double %9, double -1.168000e-08, double 2.680000e-05)
%11 = call double @llvm.fmuladd.f64(double %8, double %10, double -1.357000e-02)
%12 = call double @llvm.fmuladd.f64(double %7, double %11, double 3.115000e+01)
store double %12, double* %4
%13 = load double, double* %4
%14 = fdiv double %13, 2.801300e+01
%15 = fmul double %14, 1.000000e+03
ret double %15
}

LLVM IR (-O2):
define double @rpp_cp_N2(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double -1.168000e-08, double 2.680000e-05)
%3 = tail call double @llvm.fmuladd.f64(double %0, double %2, double -1.357000e-02)
%4 = tail call double @llvm.fmuladd.f64(double %0, double %3, double 3.115000e+01)
%5 = fdiv double %4, 2.801300e+01
%6 = fmul double %5, 1.000000e+03
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ do_uninit_read_with_intermediate_frames(int, int *);
void uninit_test7(int *val_p) {
  do_uninit_read_with_intermediate_frames(5, val_p);
}


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

x86 assembly (clang, -O2):
<uninit_test7>:
mov    %rdi,%rsi
mov    $0x5,%edi
jmp    1030 <do_uninit_read_with_intermediate_frames@plt>

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

LLVM IR (-O2):
define void @uninit_test7(i32* %0) {
%2 = tail call i32 @do_uninit_read_with_intermediate_frames(i32 5, i32* %0)
ret void
}
double minus(double a, double b) { return a - b; }


x86 assembly (clang, -O0):
<minus>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<minus>:
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @minus(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 = fsub double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @minus(double %0, double %1) {
%3 = fsub double %0, %1
ret double %3
}
int Max(int a, int b) {
  if (a < b)
    return (b);
  return (a);
}


x86 assembly (clang, -O0):
<Max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1121 <Max+0x21>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <Max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Max>:
mov    %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @Max(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
void test_range_of_unused_variable(void) { int redundant; }


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

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

LLVM IR (-O0):
define void @test_range_of_unused_variable() {
%1 = alloca i32
ret void
}

LLVM IR (-O2):
define void @test_range_of_unused_variable() {
ret void
}
int jul_is_leap_year(const int year) { return (year % 4 == 0) ? 1 : 0; }


x86 assembly (clang, -O0):
<jul_is_leap_year>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jul_is_leap_year>:
xor    %eax,%eax
test   $0x3,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @jul_is_leap_year(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 4
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 1, i32 0
ret i32 %7
}

LLVM IR (-O2):
define i32 @jul_is_leap_year(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ clear_trace();
int /*<<< orphan*/ disable_tracing();
int /*<<< orphan*/ reset_events();
int /*<<< orphan*/ set_plugin(char *);
int /*<<< orphan*/ update_ftrace_pid(char *, int);
void disable_all(int disable_tracer) {
  disable_tracing();
  if (disable_tracer)
    set_plugin("nop");
  reset_events();
  update_ftrace_pid("", 1);
  update_ftrace_pid(NULL, 0);
  clear_trace();
}


x86 assembly (clang, -O0):
<disable_all>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1050 <disable_tracing@plt>
cmpl   $0x0,-0x4(%rbp)
je     1178 <disable_all+0x28>
lea    0xe8d(%rip),%rdi
call   1030 <set_plugin@plt>
mov    $0x0,%al
call   1040 <reset_events@plt>
lea    0xe7d(%rip),%rdi
mov    $0x1,%esi
call   1060 <update_ftrace_pid@plt>
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
call   1060 <update_ftrace_pid@plt>
mov    $0x0,%al
call   1070 <clear_trace@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<disable_all>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1050 <disable_tracing@plt>
test   %ebx,%ebx
je     116a <disable_all+0x1a>
lea    0xe9b(%rip),%rdi
call   1030 <set_plugin@plt>
xor    %eax,%eax
call   1040 <reset_events@plt>
lea    0xe8b(%rip),%rdi
mov    $0x1,%esi
call   1060 <update_ftrace_pid@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1060 <update_ftrace_pid@plt>
xor    %eax,%eax
pop    %rbx
jmp    1070 <clear_trace@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"nop\00"
@.str.1 = [1 x i8] zeroinitializer
define void @disable_all(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @disable_tracing()
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @set_plugin(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
%9 = call i32 (...) @reset_events()
%10 = call i32 @update_ftrace_pid(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i32 1)
%11 = call i32 @update_ftrace_pid(i8* null, i32 0)
%12 = call i32 (...) @clear_trace()
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"nop\00"
@.str.1 = [1 x i8] zeroinitializer
define void @disable_all(i32 %0) {
%2 = tail call i32 (...) @disable_tracing()
%3 = icmp eq i32 %0, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @set_plugin(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
%7 = tail call i32 (...) @reset_events()
%8 = tail call i32 @update_ftrace_pid(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i32 1)
%9 = tail call i32 @update_ftrace_pid(i8* null, i32 0)
%10 = tail call i32 (...) @clear_trace()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ chr8setBank0(int);
int /*<<< orphan*/ prg32setBank0(int);
void m201_setParams(uint16_t addr, uint8_t val) {
  (void)val;
  chr8setBank0((addr & 0xFF) << 13);
  prg32setBank0((addr & 0xFF) << 15);
}


x86 assembly (clang, -O0):
<m201_setParams>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
and    $0xff,%edi
shl    $0xd,%edi
call   1040 <chr8setBank0@plt>
mov    -0x4(%rbp),%edi
and    $0xff,%edi
shl    $0xf,%edi
call   1030 <prg32setBank0@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m201_setParams>:
push   %rbx
movzbl %dil,%ebx
mov    %ebx,%edi
shl    $0xd,%edi
call   1040 <chr8setBank0@plt>
shl    $0xf,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <prg32setBank0@plt>

LLVM IR (-O0):
define void @m201_setParams(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = and i32 %6, 255
%8 = shl i32 %7, 13
%9 = call i32 @chr8setBank0(i32 %8)
%10 = load i32, i32* %3
%11 = and i32 %10, 255
%12 = shl i32 %11, 15
%13 = call i32 @prg32setBank0(i32 %12)
ret void
}

LLVM IR (-O2):
define void @m201_setParams(i32 %0, i32 %1) {
%3 = and i32 %0, 255
%4 = shl nuw nsw i32 %3, 13
%5 = tail call i32 @chr8setBank0(i32 %4)
%6 = shl nuw nsw i32 %3, 15
%7 = tail call i32 @prg32setBank0(i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ output(char *, char const *, char const *);
void history_output(const char *prompt, const char *line) {
  output("%s%s\n", prompt, line);
}


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

x86 assembly (clang, -O2):
<history_output>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
jmp    1030 <output@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"%s%s\0A\00"
define void @history_output(i8* %0, i8* %1) {
%3 = tail call i32 @output(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
int charCheck(char *str, char a, int i) {
  if (str[i] == a)
    return i;
  else
    return -1;
}


x86 assembly (clang, -O0):
<charCheck>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    1134 <charCheck+0x34>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113b <charCheck+0x3b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<charCheck>:
movslq %edx,%rax
cmp    %sil,(%rdi,%rax,1)
mov    $0xffffffff,%ecx
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @charCheck(i8* nocapture %0, i8 signext %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, %1
%8 = select i1 %7, i32 %2, i32 -1
ret i32 %8
}
__attribute__((no, noclone)) unsigned __int128 t161_3sub(unsigned __int128 y) {
  unsigned __int128 r;
  if (__builtin_sub_overflow((unsigned __int128)(-1), y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t161_3sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rcx
mov    -0x28(%rbp),%rdx
not    %rcx
not    %rdx
xor    %eax,%eax
mov    %rdx,-0x38(%rbp)
mov    %rcx,-0x40(%rbp)
test   $0x1,%al
jne    1155 <t161_3sub+0x45>
jmp    115c <t161_3sub+0x4c>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t161_3sub>:
mov    %rsi,%rdx
mov    %rdi,%rax
not    %rax
not    %rdx
ret

LLVM IR (-O0):
define { i64, i64 } @t161_3sub(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = bitcast i128* %4 to { i64, i64 }*
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 0
store i64 %0, i64* %8
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = load i128, i128* %4
store i128 %10, i128* %5
%11 = load i128, i128* %5
%12 = call { i128, i1 } @llvm.usub.with.overflow.i128(i128 -1, i128 %11)
%13 = extractvalue { i128, i1 } %12, 1
%14 = extractvalue { i128, i1 } %12, 0
store i128 %14, i128* %6
br i1 %13, label %15, label %17
15: ; preds = %2
%16 = call i32 (...) @bar()
br label %17
17: ; preds = %15, %2
%18 = load i128, i128* %6
store i128 %18, i128* %3
%19 = bitcast i128* %3 to { i64, i64 }*
%20 = load { i64, i64 }, { i64, i64 }* %19
ret { i64, i64 } %20
}

LLVM IR (-O2):
define { i64, i64 } @t161_3sub(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = xor i128 %6, -1
%8 = trunc i128 %7 to i64
%9 = lshr i128 %7, 64
%10 = trunc i128 %9 to i64
%11 = insertvalue { i64, i64 } poison, i64 %8, 0
%12 = insertvalue { i64, i64 } %11, i64 %10, 1
ret { i64, i64 } %12
}
void bar(int e, int f, int g, int h) {}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @bar(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
define void @bar(i32 %0, i32 %1, i32 %2, i32 %3) {
ret void
}
/* Variables and functions */
scalar_t__ MemAlloc(int);
double *CreateHistogram() {
  double *a;
  int i;
  a = (double *)MemAlloc(sizeof(double) * 32768);
  if (!a)
    return 0;
  for (i = 0; i < 32768; i++)
    a[i] = 0.0;
  return a;
}


x86 assembly (clang, -O0):
<CreateHistogram>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x40000,%edi
call   1030 <MemAlloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    113e <CreateHistogram+0x2e>
movq   $0x0,-0x8(%rbp)
jmp    1178 <CreateHistogram+0x68>
movl   $0x0,-0x14(%rbp)
cmpl   $0x8000,-0x14(%rbp)
jge    1170 <CreateHistogram+0x60>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1145 <CreateHistogram+0x35>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CreateHistogram>:
push   %rbx
mov    $0x40000,%edi
call   1040 <MemAlloc@plt>
test   %rax,%rax
je     1144 <CreateHistogram+0x24>
mov    %rax,%rbx
mov    $0x40000,%edx
mov    %rax,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
jmp    1146 <CreateHistogram+0x26>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define double* @CreateHistogram() {
%1 = alloca double*
%2 = alloca double*
%3 = alloca i32
%4 = call i64 @MemAlloc(i32 262144)
%5 = inttoptr i64 %4 to double*
store double* %5, double** %2
%6 = load double*, double** %2
%7 = icmp ne double* %6, null
br i1 %7, label %9, label %8
8: ; preds = %0
store double* null, double** %1
br label %23
9: ; preds = %0
store i32 0, i32* %3
br label %10
10: ; preds = %18, %9
%11 = load i32, i32* %3
%12 = icmp slt i32 %11, 32768
br i1 %12, label %13, label %21
13: ; preds = %10
%14 = load double*, double** %2
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds double, double* %14, i64 %16
store double 0.000000e+00, double* %17
br label %18
18: ; preds = %13
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %10
21: ; preds = %10
%22 = load double*, double** %2
store double* %22, double** %1
br label %23
23: ; preds = %21, %8
%24 = load double*, double** %1
ret double* %24
}

LLVM IR (-O2):
define double* @CreateHistogram() {
%1 = tail call i64 @MemAlloc(i32 262144)
%2 = icmp eq i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = inttoptr i64 %1 to double*
%5 = inttoptr i64 %1 to i8*
br label %6
6: ; preds = %3, %0
%7 = phi double* [ null, %0 ], [ %4, %3 ]
ret double* %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void ldtest1(const char *str) {
  printf("alternate ldtest1 implementation => %s\n", str);
}


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

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

LLVM IR (-O0):
@.str = [40 x i8] c"alternate ldtest1 implementation => %s\0A\00"
define void @ldtest1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"alternate ldtest1 implementation => %s\0A\00"
define void @ldtest1(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct RNAfold_args_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ RNAfold_cmdline_parser_release(struct RNAfold_args_info *);
void RNAfold_cmdline_parser_free(struct RNAfold_args_info *args_info) {
  RNAfold_cmdline_parser_release(args_info);
}


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

x86 assembly (clang, -O2):
<RNAfold_cmdline_parser_free>:
jmp    1030 <RNAfold_cmdline_parser_release@plt>

LLVM IR (-O0):
%struct.RNAfold_args_info = type { i32 }
define void @RNAfold_cmdline_parser_free(%struct.RNAfold_args_info* %0) {
%2 = alloca %struct.RNAfold_args_info*
store %struct.RNAfold_args_info* %0, %struct.RNAfold_args_info** %2
%3 = load %struct.RNAfold_args_info*, %struct.RNAfold_args_info** %2
%4 = call i32 @RNAfold_cmdline_parser_release(%struct.RNAfold_args_info* %3)
ret void
}

LLVM IR (-O2):
%struct.RNAfold_args_info = type { i32 }
define void @RNAfold_cmdline_parser_free(%struct.RNAfold_args_info* %0) {
%2 = tail call i32 @RNAfold_cmdline_parser_release(%struct.RNAfold_args_info* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void recursive_count(int y) {
  if (y <= 100) {
    printf("Recursive count : %d \n", y);
    recursive_count(y + 1);
  }
}


x86 assembly (clang, -O0):
<recursive_count>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jg     114f <recursive_count+0x2f>
mov    -0x4(%rbp),%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
call   1040 <recursive_count@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recursive_count>:
push   %r14
push   %rbx
push   %rax
cmp    $0x64,%edi
jg     1142 <recursive_count+0x32>
mov    %edi,%ebx
lea    0xede(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x65,%ebx
jne    1130 <recursive_count+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Recursive count : %d \0A\00"
define void @recursive_count(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 %3, 100
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 1
br label %10
10: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"Recursive count : %d \0A\00"
define void @recursive_count(i32 %0) {
%2 = icmp slt i32 %0, 101
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = add i32 %4, 1
%7 = icmp eq i32 %6, 101
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
char *strchr(const char *s, int c) {
  while (*s != '\0') {
    if (*s == (char)c)
      return ((char *)s);
    s++;
  }
  if (c == '\0')
    return ((char *)s);
  return (((void *)0));
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114e <strchr+0x4e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x14(%rbp),%ecx
movsbl %cl,%ecx
cmp    %ecx,%eax
jne    113d <strchr+0x3d>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116d <strchr+0x6d>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110b <strchr+0xb>
cmpl   $0x0,-0x14(%rbp)
jne    1165 <strchr+0x65>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116d <strchr+0x6d>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     1123 <strchr+0x23>
movsbl %sil,%edx
nopl   (%rax)
movsbl %cl,%ecx
cmp    %ecx,%edx
je     112b <strchr+0x2b>
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strchr+0x10>
xor    %ecx,%ecx
test   %esi,%esi
cmovne %rcx,%rax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %17, label %5
5: ; preds = %2
%6 = shl i32 %1, 24
%7 = ashr exact i32 %6, 24
br label %8
8: ; preds = %5, %13
%9 = phi i8 [ %3, %5 ], [ %15, %13 ]
%10 = phi i8* [ %0, %5 ], [ %14, %13 ]
%11 = sext i8 %9 to i32
%12 = icmp eq i32 %7, %11
br i1 %12, label %21, label %13
13: ; preds = %8
%14 = getelementptr inbounds i8, i8* %10, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %8
17: ; preds = %13, %2
%18 = phi i8* [ %0, %2 ], [ %14, %13 ]
%19 = icmp eq i32 %1, 0
%20 = select i1 %19, i8* %18, i8* null
br label %21
21: ; preds = %8, %17
%22 = phi i8* [ %20, %17 ], [ %10, %8 ]
ret i8* %22
}