// File: chhylp123[P]hifiasm/gfa_ut.cpp
// Function: realloc_rdb_adv(All_reads*, all_ul_t*, ma_sub_t**, R_to_U*, unsigned long*, unsigned long, unsigned long, char*, asg_t*, ug_opt_t*, ma_ug_t*, usc_t*)
void realloc_rdb_adv(All_reads* rdb, all_ul_t *x, ma_sub_t **cov, R_to_U *ruI, uint64_t *rmap, 
uint64_t rid_n, uint64_t scaf_len, char *scaf_id, asg_t *ng, ug_opt_t *uopt, ma_ug_t *raw_g, usc_t *a)
{
    uint64_t i, rid_n0 = rdb->total_reads, tname, cname; usc_t *z; 
    uint64_t scaf_id_len = strlen(scaf_id); char *des, *src; int64_t nlen, ff;
    UC_Read g_read; init_UC_Read(&g_read);
    rdb->total_reads = rid_n;
    tname = rdb->name_index[rid_n0];
    fprintf(stderr, "+[M::%s] rid_n0::%lu, rid_n::%lu\n", __func__, rid_n0, rid_n);
    ///for read bases
    REALLOC(rdb->N_site, rdb->total_reads);
    REALLOC(rdb->read_length, rdb->total_reads);
    REALLOC(rdb->read_size, rdb->total_reads);
    REALLOC(rdb->read_sperate, rdb->total_reads);
    REALLOC(rdb->trio_flag, rdb->total_reads);
    REALLOC(rdb->name_index, rdb->total_reads+1);///total_reads+1
    REALLOC((*cov), rdb->total_reads);
    if(uopt->te) {
        assert(uopt->te->n == rid_n0);
        uopt->te->n = rdb->total_reads;
        REALLOC(uopt->te->hh, rdb->total_reads);
    }
    for (i = rid_n0; i < rdb->total_reads; i++) {
        // fprintf(stderr, "[M::%s] i::%lu\n", __func__, i);
        rdb->N_site[i] = NULL;
        rdb->trio_flag[i] = AMBIGU;
        (*cov)[i].c = (*cov)[i].del = 0; 
        // rdb->read_length[i] = scaf_len;
        // rdb->read_size[i] = scaf_len;
        // (*cov)[i].s = 0; (*cov)[i].e = scaf_len;
        // cname = scaf_id_len;
        if(rmap[i] != ((uint64_t)-1)) {///not a scaffold node
            if(rdb->N_site[rmap[i]] != NULL) {
                MALLOC(rdb->N_site[i], rdb->N_site[rmap[i]][0]+1);
                memcpy(rdb->N_site[i], rdb->N_site[rmap[i]], 
                    sizeof((*(rdb->N_site[i])))*(rdb->N_site[rmap[i]][0]+1));
            }
            rdb->read_length[i] = rdb->read_length[rmap[i]];
            rdb->read_size[i] = rdb->read_length[rmap[i]];
            (*cov)[i].s = (*cov)[rmap[i]].s; 
            (*cov)[i].e = (*cov)[rmap[i]].e;
            rdb->trio_flag[i] = rdb->trio_flag[rmap[i]];
            (*cov)[i] = (*cov)[rmap[i]];
            cname = Get_NAME_LENGTH((*rdb), (rmap[i]));
            if(uopt->te) uopt->te->hh[i] = uopt->te->hh[rmap[i]];
        } else {
            z = &(a[(i-ng->r_seq)]); assert(z->nid == i); cname = scaf_id_len;
            if(reset_scaf_node_uinfo_srt_t(z, uopt->min_ovlp, scaf_len, &nlen) == 2) {
                cname = UL_INF.nid.a[z->ulid>>1].n;///ul name length
            }
            rdb->read_length[i] = nlen;
            rdb->read_size[i] = nlen;
            (*cov)[i].s = 0; (*cov)[i].e = nlen;
            ng->seq[i].len = nlen;///update length for the scaffold node
            if(uopt->te) uopt->te->hh[i] = 0;
        } 
        rdb->name_index[i] = tname; tname += cname;
        rdb->total_reads_bases += rdb->read_length[i];

        MALLOC(rdb->read_sperate[i], (rdb->read_length[i]/4+1));
        if(rmap[i] != ((uint64_t)-1)) {///not a scaffold node
            memcpy(rdb->read_sperate[i], rdb->read_sperate[rmap[i]], 
                sizeof((*(rdb->read_sperate[i])))*(rdb->read_length[i]/4+1));
        } else {
            ///set to A
            z = &(a[(i-ng->r_seq)]); assert(z->nid == i);
            ff = push_scaf_bases(rdb->read_sperate[i], &(rdb->N_site[i]), rdb, x, z, uopt->min_ovlp, scaf_len, rdb->read_length[i], &g_read, rmap, raw_g);
            if(ff == 1) ng->seq[i].del = 1;///could directly reuse HiFi; no need new node
            // memset(rdb->read_sperate[i], 0, sizeof((*(rdb->read_sperate[i])))*(rdb->read_length[i]/4+1));
        }
        ng->seq[i].len = rdb->read_length[i];
    }

    rdb->index_size = rdb->total_reads;
    rdb->name_index[i] = tname; 
    rdb->total_name_length = tname; 
    rdb->name_index_size = rdb->total_reads+1;
    REALLOC(rdb->name, tname);
    for (i = rid_n0; i < rdb->total_reads; i++) {///only need to update names for new reads
        des = Get_NAME((*rdb), i); 
        if(rmap[i] != ((uint64_t)-1)) {
            src = Get_NAME((*rdb), rmap[i]); cname = Get_NAME_LENGTH((*rdb), (rmap[i]));
        } else {
            z = &(a[(i-ng->r_seq)]); assert(z->nid == i);
            if(reset_scaf_node_uinfo_srt_t(z, uopt->min_ovlp, scaf_len, &nlen) == 2) {
                cname = UL_INF.nid.a[z->ulid>>1].n;///ul name length
                src = UL_INF.nid.a[z->ulid>>1].a;
            } else {
                src = scaf_id; cname = scaf_id_len;
            }
            // assert(nlen == (int64_t)cname);
        }
        memcpy(des, src, sizeof((*(des)))*cname);
    }

    REALLOC(rdb->paf, rdb->total_reads); 
    memset(rdb->paf+rid_n0, 0, (rdb->total_reads-rid_n0)*sizeof((*rdb->paf)));
    REALLOC(rdb->reverse_paf, rdb->total_reads);
    memset(rdb->reverse_paf+rid_n0, 0, (rdb->total_reads-rid_n0)*sizeof((*rdb->reverse_paf)));

    ruI->len = rdb->total_reads;
    REALLOC(ruI->index, ruI->len); 
    memset(ruI->index, -1, sizeof((*(ruI->index)))*(ruI->len));

    reset_bub_label_t(uopt->b_mask_t, ng, 0, 0);
    uopt->coverage_cut = (*cov);
    uopt->reverse_sources = rdb->reverse_paf;
    uopt->sources = rdb->paf;
    destory_UC_Read(&g_read);
    fprintf(stderr, "-[M::%s] rid_n0::%lu, rid_n::%lu\n", __func__, rid_n0, rid_n);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0xd0, %rsp
movq 0x38(%rbp), %rax
movq 0x30(%rbp), %rax
movq 0x28(%rbp), %rax
movq 0x20(%rbp), %rax
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
movq %rdx, -0x28(%rbp)
movq %rcx, -0x30(%rbp)
movq %r8, -0x38(%rbp)
movq %r9, -0x40(%rbp)
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rax
movq %rax, -0x50(%rbp)
movq 0x18(%rbp), %rdi
callq 0x20a0
movq %rax, -0x70(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x9850
movq -0x40(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x50(%rax)
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x50(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x58(%rbp)
movq 0x5e1b6(%rip), %rax     # 0x3c3fe0
movq (%rax), %rdi
movq -0x50(%rbp), %rcx
movq -0x40(%rbp), %r8
leaq 0x348ab(%rip), %rsi     # 0x39a6e7
leaq 0x348c6(%rip), %rdx     # 0x39a709
movb $0x0, %al
callq 0x22a0
movq -0x18(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rsi
shlq $0x0, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rsi
addq $0x1, %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x40(%rax)
movq -0x28(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rax
imulq $0xc, 0x50(%rax), %rsi
callq 0x2360
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq 0x28(%rbp), %rax
cmpq $0x0, 0x70(%rax)
je 0x365fbf
movq 0x28(%rbp), %rax
movq 0x70(%rax), %rax
movq (%rax), %rax
cmpq -0x50(%rbp), %rax
jne 0x365f61
jmp 0x365f80
leaq 0x347b1(%rip), %rdi     # 0x39a719
leaq 0x3024a(%rip), %rsi     # 0x3961b9
movl $0x3959, %edx           # imm = 0x3959
leaq 0x347b4(%rip), %rcx     # 0x39a72f
callq 0x2130
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rcx
movq 0x28(%rbp), %rax
movq 0x70(%rax), %rax
movq %rcx, (%rax)
movq 0x28(%rbp), %rax
movq 0x70(%rax), %rax
movq 0x10(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rsi
shlq $0x0, %rsi
callq 0x2360
movq %rax, %rcx
movq 0x28(%rbp), %rax
movq 0x70(%rax), %rax
movq %rcx, 0x10(%rax)
movq -0x50(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq -0x18(%rbp), %rcx
cmpq 0x50(%rcx), %rax
jae 0x3665b1
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x48(%rbp), %rcx
movq $0x0, (%rax,%rcx,8)
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x48(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x28(%rbp), %rax
movq (%rax), %rax
imulq $0xc, -0x48(%rbp), %rcx
addq %rcx, %rax
movl (%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
orl $0x0, %ecx
movl %ecx, (%rax)
movq -0x28(%rbp), %rax
movq (%rax), %rax
imulq $0xc, -0x48(%rbp), %rcx
addq %rcx, %rax
movb $0x0, 0x8(%rax)
movq -0x38(%rbp), %rax
movq -0x48(%rbp), %rcx
cmpq $-0x1, (%rax,%rcx,8)
je 0x366269
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x38(%rbp), %rcx
movq -0x48(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
cmpq $0x0, (%rax,%rcx,8)
je 0x3660e2
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x38(%rbp), %rcx
movq -0x48(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax), %rdi
addq $0x1, %rdi
shlq $0x3, %rdi
callq 0x2270
movq %rax, %rdx
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x48(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x48(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x38(%rbp), %rcx
movq -0x48(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movq (%rax,%rcx,8), %rsi
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x38(%rbp), %rcx
movq -0x48(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax), %rdx
addq $0x1, %rdx
shlq $0x3, %rdx
callq 0x2180
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x38(%rbp), %rcx
movq -0x48(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movq (%rax,%rcx,8), %rdx
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x48(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x38(%rbp), %rcx
movq -0x48(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movq (%rax,%rcx,8), %rdx
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x48(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq -0x38(%rbp), %rcx
movq -0x48(%rbp), %rdx
imulq $0xc, (%rcx,%rdx,8), %rcx
addq %rcx, %rax
movl (%rax), %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
movq -0x28(%rbp), %rax
movq (%rax), %rax
imulq $0xc, -0x48(%rbp), %rcx
addq %rcx, %rax
movl (%rax), %ecx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
andl $0x80000000, %ecx       # imm = 0x80000000
orl %edx, %ecx
movl %ecx, (%rax)
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq -0x38(%rbp), %rcx
movq -0x48(%rbp), %rdx
imulq $0xc, (%rcx,%rdx,8), %rcx
addq %rcx, %rax
movl 0x4(%rax), %ecx
movq -0x28(%rbp), %rax
movq (%rax), %rax
imulq $0xc, -0x48(%rbp), %rdx
addq %rdx, %rax
movl %ecx, 0x4(%rax)
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x38(%rbp), %rcx
movq -0x48(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movb (%rax,%rcx), %dl
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x48(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x28(%rbp), %rax
movq (%rax), %rcx
movq -0x38(%rbp), %rax
movq -0x48(%rbp), %rdx
imulq $0xc, (%rax,%rdx,8), %rax
addq %rax, %rcx
movq -0x28(%rbp), %rax
movq (%rax), %rax
imulq $0xc, -0x48(%rbp), %rdx
addq %rdx, %rax
movq (%rcx), %rdx
movq %rdx, (%rax)
movl 0x8(%rcx), %ecx
movl %ecx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x38(%rbp), %rcx
movq -0x48(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movq 0x8(%rax,%rcx,8), %rax
movq -0x18(%rbp), %rcx
movq 0x40(%rcx), %rcx
movq -0x38(%rbp), %rdx
movq -0x48(%rbp), %rsi
movq (%rdx,%rsi,8), %rdx
subq (%rcx,%rdx,8), %rax
movq %rax, -0x60(%rbp)
movq 0x28(%rbp), %rax
cmpq $0x0, 0x70(%rax)
je 0x366264
movq 0x28(%rbp), %rax
movq 0x70(%rax), %rax
movq 0x10(%rax), %rax
movq -0x38(%rbp), %rcx
movq -0x48(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movb (%rax,%rcx), %dl
movq 0x28(%rbp), %rax
movq 0x70(%rax), %rax
movq 0x10(%rax), %rax
movq -0x48(%rbp), %rcx
movb %dl, (%rax,%rcx)
jmp 0x3663b0
movq 0x38(%rbp), %rax
movq -0x48(%rbp), %rcx
movq 0x20(%rbp), %rdx
movl 0x18(%rdx), %edx
subq %rdx, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
movl (%rax), %eax
cmpq -0x48(%rbp), %rax
jne 0x366294
jmp 0x3662b3
leaq 0x3452a(%rip), %rdi     # 0x39a7c5
leaq 0x2ff17(%rip), %rsi     # 0x3961b9
movl $0x3975, %edx           # imm = 0x3975
leaq 0x34481(%rip), %rcx     # 0x39a72f
callq 0x2130
movq -0x70(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x68(%rbp), %rdi
movq 0x28(%rbp), %rax
movslq 0x44(%rax), %rsi
movq 0x10(%rbp), %rdx
leaq -0x88(%rbp), %rcx
callq 0x365460
cmpq $0x2, %rax
jne 0x366301
leaq 0x5f0d4(%rip), %rax     # 0x3c53b8
movq 0x10(%rax), %rax
movq -0x68(%rbp), %rcx
movl 0x4(%rcx), %ecx
shrl %ecx
movl %ecx, %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movq %rax, -0x60(%rbp)
movq -0x88(%rbp), %rdx
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x48(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x88(%rbp), %rdx
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x48(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x28(%rbp), %rax
movq (%rax), %rax
imulq $0xc, -0x48(%rbp), %rcx
addq %rcx, %rax
movl (%rax), %ecx
andl $0x80000000, %ecx       # imm = 0x80000000
orl $0x0, %ecx
movl %ecx, (%rax)
movq -0x88(%rbp), %rax
movl %eax, %ecx
movq -0x28(%rbp), %rax
movq (%rax), %rax
imulq $0xc, -0x48(%rbp), %rdx
addq %rdx, %rax
movl %ecx, 0x4(%rax)
movq -0x88(%rbp), %rax
movl %eax, %esi
movq 0x20(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x48(%rbp), %rcx
movl (%rax,%rcx,8), %edx
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
andl $0x80000000, %edx       # imm = 0x80000000
orl %esi, %edx
movl %edx, (%rax,%rcx,8)
movq 0x28(%rbp), %rax
cmpq $0x0, 0x70(%rax)
je 0x3663ae
movq 0x28(%rbp), %rax
movq 0x70(%rax), %rax
movq 0x10(%rax), %rax
movq -0x48(%rbp), %rcx
movb $0x0, (%rax,%rcx)
jmp 0x3663b0
movq -0x58(%rbp), %rdx
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x48(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x60(%rbp), %rax
addq -0x58(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x48(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movq -0x18(%rbp), %rax
addq 0x58(%rax), %rcx
movq %rcx, 0x58(%rax)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x48(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
shrq $0x2, %rdi
addq $0x1, %rdi
shlq $0x0, %rdi
callq 0x2270
movq %rax, %rdx
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x48(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x38(%rbp), %rax
movq -0x48(%rbp), %rcx
cmpq $-0x1, (%rax,%rcx,8)
je 0x36647d
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x48(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x38(%rbp), %rcx
movq -0x48(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movq (%rax,%rcx,8), %rsi
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x48(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
shrq $0x2, %rdx
addq $0x1, %rdx
shlq $0x0, %rdx
callq 0x2180
jmp 0x36656e
movq 0x38(%rbp), %rax
movq -0x48(%rbp), %rcx
movq 0x20(%rbp), %rdx
movl 0x18(%rdx), %edx
subq %rdx, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
movl (%rax), %eax
cmpq -0x48(%rbp), %rax
jne 0x3664a8
jmp 0x3664c7
leaq 0x34316(%rip), %rdi     # 0x39a7c5
leaq 0x2fd03(%rip), %rsi     # 0x3961b9
movl $0x3988, %edx           # imm = 0x3988
leaq 0x3426d(%rip), %rcx     # 0x39a72f
callq 0x2130
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x48(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
movq -0x48(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x68(%rbp), %r8
movq 0x28(%rbp), %rax
movslq 0x44(%rax), %r9
movq 0x10(%rbp), %r14
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x48(%rbp), %r10
movq (%rax,%r10,8), %rbx
movq -0x38(%rbp), %r10
movq 0x30(%rbp), %rax
leaq -0xb0(%rbp), %r11
movq %r14, (%rsp)
movq %rbx, 0x8(%rsp)
movq %r11, 0x10(%rsp)
movq %r10, 0x18(%rsp)
movq %rax, 0x20(%rsp)
callq 0x365970
movq %rax, -0x90(%rbp)
cmpq $0x1, -0x90(%rbp)
jne 0x36656c
movq 0x20(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x48(%rbp), %rcx
movl (%rax,%rcx,8), %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
orl $0x80000000, %edx       # imm = 0x80000000
movl %edx, (%rax,%rcx,8)
jmp 0x36656e
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x48(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, %esi
movq 0x20(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x48(%rbp), %rcx
movl (%rax,%rcx,8), %edx
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
andl $0x80000000, %edx       # imm = 0x80000000
orl %esi, %edx
movl %edx, (%rax,%rcx,8)
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x365fc7
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x58(%rbp), %rdx
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x48(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x58(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x60(%rax)
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rcx
addq $0x1, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x58(%rbp), %rsi
shlq $0x0, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x50(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq -0x18(%rbp), %rcx
cmpq 0x50(%rcx), %rax
jae 0x3667a6
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rcx
movq 0x40(%rcx), %rcx
movq -0x48(%rbp), %rdx
addq (%rcx,%rdx,8), %rax
movq %rax, -0x78(%rbp)
movq -0x38(%rbp), %rax
movq -0x48(%rbp), %rcx
cmpq $-0x1, (%rax,%rcx,8)
je 0x3666b8
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rcx
movq 0x40(%rcx), %rcx
movq -0x38(%rbp), %rdx
movq -0x48(%rbp), %rsi
movq (%rdx,%rsi,8), %rdx
addq (%rcx,%rdx,8), %rax
movq %rax, -0x80(%rbp)
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x38(%rbp), %rcx
movq -0x48(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movq 0x8(%rax,%rcx,8), %rax
movq -0x18(%rbp), %rcx
movq 0x40(%rcx), %rcx
movq -0x38(%rbp), %rdx
movq -0x48(%rbp), %rsi
movq (%rdx,%rsi,8), %rdx
subq (%rcx,%rdx,8), %rax
movq %rax, -0x60(%rbp)
jmp 0x366780
movq 0x38(%rbp), %rax
movq -0x48(%rbp), %rcx
movq 0x20(%rbp), %rdx
movl 0x18(%rdx), %edx
subq %rdx, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
movl (%rax), %eax
cmpq -0x48(%rbp), %rax
jne 0x3666e3
jmp 0x366702
leaq 0x340db(%rip), %rdi     # 0x39a7c5
leaq 0x2fac8(%rip), %rsi     # 0x3961b9
movl $0x399a, %edx           # imm = 0x399A
leaq 0x34032(%rip), %rcx     # 0x39a72f
callq 0x2130
movq -0x68(%rbp), %rdi
movq 0x28(%rbp), %rax
movslq 0x44(%rax), %rsi
movq 0x10(%rbp), %rdx
leaq -0x88(%rbp), %rcx
callq 0x365460
cmpq $0x2, %rax
jne 0x36676e
leaq 0x5ec8d(%rip), %rax     # 0x3c53b8
movq 0x10(%rax), %rax
movq -0x68(%rbp), %rcx
movl 0x4(%rcx), %ecx
shrl %ecx
movl %ecx, %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movq %rax, -0x60(%rbp)
leaq 0x5ec69(%rip), %rax     # 0x3c53b8
movq 0x10(%rax), %rax
movq -0x68(%rbp), %rcx
movl 0x4(%rcx), %ecx
shrl %ecx
movl %ecx, %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, -0x80(%rbp)
jmp 0x36677e
movq 0x18(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x70(%rbp), %rax
movq %rax, -0x60(%rbp)
jmp 0x366780
movq -0x78(%rbp), %rdi
movq -0x80(%rbp), %rsi
movq -0x60(%rbp), %rdx
shlq $0x0, %rdx
callq 0x2180
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x36661d
movq -0x18(%rbp), %rax
movq 0x78(%rax), %rdi
movq -0x18(%rbp), %rax
imulq $0x18, 0x50(%rax), %rsi
callq 0x2360
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x78(%rax)
movq -0x18(%rbp), %rax
movq 0x78(%rax), %rdi
imulq $0x18, -0x50(%rbp), %rax
addq %rax, %rdi
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rax
subq -0x50(%rbp), %rax
imulq $0x18, %rax, %rdx
xorl %esi, %esi
callq 0x2100
movq -0x18(%rbp), %rax
movq 0x80(%rax), %rdi
movq -0x18(%rbp), %rax
imulq $0x18, 0x50(%rax), %rsi
callq 0x2360
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x80(%rax)
movq -0x18(%rbp), %rax
movq 0x80(%rax), %rdi
imulq $0x18, -0x50(%rbp), %rax
addq %rax, %rdi
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rax
subq -0x50(%rbp), %rax
imulq $0x18, %rax, %rdx
xorl %esi, %esi
callq 0x2100
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x30(%rbp), %rax
movq (%rax), %rsi
shlq $0x2, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x30(%rbp), %rax
movq (%rax), %rdx
shlq $0x2, %rdx
movl $0xff, %esi
callq 0x2100
movq 0x28(%rbp), %rax
movq 0x60(%rax), %rdi
movq 0x20(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
xorl %ecx, %ecx
callq 0xcce00
movq -0x28(%rbp), %rax
movq (%rax), %rcx
movq 0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq 0x80(%rax), %rcx
movq 0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x18(%rbp), %rax
movq 0x78(%rax), %rcx
movq 0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
leaq -0xb0(%rbp), %rdi
callq 0x9670
movq 0x5d6f7(%rip), %rax     # 0x3c3fe0
movq (%rax), %rdi
movq -0x50(%rbp), %rcx
movq -0x40(%rbp), %r8
leaq 0x33ed6(%rip), %rsi     # 0x39a7d1
leaq 0x33e07(%rip), %rdx     # 0x39a709
movb $0x0, %al
callq 0x22a0
addq $0xd0, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nopw %cs:(%rax,%rax)