// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/hic.cpp
// Function: get_max_block(H_partition*, G_partition*, bubble_type*, long long*, long long*, long long*, long long*, long long*, double*)
int get_max_block(H_partition* h, G_partition* g_p, bubble_type* bub, long long* min_u,
long long* min_f_bid, long long* min_f_uid, long long* min_l_bid, long long* min_l_uid, 
double* min_w)
{
    uint32_t i;
    long long f_bid, f_uid, l_bid, l_uid;
    double w;
    (*min_w) = 1;
    (*min_u) = (*min_f_bid) = (*min_f_uid) = (*min_l_bid) = (*min_l_uid) = -1;
    for (i = 0; i < bub->chain_weight.n; i++)
    {
        if(bub->chain_weight.a[i].del) continue;
        select_max_block_by_utg(h, g_p, bub, h->link, bub->chain_weight.a[i].id,
        &f_bid, &f_uid, &l_bid, &l_uid, &w);
        if(f_bid == -1 || f_uid == -1 || l_bid == -1 || l_uid == -1) continue;
        if((*min_w) > w)
        {
            (*min_w) = w;
            (*min_u) = bub->chain_weight.a[i].id;
            (*min_f_bid) = f_bid;
            (*min_f_uid) = f_uid;
            (*min_l_bid) = l_bid;
            (*min_l_uid) = l_uid;
        }
    }

    if((*min_u) != -1 && (*min_f_bid) != -1 && (*min_f_uid) != -1 && (*min_l_bid) != -1 && (*min_l_uid) != -1)
    {
        return 1;
    }

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq 0x90(%rsp), %r11
movq 0x88(%rsp), %r10
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, (%r11)
orq $-0x1, (%r10)
movq 0x80(%rsp), %rax
orq $-0x1, (%rax)
movq %r9, 0x8(%rsp)
orq $-0x1, (%r9)
movq %r8, 0x10(%rsp)
orq $-0x1, (%r8)
movq %rdx, %r12
movq %rcx, 0x18(%rsp)
orq $-0x1, (%rcx)
movq %rsi, %r13
movq %rdi, %rbp
xorl %r14d, %r14d
leaq 0x40(%rsp), %rbx
movl %r14d, %r14d
cmpq %r14, 0xc8(%r12)
jbe 0x10f3fc
movq 0xd8(%r12), %rax
movq %r14, %r15
shlq $0x5, %r15
cmpb $0x0, 0x18(%rax,%r15)
jne 0x10f3f4
addq %r15, %rax
movq 0x30(%rbp), %rcx
movl 0x10(%rax), %r8d
movq %rbp, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %rbx, %r9
leaq 0x20(%rsp), %rax
pushq %rax
leaq 0x30(%rsp), %rax
pushq %rax
leaq 0x40(%rsp), %rax
pushq %rax
leaq 0x50(%rsp), %rax
pushq %rax
callq 0x10f13b
addq $0x20, %rsp
movq 0x40(%rsp), %rax
cmpq $-0x1, %rax
sete %dl
movq 0x38(%rsp), %rcx
cmpq $-0x1, %rcx
sete %dil
orb %dl, %dil
movq 0x30(%rsp), %rdx
cmpq $-0x1, %rdx
sete %r8b
movq 0x28(%rsp), %rsi
cmpq $-0x1, %rsi
sete %r9b
orb %r8b, %r9b
orb %dil, %r9b
jne 0x10f3f4
movq 0x90(%rsp), %rdi
movsd (%rdi), %xmm1
movsd 0x20(%rsp), %xmm0
ucomisd %xmm0, %xmm1
jbe 0x10f3f4
movsd %xmm0, (%rdi)
movq 0xd8(%r12), %rdi
movq 0x10(%rdi,%r15), %rdi
movq 0x18(%rsp), %r8
movq %rdi, (%r8)
movq 0x10(%rsp), %rdi
movq %rax, (%rdi)
movq 0x8(%rsp), %rax
movq %rcx, (%rax)
movq 0x80(%rsp), %rax
movq %rdx, (%rax)
movq 0x88(%rsp), %rax
movq %rsi, (%rax)
incl %r14d
jmp 0x10f2fb
movq 0x18(%rsp), %rax
cmpq $-0x1, (%rax)
je 0x10f43e
movq 0x10(%rsp), %rax
cmpq $-0x1, (%rax)
je 0x10f43e
movq 0x8(%rsp), %rax
cmpq $-0x1, (%rax)
je 0x10f43e
movq 0x80(%rsp), %rax
cmpq $-0x1, (%rax)
je 0x10f43e
movq 0x88(%rsp), %rax
cmpq $-0x1, (%rax)
je 0x10f43e
pushq $0x1
popq %rax
jmp 0x10f440
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq