// File: /workspace/github_cpp_makefile_star2_O3/bobverity[P]MavericK/Hungarian.cpp
// Function: augmentLeft(int, std::vector<std::vector<double, std::allocator<double>>, std::allocator<std::vector<double, std::allocator<double>>>>&, std::vector<int, std::allocator<int>>&, std::vector<int, std::allocator<int>>&, std::vector<int, std::allocator<int>>&)
vector<int> augmentLeft(int i, vector< vector<double> > &M, vector<int> &edgesRight, vector<int> &blockedLeft, vector<int> &blockedRight) {
    
    blockedLeft[i] = 1;
    vector<int> output(1,-1);
    
    // search all unmatched edges
    for (int j=0; j<int(M.size()); j++) {
        if (M[i][j]==0 && edgesRight[j]!=i && blockedRight[j]==0) {
            
            // if edge leads to augmented path then add current node to path and return
            output = augmentRight(j, M, edgesRight, blockedLeft, blockedRight);
            if (output[0]>=0) {
                output.push_back(i);
                return(output);
            }
        }
    }
    
    // if no more moves then return -1
    return(output);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %r9, %r14
movq %rcx, %r12
movq %rdx, %r13
movl %esi, %ebp
movq %rdi, %rbx
movl %esi, 0x14(%rsp)
movslq %esi, %rcx
movq %r8, 0x40(%rsp)
movq (%r8), %rax
movq %rcx, 0x38(%rsp)
movl $0x1, (%rax,%rcx,4)
movl $0x4, %edi
callq 0x3320
movq %rax, %r15
movq %rax, (%rbx)
addq $0x4, %rax
movq %rax, 0x10(%rbx)
movl $0xffffffff, (%r15)     # imm = 0xFFFFFFFF
movq %rbx, 0x8(%rsp)
movq %rax, 0x8(%rbx)
movq (%r13), %rax
movq %r13, 0x18(%rsp)
movq 0x8(%r13), %rcx
movq %rcx, %rdx
subq %rax, %rdx
shrq $0x3, %rdx
imull $0xaaaaaaab, %edx, %edx # imm = 0xAAAAAAAB
testl %edx, %edx
jle 0x5f35
movq %r14, %r9
xorl %r14d, %r14d
movq 0x38(%rsp), %rdx
leaq (%rdx,%rdx,2), %r13
movq (%rax,%r13,8), %rdx
movsd (%rdx,%r14,8), %xmm0
ucomisd 0x3023b(%rip), %xmm0    # 0x360a8
jne 0x5f16
jp 0x5f16
movq (%r12), %rdx
cmpl %ebp, (%rdx,%r14,4)
je 0x5f16
movq (%r9), %rdx
cmpl $0x0, (%rdx,%r14,4)
jne 0x5f16
leaq 0x20(%rsp), %rdi
movl %r14d, %esi
movq 0x18(%rsp), %rdx
movq %r12, %rcx
movq 0x40(%rsp), %r8
movq %r9, %rbx
callq 0x5f95
movapd 0x20(%rsp), %xmm0
movq 0x8(%rsp), %rcx
movupd %xmm0, (%rcx)
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rcx)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
testq %r15, %r15
je 0x5ef9
movq %r15, %rdi
callq 0x3310
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x5ef9
callq 0x3310
movq 0x8(%rsp), %rax
movq (%rax), %r15
cmpl $0x0, (%r15)
jns 0x5f49
movq 0x18(%rsp), %rcx
movq (%rcx), %rax
movq 0x8(%rcx), %rcx
movq %rbx, %r9
incq %r14
movq %rcx, %rdx
subq %rax, %rdx
shrq $0x3, %rdx
imull $0xaaaaaaab, %edx, %edx # imm = 0xAAAAAAAB
movslq %edx, %rdx
cmpq %rdx, %r14
jl 0x5e5b
movq 0x8(%rsp), %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rsp), %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x5f64
movl %ebp, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rdi)
jmp 0x5f35
leaq 0x14(%rsp), %rdx
callq 0x6e4e
jmp 0x5f35
movq %rax, %r14
movq 0x8(%rsp), %rax
movq (%rax), %r15
jmp 0x5f80
movq %rax, %r14
testq %r15, %r15
je 0x5f8d
movq %r15, %rdi
callq 0x3310
movq %r14, %rdi
callq 0x3580