// File: /workspace/github_cpp_makefile_star2_O3/sjtuwrk[P]SunwayMR/tools/SunwayMRHelper.hpp
// Function: SunwayMRHelper::start(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, int, int)
void SunwayMRHelper::start(string masterAddr, int masterListenPort, int threads, int memory) {
	this->masterAddr = masterAddr;
	this->masterListenPort = masterListenPort;
	this->threads = threads;
	this->memory = memory;
	this->localAddr = getLocalHost();

	if (localAddr == "") {
		Logging::logError("SunwayMRHelper: failed to obtain local IP address.");
		exit(1);
	} else {
		stringstream ipinfo;
		ipinfo << "SunwayMRHelper: local IP is " << localAddr;
		Logging::logInfo(ipinfo.str());
	}

	Logging::logInfo("SunwayMRHelper: starting listening");
	listening = init();
	if (!listening) {
		Logging::logError("SunwayMRHelper: failed to start listening.");
		exit(1);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
movl %r8d, %ebp
movl %ecx, %r14d
movl %edx, %r15d
movq %rdi, %rbx
addq $0xf0, %rdi
callq 0x31e0
movl %r15d, 0x130(%rbx)
movl %r14d, 0x134(%rbx)
movl %ebp, 0x138(%rbx)
leaq 0x20(%rsp), %r15
movq %r15, %rdi
callq 0x4357
leaq 0x110(%rbx), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x3450
movq (%r15), %rdi
leaq 0x30(%rsp), %r15
cmpq %r15, %rdi
je 0x837c
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3390
leaq 0x5d48(%rip), %rsi      # 0xe0cb
movq %r14, %rdi
callq 0x3110
leaq 0x20(%rsp), %rdi
testl %eax, %eax
je 0x847a
callq 0x3240
leaq 0x30(%rsp), %r14
leaq 0x6037(%rip), %rsi      # 0xe3e0
movl $0x1c, %edx
movq %r14, %rdi
callq 0x3400
movq 0x110(%rbx), %rsi
movq 0x118(%rbx), %rdx
movq %r14, %rdi
callq 0x3400
leaq 0x38(%rsp), %rsi
movq %rsp, %rdi
callq 0x3580
movq %rsp, %rdi
callq 0x56e8
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x83fc
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3390
movq 0xabad(%rip), %rsi      # 0x12fb0
leaq 0x20(%rsp), %rdi
callq 0x3260
leaq 0xa0(%rsp), %r15
movq %r15, %rdi
callq 0x3150
movq %r14, -0x80(%r15)
leaq 0x6009(%rip), %rsi      # 0xe431
leaq 0x6024(%rip), %rdx      # 0xe453
leaq 0x20(%rsp), %rdi
callq 0xc5ec
leaq 0x20(%rsp), %rdi
callq 0x56e8
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x845a
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3390
movq %rbx, %rdi
callq 0x8556
movb %al, 0x188(%rbx)
testb %al, %al
je 0x849c
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %r15, (%rdi)
leaq 0x5f29(%rip), %rsi      # 0xe3ad
leaq 0x5f54(%rip), %rdx      # 0xe3df
callq 0xc5ec
leaq 0x20(%rsp), %rdi
callq 0x58ec
jmp 0x84c1
leaq 0x20(%rsp), %rdi
movq %r14, (%rdi)
leaq 0x5fa9(%rip), %rsi      # 0xe454
leaq 0x5fcc(%rip), %rdx      # 0xe47e
callq 0xc5ec
leaq 0x20(%rsp), %rdi
callq 0x58ec
leaq 0x20(%rsp), %rdi
callq 0x36f8
movl $0x1, %edi
callq 0x3440
jmp 0x84ea
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
jne 0x84f7
jmp 0x854e
jmp 0x8506
jmp 0x8506
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x854e
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3390
jmp 0x854e
movq %rax, %rbx
jmp 0x854e
movq %rax, %rbx
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x8530
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3390
jmp 0x8530
jmp 0x852d
movq %rax, %rbx
movq 0xaa79(%rip), %rsi      # 0x12fb0
leaq 0x20(%rsp), %rdi
callq 0x3260
leaq 0xa0(%rsp), %rdi
callq 0x3150
movq %rbx, %rdi
callq 0x3640