// File: /workspace/github_cpp_makefile_star2_O1/mxy161610207[P]codesim/src/MyPaser.cpp
// Function: MyPaser::Program::GetFuncOpFromStr(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
int MyPaser::Program::GetFuncOpFromStr(const string& context) {
	vector<string> lines;
	lines.clear();
	SplitStringToVect(context, lines, "\n");

	bool inFunc = 0;
	string curFunc = "";
	for (auto &l : lines) {
		//cout << l<< endl;
		if (!inFunc) {
			for (auto &func : this->funcName_) {
				//string afunc = "<" + func + ">";
				if (l.find(func) != string::npos) {
					inFunc = 1;
					curFunc = func;
				}
			}
		}
		else {
			//  0:   lea    0x0(%rip),%rsi        # 7 <main+0x7>
			//	7:   sub    $0x8, % rsp
			// 12:   callq  17 <main+0x17>
			// 1d:   retq

			int pos = l.find(":\t");
			if (pos != string::npos) {
				string op = l.substr(pos + 2, l.size() - pos - 2);
				int pos = op.find_first_of(" ");
				op = op.substr(0, pos);
				//cout << curFunc << ":" << op << endl;
				this->functOp_[curFunc].push_back(op);
			}
			else
			{
				inFunc = 0;
			}
		}
	}
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rsi, %r14
movq %rdi, 0x40(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
movq 0x28(%rsp), %rbx
testq %rbx, %rbx
je 0x29ef
movl $0x10, %r15d
movq -0x10(%r15), %rdi
cmpq %rdi, %r15
je 0x29d6
movq (%r15), %rsi
incq %rsi
callq 0x21b0
leaq 0x20(%r15), %rax
addq $0x10, %r15
cmpq %rbx, %r15
movq %rax, %r15
jne 0x29c2
movq $0x0, 0x28(%rsp)
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x2655(%rip), %rsi      # 0x5054
leaq 0x264f(%rip), %rdx      # 0x5055
movq %rsp, %rdi
callq 0x3796
leaq 0x20(%rsp), %rsi
movq %rsp, %rdx
movq %r14, %rdi
callq 0x266f
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x2a34
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21b0
movq %rsp, %rdi
movq %r15, (%rdi)
leaq 0x2629(%rip), %rdx      # 0x506a
movq %rdx, %rsi
callq 0x3796
movq 0x20(%rsp), %r14
movq 0x28(%rsp), %rax
movq %rax, 0x50(%rsp)
cmpq %rax, %r14
je 0x2bce
movq 0x40(%rsp), %rax
addq $0x18, %rax
movq %rax, 0x48(%rsp)
xorl %ebx, %ebx
movq %rsp, %r12
testb $0x1, %bl
je 0x2b74
xorl %r13d, %r13d
movl $0x2, %ecx
movq %r14, %rdi
leaq 0x25d9(%rip), %rsi      # 0x5068
xorl %edx, %edx
callq 0x22c0
shlq $0x20, %rax
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
cmpq %rcx, %rax
je 0x2bbc
movq %rax, %rcx
sarq $0x20, %rcx
movabsq $0x200000000, %rdx      # imm = 0x200000000
addq %rdx, %rax
sarq $0x20, %rax
movq 0x8(%r14), %rdx
negq %rcx
addq %rdx, %rcx
addq $-0x2, %rcx
leaq 0x58(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x21d0
movl $0x1, %ecx
movq %r15, %rdi
leaq 0x2571(%rip), %rsi      # 0x5066
xorl %edx, %edx
callq 0x2270
movslq %eax, %rcx
leaq 0x78(%rsp), %r13
movq %r13, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x21d0
movq %r15, %rdi
movq %r13, %rsi
callq 0x2210
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x2b3e
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x21b0
movq 0x48(%rsp), %rdi
movq %r12, %rsi
callq 0x34fe
movq %rax, %rdi
movq %r15, %rsi
callq 0x3464
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x2bb9
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x21b0
jmp 0x2bb9
movq 0x40(%rsp), %rax
movq (%rax), %rbp
movq 0x8(%rax), %r15
cmpq %r15, %rbp
je 0x2bb9
movl %ebx, %r13d
movq (%rbp), %rsi
movq 0x8(%rbp), %rcx
movq %r14, %rdi
xorl %edx, %edx
callq 0x22c0
cmpq $-0x1, %rax
je 0x2bae
movb $0x1, %r13b
movq %r12, %rdi
movq %rbp, %rsi
callq 0x2110
addq $0x20, %rbp
cmpq %r15, %rbp
jne 0x2b88
jmp 0x2bbc
movl %ebx, %r13d
addq $0x20, %r14
movl %r13d, %ebx
cmpq 0x50(%rsp), %r14
jne 0x2a74
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x2be9
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21b0
leaq 0x20(%rsp), %rdi
callq 0x34a2
xorl %eax, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2c17
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
jne 0x2c52
jmp 0x2c5f
movq %rax, %rbx
jmp 0x2c5f
jmp 0x2c20
jmp 0x2c41
movq %rax, %rbx
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x2c44
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x21b0
jmp 0x2c44
movq %rax, %rbx
leaq 0x10(%rsp), %rax
movq (%rsp), %rdi
cmpq %rax, %rdi
je 0x2c5f
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21b0
leaq 0x20(%rsp), %rdi
callq 0x34a2
movq %rbx, %rdi
callq 0x22d0