// File: /workspace/github_c_makefile_star2_O0/c-zhou[P]yahs/link.c
// Function: intra_link_mat_init
intra_link_mat_t *intra_link_mat_init(void *dict, uint32_t resolution, int use_gap_seq)
{
    intra_link_mat_t *link_mat;
    intra_link_t *link;
    uint32_t i, n, b, p;
    uint64_t len;

    n = use_gap_seq? ((asm_dict_t *) dict)->n : ((sdict_t *) dict)->n;
    link_mat = (intra_link_mat_t *) malloc(sizeof(intra_link_mat_t));
    link_mat->n = n;
    link_mat->links = (intra_link_t *) calloc(n, sizeof(intra_link_t));

    for (i = 0; i < n; ++i) {
        link = &link_mat->links[i];
        link->c = i;
        len = use_gap_seq? ((asm_dict_t *) dict)->s[i].len : ((sdict_t *) dict)->s[i].len;
        if (len < resolution) {
            link->n = 0;
            continue;
        }
        b = div_ceil(len, resolution);
        link->n = b;
        p = (long) b * (b + 1) / 2;
        link->link = (double *) calloc(p, sizeof(double));
        if (!link->link) {
            fprintf(stderr, "[E::%s] memory allocation failure\n", __func__);
            exit(EXIT_FAILURE);
        }

#ifdef DEBUG_INTRA
        fprintf(stderr, "[DEBUG_INTRA::%s] %s bins: %d\n", __func__, use_gap_seq? ((asm_dict_t *) dict)->s[i].name : ((sdict_t *) dict)->s[i].name, link->n);
#endif
    }

    return link_mat;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
cmpl $0x0, -0x10(%rbp)
je 0xe0a3
movq -0x8(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x3c(%rbp)
jmp 0xe0ac
movq -0x8(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movl %eax, -0x28(%rbp)
movl $0x10, %edi
callq 0x2340
movq %rax, -0x18(%rbp)
movl -0x28(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movl -0x28(%rbp), %eax
movl %eax, %edi
movl $0x10, %esi
callq 0x2290
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x28(%rbp), %eax
jae 0xe207
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x24(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movl -0x24(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
cmpl $0x0, -0x10(%rbp)
je 0xe137
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x24(%rbp), %ecx
imulq $0x58, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, -0x48(%rbp)
jmp 0xe150
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x24(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movl -0xc(%rbp), %ecx
cmpq %rcx, %rax
jae 0xe174
movq -0x20(%rbp), %rax
movl $0x0, 0x4(%rax)
jmp 0xe1f9
movq -0x38(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x2aa0
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x4(%rax)
movl -0x2c(%rbp), %eax
movl -0x2c(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, %ecx
imulq %rcx, %rax
movl $0x2, %ecx
cqto
idivq %rcx
movl %eax, -0x30(%rbp)
movl -0x30(%rbp), %eax
movl %eax, %edi
movl $0x8, %esi
callq 0x2290
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0xe1f7
movq 0x2ae23(%rip), %rax     # 0x38ff8
movq (%rax), %rdi
leaq 0x234bc(%rip), %rsi     # 0x3169b
leaq 0x234ec(%rip), %rdx     # 0x316d2
movb $0x0, %al
callq 0x22c0
movl $0x1, %edi
callq 0x24c0
jmp 0xe1f9
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xe0ea
movq -0x18(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)