// File: estan[P]tsp/tsp.cpp
// Function: doubleBridge(std::vector<unsigned short, std::allocator<unsigned short>> const&)
inline vector<uint16_t> doubleBridge(const vector<uint16_t>& tour) {
    const size_t N = tour.size();
    vector<uint16_t> newTour;
    newTour.reserve(N);
    uniform_int_distribution<size_t> randomOffset(1, N / 4);
    size_t A = randomOffset(rng);
    size_t B = A + randomOffset(rng);
    size_t C = B + randomOffset(rng);
    copy(tour.begin(), tour.begin() + A, back_inserter(newTour));
    copy(tour.begin() + C, tour.end(), back_inserter(newTour));
    copy(tour.begin() + B, tour.begin() + C, back_inserter(newTour));
    copy(tour.begin() + A, tour.begin() + B, back_inserter(newTour));
    return newTour;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x180, %rsp            # imm = 0x180
movq %rdi, -0x110(%rbp)
movq %rdi, %rax
movq %rax, -0x118(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x8b90
movq -0x110(%rbp), %rdi
movq %rax, -0x18(%rbp)
movb $0x0, -0x19(%rbp)
callq 0x9820
movq -0x110(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x9840
jmp 0x7a13
movq -0x18(%rbp), %rdx
shrq $0x2, %rdx
leaq -0x40(%rbp), %rdi
movl $0x1, %esi
callq 0x9930
jmp 0x7a2b
leaq 0xaa86(%rip), %rsi      # 0x124b8
leaq -0x40(%rbp), %rdi
callq 0x9960
movq %rax, -0x120(%rbp)
jmp 0x7a44
movq -0x120(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x130(%rbp)
leaq 0xaa57(%rip), %rsi      # 0x124b8
leaq -0x40(%rbp), %rdi
callq 0x9960
movq %rax, -0x128(%rbp)
jmp 0x7a73
movq -0x128(%rbp), %rcx
movq -0x130(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x140(%rbp)
leaq 0xaa1e(%rip), %rsi      # 0x124b8
leaq -0x40(%rbp), %rdi
callq 0x9960
movq %rax, -0x138(%rbp)
jmp 0x7aac
movq -0x138(%rbp), %rcx
movq -0x140(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rdi
callq 0x8c30
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rdi
callq 0x8c30
movq %rax, -0x70(%rbp)
movq -0x48(%rbp), %rsi
leaq -0x70(%rbp), %rdi
callq 0x9a00
movq -0x110(%rbp), %rdi
movq %rax, -0x68(%rbp)
callq 0x9a40
movq %rax, -0x148(%rbp)
jmp 0x7b01
movq -0x148(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x60(%rbp), %rdi
movq -0x68(%rbp), %rsi
movq -0x78(%rbp), %rdx
callq 0x9990
movq %rax, -0x150(%rbp)
jmp 0x7b26
movq -0x150(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x10(%rbp), %rdi
callq 0x8c30
movq %rax, -0x90(%rbp)
movq -0x58(%rbp), %rsi
leaq -0x90(%rbp), %rdi
callq 0x9a00
movq %rax, -0x88(%rbp)
movq -0x10(%rbp), %rdi
callq 0x8c60
movq -0x110(%rbp), %rdi
movq %rax, -0x98(%rbp)
callq 0x9a40
movq %rax, -0x158(%rbp)
jmp 0x7b7d
movq -0x158(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0x88(%rbp), %rdi
movq -0x98(%rbp), %rsi
movq -0xa0(%rbp), %rdx
callq 0x9990
movq %rax, -0x160(%rbp)
jmp 0x7bae
movq -0x160(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0x10(%rbp), %rdi
callq 0x8c30
movq %rax, -0xb8(%rbp)
movq -0x50(%rbp), %rsi
leaq -0xb8(%rbp), %rdi
callq 0x9a00
movq %rax, -0xb0(%rbp)
movq -0x10(%rbp), %rdi
callq 0x8c30
movq %rax, -0xc8(%rbp)
movq -0x58(%rbp), %rsi
leaq -0xc8(%rbp), %rdi
callq 0x9a00
movq -0x110(%rbp), %rdi
movq %rax, -0xc0(%rbp)
callq 0x9a40
movq %rax, -0x168(%rbp)
jmp 0x7c1f
movq -0x168(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0xb0(%rbp), %rdi
movq -0xc0(%rbp), %rsi
movq -0xd0(%rbp), %rdx
callq 0x9990
movq %rax, -0x170(%rbp)
jmp 0x7c50
movq -0x170(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq -0x10(%rbp), %rdi
callq 0x8c30
movq %rax, -0xe8(%rbp)
movq -0x48(%rbp), %rsi
leaq -0xe8(%rbp), %rdi
callq 0x9a00
movq %rax, -0xe0(%rbp)
movq -0x10(%rbp), %rdi
callq 0x8c30
movq %rax, -0xf8(%rbp)
movq -0x50(%rbp), %rsi
leaq -0xf8(%rbp), %rdi
callq 0x9a00
movq -0x110(%rbp), %rdi
movq %rax, -0xf0(%rbp)
callq 0x9a40
movq %rax, -0x178(%rbp)
jmp 0x7cc1
movq -0x178(%rbp), %rax
movq %rax, -0x100(%rbp)
movq -0xe0(%rbp), %rdi
movq -0xf0(%rbp), %rsi
movq -0x100(%rbp), %rdx
callq 0x9990
movq %rax, -0x180(%rbp)
jmp 0x7cf2
movq -0x180(%rbp), %rax
movq %rax, -0x108(%rbp)
movb $0x1, -0x19(%rbp)
testb $0x1, -0x19(%rbp)
jne 0x7d32
jmp 0x7d26
movq -0x110(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0x3c20
jmp 0x7d42
movq -0x110(%rbp), %rdi
callq 0x3c20
movq -0x118(%rbp), %rax
addq $0x180, %rsp            # imm = 0x180
popq %rbp
retq
movq -0x28(%rbp), %rdi
callq 0x21f0
nopl (%rax,%rax)