// File: cfiutak1[P]HPyC-KD-Tree/main.cpp
// Function: main
int main(int argc, char** argv) {
    if (argc != 4) {
        printf("Error: Invalid number of arguments (got %d, expected 44)\n", argc);

        return 1;
    }

    std::string training_file_name = argv[1];
    if (!file_exists(training_file_name)) {
        printf("Error: Could not find training file <%s>\n", training_file_name.c_str());

        return 1;
    }

    std::string query_file_name = argv[2];
    if (!file_exists(query_file_name)) {
        printf("Error: Could not find query file <%s>\n", query_file_name.c_str());

        return 1;
    }

    std::string result_file_name = argv[3];

    TrainingFileProcessor training_file_processor(training_file_name);
    QueryFileProcessor query_file_processor(query_file_name);

    runNearestNeighbors(training_file_processor, query_file_processor, result_file_name);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x5a0, %rsp            # imm = 0x5A0
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x4, -0x8(%rbp)
je 0x28bc
movl -0x8(%rbp), %esi
leaq 0x57af(%rip), %rdi      # 0x8058
movb $0x0, %al
callq 0x2050
movl $0x1, -0x4(%rbp)
jmp 0x2b56
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x568(%rbp)
leaq -0x31(%rbp), %rdi
movq %rdi, -0x560(%rbp)
callq 0x22b0
movq -0x568(%rbp), %rsi
movq -0x560(%rbp), %rdx
leaq -0x30(%rbp), %rdi
callq 0x3610
jmp 0x28f4
leaq -0x31(%rbp), %rdi
callq 0x21a0
leaq -0x30(%rbp), %rdi
callq 0x36c0
movb %al, -0x569(%rbp)
jmp 0x290e
movb -0x569(%rbp), %al
testb $0x1, %al
jne 0x2974
jmp 0x291a
leaq -0x30(%rbp), %rdi
callq 0x20b0
movq %rax, %rsi
leaq 0x5765(%rip), %rdi      # 0x8092
xorl %eax, %eax
callq 0x2050
jmp 0x2936
movl $0x1, -0x4(%rbp)
movl $0x1, -0x48(%rbp)
jmp 0x2b4d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x31(%rbp), %rdi
callq 0x21a0
jmp 0x2c2e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x2c25
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x580(%rbp)
leaq -0x69(%rbp), %rdi
movq %rdi, -0x578(%rbp)
callq 0x22b0
movq -0x580(%rbp), %rsi
movq -0x578(%rbp), %rdx
leaq -0x68(%rbp), %rdi
callq 0x3610
jmp 0x29ac
leaq -0x69(%rbp), %rdi
callq 0x21a0
leaq -0x68(%rbp), %rdi
callq 0x36c0
movb %al, -0x581(%rbp)
jmp 0x29c6
movb -0x581(%rbp), %al
testb $0x1, %al
jne 0x2a2c
jmp 0x29d2
leaq -0x68(%rbp), %rdi
callq 0x20b0
movq %rax, %rsi
leaq 0x56d7(%rip), %rdi      # 0x80bc
xorl %eax, %eax
callq 0x2050
jmp 0x29ee
movl $0x1, -0x4(%rbp)
movl $0x1, -0x48(%rbp)
jmp 0x2b44
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x69(%rbp), %rdi
callq 0x21a0
jmp 0x2c25
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x2c1c
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x598(%rbp)
leaq -0x91(%rbp), %rdi
movq %rdi, -0x590(%rbp)
callq 0x22b0
movq -0x598(%rbp), %rsi
movq -0x590(%rbp), %rdx
leaq -0x90(%rbp), %rdi
callq 0x3610
jmp 0x2a6a
leaq -0x91(%rbp), %rdi
callq 0x21a0
leaq -0x2e8(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x20c0
jmp 0x2a88
leaq -0x2c8(%rbp), %rdi
leaq -0x2e8(%rbp), %rsi
callq 0x3700
jmp 0x2a9d
leaq -0x2e8(%rbp), %rdi
callq 0x20f0
leaq -0x538(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x20c0
jmp 0x2abb
leaq -0x518(%rbp), %rdi
leaq -0x538(%rbp), %rsi
callq 0x3770
jmp 0x2ad0
leaq -0x538(%rbp), %rdi
callq 0x20f0
leaq -0x558(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x20c0
jmp 0x2af1
leaq -0x2c8(%rbp), %rdi
leaq -0x518(%rbp), %rsi
leaq -0x558(%rbp), %rdx
callq 0x24d0
jmp 0x2b0d
leaq -0x558(%rbp), %rdi
callq 0x20f0
leaq -0x518(%rbp), %rdi
callq 0x37e0
leaq -0x2c8(%rbp), %rdi
callq 0x3800
leaq -0x90(%rbp), %rdi
callq 0x20f0
movl $0x0, -0x48(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x20f0
leaq -0x30(%rbp), %rdi
callq 0x20f0
movl -0x4(%rbp), %eax
addq $0x5a0, %rsp            # imm = 0x5A0
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x91(%rbp), %rdi
callq 0x21a0
jmp 0x2c1c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x2c10
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x2e8(%rbp), %rdi
callq 0x20f0
jmp 0x2c10
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x2c04
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x538(%rbp), %rdi
callq 0x20f0
jmp 0x2c04
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x2bf8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x558(%rbp), %rdi
callq 0x20f0
leaq -0x518(%rbp), %rdi
callq 0x37e0
leaq -0x2c8(%rbp), %rdi
callq 0x3800
leaq -0x90(%rbp), %rdi
callq 0x20f0
leaq -0x68(%rbp), %rdi
callq 0x20f0
leaq -0x30(%rbp), %rdi
callq 0x20f0
movq -0x40(%rbp), %rdi
callq 0x22a0
nopw (%rax,%rax)