// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/hic.cpp
// Function: graph_cut(unsigned long, unsigned long, min_cut_t*)
void graph_cut(uint64_t src, uint64_t dest, min_cut_t* x)
{
    /*******************************for debug************************************/
    ///if(src == 45179) print_debug_rGraph(x);
    /*******************************for debug************************************/
    if(maxFlow(src, dest, x))
    {
        ///in the last time bfs of maxFlow, rGraphVis has already been set
        uint64_t i, j, v, u;
        hc_edge *p;
        /*******************************for debug************************************/
        if(src == 45179)
        ///if(src == 26818)
        {
            ///print_debug_rGraph(x);
            print_src_dest(src, x, "src utg:");
            print_src_dest(dest, x, "dest utg:");
        }
        /*******************************for debug************************************/
        for (i = 0; i < x->rGraphVis.n; i++)
        {
            if(x->rGraphVis.a[i] == 0) continue;
            if(!x->bmerVis.a[i]) continue;
            v = i;
            for (j = 0; j < x->rGraph.a[i].n; j++)
            {
                if(x->rGraph.a[i].a[j].del) continue;
                u = x->rGraph.a[i].a[j].uID;
                if(x->rGraphVis.a[u]) continue;
                if(!x->bmerVis.a[u]) continue;
                /*******************************for debug************************************/
                if(src == 45179) fprintf(stderr, "utg%.6lul\tutg%.6lul\t%f\n", v+1, u+1, x->rGraph.a[i].a[j].weight);    
                /*******************************for debug************************************/
                ///delete <v, u>
                x->rGraph.a[i].a[j].del = 1;
                ///delete <u, v>
                p = get_rGraph_edge(x, u, v);
                p->del = 1;
                x->c_e += 2;
            }
            
        }

        /*******************************for debug************************************/
        ///if(src == 45179 || src == 31635)
        // if(src == 26818)
        // {
        //     fprintf(stderr, "hahahaha\n");
        //     print_path(26818, 1143, x);
        // }
        /*******************************for debug************************************/
    }
    /*******************************for debug************************************/
    ///if(src == 45179 || src == 31635)
    // {
    //     print_src_dest(src, x, "++++++src utg:");
    //     uint64_t m;
    //     for (m = 0; m < x->rGraph.a[src].n; m++)
    //     {
    //         if(x->rGraph.a[src].a[m].del) continue;
    //         fprintf(stderr, "src(utg%.6dl, enz:%lu)\tdes(utg%.6dl, enz:%lu)\t%f\n", 
    //         (int)(src+1), x->enzymes[src], 
    //         (int)(x->rGraph.a[src].a[m].uID+1), x->enzymes[x->rGraph.a[src].a[m].uID], 
    //         x->rGraph.a[src].a[m].weight);   
    //     }
    // }
    /*******************************for debug************************************/
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, 0x8(%rsp)
callq 0x1423a7
testq %rax, %rax
je 0x1426a3
cmpq $0xb07b, 0x8(%rsp)      # imm = 0xB07B
je 0x1426b2
cmpq $0x0, 0xb0(%rbx)
je 0x1426a3
xorl %r15d, %r15d
movq 0xc0(%rbx), %rax
cmpb $0x0, (%rax,%r15)
je 0x142693
movq 0xf0(%rbx), %rax
cmpb $0x0, (%rax,%r15)
je 0x142693
movq 0x10(%rbx), %rax
leaq (%r15,%r15,2), %r12
cmpq $0x0, (%rax,%r12,8)
je 0x142693
leaq 0x1(%r15), %rcx
movq %rcx, 0x10(%rsp)
movl $0x18, %r13d
xorl %r14d, %r14d
movq 0x10(%rax,%r12,8), %rax
cmpb $0x0, (%rax,%r13)
js 0x142656
movl -0x10(%rax,%r13), %ebp
movq 0xc0(%rbx), %rcx
cmpb $0x0, (%rcx,%rbp)
jne 0x142656
movq 0xf0(%rbx), %rcx
cmpb $0x0, (%rcx,%rbp)
je 0x142656
cmpq $0xb07b, 0x8(%rsp)      # imm = 0xB07B
je 0x142669
movq 0x10(%rbx), %rax
movq 0x10(%rax,%r12,8), %rax
orb $-0x80, (%rax,%r13)
movq %rbx, %rdi
movq %rbp, %rsi
movq %r15, %rdx
callq 0x14147f
orb $-0x80, 0x18(%rax)
addq $0x2, 0x168(%rbx)
incq %r14
movq 0x10(%rbx), %rax
addq $0x28, %r13
cmpq (%rax,%r12,8), %r14
jb 0x1425f8
jmp 0x142693
movq 0x147970(%rip), %rcx    # 0x289fe0
movq (%rcx), %rdi
leaq 0x1(%rbp), %rcx
movsd -0x18(%rax,%r13), %xmm0
leaq 0xed19a(%rip), %rsi     # 0x22f81f
movq 0x10(%rsp), %rdx
movb $0x1, %al
callq 0x22b0
jmp 0x14262e
incq %r15
cmpq 0xb0(%rbx), %r15
jb 0x1425af
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1ceaa
jmp 0x14259e