#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 base64_decode_size(size_t in_len) {
  unsigned int align = 4 - (in_len % 4);
  float fval = ((float)in_len + ((align == 4) ? 0 : align)) * 0.75;
  size_t ret = (unsigned int)fval;
  ret += ((fval - ((float)ret)) > 0) ? 1 : 0;
  return ret;
}


x86 assembly (clang, -O0):
<base64_decode_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
and    $0x3,%ecx
mov    $0x4,%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%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,-0x20(%rbp)
test   %rax,%rax
movss  %xmm0,-0x1c(%rbp)
js     1155 <base64_decode_size+0x55>
movss  -0x20(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
cmpl   $0x4,-0xc(%rbp)
jne    1173 <base64_decode_size+0x73>
xor    %eax,%eax
mov    %eax,-0x28(%rbp)
jmp    1179 <base64_decode_size+0x79>
mov    -0xc(%rbp),%eax
mov    %eax,-0x28(%rbp)
movss  -0x24(%rbp),%xmm0
mov    -0x28(%rbp),%eax
mov    %eax,%eax
cvtsi2ss %rax,%xmm1
addss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe68(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
cvttss2si -0x10(%rbp),%rax
mov    %eax,%eax
mov    %rax,-0x18(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x34(%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,-0x30(%rbp)
test   %rax,%rax
movss  %xmm0,-0x2c(%rbp)
js     11f8 <base64_decode_size+0xf8>
movss  -0x30(%rbp),%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x34(%rbp),%xmm0
movss  -0x2c(%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):
<base64_decode_size>:
mov    %edi,%eax
and    $0x3,%eax
mov    $0x4,%ecx
sub    %eax,%ecx
test   %rdi,%rdi
js     1118 <base64_decode_size+0x18>
cvtsi2ss %rdi,%xmm0
jmp    112d <base64_decode_size+0x2d>
mov    %rdi,%rdx
shr    %rdx
and    $0x1,%edi
or     %rdx,%rdi
cvtsi2ss %rdi,%xmm0
addss  %xmm0,%xmm0
test   %eax,%eax
cmove  %eax,%ecx
cvtsi2ss %ecx,%xmm1
addss  %xmm0,%xmm1
mulss  0xebe(%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 @base64_decode_size(i64 %0) {
%2 = alloca i64
%3 = alloca i32
%4 = alloca float
%5 = alloca i64
store i64 %0, i64* %2
%6 = load i64, i64* %2
%7 = urem i64 %6, 4
%8 = sub i64 4, %7
%9 = trunc i64 %8 to i32
store i32 %9, i32* %3
%10 = load i64, i64* %2
%11 = uitofp i64 %10 to float
%12 = load i32, i32* %3
%13 = icmp eq i32 %12, 4
br i1 %13, label %14, label %15
14: ; preds = %1
br label %17
15: ; preds = %1
%16 = load i32, i32* %3
br label %17
17: ; preds = %15, %14
%18 = phi i32 [ 0, %14 ], [ %16, %15 ]
%19 = uitofp i32 %18 to float
%20 = fadd float %11, %19
%21 = fpext float %20 to double
%22 = fmul double %21, 7.500000e-01
%23 = fptrunc double %22 to float
store float %23, float* %4
%24 = load float, float* %4
%25 = fptoui float %24 to i32
%26 = zext i32 %25 to i64
store i64 %26, i64* %5
%27 = load float, float* %4
%28 = load i64, i64* %5
%29 = uitofp i64 %28 to float
%30 = fsub float %27, %29
%31 = fcmp ogt float %30, 0.000000e+00
%32 = zext i1 %31 to i64
%33 = select i1 %31, i32 1, i32 0
%34 = sext i32 %33 to i64
%35 = load i64, i64* %5
%36 = add i64 %35, %34
store i64 %36, i64* %5
%37 = load i64, i64* %5
ret i64 %37
}

LLVM IR (-O2):
define i64 @base64_decode_size(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = and i32 %2, 3
%4 = sub nuw nsw i32 4, %3
%5 = uitofp i64 %0 to float
%6 = icmp eq i32 %3, 0
%7 = select i1 %6, i32 0, i32 %4
%8 = uitofp i32 %7 to float
%9 = fadd float %5, %8
%10 = fmul float %9, 7.500000e-01
%11 = fptoui float %10 to i32
%12 = zext i32 %11 to i64
%13 = uitofp i32 %11 to float
%14 = fsub float %10, %13
%15 = fcmp ogt float %14, 0.000000e+00
%16 = zext i1 %15 to i64
%17 = add nuw nsw i64 %16, %12
ret i64 %17
}