// File: estan[P]tsp/tsp.cpp
// Function: createDistanceMatrix(std::istream&)
Matrix<uint32_t> createDistanceMatrix(istream& in) {
    // Read vertex coordinates.
    size_t N;
    in >> N;
    vector<double> x(N);
    vector<double> y(N);
    for (size_t i = 0; i < N; ++i) {
        in >> x[i] >> y[i];
    }

    // Calculate distance matrix.
    Matrix<uint32_t> d(N, N);
    for (size_t i = 0; i < N; ++i) {
        for (size_t j = i + 1; j < N; ++j) {
            d[i][j] = d[j][i] = round(sqrt(pow(x[i]-x[j], 2) + pow(y[i]-y[j], 2)));
        }
    }

    return d;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq %rdi, -0xa8(%rbp)
movq %rdi, %rax
movq %rax, -0xa0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x2170
movq -0x18(%rbp), %rax
movq %rax, -0x98(%rbp)
leaq -0x31(%rbp), %rdi
movq %rdi, -0x90(%rbp)
callq 0x36d0
movq -0x98(%rbp), %rsi
movq -0x90(%rbp), %rdx
leaq -0x30(%rbp), %rdi
callq 0x36f0
jmp 0x24d5
leaq -0x31(%rbp), %rdi
callq 0x3760
movq -0x18(%rbp), %rax
movq %rax, -0xb8(%rbp)
leaq -0x61(%rbp), %rdi
movq %rdi, -0xb0(%rbp)
callq 0x36d0
movq -0xb8(%rbp), %rsi
movq -0xb0(%rbp), %rdx
leaq -0x60(%rbp), %rdi
callq 0x36f0
jmp 0x2512
leaq -0x61(%rbp), %rdi
callq 0x3760
movq $0x0, -0x70(%rbp)
movq -0x70(%rbp), %rax
cmpq -0x18(%rbp), %rax
jae 0x25d4
movq -0x10(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0x70(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x3780
movq -0xc8(%rbp), %rdi
movq %rax, %rsi
callq 0x20d0
movq %rax, -0xc0(%rbp)
jmp 0x2561
movq -0x70(%rbp), %rsi
leaq -0x60(%rbp), %rdi
callq 0x3780
movq -0xc0(%rbp), %rdi
movq %rax, %rsi
callq 0x20d0
jmp 0x257f
jmp 0x2581
movq -0x70(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x70(%rbp)
jmp 0x2523
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x31(%rbp), %rdi
callq 0x3760
jmp 0x27e6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x61(%rbp), %rdi
callq 0x3760
jmp 0x27dd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x27d4
movq -0xa8(%rbp), %rdi
movb $0x0, -0x71(%rbp)
movq -0x18(%rbp), %rdx
movq %rdx, %rsi
callq 0x37a0
jmp 0x25ed
movq $0x0, -0x80(%rbp)
movq -0x80(%rbp), %rax
cmpq -0x18(%rbp), %rax
jae 0x279c
movq -0x80(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rax
cmpq -0x18(%rbp), %rax
jae 0x2789
movq -0x80(%rbp), %rsi
leaq -0x30(%rbp), %rdi
movq %rdi, -0xe0(%rbp)
callq 0x3780
movq -0xe0(%rbp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, -0xd8(%rbp)
movq -0x88(%rbp), %rsi
callq 0x3780
movsd -0xd8(%rbp), %xmm0
movsd (%rax), %xmm1
subsd %xmm1, %xmm0
movl $0x2, %edi
callq 0x3840
movsd %xmm0, -0xd0(%rbp)
jmp 0x267a
movq -0x80(%rbp), %rsi
leaq -0x60(%rbp), %rdi
movq %rdi, -0xf8(%rbp)
callq 0x3780
movq -0xf8(%rbp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, -0xf0(%rbp)
movq -0x88(%rbp), %rsi
callq 0x3780
movsd -0xf0(%rbp), %xmm0
movsd (%rax), %xmm1
subsd %xmm1, %xmm0
movl $0x2, %edi
callq 0x3840
movsd %xmm0, -0xe8(%rbp)
jmp 0x26d1
movsd -0xe8(%rbp), %xmm1
movsd -0xd0(%rbp), %xmm0
addsd %xmm1, %xmm0
callq 0x20c0
callq 0x2070
movq -0xa8(%rbp), %rdi
cvttsd2si %xmm0, %rax
movl %eax, -0x104(%rbp)
movl -0x88(%rbp), %esi
callq 0x3870
movq %rax, -0x100(%rbp)
jmp 0x2715
movq -0xa8(%rbp), %rdi
movq -0x100(%rbp), %rax
movl -0x104(%rbp), %edx
movq -0x80(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x80(%rbp), %esi
callq 0x3870
movq %rax, -0x110(%rbp)
jmp 0x2741
movq -0x110(%rbp), %rax
movl -0x104(%rbp), %edx
movq -0x88(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x88(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x88(%rbp)
jmp 0x2612
movq -0xa8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
callq 0x38a0
jmp 0x27d4
jmp 0x278b
movq -0x80(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x80(%rbp)
jmp 0x25f5
movb $0x1, -0x71(%rbp)
testb $0x1, -0x71(%rbp)
jne 0x27b2
movq -0xa8(%rbp), %rdi
callq 0x38a0
leaq -0x60(%rbp), %rdi
callq 0x38c0
leaq -0x30(%rbp), %rdi
callq 0x38c0
movq -0xa0(%rbp), %rax
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
leaq -0x60(%rbp), %rdi
callq 0x38c0
leaq -0x30(%rbp), %rdi
callq 0x38c0
movq -0x40(%rbp), %rdi
callq 0x21f0
nop