// File: /workspace/github_cpp_makefile_star2_O3/menhits[P]phplus/src/msclStringFuncs.cpp
// Function: padString(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
string padString(const string& in, int size, int alignment,  string pad, string leftCap, string rightCap)
{
	int capSize=leftCap.size()+rightCap.size();
	int padSize=size-int(in.size()+capSize);
	
	if (padSize<0) // need to chop
	{
		if (size-capSize>=1)
		{
			return leftCap+in.substr(0, size-capSize-1)+"…"+rightCap;
		}
		else if (size-capSize>=0)
		{
			return leftCap+string("…").substr(0, size-capSize)+rightCap;
		}
		else
		{
			return (leftCap+rightCap).substr(0, size);
		}
	}
	else if (padSize==0) // input size was exactly right
	{
		return leftCap+in+rightCap;
	}
	else // need to pad
	{
		if (alignment==0) // center alignment
		{
			string leftPad, rightPad;
			
			for (int i=0; i<floor(padSize/2.0); i++)
				leftPad+=pad;
			
			for (int i=0; i<ceil(padSize/2.0); i++)
				rightPad+=pad;
			
			return leftPad+leftCap+in+rightCap+rightPad;
		}
		// left or right alignment
		else
		{
			string padStr;
			
			for (int i=0; i<padSize; i++)
				padStr+=pad;
			
			if (alignment>0) // right align
				return leftCap+in+rightCap+padStr;
			else // left align
				return padStr+leftCap+in+rightCap;
		}

	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %r9, %r15
movl %ecx, %ebp
movq %rsi, %r12
movq %rdi, 0x20(%rsp)
movq 0xf0(%rsp), %rax
movq 0x8(%rax), %rax
addq 0x8(%r9), %rax
movl 0x8(%rsi), %ecx
addl %eax, %ecx
movl %edx, %r14d
subl %ecx, %r14d
js 0x5b41f
jne 0x5b485
movq %rsp, %r14
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x5eef3
movq 0xf0(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq %r14, %rdi
callq 0xa110
movq 0x20(%rsp), %rbx
leaq 0x10(%rbx), %rdx
movq %rdx, (%rbx)
movq (%rax), %rsi
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rsi
je 0x5b6c1
movq %rsi, (%rbx)
movq (%rcx), %rdx
movq %rdx, 0x10(%rbx)
jmp 0x5b6c9
movl %edx, %ebx
movl %edx, %ecx
subl %eax, %ecx
jle 0x5b520
decl %ecx
leaq 0x48(%rsp), %r14
movq %r14, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0xa2f0
movq (%r15), %rcx
movq 0x8(%r15), %r8
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xa310
leaq 0x38(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
movq 0x20(%rsp), %rbx
je 0x5b6ea
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x5b6f3
movq %r8, %r13
leaq 0x10(%rsp), %rax
testl %ebp, %ebp
je 0x5b5a1
movq %rsp, %rbx
movq %rax, (%rbx)
movq $0x0, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
movq (%r13), %rsi
movq 0x8(%r13), %rdx
movq %rbx, %rdi
callq 0xa110
decl %r14d
jne 0x5b4a7
testl %ebp, %ebp
jle 0x5b7e4
leaq 0x48(%rsp), %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x5eef3
movq 0x20(%rsp), %rbx
movq 0xf0(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
leaq 0x48(%rsp), %rdi
callq 0xa110
leaq 0x38(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x5b86a
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x5b873
js 0x5b83a
leaq 0x58(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x20caa(%rip), %rsi     # 0x7c1e0
leaq 0x20ca6(%rip), %rdx     # 0x7c1e3
leaq 0x48(%rsp), %rdi
callq 0xdfa8
leaq 0x28(%rsp), %rdi
leaq 0x48(%rsp), %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0xa2f0
movq 0x20(%rsp), %rbx
movq (%r15), %rcx
movq 0x8(%r15), %r8
leaq 0x28(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xa310
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x5b9be
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x5b9c7
movq %rax, (%rsp)
xorl %eax, %eax
movq %rax, 0x8(%rsp)
movb %al, 0x10(%rsp)
leaq 0x38(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq %rax, -0x8(%rbp)
movb %al, (%rbp)
cvtsi2sd %r14d, %xmm0
mulsd 0x20bf3(%rip), %xmm0    # 0x7c1c0
movsd %xmm0, 0x70(%rsp)
callq 0xa4d0
xorpd %xmm1, %xmm1
movsd %xmm0, 0x68(%rsp)
ucomisd %xmm1, %xmm0
jbe 0x5b615
movl $0x1, %ebx
movq %rsp, %r14
movq (%r13), %rsi
movq 0x8(%r13), %rdx
movq %r14, %rdi
callq 0xa110
xorps %xmm0, %xmm0
cvtsi2sd %ebx, %xmm0
incl %ebx
movsd 0x68(%rsp), %xmm1
ucomisd %xmm0, %xmm1
ja 0x5b5f0
movsd 0x70(%rsp), %xmm0
callq 0xa080
movsd %xmm0, 0x68(%rsp)
ucomisd 0x20b9a(%rip), %xmm0    # 0x7c1c8
jbe 0x5b65f
movl $0x1, %ebx
leaq 0x28(%rsp), %r14
movq (%r13), %rsi
movq 0x8(%r13), %rdx
movq %r14, %rdi
callq 0xa110
xorps %xmm0, %xmm0
cvtsi2sd %ebx, %xmm0
incl %ebx
movsd 0x68(%rsp), %xmm1
ucomisd %xmm0, %xmm1
ja 0x5b63a
leaq 0x98(%rsp), %rdi
movq %rsp, %rsi
movq %r15, %rdx
callq 0x5eef3
movq (%r12), %rsi
movq 0x8(%r12), %rdx
leaq 0x98(%rsp), %rdi
callq 0xa110
movq 0x20(%rsp), %rbx
leaq 0x88(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x5b8a2
movq %rdx, 0x78(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x88(%rsp)
jmp 0x5b8ab
movupd (%rcx), %xmm0
movupd %xmm0, (%rdx)
movq 0x8(%rax), %rdx
movq %rdx, 0x8(%rbx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x10(%rsp), %rax
jmp 0x5b7db
movupd (%rcx), %xmm0
movupd %xmm0, (%r14)
movq 0x8(%rax), %rdx
leaq 0x28(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x20aca(%rip), %rsi     # 0x7c1e0
callq 0xa560
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x5b741
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x5b74a
movupd (%rcx), %xmm0
movupd %xmm0, (%r15)
movq 0x8(%rax), %rdx
movq %rsp, %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0xf0(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
callq 0xa110
leaq 0x10(%rbx), %rdx
movq %rdx, (%rbx)
movq (%rax), %rsi
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rsi
je 0x5b79a
movq %rsi, (%rbx)
movq (%rcx), %rdx
movq %rdx, 0x10(%rbx)
jmp 0x5b7a2
movupd (%rcx), %xmm0
movupd %xmm0, (%rdx)
movq 0x8(%rax), %rdx
movq %rdx, 0x8(%rbx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x5b7c7
callq 0xa2b0
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0x5b7d6
callq 0xa2b0
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
jmp 0x5bb0f
leaq 0x48(%rsp), %rdi
movq %rsp, %rsi
movq %r15, %rdx
callq 0x5eef3
movq 0x20(%rsp), %rbx
movq (%r12), %rsi
movq 0x8(%r12), %rdx
leaq 0x48(%rsp), %rdi
callq 0xa110
leaq 0x38(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x5ba6a
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x5ba73
movq %rsp, %r12
movq %r12, %rdi
movq %r15, %rsi
movq 0xf0(%rsp), %rdx
callq 0x5eef3
movslq %ebx, %rcx
movq 0x20(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0xa2f0
jmp 0x5b6e0
movupd (%rcx), %xmm0
movupd %xmm0, (%r14)
movq 0x8(%rax), %rdx
leaq 0x28(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
callq 0xa110
jmp 0x5baa3
movupd (%rcx), %xmm0
movupd %xmm0, (%r14)
movq 0x8(%rax), %rdx
leaq 0x78(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0xf0(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
callq 0xa110
leaq 0x58(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x5b902
movq %rdx, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
jmp 0x5b90b
movupd (%rcx), %xmm0
movupd %xmm0, (%r15)
movq 0x8(%rax), %rdx
leaq 0x48(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
callq 0xa110
leaq 0x10(%rbx), %rdx
movq %rdx, (%rbx)
movq (%rax), %rsi
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rsi
je 0x5b958
movq %rsi, (%rbx)
movq (%rcx), %rdx
movq %rdx, 0x10(%rbx)
jmp 0x5b960
movupd (%rcx), %xmm0
movupd %xmm0, (%rdx)
movq 0x8(%rax), %rdx
movq %rdx, 0x8(%rbx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x48(%rsp), %rdi
cmpq %r15, %rdi
je 0x5b986
callq 0xa2b0
movq 0x78(%rsp), %rdi
cmpq %r14, %rdi
je 0x5b995
callq 0xa2b0
leaq 0xa8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5b9ab
callq 0xa2b0
movq 0x28(%rsp), %rdi
cmpq %rbp, %rdi
jne 0x5bb01
jmp 0x5bb06
movupd (%rcx), %xmm0
movupd %xmm0, (%r15)
movq 0x8(%rax), %rdx
movq %rsp, %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0xf0(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
callq 0xa110
leaq 0x10(%rbx), %rdx
movq %rdx, (%rbx)
movq (%rax), %rsi
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rsi
je 0x5ba17
movq %rsi, (%rbx)
movq (%rcx), %rdx
movq %rdx, 0x10(%rbx)
jmp 0x5ba1f
movupd (%rcx), %xmm0
movupd %xmm0, (%rdx)
movq 0x8(%rax), %rdx
movq %rdx, 0x8(%rbx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x5ba44
callq 0xa2b0
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5ba57
callq 0xa2b0
movq 0x48(%rsp), %rdi
cmpq %r14, %rdi
jne 0x5bb14
jmp 0x5bb19
movupd (%rcx), %xmm0
movupd %xmm0, (%r14)
movq 0x8(%rax), %rdx
leaq 0x28(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0xf0(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
callq 0xa110
leaq 0x10(%rbx), %rdx
movq %rdx, (%rbx)
movq (%rax), %rsi
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rsi
je 0x5bac5
movq %rsi, (%rbx)
movq (%rcx), %rdx
movq %rdx, 0x10(%rbx)
jmp 0x5bacd
movupd (%rcx), %xmm0
movupd %xmm0, (%rdx)
movq 0x8(%rax), %rdx
movq %rdx, 0x8(%rbx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0x5baf3
callq 0xa2b0
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5bb06
callq 0xa2b0
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x5bb19
callq 0xa2b0
movq %rbx, %rax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x5bc2a
jmp 0x5bbd0
jmp 0x5bbe4
jmp 0x5bc4e
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x5bb58
callq 0xa2b0
jmp 0x5bb58
movq %rax, %rbx
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5bb70
callq 0xa2b0
jmp 0x5bb70
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r14, %rdi
jne 0x5bc5f
jmp 0x5bc64
movq %rax, %rbx
jmp 0x5bc64
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r15, %rdi
je 0x5bba2
callq 0xa2b0
jmp 0x5bba2
movq %rax, %rbx
movq 0x78(%rsp), %rdi
cmpq %r14, %rdi
je 0x5bbb6
callq 0xa2b0
jmp 0x5bbb6
movq %rax, %rbx
leaq 0xa8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5bc3d
callq 0xa2b0
jmp 0x5bc3d
jmp 0x5bc3a
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0x5bbe7
callq 0xa2b0
jmp 0x5bbe7
movq %rax, %rbx
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x5bc47
jmp 0x5bc51
jmp 0x5bc4e
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x5bc0f
callq 0xa2b0
jmp 0x5bc0f
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0x5bc23
callq 0xa2b0
jmp 0x5bc23
movq %rax, %rbx
leaq 0x58(%rsp), %rax
jmp 0x5bc32
movq %rax, %rbx
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
jmp 0x5bc5a
jmp 0x5bc3a
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %rbp, %rdi
je 0x5bc51
callq 0xa2b0
jmp 0x5bc51
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x5bc64
callq 0xa2b0
movq %rbx, %rdi
callq 0xa510