// File: /workspace/github_cpp_makefile_star2_O3/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 $0xa8, %rsp
movq %rsi, %rbx
movq %rdi, %r15
leaq 0x10(%rsp), %r14
movq %r14, -0x10(%r14)
movq $0x0, -0x8(%r14)
movb $0x0, (%r14)
leaq 0x78(%rsi), %rdi
callq 0x2070
testb %al, %al
je 0x7d32
movq %r15, 0x80(%rsp)
leaq 0x98(%rsp), %r14
xorl %ebp, %ebp
leaq 0x60(%rsp), %r12
leaq 0x88(%rsp), %r15
leaq 0x20(%rsp), %r13
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21b0
movsbl %al, %edx
movq %rbx, %rdi
movq %rsp, %rsi
callq 0x2330
leaq 0x70(%rsp), %rax
movq %rax, 0x60(%rsp)
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0x3a4c
movq %r14, 0x88(%rsp)
movq %r15, %rdi
leaq 0x6785(%rip), %rsi      # 0xe2ea
leaq 0x6785(%rip), %rdx      # 0xe2f1
callq 0xa0b2
movq %r12, %rdi
movq %r15, %rsi
callq 0xa604
testb %al, %al
je 0x7c0e
leaq 0x50(%rsp), %rax
movq %rax, 0x40(%rsp)
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
addq %rsi, %rdx
leaq 0x40(%rsp), %rdi
callq 0x3a4c
leaq 0x30(%rsp), %rax
movq %rax, 0x20(%rsp)
movq %r13, %rdi
leaq 0x673e(%rip), %rsi      # 0xe2f6
leaq 0x6747(%rip), %rdx      # 0xe306
callq 0xa0b2
leaq 0x40(%rsp), %rdi
movq %r13, %rsi
callq 0xa604
movl %eax, %r13d
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x7bf0
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x21d0
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x7c11
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x21d0
jmp 0x7c11
xorl %r13d, %r13d
movq 0x88(%rsp), %rdi
cmpq %r14, %rdi
je 0x7c2e
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x21d0
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x7c4a
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x21d0
incl %ebp
testb %r13b, %r13b
leaq 0x20(%rsp), %r13
je 0x7b13
movq 0xb36f(%rip), %rdi      # 0x12fd0
leaq 0x669f(%rip), %rsi      # 0xe307
movl $0x36, %edx
leaq 0x10(%rsp), %r14
callq 0x2210
movq 0x80(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x6c4a
testb %al, %al
je 0x7d40
movq 0xb335(%rip), %rdi      # 0x12fd0
leaq 0x669c(%rip), %rsi      # 0xe33e
movl $0x33, %edx
callq 0x2210
movq 0xb31d(%rip), %rdi      # 0x12fd0
leaq 0x66b8(%rip), %rsi      # 0xe372
movl $0x29, %edx
callq 0x2210
movq %r15, %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x7e34
movq 0xb2f8(%rip), %rdi      # 0x12fd0
leaq 0x66bd(%rip), %rsi      # 0xe39c
movl $0x26, %edx
callq 0x2210
movq %rbx, %rdi
xorl %esi, %esi
callq 0xa61f
movq 0xb2d6(%rip), %rdi      # 0x12fd0
leaq 0x66c2(%rip), %rsi      # 0xe3c3
movl $0x32, %edx
callq 0x2210
movq %r15, %rdi
movq %rbx, %rsi
callq 0x44b0
movb $0x1, %bl
movq 0xb2b1(%rip), %rdi      # 0x12fd0
leaq 0x66d0(%rip), %rsi      # 0xe3f6
movl $0x2f, %edx
callq 0x2210
jmp 0x7d5a
movl $0x2c, %edx
leaq 0x653d(%rip), %rsi      # 0xe27b
jmp 0x7d4c
movl $0x2d, %edx
leaq 0x66da(%rip), %rsi      # 0xe426
movq 0xb27d(%rip), %rdi      # 0x12fd0
callq 0x2210
xorl %ebx, %ebx
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x7d70
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21d0
movl %ebx, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x7e0e
movq %rax, %rbx
jmp 0x7dad
movq %rax, %rbx
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x7dad
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x21d0
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x7dd3
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x21d0
jmp 0x7dd3
movq %rax, %rbx
jmp 0x7df0
movq %rax, %rbx
movq 0x88(%rsp), %rdi
cmpq %r14, %rdi
je 0x7df0
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x21d0
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x7e11
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x21d0
jmp 0x7e11
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x7e2c
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21d0
movq %rbx, %rdi
callq 0x2300