// File: /workspace/github_cpp_makefile_star2_O1/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 %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbp
movq 0x90(%rsp), %rdi
movq 0x88(%rsp), %rsi
movq 0x80(%rsp), %rdx
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, (%rdi)
movq $-0x1, %rax
movq %rax, (%rsi)
movq %rax, (%rdx)
movq %r9, 0x8(%rsp)
movq %rax, (%r9)
movq %r8, 0x10(%rsp)
movq %rax, (%r8)
movq %rcx, 0x18(%rsp)
movq %rax, (%rcx)
cmpq $0x0, 0xc8(%r12)
je 0x150066
movl $0x1, %r14d
xorl %r15d, %r15d
leaq 0x40(%rsp), %rbx
movq 0xd8(%r12), %rax
shlq $0x5, %r15
cmpb $0x0, 0x18(%rax,%r15)
jne 0x150052
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 0x14fd70
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 0x150052
movq 0x90(%rsp), %rdi
movsd (%rdi), %xmm1
movsd 0x20(%rsp), %xmm0
ucomisd %xmm0, %xmm1
jbe 0x150052
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)
movl %r14d, %r15d
incl %r14d
cmpq %r15, 0xc8(%r12)
ja 0x14ff6d
movq 0x18(%rsp), %rax
cmpq $-0x1, (%rax)
je 0x1500a8
movq 0x10(%rsp), %rax
cmpq $-0x1, (%rax)
je 0x1500a8
movq 0x8(%rsp), %rax
cmpq $-0x1, (%rax)
je 0x1500a8
movq 0x80(%rsp), %rax
cmpq $-0x1, (%rax)
je 0x1500a8
movl $0x1, %eax
movq 0x88(%rsp), %rcx
cmpq $-0x1, (%rcx)
jne 0x1500aa
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq