xunge/DecIR huggingface dataset:
void TimerCKDivConfigure(unsigned long ulBase, unsigned long ulDiv) {

  ;

  ;
  (*((volatile unsigned long *)(ulBase + 0x00000000))) &= ~0x00000300;
  (*((volatile unsigned long *)(ulBase + 0x00000000))) |= ulDiv;
}


x86 assembly (clang, -O0):
<TimerCKDivConfigure>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
and    $0xfffffffffffffcff,%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
or     %rdx,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerCKDivConfigure>:
andq   $0xfffffffffffffcff,(%rdi)
or     %rsi,(%rdi)
ret

LLVM IR (-O0):
define void @TimerCKDivConfigure(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = add i64 %5, 0
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = and i64 %8, -769
store volatile i64 %9, i64* %7
%10 = load i64, i64* %4
%11 = load i64, i64* %3
%12 = add i64 %11, 0
%13 = inttoptr i64 %12 to i64*
%14 = load volatile i64, i64* %13
%15 = or i64 %14, %10
store volatile i64 %15, i64* %13
ret void
}

LLVM IR (-O2):
define void @TimerCKDivConfigure(i64 %0, i64 %1) {
%3 = inttoptr i64 %0 to i64*
%4 = load volatile i64, i64* %3
%5 = and i64 %4, -769
store volatile i64 %5, i64* %3
%6 = load volatile i64, i64* %3
%7 = or i64 %6, %1
store volatile i64 %7, i64* %3
ret void
}
void eap_sim_db_deinit(void *priv) {}


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

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

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

