// File: /workspace/github_cpp_makefile_star2_O1/sjtuwrk[P]SunwayMR/tools/SunwayMRHelper.hpp
// Function: SunwayMRHelper::saveAllHostsFile()
void SunwayMRHelper::saveAllHostsFile() {
	stringstream ss;
	for(unsigned int i=0; i<allResources.size(); i++) {
		ss << allResources[i].host << " " << allResources[i].threads << " " << allResources[i].memory << " " << allResources[i].listenPort;
		if (allResources[i].host == masterAddr) {
			ss << " master";
		}
		ss << endl;

	}
	bool ret = writeFile(fileSaveDir, allHostsFileName, ss.str());
	if (!ret) {
		stringstream error;
		error << "SunwayMRHelper: unable to write file: " << fileSaveDir << allHostsFileName;
		Logging::logError(error.str());
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x398, %rsp            # imm = 0x398
movq %rdi, %rbx
leaq 0x88(%rsp), %rdi
callq 0x3240
movq 0x140(%rbx), %rax
cmpq %rax, 0x148(%rbx)
je 0xb683
movl $0x1, %ebp
leaq 0x98(%rsp), %r14
xorl %ecx, %ecx
leaq 0x3039(%rip), %r15      # 0xe58e
leaq (%rcx,%rcx,2), %r12
shlq $0x4, %r12
movq (%rax,%r12), %rsi
movq 0x8(%rax,%r12), %rdx
movq %r14, %rdi
callq 0x3400
movq %rax, %r13
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x3400
movq 0x140(%rbx), %rax
movl 0x20(%rax,%r12), %esi
movq %r13, %rdi
callq 0x3610
movq %rax, %r13
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x3400
movq 0x140(%rbx), %rax
movl 0x24(%rax,%r12), %esi
movq %r13, %rdi
callq 0x3610
movq %rax, %r13
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x3400
movq 0x140(%rbx), %rax
movl 0x28(%rax,%r12), %esi
movq %r13, %rdi
callq 0x3610
movq 0x140(%rbx), %rax
movq 0x8(%rax,%r12), %rdx
cmpq 0xf8(%rbx), %rdx
jne 0xb627
testq %rdx, %rdx
je 0xb613
addq %r12, %rax
movq 0xf0(%rbx), %rsi
movq (%rax), %rdi
callq 0x33a0
testl %eax, %eax
jne 0xb627
movl $0x7, %edx
movq %r14, %rdi
leaq 0x3225(%rip), %rsi      # 0xe847
callq 0x3400
movq 0x98(%rsp), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3360
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3220
movl %ebp, %ecx
movq 0x140(%rbx), %rax
movq 0x148(%rbx), %rdx
subq %rax, %rdx
sarq $0x4, %rdx
movabsq $-0x5555555555555555, %rsi # imm = 0xAAAAAAAAAAAAAAAB
imulq %rsi, %rdx
incl %ebp
cmpq %rcx, %rdx
ja 0xb555
leaq 0x38(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x7d6d(%rip), %rsi      # 0x13400
movq 0x7d6e(%rip), %rdx      # 0x13408
addq %rsi, %rdx
leaq 0x28(%rsp), %rdi
callq 0xc532
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x7d89(%rip), %rsi      # 0x13440
movq 0x7d8a(%rip), %rdx      # 0x13448
addq %rsi, %rdx
leaq 0x8(%rsp), %rdi
callq 0xc532
leaq 0xa0(%rsp), %rsi
leaq 0x68(%rsp), %rdi
callq 0x3590
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
leaq 0x68(%rsp), %rdx
callq 0x45bb
movl %eax, %ebx
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xb70e
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3390
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0xb725
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3390
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0xb73c
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3390
testb %bl, %bl
jne 0xb7f1
leaq 0x210(%rsp), %rdi
callq 0x3240
leaq 0x220(%rsp), %rbx
leaq 0x30a0(%rip), %rsi      # 0xe800
movl $0x26, %edx
movq %rbx, %rdi
callq 0x3400
movq 0x7c8c(%rip), %rsi      # 0x13400
movq 0x7c8d(%rip), %rdx      # 0x13408
movq %rbx, %rdi
callq 0x3400
movq 0x7cb6(%rip), %rsi      # 0x13440
movq 0x7cb7(%rip), %rdx      # 0x13448
movq %rax, %rdi
callq 0x3400
leaq 0x228(%rsp), %rsi
leaq 0x48(%rsp), %rdi
callq 0x3590
leaq 0x48(%rsp), %rdi
callq 0x58fc
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xb7d0
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3390
movq 0x77d9(%rip), %rsi      # 0x12fb0
leaq 0x210(%rsp), %rdi
callq 0x3260
leaq 0x290(%rsp), %rdi
callq 0x3150
movq 0x77b8(%rip), %rsi      # 0x12fb0
leaq 0x88(%rsp), %rdi
callq 0x3260
leaq 0x108(%rsp), %rdi
callq 0x3150
addq $0x398, %rsp            # imm = 0x398
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xb8a8
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3390
jmp 0xb8a8
jmp 0xb8a5
jmp 0xb8cb
movq %rax, %rbx
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xb86e
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3390
jmp 0xb86e
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0xb88a
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3390
jmp 0xb88a
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0xb8ce
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3390
jmp 0xb8ce
jmp 0xb8cb
movq %rax, %rbx
movq 0x7701(%rip), %rsi      # 0x12fb0
leaq 0x210(%rsp), %rdi
callq 0x3260
leaq 0x290(%rsp), %rdi
callq 0x3150
jmp 0xb8ce
movq %rax, %rbx
movq 0x76db(%rip), %rsi      # 0x12fb0
leaq 0x88(%rsp), %rdi
callq 0x3260
leaq 0x108(%rsp), %rdi
callq 0x3150
movq %rbx, %rdi
callq 0x3650