// File: /workspace/github_cpp_makefile_star2_O1/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 0x4351
leaq 0x110(%rbx), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x3450
movq (%r15), %rdi
leaq 0x30(%rsp), %r15
cmpq %r15, %rdi
je 0x844a
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3390
leaq 0x5c4a(%rip), %rsi      # 0xe09b
movq %r14, %rdi
callq 0x3110
leaq 0x20(%rsp), %rdi
testl %eax, %eax
je 0x8548
callq 0x3240
leaq 0x30(%rsp), %r14
leaq 0x5f39(%rip), %rsi      # 0xe3b0
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 0x3590
movq %rsp, %rdi
callq 0x56f8
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x84ca
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3390
movq 0xaadf(%rip), %rsi      # 0x12fb0
leaq 0x20(%rsp), %rdi
callq 0x3260
leaq 0xa0(%rsp), %r15
movq %r15, %rdi
callq 0x3150
movq %r14, -0x80(%r15)
leaq 0x5f0b(%rip), %rsi      # 0xe401
leaq 0x5f26(%rip), %rdx      # 0xe423
leaq 0x20(%rsp), %rdi
callq 0xc5c2
leaq 0x20(%rsp), %rdi
callq 0x56f8
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x8528
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3390
movq %rbx, %rdi
callq 0x8624
movb %al, 0x188(%rbx)
testb %al, %al
je 0x856a
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %r15, (%rdi)
leaq 0x5e2b(%rip), %rsi      # 0xe37d
leaq 0x5e56(%rip), %rdx      # 0xe3af
callq 0xc5c2
leaq 0x20(%rsp), %rdi
callq 0x58fc
jmp 0x858f
leaq 0x20(%rsp), %rdi
movq %r14, (%rdi)
leaq 0x5eab(%rip), %rsi      # 0xe424
leaq 0x5ece(%rip), %rdx      # 0xe44e
callq 0xc5c2
leaq 0x20(%rsp), %rdi
callq 0x58fc
leaq 0x20(%rsp), %rdi
callq 0x3708
movl $0x1, %edi
callq 0x3440
jmp 0x85b8
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
jne 0x85c5
jmp 0x861c
jmp 0x85d4
jmp 0x85d4
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x861c
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3390
jmp 0x861c
movq %rax, %rbx
jmp 0x861c
movq %rax, %rbx
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x85fe
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3390
jmp 0x85fe
jmp 0x85fb
movq %rax, %rbx
movq 0xa9ab(%rip), %rsi      # 0x12fb0
leaq 0x20(%rsp), %rdi
callq 0x3260
leaq 0xa0(%rsp), %rdi
callq 0x3150
movq %rbx, %rdi
callq 0x3650