// File: /workspace/github_cpp_makefile_star2_O2/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, 0x8(%rsp)
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rdi
movaps %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
callq 0x3100
leaq 0x17a3(%rip), %rsi      # 0x4054
leaq 0x38(%rsp), %rdi
leaq 0x58(%rsp), %rdx
callq 0x3098
leaq 0x10(%rsp), %rsi
leaq 0x38(%rsp), %rdx
movq %r14, %rdi
callq 0x264d
leaq 0x38(%rsp), %rdi
callq 0x2110
leaq 0x1787(%rip), %rsi      # 0x406a
leaq 0x38(%rsp), %rdi
leaq 0x58(%rsp), %rdx
callq 0x3098
movq 0x10(%rsp), %r14
movq 0x18(%rsp), %rbp
movq 0x8(%rsp), %rax
addq $0x18, %rax
movq %rax, 0x30(%rsp)
xorl %r13d, %r13d
leaq 0x38(%rsp), %r12
cmpq %rbp, %r14
je 0x2a29
testb $0x1, %r13b
je 0x29ee
xorl %r13d, %r13d
movq %r14, %rdi
leaq 0x1736(%rip), %rsi      # 0x4068
xorl %edx, %edx
callq 0x2350
shlq $0x20, %rax
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
cmpq %rcx, %rax
je 0x29e5
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 0x2200
movq %rbx, %rdi
leaq 0x16d3(%rip), %rsi      # 0x4066
xorl %edx, %edx
callq 0x2120
movslq %eax, %rcx
leaq 0x78(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x2200
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2240
movq %r15, %rdi
callq 0x2110
movq 0x30(%rsp), %rdi
movq %r12, %rsi
callq 0x312a
movq %rax, %rdi
movq %rbx, %rsi
callq 0x30d4
movq %rbx, %rdi
callq 0x2110
movb $0x1, %r13b
addq $0x20, %r14
jmp 0x2912
movq 0x8(%rsp), %rax
movq (%rax), %r15
movq 0x8(%rax), %rbx
xorl %r13d, %r13d
cmpq %rbx, %r15
je 0x29e5
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x2360
cmpq $-0x1, %rax
je 0x2a23
movb $0x1, %r13b
movq %r12, %rdi
movq %r15, %rsi
callq 0x2140
addq $0x20, %r15
jmp 0x29fd
leaq 0x38(%rsp), %rdi
callq 0x2110
leaq 0x10(%rsp), %rdi
callq 0x3108
xorl %eax, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2a55
jmp 0x2a6d
movq %rax, %rbx
jmp 0x2a7a
jmp 0x2a5e
jmp 0x2a6d
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x2110
jmp 0x2a70
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x2110
leaq 0x10(%rsp), %rdi
callq 0x3108
movq %rbx, %rdi
callq 0x2300