LLVM IR (-O2):
define void @eap_sim_db_deinit(i8* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ read_bit();
int read_int(int bits) {
  int ret = 0;
  while (bits-- > 0)
    if (read_bit())
      ret |= 1 << bits;
  return ret;
}


x86 assembly (clang, -O0):
<read_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
jle    115c <read_int+0x4c>
mov    $0x0,%al
call   1030 <read_bit@plt>
cmp    $0x0,%rax
je     1157 <read_int+0x47>
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <read_int+0x12>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_int>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
jle    1154 <read_int+0x44>
mov    %edi,%ebx
add    $0x1,%ebx
xor    %r14d,%r14d
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <read_bit@plt>
lea    -0x2(%rbx),%ecx
mov    $0x1,%edx
shl    %cl,%edx
test   %rax,%rax
cmove  %r14d,%edx
or     %edx,%ebp
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1130 <read_int+0x20>
jmp    1156 <read_int+0x46>
xor    %ebp,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @read_int(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %16, %1
%5 = load i32, i32* %2
%6 = add nsw i32 %5, -1
store i32 %6, i32* %2
%7 = icmp sgt i32 %5, 0
br i1 %7, label %8, label %17
8: ; preds = %4
%9 = call i64 (...) @read_bit()
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %8
%12 = load i32, i32* %2
%13 = shl i32 1, %12
%14 = load i32, i32* %3
%15 = or i32 %14, %13
store i32 %15, i32* %3
br label %16
16: ; preds = %11, %8
br label %4
17: ; preds = %4
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @read_int(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %13
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = phi i32 [ %11, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i64 (...) @read_bit()
%8 = icmp eq i64 %7, 0
%9 = shl nuw i32 1, %6
%10 = select i1 %8, i32 0, i32 %9
%11 = or i32 %10, %5
%12 = icmp ugt i32 %4, 1
br i1 %12, label %3, label %13
13: ; preds = %3, %1
%14 = phi i32 [ 0, %1 ], [ %11, %3 ]
ret i32 %14
}
int icmp(int a, int b) { return (a == b) ? 0 : ((a < b) ? -1 : 1); }


x86 assembly (clang, -O0):
<icmp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1120 <icmp+0x20>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    1138 <icmp+0x38>
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%esi
mov    $0x1,%eax
mov    $0xffffffff,%ecx
cmp    %esi,%edx
cmovl  %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<icmp>:
xor    %ecx,%ecx
xor    %eax,%eax
cmp    %esi,%edi
setge  %al
lea    -0x1(%rax,%rax,1),%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @icmp(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 = icmp eq i32 %5, %6
br i1 %7, label %8, label %9
8: ; preds = %2
br label %15
9: ; preds = %2
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = icmp slt i32 %10, %11
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 -1, i32 1
br label %15
15: ; preds = %9, %8
%16 = phi i32 [ 0, %8 ], [ %14, %9 ]
ret i32 %16
}

LLVM IR (-O2):
define i32 @icmp(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = icmp slt i32 %0, %1
%5 = select i1 %4, i32 -1, i32 1
%6 = select i1 %3, i32 0, i32 %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ current_time(int *, int *, int *);
int /*<<< orphan*/ timename(int, int, int, char *);
char *timename_now(char *str) {
  int days, secs, nanosecs;
  current_time(&days, &secs, &nanosecs);
  timename(days, secs, nanosecs, str);
  return str;
}


x86 assembly (clang, -O0):
<timename_now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
call   1030 <current_time@plt>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rcx
call   1040 <timename@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timename_now>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xc(%rsp),%rdi
lea    0x8(%rsp),%rsi
lea    0x4(%rsp),%rdx
call   1030 <current_time@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
mov    0x4(%rsp),%edx
mov    %rbx,%rcx
call   1040 <timename@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @timename_now(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %2
%6 = call i32 @current_time(i32* %3, i32* %4, i32* %5)
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = load i8*, i8** %2
%11 = call i32 @timename(i32 %7, i32 %8, i32 %9, i8* %10)
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
define i8* @timename_now(i8* returned %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = call i32 @current_time(i32* %2, i32* %3, i32* %4)
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = call i32 @timename(i32 %9, i32 %10, i32 %11, i8* %0)
ret i8* %0
}
unsigned xrop3_183_0_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D ^ T;
  stk1 = S & stk2;
  stk1 = ~stk1;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


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

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

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

LLVM IR (-O2):
define i32 @xrop3_183_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %6, 255
%8 = and i32 %7, %4
%9 = xor i32 %8, %4
%10 = or i32 %8, %6
%11 = xor i32 %10, -1
%12 = xor i32 %4, -1
%13 = and i32 %12, %5
%14 = or i32 %13, %11
%15 = or i32 %14, %9
ret i32 %15
}
void *_dlsym(void *ptr, const char *str) { return (void *)0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @_dlsym(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* null
}
__attribute__((no, noclone, used)) void _ITM_WU4() { asm(""); }


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

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

LLVM IR (-O0):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (void ()* @_ITM_WU4 to i8*)], section "llvm.metadata"
define void @_ITM_WU4() {
ret void
}

LLVM IR (-O2):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (void ()* @_ITM_WU4 to i8*)], section "llvm.metadata"
define void @_ITM_WU4() {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
float Quint__easeOut(float t, float b, float c, float d, float p0, float p1) {
  return c * ((t = t / d - 1) * t * t * t * t + 1) + b;
}


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

x86 assembly (clang, -O2):
<Quint__easeOut>:
divss  %xmm3,%xmm0
addss  0xef4(%rip),%xmm0
movaps %xmm0,%xmm3
mulss  %xmm0,%xmm3
mulss  %xmm0,%xmm3
mulss  %xmm0,%xmm3
mulss  %xmm3,%xmm0
addss  0xedd(%rip),%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @Quint__easeOut(float %0, float %1, float %2, float %3, float %4, float %5) {
%7 = fdiv float %0, %3
%8 = fadd float %7, -1.000000e+00
%9 = fmul float %8, %8
%10 = fmul float %8, %9
%11 = fmul float %8, %10
%12 = tail call float @llvm.fmuladd.f32(float %11, float %8, float 1.000000e+00)
%13 = tail call float @llvm.fmuladd.f32(float %2, float %12, float %1)
ret float %13
}
int tok_add(char *buf, unsigned *cur, unsigned max, char ch) {
  unsigned i = *cur;
  if (i < (max - 1)) {
    buf[i] = ch;
    (*cur)++;
    return 0;
  }
  return -1;
}


x86 assembly (clang, -O0):
<tok_add>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %al,-0x1d(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jae    1152 <tok_add+0x52>
mov    -0x1d(%rbp),%dl
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1159 <tok_add+0x59>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tok_add>:
mov    (%rsi),%r8d
add    $0xffffffff,%edx
mov    $0xffffffff,%eax
cmp    %edx,%r8d
jae    1119 <tok_add+0x19>
mov    %cl,(%rdi,%r8,1)
addl   $0x1,(%rsi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @tok_add(i8* nocapture writeonly %0, i32* nocapture %1, i32 %2, i8 signext %3) {
%5 = load i32, i32* %1
%6 = add i32 %2, -1
%7 = icmp ult i32 %5, %6
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = zext i32 %5 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
store i8 %3, i8* %10
%11 = load i32, i32* %1
%12 = add i32 %11, 1
store i32 %12, i32* %1
br label %13
13: ; preds = %4, %8
%14 = phi i32 [ 0, %8 ], [ -1, %4 ]
ret i32 %14
}
int lsq_finish_log(struct logger_t *logger) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.logger_t = type opaque
define i32 @lsq_finish_log(%struct.logger_t* nocapture readnone %0) {
ret i32 0
}
int float_fft_idft(float *dat, int cnt) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @float_fft_idft(float* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
char *strchr(char *, char);
int isBG(char *line) {
  char *fnd = strchr(line, '&');
  if (fnd != NULL) {
    *fnd = 0;
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<isBG>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x26,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     114c <isBG+0x3c>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1153 <isBG+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isBG>:
push   %rax
mov    $0x26,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     112a <isBG+0x1a>
movb   $0x0,(%rax)
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @isBG(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @strchr(i8* %5, i8 signext 38)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i8*, i8** %4
store i8 0, i8* %10
store i32 1, i32* %2
br label %12
11: ; preds = %1
store i32 0, i32* %2
br label %12
12: ; preds = %11, %9
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @isBG(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 38)
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
store i8 0, i8* %2
br label %5
5: ; preds = %1, %4
%6 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %6
}
int i2c_bulkwrite(void *hDevice, unsigned char chip, unsigned char addr,
                  unsigned char *data, unsigned short length) {
  return 0;
}


x86 assembly (clang, -O0):
<i2c_bulkwrite>:
push   %rbp
mov    %rsp,%rbp
mov    %r8w,%ax
mov    %rdi,-0x8(%rbp)
mov    %sil,-0x9(%rbp)
mov    %dl,-0xa(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %ax,-0x1a(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @i2c_bulkwrite(i8* %0, i8 zeroext %1, i8 zeroext %2, i8* %3, i16 zeroext %4) {
%6 = alloca i8*
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8*
%10 = alloca i16
store i8* %0, i8** %6
store i8 %1, i8* %7
store i8 %2, i8* %8
store i8* %3, i8** %9
store i16 %4, i16* %10
ret i32 0
}

LLVM IR (-O2):
define i32 @i2c_bulkwrite(i8* nocapture readnone %0, i8 zeroext %1, i8 zeroext %2, i8* nocapture readnone %3, i16 zeroext %4) {
ret i32 0
}
/* Variables and functions */
int solve(int *, char *, int /*<<< orphan*/, int);
int solutions(int n, char *holes) {
  int variables[n];
  return solve(variables, holes, 0, n);
}


x86 assembly (clang, -O0):
<solutions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
lea    0xf(,%rax,4),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,%rsp
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x4(%rbp),%ecx
xor    %edx,%edx
call   1030 <solve@plt>
mov    -0x18(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solutions>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,%ecx
mov    %edi,%eax
mov    %rsp,%rdi
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rdi
mov    %rdi,%rsp
xor    %edx,%edx
call   1030 <solve@plt>
mov    %rbp,%rsp
pop    %rbp
ret

LLVM IR (-O0):
define i32 @solutions(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %3
store i8* %1, i8** %4
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
%9 = call i8* @llvm.stacksave()
store i8* %9, i8** %5
%10 = alloca i32, i64 %8
store i64 %8, i64* %6
%11 = load i8*, i8** %4
%12 = load i32, i32* %3
%13 = call i32 @solve(i32* %10, i8* %11, i32 0, i32 %12)
%14 = load i8*, i8** %5
ret i32 %13
}

LLVM IR (-O2):
define i32 @solutions(i32 %0, i8* %1) {
%3 = zext i32 %0 to i64
%4 = alloca i32, i64 %3
%5 = call i32 @solve(i32* %4, i8* %1, i32 0, i32 %0)
ret i32 %5
}
unsigned short int f5(unsigned short int x, unsigned int y) {
  return (x << y) | (x >> ((-y) & (8 * 2 - 1)));
}


x86 assembly (clang, -O0):
<f5>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
movzwl -0x2(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
movzwl -0x2(%rbp),%edx
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
and    $0xf,%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f5>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
neg    %cl
and    $0xf,%cl
shr    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @f5(i16 zeroext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i32, i32* %4
%8 = shl i32 %6, %7
%9 = load i16, i16* %3
%10 = zext i16 %9 to i32
%11 = load i32, i32* %4
%12 = sub i32 0, %11
%13 = and i32 %12, 15
%14 = ashr i32 %10, %13
%15 = or i32 %8, %14
%16 = trunc i32 %15 to i16
ret i16 %16
}

LLVM IR (-O2):
define zeroext i16 @f5(i16 zeroext %0, i32 %1) {
%3 = zext i16 %0 to i32
%4 = shl i32 %3, %1
%5 = sub i32 0, %1
%6 = and i32 %5, 15
%7 = lshr i32 %3, %6
%8 = or i32 %7, %4
%9 = trunc i32 %8 to i16
ret i16 %9
}
void func6(int *ptr1, int *ptr2) {
  if (ptr1 && ptr2) {
    *ptr1 = 100;
    *ptr2 = 200;
  } else {
    return;
  }
  *ptr1 = 300;
  *ptr2 = 400;
}


x86 assembly (clang, -O0):
<func6>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113b <func6+0x3b>
cmpq   $0x0,-0x10(%rbp)
je     113b <func6+0x3b>
mov    -0x8(%rbp),%rax
movl   $0x64,(%rax)
mov    -0x10(%rbp),%rax
movl   $0xc8,(%rax)
jmp    1140 <func6+0x40>
jmp    1154 <func6+0x54>
mov    -0x8(%rbp),%rax
movl   $0x12c,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x190,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<func6>:
test   %rdi,%rdi
je     1116 <func6+0x16>
test   %rsi,%rsi
je     1116 <func6+0x16>
movl   $0x12c,(%rdi)
movl   $0x190,(%rsi)
ret

LLVM IR (-O0):
define void @func6(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 = icmp ne i32* %5, null
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = load i32*, i32** %4
%9 = icmp ne i32* %8, null
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load i32*, i32** %3
store i32 100, i32* %11
%12 = load i32*, i32** %4
store i32 200, i32* %12
br label %14
13: ; preds = %7, %2
br label %17
14: ; preds = %10
%15 = load i32*, i32** %3
store i32 300, i32* %15
%16 = load i32*, i32** %4
store i32 400, i32* %16
br label %17
17: ; preds = %14, %13
ret void
}

LLVM IR (-O2):
define void @func6(i32* writeonly %0, i32* writeonly %1) {
%3 = icmp ne i32* %0, null
%4 = icmp ne i32* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %7
6: ; preds = %2
store i32 300, i32* %0
store i32 400, i32* %1
br label %7
7: ; preds = %2, %6
ret void
}
void foo_2_1_2_2_1_1_2_2_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_1_2_2_1_1_2_2_2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CD_initialize(char *);
int /*<<< orphan*/ PARSE_initialize();
int /*<<< orphan*/ PARSE_set(char *, int);
void initialize(char *progname) {
  CD_initialize(progname);
  PARSE_initialize();
  PARSE_set(NULL, 0);
  PARSE_set("ALL", -2);
  PARSE_set("*", 2);
}


x86 assembly (clang, -O0):
<initialize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <CD_initialize@plt>
mov    $0x0,%al
call   1040 <PARSE_initialize@plt>
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
call   1050 <PARSE_set@plt>
lea    0xea2(%rip),%rdi
mov    $0xfffffffe,%esi
call   1050 <PARSE_set@plt>
lea    0xe95(%rip),%rdi
mov    $0x2,%esi
call   1050 <PARSE_set@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialize>:
push   %rax
call   1030 <CD_initialize@plt>
xor    %eax,%eax
call   1040 <PARSE_initialize@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1050 <PARSE_set@plt>
lea    0xeb3(%rip),%rdi
mov    $0xfffffffe,%esi
call   1050 <PARSE_set@plt>
lea    0xea6(%rip),%rdi
mov    $0x2,%esi
pop    %rax
jmp    1050 <PARSE_set@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"ALL\00"
@.str.1 = [2 x i8] c"*\00"
define void @initialize(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @CD_initialize(i8* %3)
%5 = call i32 (...) @PARSE_initialize()
%6 = call i32 @PARSE_set(i8* null, i32 0)
%7 = call i32 @PARSE_set(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 -2)
%8 = call i32 @PARSE_set(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 2)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"ALL\00"
@.str.1 = [2 x i8] c"*\00"
define void @initialize(i8* %0) {
%2 = tail call i32 @CD_initialize(i8* %0)
%3 = tail call i32 (...) @PARSE_initialize()
%4 = tail call i32 @PARSE_set(i8* null, i32 0)
%5 = tail call i32 @PARSE_set(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 -2)
%6 = tail call i32 @PARSE_set(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ in_addr_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
in_addr_t inet_addr(const char *__cp) {
  __set_errno(ENOSYS);
  return 0;
}


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

x86 assembly (clang, -O2):
<inet_addr>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @inet_addr(i8* nocapture readnone %0) {
%2 = load i32, i32* @ENOSYS
%3 = tail call i32 @__set_errno(i32 %2)
ret i32 0
}
void swapNum(int *x, int *y) {
  int tempx = *x;
  *x = *y;
  *y = tempx;
}


x86 assembly (clang, -O0):
<swapNum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @swapNum(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @swapNum(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
void tprintf(const char *format, ...) {}


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

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

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

LLVM IR (-O2):
define void @tprintf(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo();
void test2(int x) {
#pragma clang __debug captured
  {
    int i;
    for (i = 0; i < x; i++)
      foo();
  }
}


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
call   1140 <__captured_stmt>
add    $0x10,%rsp
pop    %rbp
ret
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)

x86 assembly (clang, -O2):
<test2>:
push   %rbx
test   %edi,%edi
jle    112c <test2+0x1c>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <foo@plt>
add    $0xffffffff,%ebx
jne    1120 <test2+0x10>
pop    %rbx
ret

LLVM IR (-O0):
%struct.anon = type { i32* }
define void @test2(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.anon
store i32 %0, i32* %2
%4 = getelementptr inbounds %struct.anon, %struct.anon* %3, i32 0, i32 0
store i32* %2, i32** %4
ret void
}
define internal void @__captured_stmt(%struct.anon* %0) {
%2 = alloca %struct.anon*
%3 = alloca i32
store %struct.anon* %0, %struct.anon** %2
%4 = load %struct.anon*, %struct.anon** %2
store i32 0, i32* %3
br label %5
5: ; preds = %13, %1
%6 = load i32, i32* %3
%7 = getelementptr inbounds %struct.anon, %struct.anon* %4, i32 0, i32 0
%8 = load i32*, i32** %7
%9 = load i32, i32* %8
%10 = icmp slt i32 %6, %9
br i1 %10, label %11, label %16
11: ; preds = %5
%12 = call i32 (...) @foo()
br label %13
13: ; preds = %11
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %5
16: ; preds = %5
ret void
}

LLVM IR (-O2):
%struct.anon = type { i32* }
define void @test2(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 (...) @foo()
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, double);
void print(int intg, double doble) { printf("(%d <-> %.2lf) ", intg, doble); }


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

x86 assembly (clang, -O2):
<print>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"(%d <-> %.2lf) \00"
define void @print(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
store i32 %0, i32* %3
store double %1, double* %4
%5 = load i32, i32* %3
%6 = load double, double* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %5, double %6)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"(%d <-> %.2lf) \00"
define void @print(i32 %0, double %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %0, double %1)
ret void
}
void gtk_file_selection_new() {}


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

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

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

LLVM IR (-O2):
define void @gtk_file_selection_new() {
ret void
}
void master_enter() { ("master_enter"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"master_enter\00"
define void @master_enter() {
ret void
}

LLVM IR (-O2):
define void @master_enter() {
ret void
}
void addressToWord(char *dest, char *src) {
  int addr_trans = (int)src;
  dest[3] = (char)(addr_trans & 0x000000FF);
  dest[2] = (char)((addr_trans & 0x0000FF00) >> 8);
  dest[1] = (char)((addr_trans & 0x00FF0000) >> 16);
  dest[0] = (char)((addr_trans & 0xFF000000) >> 24);
}


x86 assembly (clang, -O0):
<addressToWord>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x14(%rbp),%eax
and    $0xff00,%eax
sar    $0x8,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x14(%rbp),%eax
and    $0xff0000,%eax
sar    $0x10,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x14(%rbp),%eax
and    $0xff000000,%eax
shr    $0x18,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<addressToWord>:
bswap  %esi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @addressToWord(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = ptrtoint i8* %6 to i32
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = and i32 %8, 255
%10 = trunc i32 %9 to i8
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i64 3
store i8 %10, i8* %12
%13 = load i32, i32* %5
%14 = and i32 %13, 65280
%15 = ashr i32 %14, 8
%16 = trunc i32 %15 to i8
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i64 2
store i8 %16, i8* %18
%19 = load i32, i32* %5
%20 = and i32 %19, 16711680
%21 = ashr i32 %20, 16
%22 = trunc i32 %21 to i8
%23 = load i8*, i8** %3
%24 = getelementptr inbounds i8, i8* %23, i64 1
store i8 %22, i8* %24
%25 = load i32, i32* %5
%26 = and i32 %25, -16777216
%27 = lshr i32 %26, 24
%28 = trunc i32 %27 to i8
%29 = load i8*, i8** %3
%30 = getelementptr inbounds i8, i8* %29, i64 0
store i8 %28, i8* %30
ret void
}

LLVM IR (-O2):
define void @addressToWord(i8* nocapture writeonly %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = trunc i64 %3 to i8
%5 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %4, i8* %5
%6 = lshr i64 %3, 8
%7 = trunc i64 %6 to i8
%8 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %7, i8* %8
%9 = lshr i64 %3, 16
%10 = trunc i64 %9 to i8
%11 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %10, i8* %11
%12 = lshr i64 %3, 24
%13 = trunc i64 %12 to i8
store i8 %13, i8* %0
ret void
}
void rop3_216_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = S ^ T;
  stk2 = *D & stk3;
  stk1 = T ^ stk2;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_216_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xa(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_216_0_0>:
xor    %edx,%esi
and    (%rdi),%sil
xor    %dl,%sil
mov    %sil,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_216_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %2, %1
%5 = load i8, i8* %0
%6 = and i8 %5, %4
%7 = xor i8 %6, %2
store i8 %7, i8* %0
ret void
}
int equal_int(void *ip, void *jp) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @equal_int(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
struct user_regs_struct {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ exec_by_all_variants(int, int *);
void sys_sendto(int variant_count, int *child, struct user_regs_struct *regs) {
  exec_by_all_variants(variant_count, child);
}


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

x86 assembly (clang, -O2):
<sys_sendto>:
jmp    1030 <exec_by_all_variants@plt>

LLVM IR (-O0):
%struct.user_regs_struct = type { i32 }
define void @sys_sendto(i32 %0, i32* %1, %struct.user_regs_struct* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca %struct.user_regs_struct*
store i32 %0, i32* %4
store i32* %1, i32** %5
store %struct.user_regs_struct* %2, %struct.user_regs_struct** %6
%7 = load i32, i32* %4
%8 = load i32*, i32** %5
%9 = call i32 @exec_by_all_variants(i32 %7, i32* %8)
ret void
}

LLVM IR (-O2):
%struct.user_regs_struct = type { i32 }
define void @sys_sendto(i32 %0, i32* %1, %struct.user_regs_struct* nocapture readnone %2) {
%4 = tail call i32 @exec_by_all_variants(i32 %0, i32* %1)
ret void
}
/* Variables and functions */
size_t least_power_of_2_ge(size_t size) {
  size_t remaining_bits, lowbit;
  remaining_bits = size;
  while ((lowbit = (remaining_bits & -remaining_bits)) != remaining_bits)
    remaining_bits ^= lowbit;
  if (size != remaining_bits)
    remaining_bits <<= 1;
  return remaining_bits;
}


x86 assembly (clang, -O0):
<least_power_of_2_ge>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
xor    %ecx,%ecx
sub    -0x10(%rbp),%rcx
and    %rcx,%rax
mov    %rax,-0x18(%rbp)
cmp    -0x10(%rbp),%rax
je     113c <least_power_of_2_ge+0x3c>
mov    -0x18(%rbp),%rax
xor    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <least_power_of_2_ge+0x10>
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     1156 <least_power_of_2_ge+0x56>
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<least_power_of_2_ge>:
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rcx,%rax
mov    %rcx,%rdx
neg    %rdx
and    %rcx,%rdx
mov    %rdx,%rcx
xor    %rax,%rcx
cmp    %rax,%rdx
jne    1110 <least_power_of_2_ge+0x10>
cmp    %rdi,%rax
setne  %cl
shl    %cl,%rax
ret

LLVM IR (-O0):
define i64 @least_power_of_2_ge(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %2
%5 = load i64, i64* %2
store i64 %5, i64* %3
br label %6
6: ; preds = %13, %1
%7 = load i64, i64* %3
%8 = load i64, i64* %3
%9 = sub i64 0, %8
%10 = and i64 %7, %9
store i64 %10, i64* %4
%11 = load i64, i64* %3
%12 = icmp ne i64 %10, %11
br i1 %12, label %13, label %17
13: ; preds = %6
%14 = load i64, i64* %4
%15 = load i64, i64* %3
%16 = xor i64 %15, %14
store i64 %16, i64* %3
br label %6
17: ; preds = %6
%18 = load i64, i64* %2
%19 = load i64, i64* %3
%20 = icmp ne i64 %18, %19
br i1 %20, label %21, label %24
21: ; preds = %17
%22 = load i64, i64* %3
%23 = shl i64 %22, 1
store i64 %23, i64* %3
br label %24
24: ; preds = %21, %17
%25 = load i64, i64* %3
ret i64 %25
}

LLVM IR (-O2):
define i64 @least_power_of_2_ge(i64 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %0, %1 ], [ %7, %2 ]
%4 = sub i64 0, %3
%5 = and i64 %3, %4
%6 = icmp eq i64 %5, %3
%7 = xor i64 %5, %3
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = icmp ne i64 %3, %0
%10 = zext i1 %9 to i64
%11 = shl i64 %3, %10
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void *malloc(size_t);
int /*<<< orphan*/ printf(char *);
void *xmalloc(size_t size) {
  void *p;
  p = malloc(size);
  if (!p) {
    printf("faiied malloc");
    exit(1);
  }
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116a <xmalloc+0x3a>
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <xmalloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [14 x i8] c"faiied malloc\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
ret i8* %2
}
int my_strcmp(const char *s1, const char *s2) {
  while (*s1 == *s2) {
    if (*s1 == '\0')
      return 0;
    ++s1;
    ++s2;
  }
  return (*s1 - *s2);
}


x86 assembly (clang, -O0):
<my_strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    115b <my_strcmp+0x5b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    113e <my_strcmp+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    116e <my_strcmp+0x6e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    110c <my_strcmp+0xc>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strcmp>:
mov    (%rdi),%al
mov    (%rsi),%cl
cmp    %cl,%al
jne    1124 <my_strcmp+0x24>
mov    $0x1,%edx
nopl   (%rax)
test   %al,%al
je     112d <my_strcmp+0x2d>
movzbl (%rdi,%rdx,1),%eax
movzbl (%rsi,%rdx,1),%ecx
add    $0x1,%rdx
cmp    %cl,%al
je     1110 <my_strcmp+0x10>
movsbl %al,%eax
movsbl %cl,%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @my_strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %3, %4
br i1 %5, label %6, label %17
6: ; preds = %2, %11
%7 = phi i8 [ %14, %11 ], [ %3, %2 ]
%8 = phi i8* [ %13, %11 ], [ %1, %2 ]
%9 = phi i8* [ %12, %11 ], [ %0, %2 ]
%10 = icmp eq i8 %7, 0
br i1 %10, label %23, label %11
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %12
%15 = load i8, i8* %13
%16 = icmp eq i8 %14, %15
br i1 %16, label %6, label %17
17: ; preds = %11, %2
%18 = phi i8 [ %3, %2 ], [ %14, %11 ]
%19 = phi i8 [ %4, %2 ], [ %15, %11 ]
%20 = sext i8 %18 to i32
%21 = sext i8 %19 to i32
%22 = sub nsw i32 %20, %21
br label %23
23: ; preds = %6, %17
%24 = phi i32 [ %22, %17 ], [ 0, %6 ]
ret i32 %24
}
void math_tan(void) {
  double d = lua_check_number(1, "tan");
  lua_pushnumber(tan(((d)*3.14159265358979323846 / 180.0)));
}


x86 assembly (clang, -O0):
<math_tan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
lea    0xecc(%rip),%rsi
mov    $0x0,%al
call   1030 <lua_check_number@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xeac(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xe97(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1050 <tan@plt>
mov    $0x1,%al
call   1040 <lua_pushnumber@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<math_tan>:
push   %rax
lea    0xed8(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <lua_check_number@plt>
cvtsi2sd %eax,%xmm0
mulsd  0xeb0(%rip),%xmm0
divsd  0xeb0(%rip),%xmm0
call   1050 <tan@plt>
mov    $0x1,%al
pop    %rcx
jmp    1040 <lua_pushnumber@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"tan\00"
define void @math_tan() {
%1 = alloca double
%2 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @lua_check_number to i32 (i32, i8*, ...)*)(i32 1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = sitofp i32 %2 to double
store double %3, double* %1
%4 = load double, double* %1
%5 = fmul double %4, 0x400921FB54442D18
%6 = fdiv double %5, 1.800000e+02
%7 = call double @tan(double %6)
%8 = call i32 (double, ...) bitcast (i32 (...)* @lua_pushnumber to i32 (double, ...)*)(double %7)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"tan\00"
define void @math_tan() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @lua_check_number to i32 (i32, i8*, ...)*)(i32 1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = sitofp i32 %1 to double
%3 = fmul double %2, 0x400921FB54442D18
%4 = fdiv double %3, 1.800000e+02
%5 = tail call double @tan(double %4)
%6 = tail call i32 (double, ...) bitcast (i32 (...)* @lua_pushnumber to i32 (double, ...)*)(double %5)
ret void
}
void FStar_Buffer_recall(void *x) {}


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

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

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

LLVM IR (-O2):
define void @FStar_Buffer_recall(i8* nocapture %0) {
ret void
}