// File: 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
movq %rsp, %rbp
subq $0x410, %rsp            # imm = 0x410
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x3b8(%rbp)
leaq -0x190(%rbp), %rdi
callq 0x4280
movl $0x0, -0x194(%rbp)
movq -0x3b8(%rbp), %rdi
movl -0x194(%rbp), %eax
movq %rax, -0x3c0(%rbp)
addq $0x140, %rdi            # imm = 0x140
callq 0xf900
movq %rax, %rcx
movq -0x3c0(%rbp), %rax
cmpq %rcx, %rax
jae 0xdb5a
movq -0x3b8(%rbp), %rdi
leaq -0x180(%rbp), %rax
movq %rax, -0x3d0(%rbp)
addq $0x140, %rdi            # imm = 0x140
movl -0x194(%rbp), %eax
movl %eax, %esi
callq 0xf930
movq -0x3d0(%rbp), %rdi
movq %rax, %rsi
callq 0x4380
movq %rax, -0x3c8(%rbp)
jmp 0xd9e4
movq -0x3c8(%rbp), %rdi
leaq 0xcb80(%rip), %rsi      # 0x1a572
callq 0x43f0
movq %rax, -0x3d8(%rbp)
jmp 0xda00
movq -0x3b8(%rbp), %rdi
addq $0x140, %rdi            # imm = 0x140
movl -0x194(%rbp), %eax
movl %eax, %esi
callq 0xf930
movq -0x3d8(%rbp), %rdi
movl 0x20(%rax), %esi
callq 0x4750
movq %rax, -0x3e0(%rbp)
jmp 0xda33
movq -0x3e0(%rbp), %rdi
leaq 0xcb31(%rip), %rsi      # 0x1a572
callq 0x43f0
movq %rax, -0x3e8(%rbp)
jmp 0xda4f
movq -0x3b8(%rbp), %rdi
addq $0x140, %rdi            # imm = 0x140
movl -0x194(%rbp), %eax
movl %eax, %esi
callq 0xf930
movq -0x3e8(%rbp), %rdi
movl 0x24(%rax), %esi
callq 0x4750
movq %rax, -0x3f0(%rbp)
jmp 0xda82
movq -0x3f0(%rbp), %rdi
leaq 0xcae2(%rip), %rsi      # 0x1a572
callq 0x43f0
movq %rax, -0x3f8(%rbp)
jmp 0xda9e
movq -0x3b8(%rbp), %rdi
addq $0x140, %rdi            # imm = 0x140
movl -0x194(%rbp), %eax
movl %eax, %esi
callq 0xf930
movq -0x3f8(%rbp), %rdi
movl 0x28(%rax), %esi
callq 0x4750
jmp 0xdaca
movq -0x3b8(%rbp), %rdi
addq $0x140, %rdi            # imm = 0x140
movl -0x194(%rbp), %eax
movl %eax, %esi
callq 0xf930
movq -0x3b8(%rbp), %rsi
movq %rax, %rdi
addq $0xf0, %rsi
callq 0xe410
testb $0x1, %al
jne 0xdb01
jmp 0xdb2f
leaq -0x180(%rbp), %rdi
leaq 0xcd1c(%rip), %rsi      # 0x1a82b
callq 0x43f0
jmp 0xdb16
jmp 0xdb2f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a0(%rbp)
movl %eax, -0x1a4(%rbp)
jmp 0xdd4a
leaq -0x180(%rbp), %rdi
movq 0x17483(%rip), %rsi     # 0x24fc0
callq 0x4440
jmp 0xdb44
jmp 0xdb46
movl -0x194(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x194(%rbp)
jmp 0xd970
leaq 0x17957(%rip), %rsi     # 0x254b8
leaq -0x1c8(%rbp), %rdi
callq 0x41a0
jmp 0xdb6f
leaq 0x17982(%rip), %rsi     # 0x254f8
leaq -0x1e8(%rbp), %rdi
callq 0x41a0
jmp 0xdb84
leaq -0x208(%rbp), %rdi
leaq -0x190(%rbp), %rsi
callq 0x43e0
jmp 0xdb99
leaq -0x1c8(%rbp), %rdi
leaq -0x1e8(%rbp), %rsi
leaq -0x208(%rbp), %rdx
callq 0x5c40
movb %al, -0x3f9(%rbp)
jmp 0xdbbb
leaq -0x208(%rbp), %rdi
callq 0x4878
leaq -0x1e8(%rbp), %rdi
callq 0x4878
leaq -0x1c8(%rbp), %rdi
callq 0x4878
movb -0x3f9(%rbp), %al
andb $0x1, %al
movb %al, -0x1a5(%rbp)
testb $0x1, -0x1a5(%rbp)
jne 0xdd35
leaq -0x390(%rbp), %rdi
callq 0x4280
jmp 0xdc08
leaq -0x380(%rbp), %rdi
leaq 0xcbce(%rip), %rsi      # 0x1a7e4
callq 0x43f0
movq %rax, -0x408(%rbp)
jmp 0xdc24
movq -0x408(%rbp), %rdi
leaq 0x17886(%rip), %rsi     # 0x254b8
callq 0x4380
movq %rax, -0x410(%rbp)
jmp 0xdc40
movq -0x410(%rbp), %rdi
leaq 0x178aa(%rip), %rsi     # 0x254f8
callq 0x4380
jmp 0xdc55
leaq -0x3b0(%rbp), %rdi
leaq -0x390(%rbp), %rsi
callq 0x43e0
jmp 0xdc6a
leaq -0x3b0(%rbp), %rdi
callq 0x7300
jmp 0xdc78
leaq -0x3b0(%rbp), %rdi
callq 0x4878
leaq -0x390(%rbp), %rdi
callq 0x42b0
jmp 0xdd35
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a0(%rbp)
movl %eax, -0x1a4(%rbp)
jmp 0xdce7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a0(%rbp)
movl %eax, -0x1a4(%rbp)
jmp 0xdcdb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a0(%rbp)
movl %eax, -0x1a4(%rbp)
leaq -0x208(%rbp), %rdi
callq 0x4878
leaq -0x1e8(%rbp), %rdi
callq 0x4878
leaq -0x1c8(%rbp), %rdi
callq 0x4878
jmp 0xdd4a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a0(%rbp)
movl %eax, -0x1a4(%rbp)
jmp 0xdd27
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a0(%rbp)
movl %eax, -0x1a4(%rbp)
leaq -0x3b0(%rbp), %rdi
callq 0x4878
leaq -0x390(%rbp), %rdi
callq 0x42b0
jmp 0xdd4a
leaq -0x190(%rbp), %rdi
callq 0x42b0
addq $0x410, %rsp            # imm = 0x410
popq %rbp
retq
leaq -0x190(%rbp), %rdi
callq 0x42b0
movq -0x1a0(%rbp), %rdi
callq 0x4780
nopw %cs:(%rax,%rax)