// File: minirop[P]JDecomqiler/src/Helpers.cpp
// Function: parseType(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int&)
std::string parseType(std::string signature, int & i)
{
	std::string tmp;
	switch(signature[i])
	{
		case 'B':
			tmp = "byte";
			break;
		case 'C':
			tmp = "char";
			break;
		case 'D':
			tmp = "double";
			break;
		case 'F':
			tmp = "float";
			break;
		case 'I':
			tmp = "int";
			break;
		case 'J':
			tmp = "long";
			break;
		case 'L':
			do
			{
				i++;
				tmp += signature[i];
			} while(signature[i] != ';');
			tmp.pop_back();
			break;
		case 'S':
			tmp = "short";
			break;
		case 'Z':
			tmp = "boolean";
			break;
		case '[':
			i++;
			tmp = parseType(signature, i);
			tmp += "[]";
			break;
		case 'V':
			tmp = "void";
			break;
		default:
			cerr << "unrecognized parameter '" << signature[i] << "' type in signature" << endl;
			exit(1);
	}
	
	tmp = checkClassName(tmp);
	
	return tmp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq %rsi, -0xc0(%rbp)
movq %rdi, -0xd0(%rbp)
movq %rdi, %rax
movq %rax, -0xc8(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movb $0x0, -0x19(%rbp)
callq 0x33e0
movq -0xc0(%rbp), %rdi
movq -0x18(%rbp), %rax
movslq (%rax), %rsi
callq 0x3530
movq %rax, -0xb8(%rbp)
jmp 0x294c4
movq -0xb8(%rbp), %rax
movsbl (%rax), %eax
addl $-0x42, %eax
movl %eax, %ecx
movq %rcx, -0xd8(%rbp)
subl $0x19, %eax
ja 0x29702
movq -0xd8(%rbp), %rax
leaq 0x179f(%rip), %rcx      # 0x2ac90
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x2982b
movq -0xd0(%rbp), %rdi
leaq 0x17f4(%rip), %rsi      # 0x2ad0d
callq 0x33c0
jmp 0x29520
jmp 0x29794
movq -0xd0(%rbp), %rdi
leaq 0x17d5(%rip), %rsi      # 0x2ad08
callq 0x33c0
jmp 0x2953a
jmp 0x29794
movq -0xd0(%rbp), %rdi
leaq 0x11e0(%rip), %rsi      # 0x2a72d
callq 0x33c0
jmp 0x29554
jmp 0x29794
movq -0xd0(%rbp), %rdi
leaq 0x11c0(%rip), %rsi      # 0x2a727
callq 0x33c0
jmp 0x2956e
jmp 0x29794
movq -0xd0(%rbp), %rdi
leaq 0x119d(%rip), %rsi      # 0x2a71e
callq 0x33c0
jmp 0x29588
jmp 0x29794
movq -0xd0(%rbp), %rdi
leaq 0x1187(%rip), %rsi      # 0x2a722
callq 0x33c0
jmp 0x295a2
jmp 0x29794
jmp 0x295a9
movq -0xc0(%rbp), %rdi
movq -0x18(%rbp), %rax
movl (%rax), %ecx
incl %ecx
movl %ecx, (%rax)
movq -0x18(%rbp), %rax
movslq (%rax), %rsi
callq 0x3530
movq %rax, -0xe0(%rbp)
jmp 0x295cf
movq -0xd0(%rbp), %rdi
movq -0xe0(%rbp), %rax
movsbl (%rax), %esi
callq 0x31e0
jmp 0x295e7
jmp 0x295e9
movq -0xc0(%rbp), %rdi
movq -0x18(%rbp), %rax
movslq (%rax), %rsi
callq 0x3530
movq %rax, -0xe8(%rbp)
jmp 0x29605
movq -0xe8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3b, %eax
jne 0x295a9
movq -0xd0(%rbp), %rdi
callq 0x3340
jmp 0x29794
movq -0xd0(%rbp), %rdi
leaq 0x16df(%rip), %rsi      # 0x2ad12
callq 0x33c0
jmp 0x2963a
jmp 0x29794
movq -0xd0(%rbp), %rdi
leaq 0x16b3(%rip), %rsi      # 0x2ad00
callq 0x33c0
jmp 0x29654
jmp 0x29794
movq -0xc0(%rbp), %rsi
movq -0x18(%rbp), %rax
movl (%rax), %ecx
incl %ecx
movl %ecx, (%rax)
leaq -0x70(%rbp), %rdi
callq 0x3140
jmp 0x29675
movq -0x18(%rbp), %rdx
leaq -0x50(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x29470
jmp 0x29688
movq -0xd0(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movq %rsi, -0xf0(%rbp)
callq 0x3350
movq -0xf0(%rbp), %rdi
callq 0x31d0
leaq -0x70(%rbp), %rdi
callq 0x31d0
movq -0xd0(%rbp), %rdi
leaq 0x1059(%rip), %rsi      # 0x2a71b
callq 0x3290
jmp 0x296c9
jmp 0x29794
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x31d0
jmp 0x2982b
movq -0xd0(%rbp), %rdi
leaq 0x123f(%rip), %rsi      # 0x2a935
callq 0x33c0
jmp 0x296fd
jmp 0x29794
movq 0xe8e7(%rip), %rdi      # 0x37ff0
leaq 0x1618(%rip), %rsi      # 0x2ad28
callq 0x32a0
movq %rax, -0xf8(%rbp)
jmp 0x2971e
movq -0xc0(%rbp), %rdi
movq -0x18(%rbp), %rax
movslq (%rax), %rsi
callq 0x3530
movq %rax, -0x100(%rbp)
jmp 0x2973a
movq -0xf8(%rbp), %rdi
movq -0x100(%rbp), %rax
movsbl (%rax), %esi
callq 0x3320
movq %rax, -0x108(%rbp)
jmp 0x29759
movq -0x108(%rbp), %rdi
leaq 0x15da(%rip), %rsi      # 0x2ad41
callq 0x32a0
movq %rax, -0x110(%rbp)
jmp 0x29775
movq -0x110(%rbp), %rdi
movq 0xe83d(%rip), %rsi      # 0x37fc0
callq 0x32d0
jmp 0x2978a
movl $0x1, %edi
callq 0x3330
movq -0xd0(%rbp), %rsi
leaq -0xb0(%rbp), %rdi
callq 0x3140
jmp 0x297a9
leaq -0x90(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x29000
jmp 0x297be
movq -0xd0(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x3350
leaq -0x90(%rbp), %rdi
callq 0x31d0
leaq -0xb0(%rbp), %rdi
callq 0x31d0
movb $0x1, -0x19(%rbp)
testb $0x1, -0x19(%rbp)
jne 0x2981b
jmp 0x2980f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x31d0
jmp 0x2982b
movq -0xd0(%rbp), %rdi
callq 0x31d0
movq -0xc8(%rbp), %rax
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
movq -0xd0(%rbp), %rdi
callq 0x31d0
movq -0x28(%rbp), %rdi
callq 0x34e0