// File: /workspace/github_cpp_makefile_star2_O1/mxy161610207[P]codesim/src/MyPaser.cpp
// Function: MyPaser::MaxFlow(MyPaser::Program&, MyPaser::Program&)
int MyPaser::GetFuncList(char* filename, Program& Prog) {
	char cmd[1000];
	string cmdres;

	sprintf(cmd, "mktemp");
	ExecCmd(cmd, cmdres);
	char tempFilename[50];
	strcpy(tempFilename, cmdres.c_str());
	//cout << tempFilename << endl;

	sprintf(cmd, "g++ -std=c++11 -O2 -c %s -o %s", filename, tempFilename);
	ExecCmd(cmd, cmdres);

	sprintf(cmd, "objdump -t %s", tempFilename);
	ExecCmd(cmd, cmdres);
	Prog.GetFuncNameFromStr(cmdres);
	//printf("%s\n", cmdres.c_str());

	//FILE* f = fopen("1.txt", "w");
	//fprintf(f, "%s", cmdres.c_str());
	//fclose(f);

	sprintf(cmd, "objdump --no-show-raw-insn -d %s", tempFilename);
	ExecCmd(cmd, cmdres);
	Prog.GetFuncOpFromStr(cmdres);

	/*string t = filename;
	if (t.find("a.cpp") != string::npos) {
		Prog.PrintfFuncOptoFile("A_op.txt");
	}
	else {
		Prog.PrintfFuncOptoFile("B_op.txt");
	}

	//f = fopen("2.txt", "w");
	//fprintf(f, "%s", cmdres.c_str());
	//fclose(f);
	//*/
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x4d0, %rsp            # imm = 0x4D0
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x10(%rsp), %r13
movq %r13, -0x10(%r13)
movq $0x0, -0x8(%r13)
movb $0x0, (%r13)
leaq 0xe0(%rsp), %r15
movl $0x65746b6d, (%r15)     # imm = 0x65746B6D
movl $0x706d65, 0x3(%r15)    # imm = 0x706D65
leaq 0x90(%rsp), %r12
movq %r12, -0x10(%r12)
movq %r15, %rdi
callq 0x20f0
leaq (%rsp,%rax), %rdx
addq $0xe0, %rdx
leaq 0x80(%rsp), %rdi
movq %r15, %rsi
callq 0x3796
leaq 0x80(%rsp), %rdi
movq %rsp, %rsi
callq 0x254e
movq 0x80(%rsp), %rdi
cmpq %r12, %rdi
je 0x3215
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x21b0
movq (%rsp), %rsi
leaq 0xa0(%rsp), %r15
movq %r15, %rdi
callq 0x2180
leaq 0x1e51(%rip), %rsi      # 0x5081
leaq 0xe0(%rsp), %r12
movq %r12, %rdi
movq %r14, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0x2070
leaq 0x70(%rsp), %r14
movq %r14, -0x10(%r14)
movq %r12, %rdi
callq 0x20f0
leaq (%rsp,%rax), %rdx
addq $0xe0, %rdx
leaq 0x60(%rsp), %rdi
movq %r12, %rsi
callq 0x3796
leaq 0x60(%rsp), %rdi
movq %rsp, %rsi
callq 0x254e
movq 0x60(%rsp), %rdi
cmpq %r14, %rdi
je 0x3295
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x21b0
leaq 0x1e04(%rip), %rsi      # 0x50a0
leaq 0xe0(%rsp), %r14
leaq 0xa0(%rsp), %rdx
movq %r14, %rdi
xorl %eax, %eax
callq 0x2070
leaq 0x50(%rsp), %r15
movq %r15, -0x10(%r15)
movq %r14, %rdi
callq 0x20f0
leaq (%rsp,%rax), %rdx
addq $0xe0, %rdx
leaq 0x40(%rsp), %rdi
movq %r14, %rsi
callq 0x3796
leaq 0x40(%rsp), %rdi
movq %rsp, %rsi
callq 0x254e
movq 0x40(%rsp), %rdi
cmpq %r15, %rdi
je 0x3303
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x21b0
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x27e8
leaq 0x1d99(%rip), %rsi      # 0x50ae
leaq 0xe0(%rsp), %r14
leaq 0xa0(%rsp), %rdx
movq %r14, %rdi
xorl %eax, %eax
callq 0x2070
leaq 0x30(%rsp), %r15
movq %r15, -0x10(%r15)
movq %r14, %rdi
callq 0x20f0
leaq (%rsp,%rax), %rdx
addq $0xe0, %rdx
leaq 0x20(%rsp), %rdi
movq %r14, %rsi
callq 0x3796
leaq 0x20(%rsp), %rdi
movq %rsp, %rsi
callq 0x254e
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x337c
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x21b0
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x2988
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x33f0
movq 0x30(%rsp), %rsi
jmp 0x33e3
jmp 0x33ed
jmp 0x33ed
movq %rax, %rbx
movq 0x40(%rsp), %rdi
cmpq %r15, %rdi
je 0x33f0
movq 0x50(%rsp), %rsi
jmp 0x33e3
jmp 0x33ed
movq %rax, %rbx
movq 0x60(%rsp), %rdi
cmpq %r14, %rdi
je 0x33f0
movq 0x70(%rsp), %rsi
jmp 0x33e3
jmp 0x33ed
movq %rax, %rbx
movq 0x80(%rsp), %rdi
cmpq %r12, %rdi
je 0x33f0
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x21b0
jmp 0x33f0
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x3406
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21b0
movq %rbx, %rdi
callq 0x22d0