// File: camargodev[P]n-tile-puzzle/Main.cpp
// Function: main
int main(int argc, char** argv)
{   
    StateManager manager;
    InputReader reader;
    Input input = reader.parseInput(argc, argv);

    string fileName = currentTime() + argv[1] + ".csv";

    for (auto unpackedState : input.states) {
        PackedState state = manager.pack(unpackedState);
        Result result = processAlgorithm(input.algorithm, state);
        result.printResult(); 
        result.writeResult(fileName);
    }
    return 0;
    
}

// Assembly:
subq $0x178, %rsp            # imm = 0x178
movl $0x0, 0x174(%rsp)
movl %edi, 0x170(%rsp)
movq %rsi, 0x168(%rsp)
leaq 0x150(%rsp), %rdi
callq 0x3eb0
leaq 0x14c(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x3ed0
movq 0x8(%rsp), %rsi
movl 0x170(%rsp), %edx
movq 0x168(%rsp), %rcx
leaq 0x128(%rsp), %rdi
callq 0xea50
leaq 0xc8(%rsp), %rdi
callq 0x39c0
jmp 0x3be0
movq 0x168(%rsp), %rax
movq 0x8(%rax), %rdx
leaq 0xe8(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
callq 0x3ef0
jmp 0x3c03
leaq 0x1541a(%rip), %rdx     # 0x19024
leaq 0x108(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
callq 0x3ef0
jmp 0x3c21
leaq 0xe8(%rsp), %rdi
callq 0x3180
leaq 0xc8(%rsp), %rdi
callq 0x3180
leaq 0x128(%rsp), %rax
movq %rax, 0xb0(%rsp)
movq 0xb0(%rsp), %rdi
callq 0x3f40
movq %rax, 0xa8(%rsp)
movq 0xb0(%rsp), %rdi
callq 0x3f70
movq %rax, 0xa0(%rsp)
leaq 0xa8(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0x3fa0
testb $0x1, %al
jne 0x3c93
jmp 0x3e47
leaq 0xa8(%rsp), %rdi
callq 0x3fe0
movq %rax, %rsi
leaq 0x88(%rsp), %rdi
callq 0x3ff0
jmp 0x3cb2
leaq 0x68(%rsp), %rdi
leaq 0x88(%rsp), %rsi
callq 0x3ff0
jmp 0x3cc6
leaq 0x150(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x58e0
movq %rax, (%rsp)
jmp 0x3cde
leaq 0x68(%rsp), %rdi
callq 0x40f0
movq (%rsp), %rax
movq %rax, 0x80(%rsp)
movl 0x140(%rsp), %esi
movq 0x80(%rsp), %rdx
leaq 0x30(%rsp), %rdi
callq 0x3880
jmp 0x3d0f
leaq 0x30(%rsp), %rdi
callq 0xcdf0
jmp 0x3d1b
leaq 0x10(%rsp), %rdi
leaq 0x108(%rsp), %rsi
callq 0x30f0
jmp 0x3d2f
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0xd210
jmp 0x3d40
leaq 0x10(%rsp), %rdi
callq 0x3180
leaq 0x88(%rsp), %rdi
callq 0x40f0
leaq 0xa8(%rsp), %rdi
callq 0x4150
jmp 0x3c75
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc0(%rsp)
movl %eax, 0xbc(%rsp)
jmp 0x3e88
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc0(%rsp)
movl %eax, 0xbc(%rsp)
jmp 0x3db9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc0(%rsp)
movl %eax, 0xbc(%rsp)
leaq 0xe8(%rsp), %rdi
callq 0x3180
leaq 0xc8(%rsp), %rdi
callq 0x3180
jmp 0x3e88
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc0(%rsp)
movl %eax, 0xbc(%rsp)
jmp 0x3e7b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc0(%rsp)
movl %eax, 0xbc(%rsp)
jmp 0x3e38
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc0(%rsp)
movl %eax, 0xbc(%rsp)
leaq 0x68(%rsp), %rdi
callq 0x40f0
jmp 0x3e38
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc0(%rsp)
movl %eax, 0xbc(%rsp)
leaq 0x10(%rsp), %rdi
callq 0x3180
leaq 0x88(%rsp), %rdi
callq 0x40f0
jmp 0x3e7b
movl $0x0, 0x174(%rsp)
leaq 0x108(%rsp), %rdi
callq 0x3180
leaq 0x128(%rsp), %rdi
callq 0x4170
movl 0x174(%rsp), %eax
addq $0x178, %rsp            # imm = 0x178
retq
leaq 0x108(%rsp), %rdi
callq 0x3180
leaq 0x128(%rsp), %rdi
callq 0x4170
movq 0xc0(%rsp), %rdi
callq 0x34a0
nopw %cs:(%rax,%rax)
nopl (%rax)