// File: /workspace/github_cpp_makefile_star2_O1/camargodev[P]n-tile-puzzle/src/InputReader.cpp
// Function: InputReader::getStateFromString(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
const UnpackedState InputReader :: getStateFromString(string str) {
    vector<string> values = split(str, ' ');
    UnpackedState state;
    Line stateLine;
    int numOfTiles = sqrt(values.size()); 
    int counter = 1;
    for (auto value : values) {
        stateLine.push_back(stoi(value));
        if (counter == numOfTiles) {
            state.push_back(stateLine);
            counter = 0;
            stateLine.clear();
        }
        counter++;
    }
    return state;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdi, %rbx
leaq 0x50(%rsp), %rcx
movb $0x20, (%rcx)
leaq 0x70(%rsp), %r14
movq %r14, %rdi
callq 0x528c
xorl %eax, %eax
movq %rax, 0x10(%rbx)
xorps %xmm0, %xmm0
movq %rbx, 0x30(%rsp)
movups %xmm0, (%rbx)
movq %rax, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
movq 0x8(%r14), %rax
subq (%r14), %rax
sarq $0x5, %rax
movq %rax, %xmm1
punpckldq 0x3a8e(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x3a96(%rip), %xmm1     # 0x9190
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x5716
sqrtsd %xmm0, %xmm0
jmp 0x571b
callq 0x2180
movq 0x70(%rsp), %r12
movq 0x78(%rsp), %rax
movq %rax, 0x40(%rsp)
cmpq %rax, %r12
je 0x5832
cvttsd2si %xmm0, %eax
movl %eax, 0x3c(%rsp)
movl $0x1, %ebx
leaq 0x60(%rsp), %r15
movq %r15, %r14
movq %r15, 0x50(%rsp)
movq (%r12), %rsi
movq 0x8(%r12), %rdx
addq %rsi, %rdx
leaq 0x50(%rsp), %rdi
callq 0x2c9c
movq 0x50(%rsp), %r13
callq 0x2030
movq %rax, %rbp
movl (%rax), %r15d
movl $0x0, (%rax)
movq %r13, %rdi
leaq 0x48(%rsp), %rsi
movl $0xa, %edx
callq 0x2270
cmpq %r13, 0x48(%rsp)
je 0x5862
movslq %eax, %rcx
cmpq %rax, %rcx
jne 0x586e
movl (%rbp), %ecx
cmpl $0x22, %ecx
je 0x586e
testl %ecx, %ecx
jne 0x57b6
movl %r15d, (%rbp)
movw %ax, 0xe(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x57d8
movw %ax, (%rsi)
addq $0x2, %rsi
movq %rsi, 0x18(%rsp)
movq %r14, %r15
jmp 0x57ea
leaq 0x10(%rsp), %rdi
leaq 0xe(%rsp), %rdx
movq %r14, %r15
callq 0x3cca
cmpl 0x3c(%rsp), %ebx
jne 0x5812
movq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x5d10
movq 0x10(%rsp), %rax
xorl %ebx, %ebx
cmpq %rax, 0x18(%rsp)
je 0x5812
movq %rax, 0x18(%rsp)
movq 0x50(%rsp), %rdi
cmpq %r15, %rdi
je 0x5821
callq 0x2200
incl %ebx
addq $0x20, %r12
cmpq 0x40(%rsp), %r12
jne 0x5745
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x5841
callq 0x2200
leaq 0x70(%rsp), %rdi
callq 0x5ccc
movq 0x30(%rsp), %rax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x395d(%rip), %rdi      # 0x91c6
callq 0x2120
leaq 0x3951(%rip), %rdi      # 0x91c6
callq 0x22a0
jmp 0x587c
movq %rax, %rbx
jmp 0x5893
movq %rax, %rbx
jmp 0x58a2
movq %rax, %rbx
cmpl $0x0, (%rbp)
jne 0x5893
movl %r15d, (%rbp)
movq 0x50(%rsp), %rdi
cmpq %r14, %rdi
je 0x58a2
callq 0x2200
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x58b1
callq 0x2200
movq 0x30(%rsp), %rdi
callq 0x2c16
leaq 0x70(%rsp), %rdi
callq 0x5ccc
movq %rbx, %rdi
callq 0x2330
nop