// File: 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:
subq $0x258, %rsp            # imm = 0x258
movq %rdx, 0x68(%rsp)
movq %rdi, 0x70(%rsp)
movq %rdi, %rax
movq %rax, 0x78(%rsp)
movq %rdi, 0x250(%rsp)
movq %rsi, 0x248(%rsp)
movq %rdx, 0x240(%rsp)
leaq 0x228(%rsp), %rdi
callq 0x1a570
leaq 0x207(%rsp), %rdi
movq %rdi, 0x80(%rsp)
callq 0xb690
movq 0x80(%rsp), %rdx
leaq 0x33e5d(%rip), %rsi     # 0xd1a1f
leaq 0x208(%rsp), %rdi
callq 0xb4c0
jmp 0x9dbd1
leaq 0x207(%rsp), %rdi
callq 0xb3f0
leaq 0x1cf(%rsp), %rdi
movq %rdi, 0x60(%rsp)
callq 0xb690
movq 0x60(%rsp), %rdx
leaq 0x33e23(%rip), %rsi     # 0xd1a1f
leaq 0x1d0(%rsp), %rdi
callq 0xb4c0
jmp 0x9dc0b
leaq 0x1cf(%rsp), %rdi
callq 0xb3f0
leaq 0x1a7(%rsp), %rdi
movq %rdi, 0x58(%rsp)
callq 0xb690
movq 0x58(%rsp), %rdx
leaq 0x33de9(%rip), %rsi     # 0xd1a1f
leaq 0x1a8(%rsp), %rdi
callq 0xb4c0
jmp 0x9dc45
leaq 0x1a7(%rsp), %rdi
callq 0xb3f0
movl $0xf0, 0x1a0(%rsp)
leaq 0x17f(%rsp), %rdi
movq %rdi, 0x50(%rsp)
callq 0xb690
movq 0x50(%rsp), %rdx
leaq 0x33dee(%rip), %rsi     # 0xd1a69
leaq 0x180(%rsp), %rdi
callq 0xb4c0
jmp 0x9dc8a
leaq 0x17f(%rsp), %rdi
callq 0xb3f0
movl $0x0, 0x178(%rsp)
movl 0x178(%rsp), %eax
movq %rax, 0x48(%rsp)
movq 0x248(%rsp), %rdi
callq 0x393f0
movq %rax, %rcx
movq 0x48(%rsp), %rax
cmpq %rcx, %rax
jae 0x9e21f
movl 0x178(%rsp), %ecx
movb $0x0, 0x157(%rsp)
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, 0x47(%rsp)
jbe 0x9dd76
leaq 0x1a8(%rsp), %rdi
callq 0xb2a0
movq %rax, 0x30(%rsp)
leaq 0x180(%rsp), %rdi
callq 0xb2a0
movq %rax, %rcx
movq 0x30(%rsp), %rax
addq %rcx, %rax
movq %rax, 0x38(%rsp)
movq 0x248(%rsp), %rdi
movl 0x178(%rsp), %eax
movl %eax, %esi
callq 0x48650
movq %rax, %rdi
callq 0x1bb70
movq %rax, %rsi
leaq 0x158(%rsp), %rdi
callq 0x1bb80
jmp 0x9dd49
movb $0x1, 0x157(%rsp)
leaq 0x158(%rsp), %rdi
callq 0xb2a0
movq %rax, %rcx
movq 0x38(%rsp), %rax
addq %rcx, %rax
cmpq $0xf0, %rax
setb %al
movb %al, 0x47(%rsp)
movb 0x47(%rsp), %al
movb %al, 0x2f(%rsp)
testb $0x1, 0x157(%rsp)
jne 0x9dd8a
jmp 0x9dd97
leaq 0x158(%rsp), %rdi
callq 0xb6e8
movb 0x2f(%rsp), %al
testb $0x1, %al
jne 0x9dda4
jmp 0x9dfd6
leaq 0x208(%rsp), %rdi
leaq 0x180(%rsp), %rsi
callq 0xb470
jmp 0x9ddbb
leaq 0x1a8(%rsp), %rdi
leaq 0x180(%rsp), %rsi
callq 0xb470
jmp 0x9ddd2
leaq 0x1d0(%rsp), %rdi
leaq 0x180(%rsp), %rsi
callq 0xb470
jmp 0x9dde9
movl $0x0, 0x150(%rsp)
movl 0x150(%rsp), %eax
movq %rax, 0x20(%rsp)
movq 0x248(%rsp), %rdi
movl 0x178(%rsp), %eax
movl %eax, %esi
callq 0x48650
movq %rax, %rdi
callq 0x1bb70
movq %rax, %rsi
leaq 0x130(%rsp), %rdi
callq 0x1bb80
jmp 0x9de30
leaq 0x130(%rsp), %rdi
callq 0xb2a0
movq %rax, 0x18(%rsp)
leaq 0x130(%rsp), %rdi
callq 0xb6e8
movq 0x18(%rsp), %rcx
movq 0x20(%rsp), %rax
cmpq %rcx, %rax
jae 0x9df57
leaq 0x33c03(%rip), %rsi     # 0xd1a6c
leaq 0x208(%rsp), %rdi
callq 0xb360
jmp 0x9de78
leaq 0x33bed(%rip), %rsi     # 0xd1a6c
leaq 0x1d0(%rsp), %rdi
callq 0xb360
jmp 0x9de8e
jmp 0x9de90
movl 0x150(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x150(%rsp)
jmp 0x9ddf4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1f8(%rsp)
movl %eax, 0x1f4(%rsp)
leaq 0x207(%rsp), %rdi
callq 0xb3f0
jmp 0x9e352
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1f8(%rsp)
movl %eax, 0x1f4(%rsp)
leaq 0x1cf(%rsp), %rdi
callq 0xb3f0
jmp 0x9e345
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1f8(%rsp)
movl %eax, 0x1f4(%rsp)
leaq 0x1a7(%rsp), %rdi
callq 0xb3f0
jmp 0x9e338
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1f8(%rsp)
movl %eax, 0x1f4(%rsp)
leaq 0x17f(%rsp), %rdi
callq 0xb3f0
jmp 0x9e32b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1f8(%rsp)
movl %eax, 0x1f4(%rsp)
jmp 0x9e31e
movq 0x248(%rsp), %rdi
movl 0x178(%rsp), %eax
movl %eax, %esi
callq 0x48650
movq %rax, %rdi
callq 0x1bb70
movq %rax, %rsi
leaq 0x110(%rsp), %rdi
callq 0x1bb80
jmp 0x9df87
leaq 0x1a8(%rsp), %rdi
leaq 0x110(%rsp), %rsi
callq 0xb470
jmp 0x9df9e
leaq 0x110(%rsp), %rdi
callq 0xb6e8
jmp 0x9e207
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1f8(%rsp)
movl %eax, 0x1f4(%rsp)
leaq 0x110(%rsp), %rdi
callq 0xb6e8
jmp 0x9e31e
cmpl $0x0, 0x178(%rsp)
jbe 0x9e0fe
leaq 0x228(%rsp), %rdi
leaq 0x208(%rsp), %rsi
callq 0x2e5d0
jmp 0x9dffb
leaq 0x228(%rsp), %rdi
leaq 0x1a8(%rsp), %rsi
callq 0x2e5d0
jmp 0x9e012
leaq 0x228(%rsp), %rdi
leaq 0x1d0(%rsp), %rsi
callq 0x2e5d0
jmp 0x9e029
leaq 0xef(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0xb690
movq 0x10(%rsp), %rdx
leaq 0x339d8(%rip), %rsi     # 0xd1a1f
leaq 0xf0(%rsp), %rdi
callq 0xb4c0
jmp 0x9e056
leaq 0x228(%rsp), %rdi
leaq 0xf0(%rsp), %rsi
callq 0x1a5a0
jmp 0x9e06d
leaq 0xf0(%rsp), %rdi
callq 0xb6e8
leaq 0xef(%rsp), %rdi
callq 0xb3f0
leaq 0x33991(%rip), %rsi     # 0xd1a1f
leaq 0x208(%rsp), %rdi
callq 0xb4b0
jmp 0x9e09d
leaq 0x3397b(%rip), %rsi     # 0xd1a1f
leaq 0x1d0(%rsp), %rdi
callq 0xb4b0
jmp 0x9e0b3
jmp 0x9e0fe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1f8(%rsp)
movl %eax, 0x1f4(%rsp)
jmp 0x9e0ec
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1f8(%rsp)
movl %eax, 0x1f4(%rsp)
leaq 0xf0(%rsp), %rdi
callq 0xb6e8
leaq 0xef(%rsp), %rdi
callq 0xb3f0
jmp 0x9e31e
movl $0x0, 0xe8(%rsp)
movl 0xe8(%rsp), %eax
movq %rax, 0x8(%rsp)
movq 0x248(%rsp), %rdi
movl 0x178(%rsp), %eax
movl %eax, %esi
callq 0x48650
movq %rax, %rdi
callq 0x1bb70
movq %rax, %rsi
leaq 0xc8(%rsp), %rdi
callq 0x1bb80
jmp 0x9e145
leaq 0xc8(%rsp), %rdi
callq 0xb2a0
movq %rax, (%rsp)
leaq 0xc8(%rsp), %rdi
callq 0xb6e8
movq (%rsp), %rcx
movq 0x8(%rsp), %rax
cmpq %rcx, %rax
jae 0x9e1b5
leaq 0x338f4(%rip), %rsi     # 0xd1a6c
leaq 0x208(%rsp), %rdi
callq 0xb360
jmp 0x9e187
leaq 0x338de(%rip), %rsi     # 0xd1a6c
leaq 0x1d0(%rsp), %rdi
callq 0xb360
jmp 0x9e19d
jmp 0x9e19f
movl 0xe8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xe8(%rsp)
jmp 0x9e109
movq 0x248(%rsp), %rdi
movl 0x178(%rsp), %eax
movl %eax, %esi
callq 0x48650
movq %rax, %rdi
callq 0x1bb70
movq %rax, %rsi
leaq 0xa8(%rsp), %rdi
callq 0x1bb80
jmp 0x9e1e5
leaq 0x1a8(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0xb450
leaq 0xa8(%rsp), %rdi
callq 0xb6e8
jmp 0x9e209
movl 0x178(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x178(%rsp)
jmp 0x9dca2
leaq 0x228(%rsp), %rdi
leaq 0x208(%rsp), %rsi
callq 0x2e5d0
jmp 0x9e236
leaq 0x228(%rsp), %rdi
leaq 0x1a8(%rsp), %rsi
callq 0x2e5d0
jmp 0x9e24d
leaq 0x228(%rsp), %rdi
leaq 0x1d0(%rsp), %rsi
callq 0x2e5d0
jmp 0x9e264
movq 0x68(%rsp), %rsi
leaq 0x88(%rsp), %rdi
callq 0xb1a0
jmp 0x9e278
movq 0x70(%rsp), %rdi
leaq 0x228(%rsp), %rsi
leaq 0x88(%rsp), %rdx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
xorl %r8d, %r8d
movl $0xf4, %r9d
callq 0xa9680
jmp 0x9e2a2
leaq 0x88(%rsp), %rdi
callq 0xb6e8
leaq 0x180(%rsp), %rdi
callq 0xb6e8
leaq 0x1a8(%rsp), %rdi
callq 0xb6e8
leaq 0x1d0(%rsp), %rdi
callq 0xb6e8
leaq 0x208(%rsp), %rdi
callq 0xb6e8
leaq 0x228(%rsp), %rdi
callq 0x1a600
movq 0x78(%rsp), %rax
addq $0x258, %rsp            # imm = 0x258
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1f8(%rsp)
movl %eax, 0x1f4(%rsp)
leaq 0x88(%rsp), %rdi
callq 0xb6e8
leaq 0x180(%rsp), %rdi
callq 0xb6e8
leaq 0x1a8(%rsp), %rdi
callq 0xb6e8
leaq 0x1d0(%rsp), %rdi
callq 0xb6e8
leaq 0x208(%rsp), %rdi
callq 0xb6e8
leaq 0x228(%rsp), %rdi
callq 0x1a600
movq 0x1f8(%rsp), %rdi
callq 0xb680
nopl (%rax)