xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ check(int /*<<< orphan*/, char const *);
void *malloc(size_t const);
void *long_new_array(const size_t N, const char *error_msg) {
  void *ptr;
  ptr = malloc(N * sizeof(long));
  check(ptr != NULL, error_msg);
  return ptr;
}


x86 assembly (clang, -O0):
<long_new_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
shl    $0x3,%rdi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
mov    -0x10(%rbp),%rsi
call   1040 <check@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<long_new_array>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
shl    $0x3,%rdi
call   1030 <malloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
mov    %r14,%rsi
call   1040 <check@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @long_new_array(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
%5 = alloca i8*
store i64 %0, i64* %3
store i8* %1, i8** %4
%6 = load i64, i64* %3
%7 = mul i64 %6, 8
%8 = call i8* @malloc(i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
%11 = zext i1 %10 to i32
%12 = load i8*, i8** %4
%13 = call i32 @check(i32 %11, i8* %12)
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
define noalias i8* @long_new_array(i64 %0, i8* %1) {
%3 = shl i64 %0, 3
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp ne i8* %4, null
%6 = zext i1 %5 to i32
%7 = tail call i32 @check(i32 %6, i8* %1)
ret i8* %4
}
/* Variables and functions */
int complete32(int);
int complete(int slot) { return complete32(slot); }


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

x86 assembly (clang, -O2):
<complete>:
jmp    1030 <complete32@plt>

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

LLVM IR (-O2):
define i32 @complete(i32 %0) {
%2 = tail call i32 @complete32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void warning(char *p) { fprintf(stderr, "Warning:%s \n", p); }


x86 assembly (clang, -O0):
<warning>:
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):
<warning>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [13 x i8] c"Warning:%s \0A\00"
define void @warning(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
float average(float array[10]) {
  int i;
  float aver, sum = array[0];
  for (i = 1; i < 10; i++)
    sum = sum + array[i];
  aver = sum / 10;
  return (aver);
}


x86 assembly (clang, -O0):
<average>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x14(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    114b <average+0x4b>
movss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
addss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111c <average+0x1c>
movss  -0x14(%rbp),%xmm0
movss  0xea8(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<average>:
movss  (%rdi),%xmm0
addss  0x4(%rdi),%xmm0
addss  0x8(%rdi),%xmm0
addss  0xc(%rdi),%xmm0
addss  0x10(%rdi),%xmm0
addss  0x14(%rdi),%xmm0
addss  0x18(%rdi),%xmm0
addss  0x1c(%rdi),%xmm0
addss  0x20(%rdi),%xmm0
addss  0x24(%rdi),%xmm0
divss  0xec7(%rip),%xmm0
ret

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

LLVM IR (-O2):
define float @average(float* nocapture %0) {
%2 = load float, float* %0
%3 = getelementptr inbounds float, float* %0, i64 1
%4 = load float, float* %3
%5 = fadd float %2, %4
%6 = getelementptr inbounds float, float* %0, i64 2
%7 = load float, float* %6
%8 = fadd float %5, %7
%9 = getelementptr inbounds float, float* %0, i64 3
%10 = load float, float* %9
%11 = fadd float %8, %10
%12 = getelementptr inbounds float, float* %0, i64 4
%13 = load float, float* %12
%14 = fadd float %11, %13
%15 = getelementptr inbounds float, float* %0, i64 5
%16 = load float, float* %15
%17 = fadd float %14, %16
%18 = getelementptr inbounds float, float* %0, i64 6
%19 = load float, float* %18
%20 = fadd float %17, %19
%21 = getelementptr inbounds float, float* %0, i64 7
%22 = load float, float* %21
%23 = fadd float %20, %22
%24 = getelementptr inbounds float, float* %0, i64 8
%25 = load float, float* %24
%26 = fadd float %23, %25
%27 = getelementptr inbounds float, float* %0, i64 9
%28 = load float, float* %27
%29 = fadd float %26, %28
%30 = fdiv float %29, 1.000000e+01
ret float %30
}
void Temp_Nothing(void) {}


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

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

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

LLVM IR (-O2):
define void @Temp_Nothing() {
ret void
}
void nrf_802154_priority_drop_init(void) {}


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

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

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

LLVM IR (-O2):
define void @nrf_802154_priority_drop_init() {
ret void
}
long double cubel(x)
long double x;
{ return (x * x * x); }


x86 assembly (clang, -O0):
<cubel>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fld    %st(0)
fmul   %st(1),%st
fmulp  %st,%st(1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cubel>:
fldt   0x8(%rsp)
fld    %st(0)
fmul   %st(1),%st
fmulp  %st,%st(1)
ret

LLVM IR (-O0):
define x86_fp80 @cubel(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = load x86_fp80, x86_fp80* %2
%5 = fmul x86_fp80 %3, %4
%6 = load x86_fp80, x86_fp80* %2
%7 = fmul x86_fp80 %5, %6
ret x86_fp80 %7
}

LLVM IR (-O2):
define x86_fp80 @cubel(x86_fp80 %0) {
%2 = fmul x86_fp80 %0, %0
%3 = fmul x86_fp80 %2, %0
ret x86_fp80 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ wint_t;

/* Variables and functions */
int isxdigit(int /*<<< orphan*/);
int iswxdigit(wint_t c) { return isxdigit(c); }


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

x86 assembly (clang, -O2):
<iswxdigit>:
jmp    1030 <isxdigit@plt>

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

LLVM IR (-O2):
define i32 @iswxdigit(i32 %0) {
%2 = tail call i32 @isxdigit(i32 %0)
ret i32 %2
}
int test0(long v) { return v; }


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

x86 assembly (clang, -O2):
<test0>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i32 @test0(i64 %0) {
%2 = trunc i64 %0 to i32
ret i32 %2
}
/* Variables and functions */
double __nv_fmax(double, double);
double fmax(double __a, double __b) { return __nv_fmax(__a, __b); }


x86 assembly (clang, -O0):
<fmax>:
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 <__nv_fmax@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmax>:
jmp    1030 <__nv_fmax@plt>

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

LLVM IR (-O2):
define double @fmax(double %0, double %1) {
%3 = tail call double @__nv_fmax(double %0, double %1)
ret double %3
}
reg0indreg1(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{
  if (r0 <= (*p1))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<reg0indreg1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
movswl -0x6(%rbp),%eax
mov    -0x20(%rbp),%rcx
movswl (%rcx),%ecx
cmp    %ecx,%eax
jg     113e <reg0indreg1+0x3e>
movl   $0x1,-0x4(%rbp)
jmp    1145 <reg0indreg1+0x45>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reg0indreg1>:
movswl %di,%ecx
movswl (%r9),%edx
xor    %eax,%eax
cmp    %edx,%ecx
setle  %al
ret

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

LLVM IR (-O2):
define i32 @reg0indreg1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture readnone %4, i16* nocapture %5) {
%7 = shl i32 %0, 16
%8 = ashr exact i32 %7, 16
%9 = load i16, i16* %5
%10 = sext i16 %9 to i32
%11 = icmp sle i32 %8, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
int s3cfb_open_fifo(int id, int ch, int (*do_priv)(void *), void *param) {
  return 0;
}


x86 assembly (clang, -O0):
<s3cfb_open_fifo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @s3cfb_open_fifo(i32 %0, i32 %1, i32 (i8*)* nocapture readnone %2, i8* nocapture readnone %3) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ eprintf(char *);
void var_help() {
  eprintf("Try afv?\n"
          " afv 12 int buffer[3]\n"
          " afv 12 byte buffer[1024]\n"
          "Try af[aAv][gs] [delta] [[addr]]\n"
          " afag 0  = arg0 get\n"
          " afvs 12 = var12 set\n"
          "a = arg, A = fastarg, v = var\n"
          "TODO: [[addr]] is not yet implemented. use @\n");
}


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

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

LLVM IR (-O0):
@.str = [207 x i8] c"Try afv?\0A afv 12 int buffer[3]\0A afv 12 byte buffer[1024]\0ATry af[aAv][gs] [delta] [[addr]]\0A afag 0 = arg0 get\0A afvs 12 = var12 set\0Aa = arg, A = fastarg, v = var\0ATODO: [[addr]] is not yet implemented. use @\0A\00"
define void @var_help() {
%1 = call i32 @eprintf(i8* getelementptr inbounds ([207 x i8], [207 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [207 x i8] c"Try afv?\0A afv 12 int buffer[3]\0A afv 12 byte buffer[1024]\0ATry af[aAv][gs] [delta] [[addr]]\0A afag 0 = arg0 get\0A afvs 12 = var12 set\0Aa = arg, A = fastarg, v = var\0ATODO: [[addr]] is not yet implemented. use @\0A\00"
define void @var_help() {
%1 = tail call i32 @eprintf(i8* getelementptr inbounds ([207 x i8], [207 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef unsigned char uint8_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
void USBDevAddrSet(uint32_t ui32Base, uint32_t ui32Address) {
  ;
  (*((volatile unsigned char *)(ui32Base + 0x00000000))) = (uint8_t)ui32Address;
}


x86 assembly (clang, -O0):
<USBDevAddrSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBDevAddrSet>:
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @USBDevAddrSet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i8
%7 = load i64, i64* %3
%8 = add nsw i64 %7, 0
%9 = inttoptr i64 %8 to i8*
store volatile i8 %6, i8* %9
ret void
}

LLVM IR (-O2):
define void @USBDevAddrSet(i64 %0, i64 %1) {
%3 = trunc i64 %1 to i8
%4 = inttoptr i64 %0 to i8*
store volatile i8 %3, i8* %4
ret void
}
void socfpga_arria10_timer_init(void) { return; }


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

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

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

LLVM IR (-O2):
define void @socfpga_arria10_timer_init() {
ret void
}
/* Variables and functions */
int setlogin(const char *name) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @setlogin(i8* nocapture readnone %0) {
ret i32 0
}
int _mul(int bar) { return (bar * 3); }


x86 assembly (clang, -O0):
<_mul>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x3,-0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mul>:
lea    (%rdi,%rdi,2),%eax
ret

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

LLVM IR (-O2):
define i32 @_mul(i32 %0) {
%2 = mul nsw i32 %0, 3
ret i32 %2
}
void vx_info_exit_cvirt_pc(struct _vx_cvirt_pc *cvirt_pc, int cpu) { return; }


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

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

LLVM IR (-O0):
%struct._vx_cvirt_pc = type opaque
define void @vx_info_exit_cvirt_pc(%struct._vx_cvirt_pc* %0, i32 %1) {
%3 = alloca %struct._vx_cvirt_pc*
%4 = alloca i32
store %struct._vx_cvirt_pc* %0, %struct._vx_cvirt_pc** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct._vx_cvirt_pc = type opaque
define void @vx_info_exit_cvirt_pc(%struct._vx_cvirt_pc* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
float pow(float, int);
float sigmoid(float inflection, float input) {
  return (pow(input, 1)) / (pow(input, 1) + pow(inflection, 1));
}


x86 assembly (clang, -O0):
<sigmoid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
mov    $0x1,%edi
call   1030 <pow@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
mov    $0x1,%edi
call   1030 <pow@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
mov    $0x1,%edi
call   1030 <pow@plt>
movss  -0x10(%rbp),%xmm1
movaps %xmm0,%xmm2
movss  -0xc(%rbp),%xmm0
addss  %xmm2,%xmm1
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigmoid>:
sub    $0x18,%rsp
movss  %xmm1,0xc(%rsp)
movss  %xmm0,0x10(%rsp)
movaps %xmm1,%xmm0
mov    $0x1,%edi
call   1030 <pow@plt>
movss  %xmm0,0x14(%rsp)
movss  0xc(%rsp),%xmm0
mov    $0x1,%edi
call   1030 <pow@plt>
movss  %xmm0,0xc(%rsp)
movss  0x10(%rsp),%xmm0
mov    $0x1,%edi
call   1030 <pow@plt>
addss  0xc(%rsp),%xmm0
movss  0x14(%rsp),%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @sigmoid(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 = call float @pow(float %5, i32 1)
%7 = load float, float* %4
%8 = call float @pow(float %7, i32 1)
%9 = load float, float* %3
%10 = call float @pow(float %9, i32 1)
%11 = fadd float %8, %10
%12 = fdiv float %6, %11
ret float %12
}

LLVM IR (-O2):
define float @sigmoid(float %0, float %1) {
%3 = tail call float @pow(float %1, i32 1)
%4 = tail call float @pow(float %1, i32 1)
%5 = tail call float @pow(float %0, i32 1)
%6 = fadd float %4, %5
%7 = fdiv float %3, %6
ret float %7
}
void plugin_dispatch_values() {}


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

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

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

LLVM IR (-O2):
define void @plugin_dispatch_values() {
ret void
}
/* Variables and functions */
size_t copy_str(char *, size_t, char const *);
void append_slash(const char name[], char buf[], size_t buf_size) {
  const size_t nchars = copy_str(buf, buf_size - 1, name);
  buf[nchars - 1] = '/';
  buf[nchars] = '\0';
}


x86 assembly (clang, -O0):
<append_slash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
sub    $0x1,%rsi
mov    -0x8(%rbp),%rdx
call   1030 <copy_str@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x2f,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<append_slash>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rax
lea    -0x1(%rdx),%rsi
mov    %rbx,%rdi
mov    %rax,%rdx
call   1030 <copy_str@plt>
movw   $0x2f,-0x1(%rax,%rbx,1)
pop    %rbx
ret

LLVM IR (-O0):
define void @append_slash(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = sub i64 %9, 1
%11 = load i8*, i8** %4
%12 = call i64 @copy_str(i8* %8, i64 %10, i8* %11)
store i64 %12, i64* %7
%13 = load i8*, i8** %5
%14 = load i64, i64* %7
%15 = sub i64 %14, 1
%16 = getelementptr inbounds i8, i8* %13, i64 %15
store i8 47, i8* %16
%17 = load i8*, i8** %5
%18 = load i64, i64* %7
%19 = getelementptr inbounds i8, i8* %17, i64 %18
store i8 0, i8* %19
ret void
}

LLVM IR (-O2):
define void @append_slash(i8* %0, i8* %1, i64 %2) {
%4 = add i64 %2, -1
%5 = tail call i64 @copy_str(i8* %1, i64 %4, i8* %0)
%6 = add i64 %5, -1
%7 = getelementptr inbounds i8, i8* %1, i64 %6
store i8 47, i8* %7
%8 = getelementptr inbounds i8, i8* %1, i64 %5
store i8 0, i8* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
scalar_t__ posix_memalign(void **, size_t, size_t);
void *mem_alloc_align_func(size_t size, size_t align) {
  void *ptr = NULL;
  if (posix_memalign(&ptr, align, size))
    perror("posix_memalign");
  return ptr;
}


x86 assembly (clang, -O0):
<mem_alloc_align_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
lea    -0x18(%rbp),%rdi
call   1040 <posix_memalign@plt>
cmp    $0x0,%rax
je     115f <mem_alloc_align_func+0x3f>
lea    0xea6(%rip),%rdi
call   1030 <perror@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_alloc_align_func>:
push   %rax
mov    %rdi,%rdx
movq   $0x0,(%rsp)
mov    %rsp,%rdi
call   1040 <posix_memalign@plt>
test   %rax,%rax
jne    113f <mem_alloc_align_func+0x1f>
mov    (%rsp),%rax
pop    %rcx
ret
lea    0xeba(%rip),%rdi
call   1030 <perror@plt>
jmp    1139 <mem_alloc_align_func+0x19>

LLVM IR (-O0):
@.str = [15 x i8] c"posix_memalign\00"
define i8* @mem_alloc_align_func(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
store i8* null, i8** %5
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = call i64 @posix_memalign(i8** %5, i64 %6, i64 %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %2
%13 = load i8*, i8** %5
ret i8* %13
}

LLVM IR (-O2):
@.str = [15 x i8] c"posix_memalign\00"
define i8* @mem_alloc_align_func(i64 %0, i64 %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
store i8* null, i8** %3
%5 = call i64 @posix_memalign(i8** %3, i64 %1, i64 %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %2
%10 = load i8*, i8** %3
ret i8* %10
}
/* Type definitions */
typedef int /*<<< orphan*/ cl_int;

/* Variables and functions */
int /*<<< orphan*/ syscall(int, int);
cl_int clUnloadCompiler() { return (cl_int)syscall(325, 1033); }


x86 assembly (clang, -O0):
<clUnloadCompiler>:
push   %rbp
mov    %rsp,%rbp
mov    $0x145,%edi
mov    $0x409,%esi
call   1030 <syscall@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clUnloadCompiler>:
mov    $0x145,%edi
mov    $0x409,%esi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @clUnloadCompiler() {
%1 = call i32 @syscall(i32 325, i32 1033)
ret i32 %1
}

LLVM IR (-O2):
define i32 @clUnloadCompiler() {
%1 = tail call i32 @syscall(i32 325, i32 1033)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ add(int);
int /*<<< orphan*/ printList();
int /*<<< orphan*/ reverse_n(int);
int main() {
  add(1);
  add(2);
  add(3);
  add(4);
  add(5);
  add(6);
  printList();
  reverse_n(1);
  printList();
  reverse_n(2);
  printList();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <add@plt>
mov    $0x2,%edi
call   1030 <add@plt>
mov    $0x3,%edi
call   1030 <add@plt>
mov    $0x4,%edi
call   1030 <add@plt>
mov    $0x5,%edi
call   1030 <add@plt>
mov    $0x6,%edi
call   1030 <add@plt>
mov    $0x0,%al
call   1050 <printList@plt>
mov    $0x1,%edi
call   1040 <reverse_n@plt>
mov    $0x0,%al
call   1050 <printList@plt>
mov    $0x2,%edi
call   1040 <reverse_n@plt>
mov    $0x0,%al
call   1050 <printList@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <add@plt>
mov    $0x2,%edi
call   1030 <add@plt>
mov    $0x3,%edi
call   1030 <add@plt>
mov    $0x4,%edi
call   1030 <add@plt>
mov    $0x5,%edi
call   1030 <add@plt>
mov    $0x6,%edi
call   1030 <add@plt>
xor    %eax,%eax
call   1050 <printList@plt>
mov    $0x1,%edi
call   1040 <reverse_n@plt>
xor    %eax,%eax
call   1050 <printList@plt>
mov    $0x2,%edi
call   1040 <reverse_n@plt>
xor    %eax,%eax
call   1050 <printList@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @add(i32 1)
%3 = call i32 @add(i32 2)
%4 = call i32 @add(i32 3)
%5 = call i32 @add(i32 4)
%6 = call i32 @add(i32 5)
%7 = call i32 @add(i32 6)
%8 = call i32 (...) @printList()
%9 = call i32 @reverse_n(i32 1)
%10 = call i32 (...) @printList()
%11 = call i32 @reverse_n(i32 2)
%12 = call i32 (...) @printList()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @add(i32 1)
%2 = tail call i32 @add(i32 2)
%3 = tail call i32 @add(i32 3)
%4 = tail call i32 @add(i32 4)
%5 = tail call i32 @add(i32 5)
%6 = tail call i32 @add(i32 6)
%7 = tail call i32 (...) @printList()
%8 = tail call i32 @reverse_n(i32 1)
%9 = tail call i32 (...) @printList()
%10 = tail call i32 @reverse_n(i32 2)
%11 = tail call i32 (...) @printList()
ret i32 0
}
void fun(char *s, int l) {
  char buf[0x100];
  strncpy(buf, s, l);
  asm volatile("" ::"m"(buf[0]));
}


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rdx
call   1030 <strncpy@plt>
lea    -0x110(%rbp),%rax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun>:
sub    $0x108,%rsp
mov    %rdi,%rax
movslq %esi,%rdx
mov    %rsp,%rdi
mov    %rax,%rsi
call   1030 <strncpy@plt>
add    $0x108,%rsp
ret

LLVM IR (-O0):
define void @fun(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [256 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = call i8* @strncpy(i8* %6, i8* %7, i64 %9)
%11 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
ret void
}

LLVM IR (-O2):
define void @fun(i8* nocapture %0, i32 %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = sext i32 %1 to i64
%6 = call i8* @strncpy(i8* %4, i8* %0, i64 %5)
ret void
}
void g_direct_hash() {}


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

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

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

LLVM IR (-O2):
define void @g_direct_hash() {
ret void
}
int popcount(long v) {
  int total;
  total = ((v >> 1) & 0x5555) + (v & 0x5555);
  total = ((total >> 2) & 0x3333) + (total & 0x3333);
  total = ((total >> 4) & 0x0f0f) + (total & 0x0f0f);
  return (total & 0xff) + (total >> 8);
}


x86 assembly (clang, -O0):
<popcount>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x1,%rax
and    $0x5555,%rax
mov    -0x8(%rbp),%rcx
and    $0x5555,%rcx
add    %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x2,%eax
and    $0x3333,%eax
mov    -0xc(%rbp),%ecx
and    $0x3333,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x4,%eax
and    $0xf0f,%eax
mov    -0xc(%rbp),%ecx
and    $0xf0f,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<popcount>:
mov    %edi,%eax
shr    %eax
and    $0x5555,%eax
and    $0x5555,%edi
add    %edi,%eax
mov    %eax,%ecx
shr    $0x2,%ecx
and    $0x3333,%ecx
and    $0x3333,%eax
add    %ecx,%eax
mov    %eax,%ecx
shr    $0x4,%ecx
and    $0x707,%ecx
and    $0x707,%eax
add    %ecx,%eax
movzbl %al,%ecx
shr    $0x8,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @popcount(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = ashr i64 %4, 1
%6 = and i64 %5, 21845
%7 = load i64, i64* %2
%8 = and i64 %7, 21845
%9 = add nsw i64 %6, %8
%10 = trunc i64 %9 to i32
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = ashr i32 %11, 2
%13 = and i32 %12, 13107
%14 = load i32, i32* %3
%15 = and i32 %14, 13107
%16 = add nsw i32 %13, %15
store i32 %16, i32* %3
%17 = load i32, i32* %3
%18 = ashr i32 %17, 4
%19 = and i32 %18, 3855
%20 = load i32, i32* %3
%21 = and i32 %20, 3855
%22 = add nsw i32 %19, %21
store i32 %22, i32* %3
%23 = load i32, i32* %3
%24 = and i32 %23, 255
%25 = load i32, i32* %3
%26 = ashr i32 %25, 8
%27 = add nsw i32 %24, %26
ret i32 %27
}

LLVM IR (-O2):
define i32 @popcount(i64 %0) {
%2 = lshr i64 %0, 1
%3 = and i64 %2, 21845
%4 = and i64 %0, 21845
%5 = add nuw nsw i64 %3, %4
%6 = trunc i64 %5 to i32
%7 = lshr i32 %6, 2
%8 = and i32 %7, 13107
%9 = and i32 %6, 13107
%10 = add nuw nsw i32 %8, %9
%11 = lshr i32 %10, 4
%12 = and i32 %11, 1799
%13 = and i32 %10, 1799
%14 = add nuw nsw i32 %12, %13
%15 = and i32 %14, 15
%16 = lshr i32 %14, 8
%17 = add nuw nsw i32 %15, %16
ret i32 %17
}
void fix_signals(void) {}


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

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

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

LLVM IR (-O2):
define void @fix_signals() {
ret void
}
int _islower(int c) {
  if (c >= 'a' && c <= 'z')
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<_islower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x61,-0x8(%rbp)
jl     1127 <_islower+0x27>
cmpl   $0x7a,-0x8(%rbp)
jg     1127 <_islower+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <_islower+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_islower>:
add    $0xffffff9f,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @_islower(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
const char *get_usage(void) {
  return "spc_scr_enc usage:\n"
         "\t--cpu_mem    | -c <cpu memory configuration filepath>\n"
         "\t--table      | -t <table filepath>\n"
         "\t--rom        | -r <original rom filepath>\n"
         "\t--xml        | -x <output xml script filepath>\n"
         "\t--version    | -v <version>\n"
         "\t--help       | -h <aide>\n";
}


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

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

LLVM IR (-O0):
@.str = [257 x i8] c"spc_scr_enc usage:\0A\09--cpu_mem | -c <cpu memory configuration filepath>\0A\09--table | -t <table filepath>\0A\09--rom | -r <original rom filepath>\0A\09--xml | -x <output xml script filepath>\0A\09--version | -v <version>\0A\09--help | -h <aide>\0A\00"
define i8* @get_usage() {
ret i8* getelementptr inbounds ([257 x i8], [257 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [257 x i8] c"spc_scr_enc usage:\0A\09--cpu_mem | -c <cpu memory configuration filepath>\0A\09--table | -t <table filepath>\0A\09--rom | -r <original rom filepath>\0A\09--xml | -x <output xml script filepath>\0A\09--version | -v <version>\0A\09--help | -h <aide>\0A\00"
define i8* @get_usage() {
ret i8* getelementptr inbounds ([257 x i8], [257 x i8]* @.str, i64 0, i64 0)
}
void app_message_deregister_callbacks(void) {}


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

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

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

LLVM IR (-O2):
define void @app_message_deregister_callbacks() {
ret void
}
int elias_gamma_bits(int value) {
  int bits = 1;
  while (value > 1)
    bits += 2, value >>= 1;
  return bits;
}


x86 assembly (clang, -O0):
<elias_gamma_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    112f <elias_gamma_bits+0x2f>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <elias_gamma_bits+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<elias_gamma_bits>:
mov    $0x1,%eax
cmp    $0x2,%edi
jl     112c <elias_gamma_bits+0x2c>
mov    $0x1,%eax
mov    %edi,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x2,%eax
shr    %ecx
cmp    $0x3,%edi
mov    %ecx,%edi
ja     1120 <elias_gamma_bits+0x20>
ret

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

LLVM IR (-O2):
define i32 @elias_gamma_bits(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 1, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 2
%7 = lshr i32 %5, 1
%8 = icmp ugt i32 %5, 3
br i1 %8, label %3, label %9
9: ; preds = %3, %1
%10 = phi i32 [ 1, %1 ], [ %6, %3 ]
ret i32 %10
}
int isprime(unsigned int number) {
  for (unsigned int div = 3; div <= number / div; div += 2)
    if (number % div == 0)
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<isprime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    %edx,%edx
divl   -0xc(%rbp)
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
ja     1159 <isprime+0x59>
mov    -0x8(%rbp),%eax
xor    %edx,%edx
divl   -0xc(%rbp)
cmp    $0x0,%edx
jne    1146 <isprime+0x46>
movl   $0x0,-0x4(%rbp)
jmp    1160 <isprime+0x60>
jmp    114b <isprime+0x4b>
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <isprime+0xe>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprime>:
mov    $0x1,%eax
cmp    $0x9,%edi
jb     1130 <isprime+0x30>
mov    $0x3,%esi
nop
mov    %edi,%eax
xor    %edx,%edx
div    %esi
mov    %edx,%ecx
test   %edx,%edx
je     1129 <isprime+0x29>
add    $0x2,%esi
mov    %edi,%eax
xor    %edx,%edx
div    %esi
cmp    %eax,%esi
jbe    1110 <isprime+0x10>
xor    %eax,%eax
test   %ecx,%ecx
setne  %al
ret

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

LLVM IR (-O2):
define i32 @isprime(i32 %0) {
%2 = icmp ult i32 %0, 9
br i1 %2, label %14, label %6
3: ; preds = %6
%4 = udiv i32 %0, %10
%5 = icmp ugt i32 %10, %4
br i1 %5, label %11, label %6
6: ; preds = %1, %3
%7 = phi i32 [ %10, %3 ], [ 3, %1 ]
%8 = urem i32 %0, %7
%9 = icmp eq i32 %8, 0
%10 = add i32 %7, 2
br i1 %9, label %11, label %3
11: ; preds = %6, %3
%12 = xor i1 %9, true
%13 = zext i1 %12 to i32
br label %14
14: ; preds = %11, %1
%15 = phi i32 [ 1, %1 ], [ %13, %11 ]
ret i32 %15
}
/* Variables and functions */
int crn_set_flag(char *, int /*<<< orphan*/);
int crn_ifdown(char *name) { return crn_set_flag(name, 0); }


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

x86 assembly (clang, -O2):
<crn_ifdown>:
xor    %esi,%esi
jmp    1030 <crn_set_flag@plt>

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

LLVM IR (-O2):
define i32 @crn_ifdown(i8* %0) {
%2 = tail call i32 @crn_set_flag(i8* %0, i32 0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ code;

/* Variables and functions */
int /*<<< orphan*/ __console_write(char const *, int);
void console_purple() {
  static const char code[] = {0x1b, '[', '3', '5', ';', '0', '6', 'm'};
  __console_write(code, sizeof(code));
}


x86 assembly (clang, -O0):
<console_purple>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x8,%esi
call   1030 <__console_write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<console_purple>:
lea    0xee9(%rip),%rdi
mov    $0x8,%esi
jmp    1030 <__console_write@plt>

LLVM IR (-O0):
@console_purple.code = internal constant [8 x i8] c"\1B[35;06m"
define void @console_purple() {
%1 = call i32 @__console_write(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @console_purple.code, i64 0, i64 0), i32 8)
ret void
}

LLVM IR (-O2):
@console_purple.code = internal constant [8 x i8] c"\1B[35;06m"
define void @console_purple() {
%1 = tail call i32 @__console_write(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @console_purple.code, i64 0, i64 0), i32 8)
ret void
}
void XtInitializeWidgetClass() {}


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

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

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

LLVM IR (-O2):
define void @XtInitializeWidgetClass() {
ret void
}
long syscall5(long nr, long a1, long a2, long a3, long a4, long a5) {
  register long r0 asm("rax") = nr;
  register long r1 asm("rdi") = a1;
  register long r2 asm("rsi") = a2;
  register long r3 asm("rdx") = a3;
  register long r4 asm("r10") = a4;
  register long r5 asm("r8") = a5;
  asm volatile("syscall"
               : "=r"(r0)
               : "r"(r0), "r"(r1), "r"(r2), "r"(r3), "r"(r4), "r"(r5)
               : "rcx", "r11", "memory");
  return r0;
}


x86 assembly (clang, -O0):
<syscall5>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x38(%rbp),%rax
mov    -0x40(%rbp),%rdi
mov    -0x48(%rbp),%rsi
mov    -0x50(%rbp),%rdx
mov    -0x58(%rbp),%r10
mov    -0x60(%rbp),%r8
syscall
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscall5>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
mov    %r8,%r10
mov    %r9,%r8
syscall
ret

LLVM IR (-O0):
define i64 @syscall5(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5) {
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca i64
%15 = alloca i64
%16 = alloca i64
%17 = alloca i64
%18 = alloca i64
store i64 %0, i64* %7
store i64 %1, i64* %8
store i64 %2, i64* %9
store i64 %3, i64* %10
store i64 %4, i64* %11
store i64 %5, i64* %12
%19 = load i64, i64* %7
store i64 %19, i64* %13
%20 = load i64, i64* %8
store i64 %20, i64* %14
%21 = load i64, i64* %9
store i64 %21, i64* %15
%22 = load i64, i64* %10
store i64 %22, i64* %16
%23 = load i64, i64* %11
store i64 %23, i64* %17
%24 = load i64, i64* %12
store i64 %24, i64* %18
%25 = load i64, i64* %13
%26 = load i64, i64* %14
%27 = load i64, i64* %15
%28 = load i64, i64* %16
%29 = load i64, i64* %17
%30 = load i64, i64* %18
%31 = call i64 asm sideeffect "syscall", "={rax},{rax},{rdi},{rsi},{rdx},{r10},{r8},~{rcx},~{r11},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %25, i64 %26, i64 %27, i64 %28, i64 %29, i64 %30)
store i64 %31, i64* %13
%32 = load i64, i64* %13
ret i64 %32
}

LLVM IR (-O2):
define i64 @syscall5(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5) {
%7 = tail call i64 asm sideeffect "syscall", "={rax},{rax},{rdi},{rsi},{rdx},{r10},{r8},~{rcx},~{r11},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5)
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ coloration(char *, char *);
int /*<<< orphan*/ systemePoints(int, int /*<<< orphan*/, int);
void gagneRouletteRusse(int nbPoints, int modeDeJeux) {
  coloration("\nVous etes en vie !\n", "32");
  systemePoints(nbPoints, 0, modeDeJeux);
}


x86 assembly (clang, -O0):
<gagneRouletteRusse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    0xecb(%rip),%rdi
lea    0xed9(%rip),%rsi
call   1030 <coloration@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
xor    %esi,%esi
call   1040 <systemePoints@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gagneRouletteRusse>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xed2(%rip),%rdi
lea    0xee0(%rip),%rsi
call   1030 <coloration@plt>
mov    %ebp,%edi
xor    %esi,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <systemePoints@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"\0AVous etes en vie !\0A\00"
@.str.1 = [3 x i8] c"32\00"
define void @gagneRouletteRusse(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @coloration(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @systemePoints(i32 %6, i32 0, i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"\0AVous etes en vie !\0A\00"
@.str.1 = [3 x i8] c"32\00"
define void @gagneRouletteRusse(i32 %0, i32 %1) {
%3 = tail call i32 @coloration(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @systemePoints(i32 %0, i32 0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
int /*<<< orphan*/ test_alt();
int /*<<< orphan*/ test_array();
int /*<<< orphan*/ test_basic();
void testmain() {
  print("typeof");
  test_basic();
  test_array();
  test_alt();
}


x86 assembly (clang, -O0):
<testmain>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
call   1030 <print@plt>
mov    $0x0,%al
call   1050 <test_basic@plt>
mov    $0x0,%al
call   1040 <test_array@plt>
mov    $0x0,%al
call   1060 <test_alt@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testmain>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1030 <print@plt>
xor    %eax,%eax
call   1050 <test_basic@plt>
xor    %eax,%eax
call   1040 <test_array@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <test_alt@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"typeof\00"
define void @testmain() {
%1 = call i32 @print(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @test_basic()
%3 = call i32 (...) @test_array()
%4 = call i32 (...) @test_alt()
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"typeof\00"
define void @testmain() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @test_basic()
%3 = tail call i32 (...) @test_array()
%4 = tail call i32 (...) @test_alt()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glPopClientAttrib();
int /*<<< orphan*/ printf(char *, ...);
void trace_glPopClientAttrib(void) {
  printf("%20s(", "glPopClientAttrib");
  printf(");\n");
  glPopClientAttrib();
}


x86 assembly (clang, -O0):
<trace_glPopClientAttrib>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed4(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xed8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <glPopClientAttrib@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<trace_glPopClientAttrib>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0xec7(%rip),%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xecb(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <glPopClientAttrib@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%20s(\00"
@.str.1 = [18 x i8] c"glPopClientAttrib\00"
@.str.2 = [4 x i8] c");\0A\00"
define void @trace_glPopClientAttrib() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%3 = call i32 (...) @glPopClientAttrib()
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%20s(\00"
@.str.1 = [18 x i8] c"glPopClientAttrib\00"
@str = [3 x i8] c");\00"
define void @trace_glPopClientAttrib() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (...) @glPopClientAttrib()
ret void
}
/* Variables and functions */
int handleevent();
int /*<<< orphan*/ process_window_closure(int);
void eventloop() {
  int status;
  while (1) {
    status = handleevent();
    if (status <= 0)
      process_window_closure(status);
  }
}


x86 assembly (clang, -O0):
<eventloop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <handleevent@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jg     1144 <eventloop+0x24>
mov    -0x4(%rbp),%edi
call   1040 <process_window_closure@plt>
jmp    1128 <eventloop+0x8>

x86 assembly (clang, -O2):
<eventloop>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <handleevent@plt>
test   %eax,%eax
jg     1130 <eventloop+0x10>
mov    %eax,%edi
call   1040 <process_window_closure@plt>
jmp    1130 <eventloop+0x10>

LLVM IR (-O0):
define void @eventloop() {
%1 = alloca i32
br label %2
2: ; preds = %0, %9
%3 = call i32 (...) @handleevent()
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp sle i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = load i32, i32* %1
%8 = call i32 @process_window_closure(i32 %7)
br label %9
9: ; preds = %6, %2
br label %2
}

LLVM IR (-O2):
define void @eventloop() {
br label %1
1: ; preds = %6, %0
%2 = tail call i32 (...) @handleevent()
%3 = icmp slt i32 %2, 1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @process_window_closure(i32 %2)
br label %6
6: ; preds = %4, %1
br label %1
}
double dummy(double x) { return x; }


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

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

LLVM IR (-O0):
define double @dummy(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
ret double %3
}

LLVM IR (-O2):
define double @dummy(double returned %0) {
ret double %0
}