// File: camargodev[P]n-tile-puzzle/src/Result.cpp
// Function: Result::writeResult(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Result :: writeResult(string fileName) {
    ofstream outFile;
    outFile.open(fileName, std::ios_base::app);

    string strResult = "";
    strResult += to_string(this->expandedNodes) + ",";
    strResult += to_string(this->optimalSolutionLenght) + ",";
    strResult += to_string(this->duration) + ",";
    strResult += to_string(this->totalHValue/max(this->counter, 1)) + ",";
    strResult += to_string(this->initialHeuristicValue);
    outFile << strResult + "\n";

    outFile.close();
}

// Assembly:
subq $0x3c8, %rsp            # imm = 0x3C8
movq %rsi, 0x30(%rsp)
movq %rdi, 0x3c0(%rsp)
movq %rsi, 0x3b8(%rsp)
movq 0x3c0(%rsp), %rax
movq %rax, 0x20(%rsp)
leaq 0x1b8(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0x3470
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %rsi
movl $0x1, %edx
callq 0x3110
jmp 0xd261
leaq 0x187(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0x34b0
movq 0x18(%rsp), %rdx
leaq 0xbdbb(%rip), %rsi      # 0x1903a
leaq 0x188(%rsp), %rdi
callq 0x3390
jmp 0xd28e
leaq 0x187(%rsp), %rdi
callq 0x3310
movq 0x20(%rsp), %rax
movl (%rax), %esi
leaq 0x140(%rsp), %rdi
callq 0xd730
jmp 0xd2b1
leaq 0xbda4(%rip), %rdx      # 0x1905c
leaq 0x160(%rsp), %rdi
leaq 0x140(%rsp), %rsi
callq 0x3ef0
jmp 0xd2cf
leaq 0x188(%rsp), %rdi
leaq 0x160(%rsp), %rsi
callq 0x3360
jmp 0xd2e6
leaq 0x160(%rsp), %rdi
callq 0x3180
leaq 0x140(%rsp), %rdi
callq 0x3180
movq 0x20(%rsp), %rax
movswl 0xc(%rax), %esi
leaq 0x100(%rsp), %rdi
callq 0xd730
jmp 0xd318
leaq 0xbd3d(%rip), %rdx      # 0x1905c
leaq 0x120(%rsp), %rdi
leaq 0x100(%rsp), %rsi
callq 0x3ef0
jmp 0xd336
leaq 0x188(%rsp), %rdi
leaq 0x120(%rsp), %rsi
callq 0x3360
jmp 0xd34d
leaq 0x120(%rsp), %rdi
callq 0x3180
leaq 0x100(%rsp), %rdi
callq 0x3180
movq 0x20(%rsp), %rax
movss 0x10(%rax), %xmm0
leaq 0xc0(%rsp), %rdi
callq 0xd870
jmp 0xd380
leaq 0xbcd5(%rip), %rdx      # 0x1905c
leaq 0xe0(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
callq 0x3ef0
jmp 0xd39e
leaq 0x188(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
callq 0x3360
jmp 0xd3b5
leaq 0xe0(%rsp), %rdi
callq 0x3180
leaq 0xc0(%rsp), %rdi
callq 0x3180
movq 0x20(%rsp), %rdi
movsd 0x30(%rdi), %xmm0
movsd %xmm0, 0x8(%rsp)
addq $0x8, %rdi
movl $0x1, 0x7c(%rsp)
leaq 0x7c(%rsp), %rsi
callq 0xd6f0
movq %rax, 0x10(%rsp)
jmp 0xd3fc
movsd 0x8(%rsp), %xmm0
movq 0x10(%rsp), %rax
cvtsi2sdl (%rax), %xmm1
divsd %xmm1, %xmm0
leaq 0x80(%rsp), %rdi
callq 0xd8c0
jmp 0xd41e
leaq 0xbc37(%rip), %rdx      # 0x1905c
leaq 0xa0(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0x3ef0
jmp 0xd43c
leaq 0x188(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0x3360
jmp 0xd453
leaq 0xa0(%rsp), %rdi
callq 0x3180
leaq 0x80(%rsp), %rdi
callq 0x3180
movq 0x20(%rsp), %rax
movswl 0x20(%rax), %esi
leaq 0x58(%rsp), %rdi
callq 0xd730
jmp 0xd482
leaq 0x188(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x3360
jmp 0xd496
leaq 0x58(%rsp), %rdi
callq 0x3180
leaq 0xbb92(%rip), %rdx      # 0x19039
leaq 0x38(%rsp), %rdi
leaq 0x188(%rsp), %rsi
callq 0xd910
jmp 0xd4bb
leaq 0x1b8(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x3290
jmp 0xd4cf
leaq 0x38(%rsp), %rdi
callq 0x3180
leaq 0x1b8(%rsp), %rdi
callq 0x33c0
jmp 0xd4e8
leaq 0x188(%rsp), %rdi
callq 0x3180
leaq 0x1b8(%rsp), %rdi
callq 0x33f0
addq $0x3c8, %rsp            # imm = 0x3C8
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b0(%rsp)
movl %eax, 0x1ac(%rsp)
jmp 0xd6ce
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b0(%rsp)
movl %eax, 0x1ac(%rsp)
leaq 0x187(%rsp), %rdi
callq 0x3310
jmp 0xd6ce
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b0(%rsp)
movl %eax, 0x1ac(%rsp)
jmp 0xd6c1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b0(%rsp)
movl %eax, 0x1ac(%rsp)
jmp 0xd599
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b0(%rsp)
movl %eax, 0x1ac(%rsp)
leaq 0x160(%rsp), %rdi
callq 0x3180
leaq 0x140(%rsp), %rdi
callq 0x3180
jmp 0xd6c1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b0(%rsp)
movl %eax, 0x1ac(%rsp)
jmp 0xd5e2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b0(%rsp)
movl %eax, 0x1ac(%rsp)
leaq 0x120(%rsp), %rdi
callq 0x3180
leaq 0x100(%rsp), %rdi
callq 0x3180
jmp 0xd6c1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b0(%rsp)
movl %eax, 0x1ac(%rsp)
jmp 0xd62b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b0(%rsp)
movl %eax, 0x1ac(%rsp)
leaq 0xe0(%rsp), %rdi
callq 0x3180
leaq 0xc0(%rsp), %rdi
callq 0x3180
jmp 0xd6c1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b0(%rsp)
movl %eax, 0x1ac(%rsp)
jmp 0xd674
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b0(%rsp)
movl %eax, 0x1ac(%rsp)
leaq 0xa0(%rsp), %rdi
callq 0x3180
leaq 0x80(%rsp), %rdi
callq 0x3180
jmp 0xd6c1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b0(%rsp)
movl %eax, 0x1ac(%rsp)
leaq 0x58(%rsp), %rdi
callq 0x3180
jmp 0xd6c1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b0(%rsp)
movl %eax, 0x1ac(%rsp)
leaq 0x38(%rsp), %rdi
callq 0x3180
leaq 0x188(%rsp), %rdi
callq 0x3180
leaq 0x1b8(%rsp), %rdi
callq 0x33f0
movq 0x1b0(%rsp), %rdi
callq 0x34a0
nopl (%rax,%rax)