// File: /workspace/github_cpp_makefile_star2_O3/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 0xb595
movl $0x1, %ebp
leaq 0x98(%rsp), %r14
xorl %ecx, %ecx
leaq 0x3157(%rip), %r15      # 0xe5be
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 0x3600
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 0x3600
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 0x3600
movq 0x140(%rbx), %rax
movq 0x8(%rax,%r12), %rdx
cmpq 0xf8(%rbx), %rdx
jne 0xb539
testq %rdx, %rdx
je 0xb525
addq %r12, %rax
movq 0xf0(%rbx), %rsi
movq (%rax), %rdi
callq 0x33a0
testl %eax, %eax
jne 0xb539
movl $0x7, %edx
movq %r14, %rdi
leaq 0x3343(%rip), %rsi      # 0xe877
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 0xb467
leaq 0x38(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x7e53(%rip), %rsi      # 0x133f8
movq 0x7e54(%rip), %rdx      # 0x13400
addq %rsi, %rdx
leaq 0x28(%rsp), %rdi
callq 0xc556
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x7e6f(%rip), %rsi      # 0x13438
movq 0x7e70(%rip), %rdx      # 0x13440
addq %rsi, %rdx
leaq 0x8(%rsp), %rdi
callq 0xc556
leaq 0xa0(%rsp), %rsi
leaq 0x68(%rsp), %rdi
callq 0x3580
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
leaq 0x68(%rsp), %rdx
callq 0x45c1
movl %eax, %ebx
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xb620
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3390
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0xb637
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3390
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0xb64e
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3390
testb %bl, %bl
jne 0xb703
leaq 0x210(%rsp), %rdi
callq 0x3240
leaq 0x220(%rsp), %rbx
leaq 0x31be(%rip), %rsi      # 0xe830
movl $0x26, %edx
movq %rbx, %rdi
callq 0x3400
movq 0x7d72(%rip), %rsi      # 0x133f8
movq 0x7d73(%rip), %rdx      # 0x13400
movq %rbx, %rdi
callq 0x3400
movq 0x7d9c(%rip), %rsi      # 0x13438
movq 0x7d9d(%rip), %rdx      # 0x13440
movq %rax, %rdi
callq 0x3400
leaq 0x228(%rsp), %rsi
leaq 0x48(%rsp), %rdi
callq 0x3580
leaq 0x48(%rsp), %rdi
callq 0x58ec
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xb6e2
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3390
movq 0x78c7(%rip), %rsi      # 0x12fb0
leaq 0x210(%rsp), %rdi
callq 0x3260
leaq 0x290(%rsp), %rdi
callq 0x3150
movq 0x78a6(%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 0xb7ba
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3390
jmp 0xb7ba
jmp 0xb7b7
jmp 0xb7dd
movq %rax, %rbx
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xb780
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3390
jmp 0xb780
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0xb79c
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3390
jmp 0xb79c
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0xb7e0
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3390
jmp 0xb7e0
jmp 0xb7dd
movq %rax, %rbx
movq 0x77ef(%rip), %rsi      # 0x12fb0
leaq 0x210(%rsp), %rdi
callq 0x3260
leaq 0x290(%rsp), %rdi
callq 0x3150
jmp 0xb7e0
movq %rax, %rbx
movq 0x77c9(%rip), %rsi      # 0x12fb0
leaq 0x88(%rsp), %rdi
callq 0x3260
leaq 0x108(%rsp), %rdi
callq 0x3150
movq %rbx, %rdi
callq 0x3640