#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 */
scalar_t__ ceil(size_t);
size_t BitlyLib_SCAVENGEREstimateBas64EncodedDataSize(size_t inDataSize) {
  size_t theEncodedDataSize = (int)ceil(inDataSize / 3.0) * 4;
  theEncodedDataSize = theEncodedDataSize / 72 * 74 + theEncodedDataSize % 72;
  return (theEncodedDataSize);
}


x86 assembly (clang, -O0):
<BitlyLib_SCAVENGEREstimateBas64EncodedDataSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movaps 0xedd(%rip),%xmm1
movq   -0x8(%rbp),%xmm0
punpckldq %xmm1,%xmm0
movapd 0xedc(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  0xed5(%rip),%xmm1
divsd  %xmm1,%xmm0
movaps %xmm0,%xmm1
cvttsd2si %xmm1,%rdi
mov    %rdi,%rcx
sar    $0x3f,%rcx
movsd  0xec2(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
and    %rcx,%rax
or     %rax,%rdi
call   1030 <ceil@plt>
shl    $0x2,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x48,%ecx
xor    %edx,%edx
div    %rcx
imul   $0x4a,%rax,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x48,%ecx
xor    %edx,%edx
div    %rcx
mov    -0x18(%rbp),%rax
add    %rdx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BitlyLib_SCAVENGEREstimateBas64EncodedDataSize>:
push   %rax
movq   %rdi,%xmm0
punpckldq 0xee2(%rip),%xmm0
subpd  0xeea(%rip),%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
addsd  %xmm0,%xmm1
divsd  0xee6(%rip),%xmm1
cvttsd2si %xmm1,%rax
mov    %rax,%rcx
sar    $0x3f,%rcx
subsd  0xeda(%rip),%xmm1
cvttsd2si %xmm1,%rdi
and    %rcx,%rdi
or     %rax,%rdi
call   1030 <ceil@plt>
shl    $0x2,%eax
movslq %eax,%rcx
movabs $0xe38e38e38e38e38f,%rdx
38 8e e3
mov    %rcx,%rax
mul    %rdx
shr    $0x6,%rdx
imul   $0x4a,%rdx,%rax
shl    $0x3,%rdx
lea    (%rdx,%rdx,8),%rdx
sub    %rdx,%rcx
add    %rax,%rcx
mov    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @BitlyLib_SCAVENGEREstimateBas64EncodedDataSize(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = uitofp i64 %4 to double
%6 = fdiv double %5, 3.000000e+00
%7 = fptoui double %6 to i64
%8 = call i64 @ceil(i64 %7)
%9 = trunc i64 %8 to i32
%10 = mul nsw i32 %9, 4
%11 = sext i32 %10 to i64
store i64 %11, i64* %3
%12 = load i64, i64* %3
%13 = udiv i64 %12, 72
%14 = mul i64 %13, 74
%15 = load i64, i64* %3
%16 = urem i64 %15, 72
%17 = add i64 %14, %16
store i64 %17, i64* %3
%18 = load i64, i64* %3
ret i64 %18
}

LLVM IR (-O2):
define i64 @BitlyLib_SCAVENGEREstimateBas64EncodedDataSize(i64 %0) {
%2 = uitofp i64 %0 to double
%3 = fdiv double %2, 3.000000e+00
%4 = fptoui double %3 to i64
%5 = tail call i64 @ceil(i64 %4)
%6 = trunc i64 %5 to i32
%7 = shl nsw i32 %6, 2
%8 = sext i32 %7 to i64
%9 = udiv i64 %8, 72
%10 = mul i64 %9, 74
%11 = urem i64 %8, 72
%12 = add i64 %10, %11
ret i64 %12
}