// File: minirop[P]JDecomqiler/src/Helpers.cpp
// Function: parseSignature(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
std::vector<std::string> parseSignature(std::string signature)
{
	std::vector<std::string> params;
	
	int i = 0;
	if(signature[i] == '(')
	{
		i++;
		
		int next_is_array = 0;
		std::string type;
		while(signature[i] != ')')
		{
			if(signature[i] == '[')
			{
				next_is_array++;
			}
			else
			{
				type = parseType(signature, i);
			}
			
			if(type.length() > 0)
			{
				std::string tmp = type;
				while(next_is_array > 0)
				{
					tmp += "[]";
					next_is_array--;
				}
				params.push_back(tmp);
				tmp.clear();
			}
			
			i++;
		}
		i++; // skip the ')'
	}
	
	params.push_back(parseType(signature, i));
	
	return params;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
movq %rsi, -0xf8(%rbp)
movq %rdi, -0x108(%rbp)
movq %rdi, %rax
movq %rax, -0x100(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movb $0x0, -0x11(%rbp)
callq 0x5dd0
movq -0xf8(%rbp), %rdi
movl $0x0, -0x18(%rbp)
movslq -0x18(%rbp), %rsi
callq 0x3530
movq %rax, -0xf0(%rbp)
jmp 0x291c4
movq -0xf0(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x28, %eax
jne 0x293a4
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
movl $0x0, -0x28(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x33e0
movq -0xf8(%rbp), %rdi
movslq -0x18(%rbp), %rsi
callq 0x3530
movq %rax, -0x110(%rbp)
jmp 0x29209
movq -0x110(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x29, %eax
je 0x29382
movq -0xf8(%rbp), %rdi
movslq -0x18(%rbp), %rsi
callq 0x3530
movq %rax, -0x118(%rbp)
jmp 0x29235
movq -0x118(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x5b, %eax
jne 0x29274
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x292e0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x2945b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x29396
movq -0xf8(%rbp), %rsi
leaq -0x88(%rbp), %rdi
callq 0x3140
jmp 0x29289
leaq -0x68(%rbp), %rdi
leaq -0x88(%rbp), %rsi
leaq -0x18(%rbp), %rdx
callq 0x29470
jmp 0x2929f
leaq -0x48(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x3350
leaq -0x68(%rbp), %rdi
callq 0x31d0
leaq -0x88(%rbp), %rdi
callq 0x31d0
jmp 0x292e0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x31d0
jmp 0x29396
leaq -0x48(%rbp), %rdi
callq 0x3410
cmpq $0x0, %rax
jbe 0x29374
leaq -0xa8(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x3140
jmp 0x29305
jmp 0x29307
cmpl $0x0, -0x28(%rbp)
jle 0x29347
leaq 0x1407(%rip), %rsi      # 0x2a71b
leaq -0xa8(%rbp), %rdi
callq 0x3290
jmp 0x29322
movl -0x28(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x29307
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x31d0
jmp 0x29396
movq -0x108(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x20810
jmp 0x2935c
leaq -0xa8(%rbp), %rdi
callq 0x33a0
leaq -0xa8(%rbp), %rdi
callq 0x31d0
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x291f0
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x31d0
jmp 0x293a4
leaq -0x48(%rbp), %rdi
callq 0x31d0
jmp 0x2945b
movq -0xf8(%rbp), %rsi
leaq -0xe8(%rbp), %rdi
callq 0x3140
jmp 0x293b9
leaq -0xc8(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
leaq -0x18(%rbp), %rdx
callq 0x29470
jmp 0x293d2
movq -0x108(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x5780
jmp 0x293e7
leaq -0xc8(%rbp), %rdi
callq 0x31d0
leaq -0xe8(%rbp), %rdi
callq 0x31d0
movb $0x1, -0x11(%rbp)
testb $0x1, -0x11(%rbp)
jne 0x2944b
jmp 0x2943f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x29431
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x31d0
leaq -0xe8(%rbp), %rdi
callq 0x31d0
jmp 0x2945b
movq -0x108(%rbp), %rdi
callq 0x5d00
movq -0x100(%rbp), %rax
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
movq -0x108(%rbp), %rdi
callq 0x5d00
movq -0x20(%rbp), %rdi
callq 0x34e0