// File: /workspace/github_cpp_makefile_star2_O1/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 %edx, %ebx
movq %rsi, %r12
movq %rdi, 0x20(%rsp)
movq 0xf0(%rsp), %rax
movq 0x8(%rax), %rdx
addq 0x8(%r9), %rdx
movl 0x8(%rsi), %eax
addl %edx, %eax
movl %ebx, %r14d
subl %eax, %r14d
js 0x5a706
jne 0x5a76a
movq %rsp, %r14
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x5e1db
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 0x5a9af
movq %rsi, (%rbx)
movq (%rcx), %rdx
movq %rdx, 0x10(%rbx)
jmp 0x5a9b7
movl %ebx, %ecx
subl %edx, %ecx
jle 0x5a80e
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 0x5a9d8
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x5a9e1
movq %r8, %r13
movl %ecx, %ebp
leaq 0x10(%rsp), %rcx
testl %ebp, %ebp
je 0x5a88f
movq %rcx, (%rsp)
movq $0x0, 0x8(%rsp)
movb $0x0, 0x10(%rsp)
cmpl %eax, %ebx
je 0x5a7aa
movq %rsp, %rbx
movq (%r13), %rsi
movq 0x8(%r13), %rdx
movq %rbx, %rdi
callq 0xa110
decl %r14d
jne 0x5a795
testl %ebp, %ebp
jle 0x5aaec
leaq 0x48(%rsp), %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x5e1db
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 0x5ab72
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x5ab7b
js 0x5ab42
leaq 0x58(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x209fc(%rip), %rsi     # 0x7b220
leaq 0x209f8(%rip), %rdx     # 0x7b223
leaq 0x48(%rsp), %rdi
callq 0xdf6a
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 0x5accb
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x5acd4
movq %rcx, (%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 0x20945(%rip), %xmm0    # 0x7b200
movsd %xmm0, 0x70(%rsp)
callq 0xa4d0
xorpd %xmm1, %xmm1
movsd %xmm0, 0x68(%rsp)
ucomisd %xmm1, %xmm0
jbe 0x5a903
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 0x5a8de
movsd 0x70(%rsp), %xmm0
callq 0xa080
movsd %xmm0, 0x68(%rsp)
ucomisd 0x208ec(%rip), %xmm0    # 0x7b208
jbe 0x5a94d
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 0x5a928
leaq 0x98(%rsp), %rdi
movq %rsp, %rsi
movq %r15, %rdx
callq 0x5e1db
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 0x5abaa
movq %rdx, 0x78(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x88(%rsp)
jmp 0x5abb3
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 0x5aac9
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 0x2081c(%rip), %rsi     # 0x7b220
callq 0xa560
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x5aa2f
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x5aa38
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 0x5aa88
movq %rsi, (%rbx)
movq (%rcx), %rdx
movq %rdx, 0x10(%rbx)
jmp 0x5aa90
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 0x5aab5
callq 0xa2b0
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0x5aac4
callq 0xa2b0
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5aad7
callq 0xa2b0
movq %rbx, %rax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x48(%rsp), %rdi
movq %rsp, %rsi
movq %r15, %rdx
callq 0x5e1db
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 0x5ad6e
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x5ad77
movq %rsp, %r12
movq %r12, %rdi
movq %r15, %rsi
movq 0xf0(%rsp), %rdx
callq 0x5e1db
movslq %ebx, %rcx
movq 0x20(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0xa2f0
jmp 0x5a9ce
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 0x5ada7
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 0x5ac0a
movq %rdx, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
jmp 0x5ac13
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 0x5ac60
movq %rsi, (%rbx)
movq (%rcx), %rdx
movq %rdx, 0x10(%rbx)
jmp 0x5ac68
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 0x5ac8e
callq 0xa2b0
movq 0x78(%rsp), %rdi
cmpq %r14, %rdi
je 0x5ac9d
callq 0xa2b0
leaq 0xa8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
leaq 0x10(%rsp), %r14
je 0x5acb8
callq 0xa2b0
movq 0x28(%rsp), %rdi
cmpq %rbp, %rdi
jne 0x5ae0a
jmp 0x5ae0f
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 0x5ad24
movq %rsi, (%rbx)
movq (%rcx), %rdx
movq %rdx, 0x10(%rbx)
jmp 0x5ad2c
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 0x5ad51
callq 0xa2b0
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5ad64
callq 0xa2b0
movq 0x48(%rsp), %rdi
jmp 0x5ae13
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 0x5adc9
movq %rsi, (%rbx)
movq (%rcx), %rdx
movq %rdx, 0x10(%rbx)
jmp 0x5add1
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 0x5adf7
callq 0xa2b0
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
leaq 0x10(%rsp), %r14
je 0x5ae0f
callq 0xa2b0
movq (%rsp), %rdi
cmpq %r14, %rdi
jne 0x5aad2
jmp 0x5aad7
jmp 0x5af1d
jmp 0x5aec3
jmp 0x5aed7
jmp 0x5af41
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x5ae4b
callq 0xa2b0
jmp 0x5ae4b
movq %rax, %rbx
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5ae63
callq 0xa2b0
jmp 0x5ae63
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r14, %rdi
jne 0x5af52
jmp 0x5af57
movq %rax, %rbx
jmp 0x5af57
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r15, %rdi
je 0x5ae95
callq 0xa2b0
jmp 0x5ae95
movq %rax, %rbx
movq 0x78(%rsp), %rdi
cmpq %r14, %rdi
je 0x5aea9
callq 0xa2b0
jmp 0x5aea9
movq %rax, %rbx
leaq 0xa8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5af30
callq 0xa2b0
jmp 0x5af30
jmp 0x5af2d
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0x5aeda
callq 0xa2b0
jmp 0x5aeda
movq %rax, %rbx
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x5af3a
jmp 0x5af44
jmp 0x5af41
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x5af02
callq 0xa2b0
jmp 0x5af02
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0x5af16
callq 0xa2b0
jmp 0x5af16
movq %rax, %rbx
leaq 0x58(%rsp), %rax
jmp 0x5af25
movq %rax, %rbx
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
jmp 0x5af4d
jmp 0x5af2d
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %rbp, %rdi
je 0x5af44
callq 0xa2b0
jmp 0x5af44
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x5af57
callq 0xa2b0
movq %rbx, %rdi
callq 0xa510