// File: /workspace/github_cpp_makefile_star2_O2/menhits[P]phplus/src/Token.cpp
// Function: tableStringFromTokens(std::vector<std::shared_ptr<TokenData>, std::allocator<std::shared_ptr<TokenData>>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
string tableStringFromTokens(const vector<Token>& tokens, string tableName)
{
	/*string out="Name\tType\n";
	
	for (unsigned i=0; i<tokens.size(); ++i)
	{
		out+=replaceSubstring(tokens[i]->getText(), "\n", "\\n") + "\t";
		
		out+=tokens[i]->getTypeDescription();
		
		if (i<tokens.size()-1)
			out+="\n";
	}
	
	return putStringInTable(out, tableName);*/
	
	vector<string> lines;
	string abv="", blw="";
	string str="";
	//const int tabSize=1;
	const int maxWidth=240;
	const string seporator="    ";
	//const string seporator="   |   ";
	
	for (unsigned i=0; i<tokens.size(); ++i)
	{
		//string next=" | ";
		
		//for (int j=0; j<int(tabSize-str.size()%tabSize); j++)
		//	next+=" ";
		
		//next+=tokens[i]->getText();
		
		if (i>0 && str.size()+seporator.size()+tokens[i]->getText().size()<maxWidth)
		{
			abv+=seporator;
			str+=seporator;
			blw+=seporator;
			
			for (unsigned j=0; j<tokens[i]->getText().size(); j++)
			{
				abv+=" ";
				blw+=" ";
			}
			
			str+=tokens[i]->getText();
		}
		else
		{
			if (i>0)
			{
				lines.push_back(abv);
				lines.push_back(str);
				lines.push_back(blw);
				lines.push_back("");
				abv="";
				blw="";
			}
			
			for (unsigned j=0; j<tokens[i]->getText().size(); j++)
			{
				abv+=" ";
				blw+=" ";
			}
			
			str=tokens[i]->getText();
		}
	}
	
	lines.push_back(abv);
	lines.push_back(str);
	lines.push_back(blw);
	
	return lineListToBoxedString(lines, tableName, -1, false, maxWidth+4);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rdx, %r14
movq %rsi, 0x8(%rsp)
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
andq $0x0, 0x20(%rsp)
leaq 0x1759d(%rip), %rsi     # 0x54a1f
leaq 0x78(%rsp), %rdi
leaq 0x58(%rsp), %rdx
callq 0xa150
leaq 0x17587(%rip), %rsi     # 0x54a1f
leaq 0x58(%rsp), %rdi
leaq 0x38(%rsp), %rdx
callq 0xa150
leaq 0x17571(%rip), %rsi     # 0x54a1f
leaq 0x38(%rsp), %rdi
leaq 0xa8(%rsp), %rdx
callq 0xa150
movq %r14, 0xa0(%rsp)
movq %rbx, 0x98(%rsp)
leaq 0x17592(%rip), %rsi     # 0x54a69
leaq 0xa8(%rsp), %rdi
leaq 0xc8(%rsp), %rdx
callq 0xa150
xorl %r15d, %r15d
leaq 0xc8(%rsp), %r12
leaq 0x1756e(%rip), %r13     # 0x54a6c
movl %r15d, %r15d
movq 0x8(%rsp), %rcx
movq (%rcx), %rax
movq 0x8(%rcx), %rcx
subq %rax, %rcx
sarq $0x4, %rcx
cmpq %r15, %rcx
jbe 0x3d71a
testq %r15, %r15
movq %r15, 0x30(%rsp)
je 0x3d669
movq 0x40(%rsp), %r14
movq 0xb0(%rsp), %rbp
movq %r15, %rbx
shlq $0x4, %rbx
movq (%rax,%rbx), %rsi
movq %r12, %rdi
callq 0xa3b0
addq %r14, %rbp
addq 0xd0(%rsp), %rbp
movq %r12, %rdi
callq 0xa558
cmpq $0xef, %rbp
ja 0x3d5f1
leaq 0x78(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0xa540
leaq 0x38(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0xa540
leaq 0x58(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0xa540
xorl %ebp, %ebp
movq 0x8(%rsp), %rax
movq (%rax), %rax
movq (%rax,%rbx), %rsi
movq %r12, %rdi
callq 0xa3b0
movl %ebp, %r14d
movq 0xd0(%rsp), %r15
movq %r12, %rdi
callq 0xa558
cmpq %r14, %r15
jbe 0x3d6e4
leaq 0x78(%rsp), %rdi
movq %r13, %rsi
callq 0xa520
leaq 0x58(%rsp), %rdi
movq %r13, %rsi
callq 0xa520
incl %ebp
jmp 0x3d5a3
leaq 0x10(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0x1855a
leaq 0x10(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x1855a
leaq 0x10(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x1855a
movq %r12, %rdi
leaq 0x173f7(%rip), %rsi     # 0x54a1f
leaq 0x7(%rsp), %rdx
callq 0xa150
leaq 0x10(%rsp), %rdi
movq %r12, %rsi
callq 0x13632
movq %r12, %rdi
callq 0xa558
leaq 0x78(%rsp), %rdi
leaq 0x173cc(%rip), %rsi     # 0x54a1f
callq 0xa530
leaq 0x58(%rsp), %rdi
leaq 0x173bb(%rip), %rsi     # 0x54a1f
callq 0xa530
xorl %ebp, %ebp
movq %r15, %rbx
shlq $0x4, %rbx
movq 0x8(%rsp), %rax
movq (%rax), %rax
movq (%rax,%rbx), %rsi
movq %r12, %rdi
callq 0xa3b0
movl %ebp, %r14d
movq 0xd0(%rsp), %r15
movq %r12, %rdi
callq 0xa558
cmpq %r14, %r15
jbe 0x3d6bc
leaq 0x78(%rsp), %rdi
movq %r13, %rsi
callq 0xa520
leaq 0x58(%rsp), %rdi
movq %r13, %rsi
callq 0xa520
incl %ebp
jmp 0x3d672
movq 0x8(%rsp), %rax
movq (%rax), %rax
movq (%rax,%rbx), %rsi
movq %r12, %rdi
callq 0xa3b0
movq 0x30(%rsp), %r15
leaq 0x38(%rsp), %rdi
movq %r12, %rsi
callq 0xa350
jmp 0x3d70a
movq 0x8(%rsp), %rax
movq (%rax), %rax
movq (%rax,%rbx), %rsi
movq %r12, %rdi
callq 0xa3b0
movq 0x30(%rsp), %r15
leaq 0x38(%rsp), %rdi
movq %r12, %rsi
callq 0xa540
movq %r12, %rdi
callq 0xa558
incl %r15d
jmp 0x3d4fe
leaq 0x10(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0x1855a
leaq 0x10(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x1855a
leaq 0x10(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x1855a
leaq 0xe8(%rsp), %rdi
movq 0xa0(%rsp), %rsi
callq 0xa3b0
leaq 0x10(%rsp), %rsi
leaq 0xe8(%rsp), %rdx
pushq $-0x1
popq %rcx
movq 0x98(%rsp), %rbx
movq %rbx, %rdi
xorl %r8d, %r8d
movl $0xf4, %r9d
callq 0x42359
leaq 0xe8(%rsp), %rdi
callq 0xa558
leaq 0xa8(%rsp), %rdi
callq 0xa558
leaq 0x38(%rsp), %rdi
callq 0xa558
leaq 0x58(%rsp), %rdi
callq 0xa558
leaq 0x78(%rsp), %rdi
callq 0xa558
leaq 0x10(%rsp), %rdi
callq 0x11670
movq %rbx, %rax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0xe8(%rsp), %rdi
jmp 0x3d80e
movq %rax, %rbx
jmp 0x3d833
movq %rax, %rbx
jmp 0x3d83d
movq %rax, %rbx
jmp 0x3d847
movq %rax, %rbx
jmp 0x3d851
jmp 0x3d823
jmp 0x3d803
jmp 0x3d823
movq %rax, %rbx
leaq 0xc8(%rsp), %rdi
callq 0xa558
jmp 0x3d826
jmp 0x3d823
jmp 0x3d823
jmp 0x3d823
jmp 0x3d823
jmp 0x3d823
jmp 0x3d823
jmp 0x3d823
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0xa558
leaq 0x38(%rsp), %rdi
callq 0xa558
leaq 0x58(%rsp), %rdi
callq 0xa558
leaq 0x78(%rsp), %rdi
callq 0xa558
leaq 0x10(%rsp), %rdi
callq 0x11670
movq %rbx, %rdi
callq 0xa500