// File: /workspace/github_cpp_makefile_star2_O1/ekg[P]sgd2/src/sgd2.hpp
// Function: sgd2::maxmin_bfs_unweighted(std::vector<std::vector<unsigned long, std::allocator<unsigned long>>, std::allocator<std::vector<unsigned long, std::allocator<unsigned long>>>> const&, unsigned long, std::vector<unsigned long, std::allocator<unsigned long>>&, std::vector<unsigned long, std::allocator<unsigned long>>&)
void maxmin_bfs_unweighted(const std::vector<std::vector<uint64_t>>& graph, const uint64_t p, std::vector<uint64_t>& mins, std::vector<uint64_t>& argmins)
{
    uint64_t n = graph.size();
    std::queue<uint64_t> q;
    std::vector<uint64_t> d(n, -1);

    q.push(p);
    d[p] = 0;
    while (!q.empty())
    {
        uint64_t current = q.front();
        q.pop();
        for (uint64_t next : graph[current])
        {
            if (d[next] == -1)
            {
                q.push(next);
                d[next] = d[current] + 1;
                if (d[next] < mins[next])
                {
                    mins[next] = d[next];
                    argmins[next] = p;
                }
            }
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, -0x40(%rbp)
movq 0x8(%rdi), %rax
movq %rdi, -0xb8(%rbp)
subq (%rdi), %rax
sarq $0x3, %rax
movabsq $-0x5555555555555555, %r12 # imm = 0xAAAAAAAAAAAAAAAB
imulq %rax, %r12
xorps %xmm0, %xmm0
leaq -0xb0(%rbp), %rdi
movaps %xmm0, 0x40(%rdi)
movaps %xmm0, 0x30(%rdi)
movaps %xmm0, 0x20(%rdi)
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, (%rdi)
xorl %esi, %esi
callq 0x8eec
leaq -0x38(%rbp), %rdx
movq $-0x1, (%rdx)
leaq -0x58(%rbp), %rdi
leaq -0x29(%rbp), %rcx
movq %r12, %rsi
callq 0x7c2e
movq -0x80(%rbp), %rax
movq -0x70(%rbp), %rcx
addq $-0x8, %rcx
cmpq %rcx, %rax
je 0x4578
movq -0x40(%rbp), %rcx
movq %rcx, (%rax)
addq $0x8, %rax
movq %rax, -0x80(%rbp)
jmp 0x4588
leaq -0xb0(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x9074
movq -0x40(%rbp), %rax
movq -0x58(%rbp), %rcx
movq $0x0, (%rcx,%rax,8)
movq -0xa0(%rbp), %rax
cmpq %rax, -0x80(%rbp)
je 0x46a6
movq (%rax), %r15
movq -0x90(%rbp), %rcx
addq $-0x8, %rcx
cmpq %rcx, %rax
je 0x45c2
addq $0x8, %rax
jmp 0x45fe
movq -0x98(%rbp), %rdi
movl $0x200, %esi            # imm = 0x200
callq 0x2180
movq -0x88(%rbp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, -0x88(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x98(%rbp)
leaq 0x200(%rax), %rcx
movq %rcx, -0x90(%rbp)
movq %rax, -0xa0(%rbp)
movq -0xb8(%rbp), %rax
movq (%rax), %rax
leaq (%r15,%r15,2), %rcx
movq (%rax,%rcx,8), %r12
movq 0x8(%rax,%rcx,8), %r13
cmpq %r13, %r12
je 0x4598
movq (%r12), %rax
movq %rax, -0x38(%rbp)
movq -0x58(%rbp), %rcx
cmpq $-0x1, (%rcx,%rax,8)
jne 0x469d
movq -0x80(%rbp), %rcx
movq -0x70(%rbp), %rdx
addq $-0x8, %rdx
cmpq %rdx, %rcx
je 0x4656
movq %rax, (%rcx)
addq $0x8, %rcx
movq %rcx, -0x80(%rbp)
jmp 0x4666
leaq -0xb0(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x9074
movq -0x58(%rbp), %rcx
movq (%rcx,%r15,8), %rax
incq %rax
movq -0x38(%rbp), %rdx
movq %rax, (%rcx,%rdx,8)
movq -0x38(%rbp), %rax
movq (%rcx,%rax,8), %rcx
movq (%r14), %rdx
cmpq (%rdx,%rax,8), %rcx
jae 0x469d
movq %rcx, (%rdx,%rax,8)
movq -0x40(%rbp), %rax
movq -0x38(%rbp), %rcx
movq (%rbx), %rdx
movq %rax, (%rdx,%rcx,8)
addq $0x8, %r12
jmp 0x461c
movq -0x58(%rbp), %rdi
testq %rdi, %rdi
je 0x46bb
movq -0x48(%rbp), %rsi
subq %rdi, %rsi
callq 0x2180
leaq -0xb0(%rbp), %rdi
callq 0x84d6
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x46e0
movq %rax, %rbx
jmp 0x46f8
movq %rax, %rbx
movq -0x58(%rbp), %rdi
testq %rdi, %rdi
je 0x46f8
movq -0x48(%rbp), %rsi
subq %rdi, %rsi
callq 0x2180
leaq -0xb0(%rbp), %rdi
callq 0x84d6
movq %rbx, %rdi
callq 0x2240