xunge/DecIR huggingface dataset:
/* Variables and functions */
bool nrf52_errata_4(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_4() {
ret i32 0
}
int _error_to_rc_no_timeout(int err) { return err == 0 ? 0 : 1; }


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

x86 assembly (clang, -O2):
<_error_to_rc_no_timeout>:
xor    %eax,%eax
test   %edi,%edi
setne  %al
ret

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

LLVM IR (-O2):
define i32 @_error_to_rc_no_timeout(i32 %0) {
%2 = icmp ne i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
double expectationToProbability(double e) {
  if (e < 0.999)
    return e;
  else
    return 0.999;
}


x86 assembly (clang, -O0):
<expectationToProbability>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  0xeef(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    112b <expectationToProbability+0x2b>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1138 <expectationToProbability+0x38>
movsd  0xecd(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<expectationToProbability>:
minsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @expectationToProbability(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 0x3FEFF7CED916872B
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load double, double* %3
store double %7, double* %2
br label %9
8: ; preds = %1
store double 0x3FEFF7CED916872B, double* %2
br label %9
9: ; preds = %8, %6
%10 = load double, double* %2
ret double %10
}

LLVM IR (-O2):
define double @expectationToProbability(double %0) {
%2 = fcmp olt double %0, 0x3FEFF7CED916872B
%3 = select i1 %2, double %0, double 0x3FEFF7CED916872B
ret double %3
}
unsigned int ceil_shift(unsigned int a, unsigned int b) {
  return (((a) + (1 << (b)) - 1) >> (b));
}


x86 assembly (clang, -O0):
<ceil_shift>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
sub    $0x1,%eax
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceil_shift>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
add    %edi,%eax
add    $0xffffffff,%eax
shr    %cl,%eax
ret

LLVM IR (-O0):
define i32 @ceil_shift(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 = shl i32 1, %6
%8 = add i32 %5, %7
%9 = sub i32 %8, 1
%10 = load i32, i32* %4
%11 = lshr i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @ceil_shift(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = add i32 %0, -1
%5 = add i32 %4, %3
%6 = lshr i32 %5, %1
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_p224_sub(uintptr_t, uintptr_t, uintptr_t);
void fiat_p224_sub(uint32_t out1[7], const uint32_t arg1[7],
                   const uint32_t arg2[7]) {
  internal_fiat_p224_sub((uintptr_t)out1, (uintptr_t)arg1, (uintptr_t)arg2);
}


x86 assembly (clang, -O0):
<fiat_p224_sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <internal_fiat_p224_sub@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fiat_p224_sub>:
jmp    1030 <internal_fiat_p224_sub@plt>

LLVM IR (-O0):
define void @fiat_p224_sub(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %4
%8 = ptrtoint i32* %7 to i64
%9 = load i32*, i32** %5
%10 = ptrtoint i32* %9 to i64
%11 = load i32*, i32** %6
%12 = ptrtoint i32* %11 to i64
%13 = call i32 @internal_fiat_p224_sub(i64 %8, i64 %10, i64 %12)
ret void
}

LLVM IR (-O2):
define void @fiat_p224_sub(i32* %0, i32* %1, i32* %2) {
%4 = ptrtoint i32* %0 to i64
%5 = ptrtoint i32* %1 to i64
%6 = ptrtoint i32* %2 to i64
%7 = tail call i32 @internal_fiat_p224_sub(i64 %4, i64 %5, i64 %6)
ret void
}
XUnmapWindow() {}


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

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

LLVM IR (-O0):
define i32 @XUnmapWindow() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XUnmapWindow() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ strncmp(char *, char *, int);
void NormalizeSignature(char *Signature) {
  if (!strncmp(Signature, "RSD ", 4)) {
    Signature[3] = 'P';
  }
}


x86 assembly (clang, -O0):
<NormalizeSignature>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1142 <NormalizeSignature+0x32>
mov    -0x8(%rbp),%rax
movb   $0x50,0x3(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NormalizeSignature>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     112b <NormalizeSignature+0x1b>
pop    %rbx
ret
movb   $0x50,0x3(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"RSD \00"
define void @NormalizeSignature(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strncmp(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%5 = icmp ne i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 3
store i8 80, i8* %8
br label %9
9: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"RSD \00"
define void @NormalizeSignature(i8* %0) {
%2 = tail call i32 @strncmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 3
store i8 80, i8* %5
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dhcp_packet(int, char *, char *, char *, char *);
void dhcp_request(char *ipaddr, char *gwaddr, char *hardware) {
  dhcp_packet(3, ipaddr, ipaddr, gwaddr, hardware);
}


x86 assembly (clang, -O0):
<dhcp_request>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    $0x3,%edi
call   1030 <dhcp_packet@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dhcp_request>:
mov    %rdx,%r8
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    $0x3,%edi
mov    %rdx,%rsi
jmp    1030 <dhcp_packet@plt>

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

LLVM IR (-O2):
define void @dhcp_request(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @dhcp_packet(i32 3, i8* %0, i8* %0, i8* %1, i8* %2)
ret void
}
/* Variables and functions */
float fastsqrt1(float);
float fastsqrt3(float x) {
  float v = fastsqrt1(x);
  v = v + x / v;
  v = 0.25f * v + x / v;
  return v;
}


x86 assembly (clang, -O0):
<fastsqrt3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <fastsqrt1@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
divss  -0x8(%rbp),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
divss  -0x8(%rbp),%xmm1
movss  0xea5(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fastsqrt3>:
push   %rax
movss  %xmm0,0x4(%rsp)
call   1030 <fastsqrt1@plt>
movss  0x4(%rsp),%xmm2
movaps %xmm2,%xmm1
divss  %xmm0,%xmm1
addss  %xmm1,%xmm0
divss  %xmm0,%xmm2
mulss  0xec7(%rip),%xmm0
addss  %xmm2,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @fastsqrt3(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = call float @fastsqrt1(float %4)
store float %5, float* %3
%6 = load float, float* %3
%7 = load float, float* %2
%8 = load float, float* %3
%9 = fdiv float %7, %8
%10 = fadd float %6, %9
store float %10, float* %3
%11 = load float, float* %3
%12 = load float, float* %2
%13 = load float, float* %3
%14 = fdiv float %12, %13
%15 = call float @llvm.fmuladd.f32(float 2.500000e-01, float %11, float %14)
store float %15, float* %3
%16 = load float, float* %3
ret float %16
}

LLVM IR (-O2):
define float @fastsqrt3(float %0) {
%2 = tail call float @fastsqrt1(float %0)
%3 = fdiv float %0, %2
%4 = fadd float %2, %3
%5 = fdiv float %0, %4
%6 = tail call float @llvm.fmuladd.f32(float %4, float 2.500000e-01, float %5)
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ LUSubstitute(int, double *, double *, double *);
extern void LUSolve(int n, double *LU, double *x, double *b) {
  LUSubstitute(n, LU, x, b);
  return;
}


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

x86 assembly (clang, -O2):
<LUSolve>:
jmp    1030 <LUSubstitute@plt>

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

LLVM IR (-O2):
define void @LUSolve(i32 %0, double* %1, double* %2, double* %3) {
%5 = tail call i32 @LUSubstitute(i32 %0, double* %1, double* %2, double* %3)
ret void
}
long proc6(long p1, int p2, short p3, char p4, long *p5, long p6) {
  *p5 = p1 + p2 + p3 - p4;
  return *p5 + p6;
}


x86 assembly (clang, -O0):
<proc6>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %dx,%cx
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %cx,-0xe(%rbp)
mov    %al,-0xf(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rax
add    %rax,%rcx
movswq -0xe(%rbp),%rax
add    %rax,%rcx
movsbq -0xf(%rbp),%rax
sub    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
add    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<proc6>:
movslq %esi,%rsi
add    %rdi,%rsi
movslq %edx,%rax
add    %rsi,%rax
movslq %ecx,%rcx
sub    %rcx,%rax
mov    %rax,(%r8)
add    %r9,%rax
ret

LLVM IR (-O0):
define i64 @proc6(i64 %0, i32 %1, i16 signext %2, i8 signext %3, i64* %4, i64 %5) {
%7 = alloca i64
%8 = alloca i32
%9 = alloca i16
%10 = alloca i8
%11 = alloca i64*
%12 = alloca i64
store i64 %0, i64* %7
store i32 %1, i32* %8
store i16 %2, i16* %9
store i8 %3, i8* %10
store i64* %4, i64** %11
store i64 %5, i64* %12
%13 = load i64, i64* %7
%14 = load i32, i32* %8
%15 = sext i32 %14 to i64
%16 = add nsw i64 %13, %15
%17 = load i16, i16* %9
%18 = sext i16 %17 to i64
%19 = add nsw i64 %16, %18
%20 = load i8, i8* %10
%21 = sext i8 %20 to i64
%22 = sub nsw i64 %19, %21
%23 = load i64*, i64** %11
store i64 %22, i64* %23
%24 = load i64*, i64** %11
%25 = load i64, i64* %24
%26 = load i64, i64* %12
%27 = add nsw i64 %25, %26
ret i64 %27
}

LLVM IR (-O2):
define i64 @proc6(i64 %0, i32 %1, i16 signext %2, i8 signext %3, i64* nocapture writeonly %4, i64 %5) {
%7 = sext i32 %1 to i64
%8 = add nsw i64 %7, %0
%9 = sext i16 %2 to i64
%10 = add nsw i64 %8, %9
%11 = sext i8 %3 to i64
%12 = sub i64 %10, %11
store i64 %12, i64* %4
%13 = add nsw i64 %12, %5
ret i64 %13
}
void rop3_229_1_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;
  stk1 = ~stk1;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_229_1_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
and    %ecx,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_229_1_0>:
mov    %edx,%eax
and    %sil,%al
mov    (%rdi),%cl
or     %cl,%al
xor    %dl,%al
or     %sil,%al
not    %al
and    %sil,%cl
or     %al,%cl
mov    %cl,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_229_1_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 = and 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 = or 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 = zext i8 %29 to i32
%31 = xor i32 %30, -1
%32 = trunc i32 %31 to i8
store i8 %32, i8* %7
%33 = load i8, i8* %7
%34 = zext i8 %33 to i32
%35 = load i8, i8* %5
%36 = zext i8 %35 to i32
%37 = xor i32 %36, -1
%38 = and i32 %34, %37
%39 = load i8*, i8** %4
%40 = load i8, i8* %39
%41 = zext i8 %40 to i32
%42 = load i8, i8* %5
%43 = zext i8 %42 to i32
%44 = and i32 %41, %43
%45 = or i32 %38, %44
%46 = trunc i32 %45 to i8
%47 = load i8*, i8** %4
store i8 %46, i8* %47
ret void
}

LLVM IR (-O2):
define void @rop3_229_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = and i8 %2, %1
%5 = load i8, i8* %0
%6 = or i8 %5, %4
%7 = xor i8 %6, %2
%8 = or i8 %7, %1
%9 = xor i8 %8, -1
%10 = and i8 %5, %1
%11 = or i8 %10, %9
store i8 %11, i8* %0
ret void
}
/* Type definitions */
struct cymkd_parser {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ document(struct cymkd_parser *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void _cymkd_render(struct cymkd_parser *parser) {
  if (!document(parser)) {
    fprintf(stderr, "ERROR: Markdown document is invalid\n");
  }
}


x86 assembly (clang, -O0):
<_cymkd_render>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <document@plt>
cmp    $0x0,%eax
jne    1153 <_cymkd_render+0x33>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
lea    0xeb2(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_cymkd_render>:
push   %rax
call   1030 <document@plt>
test   %eax,%eax
je     112c <_cymkd_render+0xc>
pop    %rax
ret
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xec4(%rip),%rsi
pop    %rax
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
%struct.cymkd_parser = type { i32 }
@stderr = global i32 0
@.str = [37 x i8] c"ERROR: Markdown document is invalid\0A\00"
define void @_cymkd_render(%struct.cymkd_parser* %0) {
%2 = alloca %struct.cymkd_parser*
store %struct.cymkd_parser* %0, %struct.cymkd_parser** %2
%3 = load %struct.cymkd_parser*, %struct.cymkd_parser** %2
%4 = call i32 @document(%struct.cymkd_parser* %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
%struct.cymkd_parser = type { i32 }
@stderr = global i32 0
@.str = [37 x i8] c"ERROR: Markdown document is invalid\0A\00"
define void @_cymkd_render(%struct.cymkd_parser* %0) {
%2 = tail call i32 @document(%struct.cymkd_parser* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %4, %1
ret void
}
void TIMER_RC_intr(void) {}


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

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

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

LLVM IR (-O2):
define void @TIMER_RC_intr() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ASF_Done();
int /*<<< orphan*/ AVI_Done();
int /*<<< orphan*/ MP4_Done();
int /*<<< orphan*/ MPG_Done();
int /*<<< orphan*/ NSV_Done();
int /*<<< orphan*/ WAV_Done();
void DLLUnRegister() {
  ASF_Done();
  AVI_Done();
  WAV_Done();
  MP4_Done();
  MPG_Done();
  NSV_Done();
}


x86 assembly (clang, -O0):
<DLLUnRegister>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <ASF_Done@plt>
mov    $0x0,%al
call   1080 <AVI_Done@plt>
mov    $0x0,%al
call   1050 <WAV_Done@plt>
mov    $0x0,%al
call   1030 <MP4_Done@plt>
mov    $0x0,%al
call   1070 <MPG_Done@plt>
mov    $0x0,%al
call   1060 <NSV_Done@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DLLUnRegister>:
push   %rax
xor    %eax,%eax
call   1040 <ASF_Done@plt>
xor    %eax,%eax
call   1080 <AVI_Done@plt>
xor    %eax,%eax
call   1050 <WAV_Done@plt>
xor    %eax,%eax
call   1030 <MP4_Done@plt>
xor    %eax,%eax
call   1070 <MPG_Done@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <NSV_Done@plt>

LLVM IR (-O0):
define void @DLLUnRegister() {
%1 = call i32 (...) @ASF_Done()
%2 = call i32 (...) @AVI_Done()
%3 = call i32 (...) @WAV_Done()
%4 = call i32 (...) @MP4_Done()
%5 = call i32 (...) @MPG_Done()
%6 = call i32 (...) @NSV_Done()
ret void
}

LLVM IR (-O2):
define void @DLLUnRegister() {
%1 = tail call i32 (...) @ASF_Done()
%2 = tail call i32 (...) @AVI_Done()
%3 = tail call i32 (...) @WAV_Done()
%4 = tail call i32 (...) @MP4_Done()
%5 = tail call i32 (...) @MPG_Done()
%6 = tail call i32 (...) @NSV_Done()
ret void
}
void f57(void) {
  ({
    a:
      ({ 0; });
      ({
        goto a;
        0;
      });
      0;
  });
  ({
    ({ 0; });
    ({ 0; });
    0;
  });
  0;
}


x86 assembly (clang, -O0):
<f57>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
jmp    1104 <f57+0x4>

x86 assembly (clang, -O2):
<f57>:
jmp    1100 <f57>

LLVM IR (-O0):
define void @f57() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
br label %4
4: ; preds = %4, %0
store i32 0, i32* %1
%5 = load i32, i32* %1
br label %4
}

LLVM IR (-O2):
define void @f57() {
br label %1
1: ; preds = %1, %0
br label %1
}
void remove_newline(char *string) {
  char *p = string;
  while (*p) {
    if (*p == '\n' || *p == '\r') {
      *p = '\0';
      return;
    }
    p++;
  }
}


x86 assembly (clang, -O0):
<remove_newline>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115a <remove_newline+0x5a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
je     113d <remove_newline+0x3d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
jne    1149 <remove_newline+0x49>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
jmp    115a <remove_newline+0x5a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <remove_newline+0x10>
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_newline>:
movzbl (%rdi),%eax
test   %al,%al
je     1118 <remove_newline+0x18>
cmp    $0xd,%al
je     1115 <remove_newline+0x15>
cmp    $0xa,%al
je     1115 <remove_newline+0x15>
add    $0x1,%rdi
jmp    1100 <remove_newline>
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @remove_newline(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
switch i8 %4, label %6 [
i8 0, label %8
i8 10, label %5
i8 13, label %5
]
5: ; preds = %2, %2
store i8 0, i8* %3
br label %8
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
8: ; preds = %2, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
void panic(const char *msg, const int line) {
  if (line == 0) {
    printf("Error: %s.\n", msg);
  } else {
    printf("Error in line %d: %s.\n", line, msg);
  }
  exit(1);
}


x86 assembly (clang, -O0):
<panic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1150 <panic+0x30>
mov    -0x8(%rbp),%rsi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1165 <panic+0x45>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%rdx
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<panic>:
push   %rax
mov    %rdi,%rdx
test   %esi,%esi
jne    1143 <panic+0x23>
lea    0xed1(%rip),%rdi
mov    %rdx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
lea    0xec2(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"Error: %s.\0A\00"
@.str.1 = [23 x i8] c"Error in line %d: %s.\0A\00"
define void @panic(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %8)
br label %14
10: ; preds = %2
%11 = load i32, i32* %4
%12 = load i8*, i8** %3
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %11, i8* %12)
br label %14
14: ; preds = %10, %7
%15 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [12 x i8] c"Error: %s.\0A\00"
@.str.1 = [23 x i8] c"Error in line %d: %s.\0A\00"
define void @panic(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %8
6: ; preds = %2
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %1, i8* %0)
br label %8
8: ; preds = %6, %4
%9 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
size_t ilog10(unsigned long num) {
  size_t i;
  unsigned long p = 1;
  for (i = 0; i < ((sizeof(unsigned long) << 1) + (sizeof(unsigned long) >> 1));
       i++) {
    if (num < p)
      break;
    p *= 10;
  }
  return !i ? 1 : i;
}


x86 assembly (clang, -O0):
<ilog10>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1,-0x18(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x14,-0x10(%rbp)
jae    1150 <ilog10+0x50>
mov    -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1136 <ilog10+0x36>
jmp    1150 <ilog10+0x50>
imul   $0xa,-0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1118 <ilog10+0x18>
cmpq   $0x0,-0x10(%rbp)
jne    1169 <ilog10+0x69>
mov    $0x1,%eax
mov    %rax,-0x20(%rbp)
jmp    1171 <ilog10+0x71>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ilog10>:
test   %rdi,%rdi
je     112a <ilog10+0x2a>
mov    $0x1,%ecx
xor    %eax,%eax
nopl   0x0(%rax)
mov    %rax,%rdx
add    $0x1,%rax
cmp    $0x12,%rdx
ja     1129 <ilog10+0x29>
add    %rcx,%rcx
lea    (%rcx,%rcx,4),%rcx
cmp    %rdi,%rcx
jbe    1110 <ilog10+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i64 @ilog10(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %6, %3 ], [ 1, %1 ]
%5 = phi i64 [ %7, %3 ], [ 0, %1 ]
%6 = mul i64 %4, 10
%7 = add nuw nsw i64 %5, 1
%8 = icmp ugt i64 %5, 18
%9 = icmp ugt i64 %6, %0
%10 = select i1 %8, i1 true, i1 %9
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i64 [ 1, %1 ], [ %7, %3 ]
ret i64 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_CUR;
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
int end_sss_collection(void *ctx, int mode) {
  FILE *fp = ctx;
  fseek(fp, -1, SEEK_CUR);
  fputs("]},", fp);
  return 0;
}


x86 assembly (clang, -O0):
<end_sss_collection>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x2ea6(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%esi
call   1040 <fseek@plt>
mov    -0x18(%rbp),%rsi
lea    0xea7(%rip),%rdi
call   1030 <fputs@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<end_sss_collection>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ebd(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%esi
call   1030 <fseek@plt>
lea    0xec2(%rip),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@SEEK_CUR = global i32 0
@.str = [4 x i8] c"]},\00"
define i32 @end_sss_collection(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = load i32, i32* @SEEK_CUR
%10 = call i32 @fseek(i32* %8, i32 -1, i32 %9)
%11 = load i32*, i32** %5
%12 = call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %11)
ret i32 0
}

LLVM IR (-O2):
@SEEK_CUR = global i32 0
@.str = [4 x i8] c"]},\00"
define i32 @end_sss_collection(i8* nocapture %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* @SEEK_CUR
%5 = tail call i32 @fseek(i32* %3, i32 -1, i32 %4)
%6 = tail call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 3, i64 1, i32* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ keywait(int);
void keydownwait() { keywait(1); }


x86 assembly (clang, -O0):
<keydownwait>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <keywait@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<keydownwait>:
mov    $0x1,%edi
jmp    1030 <keywait@plt>

LLVM IR (-O0):
define void @keydownwait() {
%1 = call i32 @keywait(i32 1)
ret void
}

LLVM IR (-O2):
define void @keydownwait() {
%1 = tail call i32 @keywait(i32 1)
ret void
}
/* Variables and functions */
unsigned char ADS1299ReadReg(int);
int /*<<< orphan*/ ADS1299WriteReg(int, unsigned char);
void ADS1299SetDataRate(unsigned char mode) {
  unsigned char oldValue, newValue;
  oldValue = ADS1299ReadReg(0x01);
  newValue = oldValue | (mode & 0x07);
  ADS1299WriteReg(0x01, newValue);
}


x86 assembly (clang, -O0):
<ADS1299SetDataRate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1,%edi
call   1040 <ADS1299ReadReg@plt>
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
movzbl -0x1(%rbp),%ecx
and    $0x7,%ecx
or     %ecx,%eax
mov    %al,-0x3(%rbp)
mov    $0x1,%edi
movzbl -0x3(%rbp),%esi
call   1030 <ADS1299WriteReg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADS1299SetDataRate>:
push   %rbx
mov    %edi,%ebx
mov    $0x1,%edi
call   1040 <ADS1299ReadReg@plt>
and    $0x7,%bl
or     %al,%bl
movzbl %bl,%esi
mov    $0x1,%edi
pop    %rbx
jmp    1030 <ADS1299WriteReg@plt>

LLVM IR (-O0):
define void @ADS1299SetDataRate(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %2
%5 = call zeroext i8 @ADS1299ReadReg(i32 1)
store i8 %5, i8* %3
%6 = load i8, i8* %3
%7 = zext i8 %6 to i32
%8 = load i8, i8* %2
%9 = zext i8 %8 to i32
%10 = and i32 %9, 7
%11 = or i32 %7, %10
%12 = trunc i32 %11 to i8
store i8 %12, i8* %4
%13 = load i8, i8* %4
%14 = call i32 @ADS1299WriteReg(i32 1, i8 zeroext %13)
ret void
}

LLVM IR (-O2):
define void @ADS1299SetDataRate(i8 zeroext %0) {
%2 = tail call zeroext i8 @ADS1299ReadReg(i32 1)
%3 = and i8 %0, 7
%4 = or i8 %2, %3
%5 = tail call i32 @ADS1299WriteReg(i32 1, i8 zeroext %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_DUPFD;
int fcntl(int, int /*<<< orphan*/, int);
int dup2(int fd, int fd2) { return fcntl(fd, F_DUPFD, fd2); }


x86 assembly (clang, -O0):
<dup2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dup2>:
mov    %esi,%edx
mov    0x2ecf(%rip),%rax
mov    (%rax),%esi
jmp    1030 <fcntl@plt>

LLVM IR (-O0):
@F_DUPFD = global i32 0
define i32 @dup2(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* @F_DUPFD
%7 = load i32, i32* %4
%8 = call i32 @fcntl(i32 %5, i32 %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@F_DUPFD = global i32 0
define i32 @dup2(i32 %0, i32 %1) {
%3 = load i32, i32* @F_DUPFD
%4 = tail call i32 @fcntl(i32 %0, i32 %3, i32 %1)
ret i32 %4
}
/* Variables and functions */
scalar_t__ getchar();
void b_getchar_16(short idx, short *cells, int size) {
  cells[idx] = (short)getchar();
}


x86 assembly (clang, -O0):
<b_getchar_16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %ax,%dx
mov    -0x10(%rbp),%rax
movswq -0x2(%rbp),%rcx
mov    %dx,(%rax,%rcx,2)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_getchar_16>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <getchar@plt>
movslq %ebp,%rcx
mov    %ax,(%rbx,%rcx,2)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @b_getchar_16(i16 signext %0, i16* %1, i32 %2) {
%4 = alloca i16
%5 = alloca i16*
%6 = alloca i32
store i16 %0, i16* %4
store i16* %1, i16** %5
store i32 %2, i32* %6
%7 = call i64 (...) @getchar()
%8 = trunc i64 %7 to i16
%9 = load i16*, i16** %5
%10 = load i16, i16* %4
%11 = sext i16 %10 to i64
%12 = getelementptr inbounds i16, i16* %9, i64 %11
store i16 %8, i16* %12
ret void
}

LLVM IR (-O2):
define void @b_getchar_16(i16 signext %0, i16* nocapture writeonly %1, i32 %2) {
%4 = tail call i64 (...) @getchar()
%5 = trunc i64 %4 to i16
%6 = sext i16 %0 to i64
%7 = getelementptr inbounds i16, i16* %1, i64 %6
store i16 %5, i16* %7
ret void
}
/* Variables and functions */
__attribute__((no)) int bool_(float f) {
  bool c = f;
  if (c) {
    return c;
  }
  return 23;
}


x86 assembly (clang, -O0):
<bool_>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
cvttss2si -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1126 <bool_+0x26>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    112d <bool_+0x2d>
movl   $0x17,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bool_>:
cvttss2si %xmm0,%ecx
test   %ecx,%ecx
mov    $0x17,%eax
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @bool_(float %0) {
%2 = fptosi float %0 to i32
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 23, i32 %2
ret i32 %4
}
/* Variables and functions */
int syscall(int, char const *, unsigned int);
int delete_module(const char *a, unsigned b) { return syscall(129, a, b); }


x86 assembly (clang, -O0):
<delete_module>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    $0x81,%edi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delete_module>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0x81,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @delete_module(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @syscall(i32 129, i8* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @delete_module(i8* %0, i32 %1) {
%3 = tail call i32 @syscall(i32 129, i8* %0, i32 %1)
ret i32 %3
}
void fbsd_init_signals() {}


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

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

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

LLVM IR (-O2):
define void @fbsd_init_signals() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ heapifyDown(int *, int *);
int del(int *pq, int *cap) {
  int val = pq[0];
  pq[0] = pq[*cap];
  *cap = *cap - 1;
  heapifyDown(pq, cap);
  return val;
}


x86 assembly (clang, -O0):
<del>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,4),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
sub    $0x1,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <heapifyDown@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<del>:
push   %rbx
mov    (%rdi),%ebx
movslq (%rsi),%rax
mov    (%rdi,%rax,4),%eax
mov    %eax,(%rdi)
addl   $0xffffffff,(%rsi)
call   1030 <heapifyDown@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @del(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 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
store i32 %8, i32* %5
%9 = load i32*, i32** %3
%10 = load i32*, i32** %4
%11 = load i32, i32* %10
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %9, i64 %12
%14 = load i32, i32* %13
%15 = load i32*, i32** %3
%16 = getelementptr inbounds i32, i32* %15, i64 0
store i32 %14, i32* %16
%17 = load i32*, i32** %4
%18 = load i32, i32* %17
%19 = sub nsw i32 %18, 1
%20 = load i32*, i32** %4
store i32 %19, i32* %20
%21 = load i32*, i32** %3
%22 = load i32*, i32** %4
%23 = call i32 @heapifyDown(i32* %21, i32* %22)
%24 = load i32, i32* %5
ret i32 %24
}

LLVM IR (-O2):
define i32 @del(i32* %0, i32* %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
store i32 %7, i32* %0
%8 = load i32, i32* %1
%9 = add nsw i32 %8, -1
store i32 %9, i32* %1
%10 = tail call i32 @heapifyDown(i32* %0, i32* %1)
ret i32 %3
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t __attribute__((always_)) arith_shift_right(int32_t x, int shift) {
  if (x >= 0)
    return x >> shift;
  return ~((~x) >> shift);
}


x86 assembly (clang, -O0):
<arith_shift_right>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1124 <arith_shift_right+0x24>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
sar    %cl,%eax
mov    %eax,-0x4(%rbp)
jmp    1135 <arith_shift_right+0x35>
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
mov    -0xc(%rbp),%ecx
sar    %cl,%eax
xor    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<arith_shift_right>:
mov    %esi,%ecx
mov    %edi,%eax
sar    %cl,%eax
ret

LLVM IR (-O0):
define i32 @arith_shift_right(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = icmp sge i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = ashr i32 %9, %10
store i32 %11, i32* %3
br label %18
12: ; preds = %2
%13 = load i32, i32* %4
%14 = xor i32 %13, -1
%15 = load i32, i32* %5
%16 = ashr i32 %14, %15
%17 = xor i32 %16, -1
store i32 %17, i32* %3
br label %18
18: ; preds = %12, %8
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @arith_shift_right(i32 %0, i32 %1) {
%3 = ashr i32 %0, %1
ret i32 %3
}
int main() {
  const void *******x;
  const void ********px = &x;
  struct {
    void *foo;
    struct {
      void *bar;
      void *ptr;
    } data;
  } inst, *pinst = &inst, **ppinst = &pinst, ***pppinst = &ppinst,
          ****ppppinst = &pppinst, *****pppppinst = &ppppinst;
  (****pppppinst)->data.ptr = (void *)0;
  const long val = (long)*******px;
  return val;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
lea    -0x38(%rbp),%rax
mov    %rax,-0x40(%rbp)
lea    -0x40(%rbp),%rax
mov    %rax,-0x48(%rbp)
lea    -0x48(%rbp),%rax
mov    %rax,-0x50(%rbp)
lea    -0x50(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%rax
mov    (%rax),%rax
mov    (%rax),%rax
movq   $0x0,0x10(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%rax
mov    (%rax),%rax
mov    (%rax),%rax
mov    (%rax),%rax
mov    (%rax),%rax
mov    (%rax),%rax
mov    %rax,-0x60(%rbp)
mov    -0x60(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.anon = type { i8*, %struct.anon.0 }
%struct.anon.0 = type { i8*, i8* }
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*******
%3 = alloca i8********
%4 = alloca %struct.anon
%5 = alloca %struct.anon*
%6 = alloca %struct.anon**
%7 = alloca %struct.anon***
%8 = alloca %struct.anon****
%9 = alloca %struct.anon*****
%10 = alloca i64
store i32 0, i32* %1
store i8******** %2, i8********* %3
store %struct.anon* %4, %struct.anon** %5
store %struct.anon** %5, %struct.anon*** %6
store %struct.anon*** %6, %struct.anon**** %7
store %struct.anon**** %7, %struct.anon***** %8
store %struct.anon***** %8, %struct.anon****** %9
%11 = load %struct.anon*****, %struct.anon****** %9
%12 = load %struct.anon****, %struct.anon***** %11
%13 = load %struct.anon***, %struct.anon**** %12
%14 = load %struct.anon**, %struct.anon*** %13
%15 = load %struct.anon*, %struct.anon** %14
%16 = getelementptr inbounds %struct.anon, %struct.anon* %15, i32 0, i32 1
%17 = getelementptr inbounds %struct.anon.0, %struct.anon.0* %16, i32 0, i32 1
store i8* null, i8** %17
%18 = load i8********, i8********* %3
%19 = load i8*******, i8******** %18
%20 = load i8******, i8******* %19
%21 = load i8*****, i8****** %20
%22 = load i8****, i8***** %21
%23 = load i8***, i8**** %22
%24 = load i8**, i8*** %23
%25 = load i8*, i8** %24
%26 = ptrtoint i8* %25 to i64
store i64 %26, i64* %10
%27 = load i64, i64* %10
%28 = trunc i64 %27 to i32
ret i32 %28
}

LLVM IR (-O2):
%struct.anon = type { i8*, %struct.anon.0 }
%struct.anon.0 = type { i8*, i8* }
define i32 @main() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ SIGPIPE;
int /*<<< orphan*/ SIG_IGN;
int epoll_create(int);
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
int sp_create() {
  signal(SIGPIPE, SIG_IGN);
  return epoll_create(1024);
}


x86 assembly (clang, -O0):
<sp_create>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
mov    $0x400,%edi
call   1040 <epoll_create@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sp_create>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    0x2eb7(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
mov    $0x400,%edi
pop    %rax
jmp    1040 <epoll_create@plt>

LLVM IR (-O0):
@SIGPIPE = global i32 0
@SIG_IGN = global i32 0
define i32 @sp_create() {
%1 = load i32, i32* @SIGPIPE
%2 = load i32, i32* @SIG_IGN
%3 = call i32 @signal(i32 %1, i32 %2)
%4 = call i32 @epoll_create(i32 1024)
ret i32 %4
}

LLVM IR (-O2):
@SIGPIPE = global i32 0
@SIG_IGN = global i32 0
define i32 @sp_create() {
%1 = load i32, i32* @SIGPIPE
%2 = load i32, i32* @SIG_IGN
%3 = tail call i32 @signal(i32 %1, i32 %2)
%4 = tail call i32 @epoll_create(i32 1024)
ret i32 %4
}
/* Variables and functions */
double logf(float);
float Q_log2f(float f) { return logf(f) / 0.693147180559945309417; }


x86 assembly (clang, -O0):
<Q_log2f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <logf@plt>
movsd  0xed1(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q_log2f>:
push   %rax
call   1030 <logf@plt>
divsd  0xee2(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @Q_log2f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call double @logf(float %3)
%5 = fdiv double %4, 0x3FE62E42FEFA39EF
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @Q_log2f(float %0) {
%2 = tail call double @logf(float %0)
%3 = fdiv double %2, 0x3FE62E42FEFA39EF
%4 = fptrunc double %3 to float
ret float %4
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int stun_make_type(int);
uint16_t stun_make_success_response(uint16_t method) {
  return ((stun_make_type(method) & 0xFEEF) | 0x0100);
}


x86 assembly (clang, -O0):
<stun_make_success_response>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <stun_make_type@plt>
and    $0xfeef,%eax
or     $0x100,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stun_make_success_response>:
push   %rax
call   1030 <stun_make_type@plt>
and    $0xfeef,%eax
or     $0x100,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @stun_make_success_response(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @stun_make_type(i32 %3)
%5 = and i32 %4, 65263
%6 = or i32 %5, 256
ret i32 %6
}

LLVM IR (-O2):
define i32 @stun_make_success_response(i32 %0) {
%2 = tail call i32 @stun_make_type(i32 %0)
%3 = and i32 %2, 65263
%4 = or i32 %3, 256
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void putLDCharOL(void) { printf("\x01B(0\x06C\x01B(B"); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"\1B(0l\1B(B\00"
define void @putLDCharOL() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
int main() {
  unsigned long test = -1L >> 1;
  switch (test) {
  case (char)-1:
    return 1;
  case ((unsigned long)-1L >> 1):
    return 2;
  default:
    return 3;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movq   $0xffffffffffffffff,-0x10(%rbp)
ff
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
sub    $0xffffffffffffffff,%rax
je     1146 <main+0x46>
jmp    112a <main+0x2a>
mov    -0x18(%rbp),%rax
movabs $0x7fffffffffffffff,%rcx
ff ff 7f
sub    %rcx,%rax
je     1152 <main+0x52>
jmp    115e <main+0x5e>
movl   $0x1,-0x4(%rbp)
jmp    1165 <main+0x65>
movl   $0x2,-0x4(%rbp)
jmp    1165 <main+0x65>
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
store i64 -1, i64* %2
%3 = load i64, i64* %2
switch i64 %3, label %6 [
i64 -1, label %4
i64 9223372036854775807, label %5
]
4: ; preds = %0
store i32 1, i32* %1
br label %7
5: ; preds = %0
store i32 2, i32* %1
br label %7
6: ; preds = %0
store i32 3, i32* %1
br label %7
7: ; preds = %6, %5, %4
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void msp_free(void *buffer) { free(buffer); }


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

x86 assembly (clang, -O2):
<msp_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @msp_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int PnameRef();
PfigureGroupNameRef() {
  int b = -1;
  ;
  b = PnameRef();
  return (b);
}


x86 assembly (clang, -O0):
<PfigureGroupNameRef>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xffffffff,-0x4(%rbp)
mov    $0x0,%al
call   1030 <PnameRef@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @PfigureGroupNameRef() {
%1 = alloca i32
store i32 -1, i32* %1
%2 = call i32 (...) @PnameRef()
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @PfigureGroupNameRef() {
%1 = tail call i32 (...) @PnameRef()
ret i32 %1
}