// File: /workspace/github_cpp_makefile_star2_O3/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, 0x28(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x16e2(%rip), %rsi      # 0x4064
leaq 0x16dc(%rip), %rdx      # 0x4065
leaq 0x8(%rsp), %rdi
callq 0x372e
leaq 0x30(%rsp), %rsi
leaq 0x8(%rsp), %rdx
movq %r14, %rdi
callq 0x266f
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x29bc
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21b0
leaq 0x8(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x16af(%rip), %rdx      # 0x407a
movq %rdx, %rsi
callq 0x372e
movq 0x30(%rsp), %r14
movq 0x38(%rsp), %r15
cmpq %r15, %r14
je 0x2b4d
movq 0x28(%rsp), %rax
addq $0x18, %rax
movq %rax, 0x50(%rsp)
xorl %r13d, %r13d
leaq 0x8(%rsp), %r12
testb $0x1, %r13b
je 0x2b0d
xorl %r13d, %r13d
movl $0x2, %ecx
movq %r14, %rdi
leaq 0x1660(%rip), %rsi      # 0x4078
xorl %edx, %edx
callq 0x22c0
shlq $0x20, %rax
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
cmpq %rcx, %rax
je 0x2afe
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), %rbx
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x21d0
movl $0x1, %ecx
movq %rbx, %rdi
leaq 0x15f8(%rip), %rsi      # 0x4076
xorl %edx, %edx
callq 0x2270
movslq %eax, %rcx
leaq 0x78(%rsp), %r13
movq %r13, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x21d0
movq %rbx, %rdi
movq %r13, %rsi
callq 0x2210
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x2ac7
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x21b0
movq 0x50(%rsp), %rdi
movq %r12, %rsi
callq 0x34ce
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3432
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x2afb
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x21b0
movb $0x1, %r13b
addq $0x20, %r14
cmpq %r15, %r14
jne 0x29fc
jmp 0x2b4d
movq 0x28(%rsp), %rax
movq (%rax), %rbp
movq 0x8(%rax), %rbx
xorl %r13d, %r13d
cmpq %rbx, %rbp
je 0x2afe
movq (%rbp), %rsi
movq 0x8(%rbp), %rcx
movq %r14, %rdi
xorl %edx, %edx
callq 0x22c0
cmpq $-0x1, %rax
je 0x2b47
movb $0x1, %r13b
movq %r12, %rdi
movq %rbp, %rsi
callq 0x2110
addq $0x20, %rbp
jmp 0x2b1c
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x2b69
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21b0
leaq 0x30(%rsp), %rdi
callq 0x3470
xorl %eax, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2b98
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
jne 0x2bd4
jmp 0x2be1
movq %rax, %rbx
jmp 0x2be1
jmp 0x2ba1
jmp 0x2bc2
movq %rax, %rbx
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x2bc5
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x21b0
jmp 0x2bc5
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq 0x8(%rsp), %rdi
cmpq %rax, %rdi
je 0x2be1
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21b0
leaq 0x30(%rsp), %rdi
callq 0x3470
movq %rbx, %rdi
callq 0x22d0