// File: WShabti-Team[P]WShabtiPict/wshabtilib/java-source-code-parser/java-source-code-parser.cpp
// Function: get_prototypes(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
vector<string> get_prototypes(string source_code_path)
{
    std::ifstream source_input_file;
    source_input_file.open(source_code_path, std::ios_base::in);

    string search_string = "";
    string source_code = "";
    vector<string> prototype;

    smatch sm ;

    //PROTOTYPE REGEX
    regex prototype_regex(R"rgx(((public|private|protected|static|final|native|synchronized|abstract|transient)+\s)+[\w\<\>\[\]]+\s+(\w+) *\([^\)]*\))rgx");
    
    while(!source_input_file.eof())
	{
        getline(source_input_file, search_string);
        source_code.append(search_string);        
    }

    while(regex_search(source_code, sm, prototype_regex))
    {
        prototype.push_back(sm[0]);
        source_code = sm.suffix();
    }

    return prototype;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x340, %rsp            # imm = 0x340
movq %rsi, -0x300(%rbp)
movq %rdi, -0x318(%rbp)
movq %rdi, %rax
movq %rax, -0x310(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x218(%rbp), %rdi
movq %rdi, -0x308(%rbp)
callq 0x76d0
movq -0x308(%rbp), %rdi
movq -0x300(%rbp), %rsi
movl $0x8, %edx
callq 0x7520
jmp 0x35f38
leaq -0x249(%rbp), %rdi
movq %rdi, -0x320(%rbp)
callq 0x79e0
movq -0x320(%rbp), %rdx
leaq 0x2fcd9(%rip), %rsi     # 0x65c32
leaq -0x248(%rbp), %rdi
callq 0xd700
jmp 0x35f67
leaq -0x249(%rbp), %rdi
callq 0x7660
leaq -0x271(%rbp), %rdi
movq %rdi, -0x328(%rbp)
callq 0x79e0
movq -0x328(%rbp), %rdx
leaq 0x2fc9e(%rip), %rsi     # 0x65c32
leaq -0x270(%rbp), %rdi
callq 0xd700
jmp 0x35fa2
leaq -0x271(%rbp), %rdi
callq 0x7660
movq -0x318(%rbp), %rdi
movb $0x0, -0x272(%rbp)
callq 0x32b00
leaq -0x298(%rbp), %rdi
callq 0x364e0
jmp 0x35fcf
leaq 0x2edb9(%rip), %rsi     # 0x64d8f
leaq -0x2b8(%rbp), %rdi
movl $0x10, %edx
callq 0x36520
jmp 0x35fe9
jmp 0x35feb
movq -0x218(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x218(%rbp,%rax), %rdi
callq 0x7a30
movb %al, -0x329(%rbp)
jmp 0x3600b
movb -0x329(%rbp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x3601c
jmp 0x360ea
leaq -0x218(%rbp), %rdi
leaq -0x248(%rbp), %rsi
callq 0x70e0
jmp 0x36031
leaq -0x270(%rbp), %rdi
leaq -0x248(%rbp), %rsi
callq 0x7a80
jmp 0x36046
jmp 0x35feb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x36284
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
leaq -0x249(%rbp), %rdi
callq 0x7660
jmp 0x36284
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
leaq -0x271(%rbp), %rdi
callq 0x7660
jmp 0x36278
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x36260
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x36212
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x36206
jmp 0x360ec
leaq -0x270(%rbp), %rdi
leaq -0x298(%rbp), %rsi
leaq -0x2b8(%rbp), %rdx
xorl %ecx, %ecx
callq 0x365c0
movb %al, -0x32a(%rbp)
jmp 0x36110
movb -0x32a(%rbp), %al
testb $0x1, %al
jne 0x3611f
jmp 0x361dc
xorl %eax, %eax
movl %eax, %esi
leaq -0x298(%rbp), %rdi
callq 0x36620
movq %rax, -0x338(%rbp)
jmp 0x36138
movq -0x338(%rbp), %rsi
leaq -0x2d8(%rbp), %rdi
callq 0x36690
jmp 0x3614d
movq -0x318(%rbp), %rdi
leaq -0x2d8(%rbp), %rsi
callq 0x32b90
jmp 0x36162
leaq -0x2d8(%rbp), %rdi
callq 0x73e0
leaq -0x298(%rbp), %rdi
callq 0x36710
movq %rax, -0x340(%rbp)
jmp 0x36183
movq -0x340(%rbp), %rsi
leaq -0x2f8(%rbp), %rdi
callq 0x36690
jmp 0x36198
leaq -0x270(%rbp), %rdi
leaq -0x2f8(%rbp), %rsi
callq 0x7720
leaq -0x2f8(%rbp), %rdi
callq 0x73e0
jmp 0x360ec
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
leaq -0x2d8(%rbp), %rdi
callq 0x73e0
jmp 0x36206
movb $0x1, -0x272(%rbp)
leaq -0x2b8(%rbp), %rdi
callq 0x366c0
leaq -0x298(%rbp), %rdi
callq 0x366f0
testb $0x1, -0x272(%rbp)
jne 0x3622c
jmp 0x36220
leaq -0x2b8(%rbp), %rdi
callq 0x366c0
leaq -0x298(%rbp), %rdi
callq 0x366f0
jmp 0x36260
movq -0x318(%rbp), %rdi
callq 0x32bc0
leaq -0x270(%rbp), %rdi
callq 0x73e0
leaq -0x248(%rbp), %rdi
callq 0x73e0
leaq -0x218(%rbp), %rdi
callq 0x7140
movq -0x310(%rbp), %rax
addq $0x340, %rsp            # imm = 0x340
popq %rbp
retq
movq -0x318(%rbp), %rdi
callq 0x32bc0
leaq -0x270(%rbp), %rdi
callq 0x73e0
leaq -0x248(%rbp), %rdi
callq 0x73e0
leaq -0x218(%rbp), %rdi
callq 0x7140
movq -0x220(%rbp), %rdi
callq 0x79d0
nopl (%rax)