#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
size_t base16_decode_size(size_t in_len) {
  float fval = ((float)in_len + (in_len % 2)) * 0.5;
  size_t ret = (unsigned int)fval;
  ret += ((fval - ((float)ret)) > 0) ? 1 : 0;
  return ret;
}


x86 assembly (clang, -O0):
<base16_decode_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
shr    %rdx
mov    %eax,%ecx
and    $0x1,%ecx
mov    %ecx,-0x24(%rbp)
or     %rdx,%rcx
cvtsi2ss %rcx,%xmm0
addss  %xmm0,%xmm0
cvtsi2ss %rax,%xmm1
movss  %xmm1,-0x20(%rbp)
test   %rax,%rax
movss  %xmm0,-0x1c(%rbp)
js     1148 <base16_decode_size+0x48>
movss  -0x20(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    -0x24(%rbp),%eax
movss  -0x1c(%rbp),%xmm0
cvtsi2ss %eax,%xmm1
addss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe9c(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
cvttss2si -0xc(%rbp),%rax
mov    %eax,%eax
mov    %rax,-0x18(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
shr    %rdx
mov    %eax,%ecx
and    $0x1,%ecx
or     %rdx,%rcx
cvtsi2ss %rcx,%xmm0
addss  %xmm0,%xmm0
cvtsi2ss %rax,%xmm1
movss  %xmm1,-0x2c(%rbp)
test   %rax,%rax
movss  %xmm0,-0x28(%rbp)
js     11c4 <base16_decode_size+0xc4>
movss  -0x2c(%rbp),%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0x30(%rbp),%xmm0
movss  -0x28(%rbp),%xmm1
subss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
xor    %eax,%eax
mov    $0x1,%ecx
ucomiss %xmm1,%xmm0
cmova  %ecx,%eax
cltq
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<base16_decode_size>:
mov    %edi,%eax
and    $0x1,%eax
test   %rdi,%rdi
js     1111 <base16_decode_size+0x11>
cvtsi2ss %rdi,%xmm0
jmp    1120 <base16_decode_size+0x20>
shr    %rdi
or     %rax,%rdi
cvtsi2ss %rdi,%xmm0
addss  %xmm0,%xmm0
cvtsi2ss %eax,%xmm1
addss  %xmm0,%xmm1
mulss  0xed0(%rip),%xmm1
cvttss2si %xmm1,%rax
mov    %eax,%ecx
xorps  %xmm0,%xmm0
cvtsi2ss %rcx,%xmm0
subss  %xmm0,%xmm1
xorps  %xmm0,%xmm0
xor    %eax,%eax
ucomiss %xmm0,%xmm1
seta   %al
add    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @base16_decode_size(i64 %0) {
%2 = alloca i64
%3 = alloca float
%4 = alloca i64
store i64 %0, i64* %2
%5 = load i64, i64* %2
%6 = uitofp i64 %5 to float
%7 = load i64, i64* %2
%8 = urem i64 %7, 2
%9 = uitofp i64 %8 to float
%10 = fadd float %6, %9
%11 = fpext float %10 to double
%12 = fmul double %11, 5.000000e-01
%13 = fptrunc double %12 to float
store float %13, float* %3
%14 = load float, float* %3
%15 = fptoui float %14 to i32
%16 = zext i32 %15 to i64
store i64 %16, i64* %4
%17 = load float, float* %3
%18 = load i64, i64* %4
%19 = uitofp i64 %18 to float
%20 = fsub float %17, %19
%21 = fcmp ogt float %20, 0.000000e+00
%22 = zext i1 %21 to i64
%23 = select i1 %21, i32 1, i32 0
%24 = sext i32 %23 to i64
%25 = load i64, i64* %4
%26 = add i64 %25, %24
store i64 %26, i64* %4
%27 = load i64, i64* %4
ret i64 %27
}

LLVM IR (-O2):
define i64 @base16_decode_size(i64 %0) {
%2 = uitofp i64 %0 to float
%3 = and i64 %0, 1
%4 = uitofp i64 %3 to float
%5 = fadd float %2, %4
%6 = fmul float %5, 5.000000e-01
%7 = fptoui float %6 to i32
%8 = zext i32 %7 to i64
%9 = uitofp i32 %7 to float
%10 = fsub float %6, %9
%11 = fcmp ogt float %10, 0.000000e+00
%12 = zext i1 %11 to i64
%13 = add nuw nsw i64 %12, %8
ret i64 %13
}