// File: /workspace/github_cpp_makefile_star2_O1/mehrangoli[P]Static-Data-Extractor/SCmain.cpp
// Function: ScMain::find_scmain(std::basic_ifstream<char, std::char_traits<char>>&)
bool ScMain::find_scmain (ifstream &debugSymbol){
	string line;
	bool finish = 0;
	unsigned int line_num = 0;
	
	if (debugSymbol.is_open()){
    	while (getline (debugSymbol,line)){
			line_num++;
			if (string_finder(line, BLOCK) && string_finder(line, SCMAIN)){
				cout << "\033[1;32mStarting sc_main() variables extraction...\033[0m\n";
				finish = find_scmain_elements (debugSymbol, line_num);
				if (finish){
					cout << "\033[1;32msc_main() variables extraction is dine!\033[0m\n";
					cout << "\033[1;32mStarting module extraction...\033[0m\n";
					find_module (debugSymbol, line_num);
					cout << "\033[1;32mModule extraction is done!\033[0m\n";
					GotoLine(debugSymbol, 0);  //-------start from begining of file
					cout << "\033[1;32mStarting local variables extraction...\033[0m\n";
					set_func_localVar(debugSymbol);
					cout << "\033[1;32mLocal variables extraction is done!\033[0m\n";
					return 1;
				}
				else{
					cout << "\033[1;31mCould not find sc_main() function\033[0m\n";
					return 0;
				}
			}
    	}
	}
	else{
		cout << "\033[1;31mUnable to open Debug Symbol file\033[0m\n"; 
		return 0;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rsi, %rbx
movq %rdi, %r15
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
movq $0x0, -0x8(%r14)
movb $0x0, (%r14)
leaq 0x78(%rsi), %rdi
callq 0x2070
testb %al, %al
je 0x7f61
movq %r15, 0xb0(%rsp)
leaq 0x58(%rsp), %rax
movq %rax, 0xa8(%rsp)
xorl %ebp, %ebp
leaq 0x88(%rsp), %r12
leaq 0x68(%rsp), %r15
leaq 0x28(%rsp), %r13
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21b0
movsbl %al, %edx
movq %rbx, %rdi
leaq 0x8(%rsp), %rsi
callq 0x2330
leaq 0x98(%rsp), %rax
movq %rax, 0x88(%rsp)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0x3a5a
leaq 0x78(%rsp), %rax
movq %rax, 0x68(%rsp)
movq %r15, %rdi
leaq 0x7563(%rip), %rsi      # 0xf2ea
leaq 0x7563(%rip), %rdx      # 0xf2f1
callq 0xa7aa
movq %r12, %rdi
movq %r15, %rsi
callq 0xad00
movl %eax, %r14d
testb %al, %al
je 0x7df8
leaq 0x58(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
leaq 0x48(%rsp), %rdi
callq 0x3a5a
leaq 0x38(%rsp), %rax
movq %rax, 0x28(%rsp)
movq %r13, %rdi
leaq 0x751c(%rip), %rsi      # 0xf2f6
leaq 0x7525(%rip), %rdx      # 0xf306
callq 0xa7aa
leaq 0x48(%rsp), %rdi
movq %r13, %rsi
callq 0xad00
movl %eax, %r13d
jmp 0x7dfb
xorl %r13d, %r13d
testb %r14b, %r14b
je 0x7e38
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x7e1c
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x21d0
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x7e38
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x21d0
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x7e54
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x21d0
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x7e79
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x21d0
incl %ebp
testb %r13b, %r13b
leaq 0x28(%rsp), %r13
je 0x7d2a
movq 0xc140(%rip), %rdi      # 0x13fd0
leaq 0x7470(%rip), %rsi      # 0xf307
movl $0x36, %edx
leaq 0x18(%rsp), %r14
callq 0x2210
movq 0xb0(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x6dfe
testb %al, %al
je 0x7f6f
movq 0xc106(%rip), %rdi      # 0x13fd0
leaq 0x746d(%rip), %rsi      # 0xf33e
movl $0x33, %edx
callq 0x2210
movq 0xc0ee(%rip), %rdi      # 0x13fd0
leaq 0x7489(%rip), %rsi      # 0xf372
movl $0x29, %edx
callq 0x2210
movq %r15, %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x806e
movq 0xc0c9(%rip), %rdi      # 0x13fd0
leaq 0x748e(%rip), %rsi      # 0xf39c
movl $0x26, %edx
callq 0x2210
movq %rbx, %rdi
xorl %esi, %esi
callq 0xad1b
movq 0xc0a7(%rip), %rdi      # 0x13fd0
leaq 0x7493(%rip), %rsi      # 0xf3c3
movl $0x32, %edx
callq 0x2210
movq %r15, %rdi
movq %rbx, %rsi
callq 0x44ba
movb $0x1, %bl
movq 0xc082(%rip), %rdi      # 0x13fd0
leaq 0x74a1(%rip), %rsi      # 0xf3f6
movl $0x2f, %edx
callq 0x2210
jmp 0x7f89
movl $0x2c, %edx
leaq 0x730e(%rip), %rsi      # 0xf27b
jmp 0x7f7b
movl $0x2d, %edx
leaq 0x74ab(%rip), %rsi      # 0xf426
movq 0xc04e(%rip), %rdi      # 0x13fd0
callq 0x2210
xorl %ebx, %ebx
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x7fa0
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21d0
movl %ebx, %eax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x8046
movq %rax, %rbx
jmp 0x7fdd
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x7fdd
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x21d0
movq 0x48(%rsp), %rdi
cmpq 0xa8(%rsp), %rdi
je 0x8003
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x21d0
jmp 0x8003
movq %rax, %rbx
jmp 0x801f
movq %rax, %rbx
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x801f
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x21d0
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x8049
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x21d0
jmp 0x8049
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x8065
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21d0
movq %rbx, %rdi
callq 0x2300
nop