// File: /workspace/github_cpp_makefile_star2_O2/menhits[P]phplus/src/utils/stringDrawing.cpp
// Function: str::getBoxedString(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, bool, int)
string getBoxedString(const string& in, string boxName, bool showLineNums, bool alwaysWidthMax, int maxWidth)
{
	vector<string> lines;
	int width;
	
	if (maxWidth<0)
	{
		maxWidth=getTermWidth()-4;
	}
	
	str::splitByLine(lines, tabsToSpaces(in));
	
	int startLineNum=1;
	
	while (!lines.empty() && lines[0].empty())
	{
		lines.erase(lines.begin());
		startLineNum++;
	}
	
	while (!lines.empty() && lines.back().empty())
	{
		lines.pop_back();
	}
	
	int nameWidth=getWidth(boxName);
	
	if (showLineNums)
	{
		int numChars=getWidth(to_string(lines.size()+startLineNum-1));
		
		for (int i=0; i<(int)lines.size(); i++)
		{
			lines[i]=pad(to_string(i+startLineNum), numChars+5, ALIGNMENT_RIGHT, " ", "", "    ")+lines[i];
		}
	}
	
	if (alwaysWidthMax)
	{
		width=maxWidth;
	}
	else
	{
		width=std::min(std::max(str::getMaxWidth(lines), nameWidth+4-2), maxWidth);
	}
	
	str::padWidths(lines, width);
	
	for (int i=0; i<(int)lines.size(); i++)
	{
		lines[i]=" ┃ "+lines[i]+" ┃ ";
	}
	
	string bottom;
	string emptyLn;
	
	for (int i=0; i<width; i++)
	{
		bottom+="━";
		emptyLn+=" ";
	}
	
	if (boxName.empty())
	{
		lines.insert(lines.begin(), " ┃ "+bottom+ " ┃ ");
		lines.insert(lines.begin(), " ┏━"+emptyLn+"━┓ ");
	}
	else
	{
		string underline;
		for (int i=0; i<nameWidth; i++)
		{
			underline+="─";
		}
		
		lines.insert(lines.begin(), " ┃"+pad(underline,	width+2, ALIGNMENT_CENTER, " ", "╰─", "─╯")+"┃ ");
		lines.insert(lines.begin(), " ┏"+pad(boxName,	width+2, ALIGNMENT_CENTER, "━", "┥ ", " ┝")+"┓ ");
		lines.insert(lines.begin(), "  "+pad(underline,	width+2, ALIGNMENT_CENTER, " ", "╭─", "─╮")+"  ");
	}
	
	
	lines.push_back(" ┃ "+emptyLn+" ┃ ");
	lines.push_back(" ┗━"+bottom +"━┛ ");
	
	
	
	return join(lines);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x308, %rsp            # imm = 0x308
movl %r8d, 0x90(%rsp)
movl %ecx, %ebx
movq %rdx, 0x88(%rsp)
movq %rsi, %r14
movq %rdi, %r12
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
andq $0x0, 0x20(%rsp)
movl %r9d, 0xc(%rsp)
testl %r9d, %r9d
jns 0x4fbf5
callq 0x42ee9
addl $-0x4, %eax
movl %eax, 0xc(%rsp)
leaq 0x68(%rsp), %rdi
pushq $0x4
popq %rdx
movq %r14, %rsi
callq 0x53a8a
leaq 0x10(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x53173
leaq 0x68(%rsp), %rdi
callq 0xa558
xorl %r15d, %r15d
leaq 0x10(%rsp), %r14
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdi
cmpq %rdi, %rsi
je 0x4fc49
cmpq $0x0, 0x8(%rsi)
jne 0x4fc49
movq %r14, %rdi
callq 0x531d4
incq %r15
jmp 0x4fc26
movq %r12, 0x100(%rsp)
leaq 0x1(%r15), %r13
cmpq %rdi, %rsi
je 0x4fc7b
cmpq $0x0, -0x18(%rdi)
jne 0x4fc7b
addq $-0x20, %rdi
movq %rdi, 0x18(%rsp)
callq 0xa558
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdi
jmp 0x4fc55
movq 0x88(%rsp), %rdi
callq 0x4fb48
movq %rax, 0xd8(%rsp)
testb %bl, %bl
je 0x4fe02
movq 0x18(%rsp), %rsi
subq 0x10(%rsp), %rsi
sarq $0x5, %rsi
addq %r15, %rsi
leaq 0x68(%rsp), %rdi
callq 0x1201c
leaq 0x68(%rsp), %rdi
callq 0x4fb48
movl %eax, %ebx
leaq 0x68(%rsp), %rdi
callq 0xa558
addl $0x5, %ebx
movl %ebx, 0x94(%rsp)
xorl %r12d, %r12d
leaq 0x48(%rsp), %r15
leaq 0xe0(%rsp), %r14
xorl %ebp, %ebp
movq 0x18(%rsp), %rax
subq 0x10(%rsp), %rax
shrq $0x5, %rax
cltq
cmpq %rax, %rbp
jge 0x4fe02
movq %r15, %rdi
movl %r13d, %esi
callq 0x1837a
leaq 0x268(%rsp), %rdi
leaq 0x4d54(%rip), %rsi      # 0x54a6c
leaq 0x28(%rsp), %rdx
callq 0xa150
leaq 0x2e8(%rsp), %rbx
leaq 0x248(%rsp), %rdi
leaq 0x4ce6(%rip), %rsi      # 0x54a1f
leaq 0xb8(%rsp), %rdx
callq 0xa150
movq %rbx, %rdi
leaq 0x4d19(%rip), %rsi      # 0x54a69
leaq 0x98(%rsp), %rdx
callq 0xa150
movq %rbx, (%rsp)
movq %r14, %rdi
movq %r15, %rbx
movq %r15, %rsi
movl 0x94(%rsp), %edx
pushq $-0x1
popq %rcx
leaq 0x268(%rsp), %r8
leaq 0x248(%rsp), %r9
callq 0x535ca
movq 0x10(%rsp), %rdx
addq %r12, %rdx
leaq 0x68(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x184b5
movq 0x10(%rsp), %rdi
addq %r12, %rdi
movq %r15, %rsi
callq 0xa350
movq %r15, %rdi
callq 0xa558
movq %r14, %rdi
callq 0xa558
leaq 0x2e8(%rsp), %rdi
callq 0xa558
leaq 0x248(%rsp), %rdi
callq 0xa558
leaq 0x268(%rsp), %rdi
callq 0xa558
movq %rbx, %r15
movq %rbx, %rdi
callq 0xa558
incq %rbp
incl %r13d
addq $0x20, %r12
jmp 0x4fce5
cmpb $0x0, 0x90(%rsp)
jne 0x4fe33
leaq 0x10(%rsp), %rdi
callq 0x4f910
movq 0xd8(%rsp), %rcx
addl $0x2, %ecx
cmpl %ecx, %eax
cmovgl %eax, %ecx
movl 0xc(%rsp), %eax
cmpl %ecx, %eax
cmovgel %ecx, %eax
movl %eax, 0xc(%rsp)
leaq 0x4c32(%rip), %rsi      # 0x54a6c
leaq 0x228(%rsp), %rdi
leaq 0x68(%rsp), %rdx
callq 0xa150
leaq 0x4bcc(%rip), %rsi      # 0x54a1f
leaq 0x208(%rsp), %rdi
leaq 0xe0(%rsp), %rdx
callq 0xa150
leaq 0x4bb0(%rip), %rsi      # 0x54a1f
leaq 0x1e8(%rsp), %rdi
leaq 0x48(%rsp), %rdx
callq 0xa150
leaq 0x10(%rsp), %rdi
pushq $0x1
popq %rdx
leaq 0x228(%rsp), %rcx
leaq 0x208(%rsp), %r8
leaq 0x1e8(%rsp), %r9
movl 0xc(%rsp), %esi
callq 0x4f95a
leaq 0x1e8(%rsp), %rdi
callq 0xa558
leaq 0x208(%rsp), %rdi
callq 0xa558
leaq 0x228(%rsp), %rdi
callq 0xa558
xorl %r12d, %r12d
leaq 0xa56c(%rip), %rbx      # 0x5a447
leaq 0xe0(%rsp), %r14
leaq 0x68(%rsp), %r15
xorl %r13d, %r13d
movq 0x10(%rsp), %rdx
movq 0x18(%rsp), %rax
subq %rdx, %rax
shrq $0x5, %rax
cltq
cmpq %rax, %r13
jge 0x4ff48
addq %r12, %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0xc8a1
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0xc882
movq 0x10(%rsp), %rdi
addq %r12, %rdi
movq %r15, %rsi
callq 0xa350
movq %r15, %rdi
callq 0xa558
movq %r14, %rdi
callq 0xa558
incq %r13
addq $0x20, %r12
jmp 0x4feeb
leaq 0x78(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
xorl %ebp, %ebp
movb %bpl, (%rax)
leaq 0xf0(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %bpl, (%rax)
movl 0xc(%rsp), %eax
testl %eax, %eax
cmovgl %eax, %ebp
leaq 0xa4d2(%rip), %rbx      # 0x5a451
leaq 0x68(%rsp), %r14
leaq 0x4ae1(%rip), %r15      # 0x54a6c
leaq 0xe0(%rsp), %r12
movq 0x100(%rsp), %r13
subl $0x1, %ebp
jb 0x4ffb8
movq %r14, %rdi
movq %rbx, %rsi
callq 0xa520
movq %r12, %rdi
movq %r15, %rsi
callq 0xa520
jmp 0x4ff9b
movq 0x88(%rsp), %rax
cmpq $0x0, 0x8(%rax)
je 0x5034a
leaq 0x58(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
xorl %ebp, %ebp
movq 0xd8(%rsp), %rax
testl %eax, %eax
cmovgl %eax, %ebp
leaq 0xa4a5(%rip), %rbx      # 0x5a497
leaq 0x48(%rsp), %r14
subl $0x1, %ebp
jb 0x50009
movq %r14, %rdi
movq %rbx, %rsi
callq 0xa520
jmp 0x4fff7
movq 0x10(%rsp), %rbx
leaq 0x4a57(%rip), %rsi      # 0x54a6c
leaq 0x1c8(%rsp), %rdi
leaq 0xb(%rsp), %rdx
callq 0xa150
leaq 0xa434(%rip), %rsi      # 0x5a462
leaq 0x1a8(%rsp), %rdi
leaq 0xa(%rsp), %rdx
callq 0xa150
leaq 0x57bf(%rip), %rsi      # 0x55806
leaq 0x2c8(%rsp), %r14
leaq 0x9(%rsp), %rdx
movq %r14, %rdi
callq 0xa150
movl 0xc(%rsp), %edx
addl $0x2, %edx
movq %r14, (%rsp)
leaq 0x98(%rsp), %rdi
leaq 0x48(%rsp), %rsi
leaq 0x1c8(%rsp), %r8
leaq 0x1a8(%rsp), %r9
movl %edx, %ebp
xorl %ecx, %ecx
callq 0x535ca
leaq 0xa3c9(%rip), %rsi      # 0x5a45d
leaq 0xb8(%rsp), %rdi
leaq 0x98(%rsp), %rdx
callq 0x11ff8
leaq 0xa398(%rip), %rdx      # 0x5a448
leaq 0x28(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
callq 0xc882
leaq 0x10(%rsp), %rdi
leaq 0x28(%rsp), %rdx
movq %rbx, %rsi
callq 0x532ee
leaq 0x28(%rsp), %rdi
callq 0xa558
leaq 0xb8(%rsp), %rdi
callq 0xa558
leaq 0x98(%rsp), %rdi
callq 0xa558
leaq 0x2c8(%rsp), %rdi
callq 0xa558
leaq 0x1a8(%rsp), %rdi
callq 0xa558
leaq 0x1c8(%rsp), %rdi
callq 0xa558
movq 0x10(%rsp), %rbx
leaq 0xa326(%rip), %rsi      # 0x5a451
leaq 0x188(%rsp), %rdi
leaq 0xb(%rsp), %rdx
callq 0xa150
leaq 0xa32a(%rip), %rsi      # 0x5a46e
leaq 0x168(%rsp), %rdi
leaq 0xa(%rsp), %rdx
callq 0xa150
leaq 0xa316(%rip), %rsi      # 0x5a473
leaq 0x2a8(%rsp), %r14
leaq 0x9(%rsp), %rdx
movq %r14, %rdi
callq 0xa150
movq %r14, (%rsp)
leaq 0x98(%rsp), %rdi
leaq 0x188(%rsp), %r8
leaq 0x168(%rsp), %r9
movq 0x88(%rsp), %rsi
movl %ebp, %edx
xorl %ecx, %ecx
callq 0x535ca
leaq 0xa2c3(%rip), %rsi      # 0x5a469
leaq 0xb8(%rsp), %rdi
leaq 0x98(%rsp), %rdx
callq 0x11ff8
leaq 0xa296(%rip), %rdx      # 0x5a458
leaq 0x28(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
callq 0xc882
leaq 0x10(%rsp), %rdi
leaq 0x28(%rsp), %rdx
movq %rbx, %rsi
callq 0x532ee
leaq 0x28(%rsp), %rdi
callq 0xa558
leaq 0xb8(%rsp), %rdi
callq 0xa558
leaq 0x98(%rsp), %rdi
callq 0xa558
leaq 0x2a8(%rsp), %rdi
callq 0xa558
leaq 0x168(%rsp), %rdi
callq 0xa558
leaq 0x188(%rsp), %rdi
callq 0xa558
movq 0x10(%rsp), %rbx
leaq 0x482f(%rip), %rsi      # 0x54a6c
leaq 0x148(%rsp), %rdi
leaq 0xb(%rsp), %rdx
callq 0xa150
leaq 0xa222(%rip), %rsi      # 0x5a478
leaq 0x128(%rsp), %rdi
leaq 0xa(%rsp), %rdx
callq 0xa150
leaq 0x552f(%rip), %rsi      # 0x5579e
leaq 0x288(%rsp), %r14
leaq 0x9(%rsp), %rdx
movq %r14, %rdi
callq 0xa150
movq %r14, (%rsp)
leaq 0x98(%rsp), %rdi
leaq 0x48(%rsp), %rsi
leaq 0x148(%rsp), %r8
leaq 0x128(%rsp), %r9
movl %ebp, %edx
xorl %ecx, %ecx
callq 0x535ca
leaq 0x47b6(%rip), %rsi      # 0x54a6b
leaq 0xb8(%rsp), %rdi
leaq 0x98(%rsp), %rdx
callq 0x11ff8
leaq 0x479a(%rip), %rdx      # 0x54a6b
leaq 0x28(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
callq 0xc882
leaq 0x10(%rsp), %rdi
leaq 0x28(%rsp), %rdx
movq %rbx, %rsi
callq 0x532ee
leaq 0x28(%rsp), %rdi
callq 0xa558
leaq 0xb8(%rsp), %rdi
callq 0xa558
leaq 0x98(%rsp), %rdi
callq 0xa558
leaq 0x288(%rsp), %rdi
callq 0xa558
leaq 0x128(%rsp), %rdi
callq 0xa558
leaq 0x148(%rsp), %rdi
callq 0xa558
leaq 0x48(%rsp), %rdi
jmp 0x503f6
movq 0x10(%rsp), %rbx
leaq 0xa0f1(%rip), %rsi      # 0x5a447
leaq 0x28(%rsp), %rdi
leaq 0x68(%rsp), %rdx
callq 0xc8a1
leaq 0xa0db(%rip), %rdx      # 0x5a447
leaq 0x48(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0xc882
leaq 0x10(%rsp), %rdi
leaq 0x48(%rsp), %rdx
movq %rbx, %rsi
callq 0x532ee
leaq 0x48(%rsp), %rdi
callq 0xa558
leaq 0x28(%rsp), %rdi
callq 0xa558
movq 0x10(%rsp), %rbx
leaq 0xa0a0(%rip), %rsi      # 0x5a44d
leaq 0x28(%rsp), %rdi
leaq 0xe0(%rsp), %rdx
callq 0xc8a1
leaq 0xa08f(%rip), %rdx      # 0x5a455
leaq 0x48(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0xc882
leaq 0x10(%rsp), %rdi
leaq 0x48(%rsp), %rdx
movq %rbx, %rsi
callq 0x532ee
leaq 0x48(%rsp), %rdi
callq 0xa558
leaq 0x28(%rsp), %rdi
callq 0xa558
leaq 0xa045(%rip), %rsi      # 0x5a447
leaq 0x28(%rsp), %rdi
leaq 0xe0(%rsp), %rdx
callq 0xc8a1
leaq 0xa02c(%rip), %rdx      # 0x5a447
leaq 0x48(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0xc882
leaq 0x10(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x13632
leaq 0x48(%rsp), %rdi
callq 0xa558
leaq 0x28(%rsp), %rdi
callq 0xa558
leaq 0xa02b(%rip), %rsi      # 0x5a47f
leaq 0x28(%rsp), %rdi
leaq 0x68(%rsp), %rdx
callq 0xc8a1
leaq 0xa01d(%rip), %rdx      # 0x5a487
leaq 0x48(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0xc882
leaq 0x10(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x13632
leaq 0x48(%rsp), %rdi
callq 0xa558
leaq 0x28(%rsp), %rdi
callq 0xa558
leaq 0x4a55(%rip), %rsi      # 0x54ef8
leaq 0x108(%rsp), %rdi
leaq 0x48(%rsp), %rdx
callq 0xa150
leaq 0x10(%rsp), %rsi
leaq 0x108(%rsp), %rdx
pushq $0x1
popq %rcx
movq %r13, %rdi
callq 0x4faac
leaq 0x108(%rsp), %rdi
callq 0xa558
leaq 0xe0(%rsp), %rdi
callq 0xa558
leaq 0x68(%rsp), %rdi
callq 0xa558
leaq 0x10(%rsp), %rdi
callq 0x11670
movq %r13, %rax
addq $0x308, %rsp            # imm = 0x308
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x506a6
jmp 0x506b5
jmp 0x50780
jmp 0x506a6
jmp 0x506b5
jmp 0x50780
jmp 0x5077b
jmp 0x5077b
jmp 0x506ff
jmp 0x5077b
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0xa558
jmp 0x50554
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0xa558
jmp 0x50566
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0xa558
jmp 0x50578
movq %rax, %rbx
leaq 0x288(%rsp), %rdi
callq 0xa558
jmp 0x5058a
movq %rax, %rbx
leaq 0x128(%rsp), %rdi
callq 0xa558
leaq 0x148(%rsp), %rdi
jmp 0x50674
movq %rax, %rbx
jmp 0x50597
jmp 0x5075f
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0xa558
jmp 0x505c0
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0xa558
jmp 0x505d2
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0xa558
jmp 0x505e4
movq %rax, %rbx
leaq 0x2a8(%rsp), %rdi
callq 0xa558
jmp 0x505f6
movq %rax, %rbx
leaq 0x168(%rsp), %rdi
callq 0xa558
leaq 0x188(%rsp), %rdi
jmp 0x50674
movq %rax, %rbx
jmp 0x50603
jmp 0x5075f
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0xa558
jmp 0x50629
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0xa558
jmp 0x5063b
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0xa558
jmp 0x5064d
movq %rax, %rbx
leaq 0x2c8(%rsp), %rdi
callq 0xa558
jmp 0x5065f
movq %rax, %rbx
leaq 0x1a8(%rsp), %rdi
callq 0xa558
leaq 0x1c8(%rsp), %rdi
callq 0xa558
jmp 0x50762
movq %rax, %rbx
jmp 0x5066c
jmp 0x5075f
movq %rax, %rbx
leaq 0x108(%rsp), %rdi
jmp 0x50767
jmp 0x50780
jmp 0x506a6
jmp 0x506b5
jmp 0x50780
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0xa558
jmp 0x506b8
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
jmp 0x50767
jmp 0x50780
movq %rax, %rbx
leaq 0x1e8(%rsp), %rdi
callq 0xa558
jmp 0x506dc
movq %rax, %rbx
leaq 0x208(%rsp), %rdi
callq 0xa558
jmp 0x506ee
movq %rax, %rbx
leaq 0x228(%rsp), %rdi
jmp 0x50795
jmp 0x5077b
jmp 0x5077b
movq %rax, %rbx
jmp 0x50790
jmp 0x5077b
jmp 0x5077b
jmp 0x5077b
movq %rax, %rbx
leaq 0xe0(%rsp), %rdi
callq 0xa558
jmp 0x50722
movq %rax, %rbx
leaq 0x2e8(%rsp), %rdi
callq 0xa558
jmp 0x50739
movq %rax, %rbx
jmp 0x50746
movq %rax, %rbx
leaq 0x248(%rsp), %rdi
callq 0xa558
leaq 0x268(%rsp), %rdi
callq 0xa558
jmp 0x50758
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
jmp 0x50795
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0xa558
jmp 0x50783
movq %rax, %rbx
leaq 0xe0(%rsp), %rdi
jmp 0x50795
movq %rax, %rbx
jmp 0x5079a
movq %rax, %rbx
leaq 0xe0(%rsp), %rdi
callq 0xa558
leaq 0x68(%rsp), %rdi
callq 0xa558
leaq 0x10(%rsp), %rdi
callq 0x11670
movq %rbx, %rdi
callq 0xa500