// File: chhylp123[P]hifiasm/Correct.cpp
// Function: generate_haplotypes_naive_UL(haplotype_evdience_alloc*, overlap_region_alloc*, double, void*)
void generate_haplotypes_naive_UL(haplotype_evdience_alloc* hap, overlap_region_alloc* overlap_list, double up, void *km)
{
    if(hap->length == 0) return;
    uint64_t k, l, i, o, *a, ii, m_snp_stat, m_list, m_off;
    int64_t z; 
    SnpStats *s = NULL, *t = NULL;

    for (k = 1, l = 0, i = m_snp_stat = m_list = 0; k <= hap->snp_stat.n; ++k) {///filter snps
        if(k == hap->snp_stat.n || hap->snp_stat.a[k].site != hap->snp_stat.a[l].site) {
            if((l > 0) && (hap->snp_stat.a[l].site == (hap->snp_stat.a[l-1].site + 1))) {
                l = k; continue;
            }
            if((k < hap->snp_stat.n) && ((hap->snp_stat.a[l].site+1) == hap->snp_stat.a[k].site)) {
                l = k; continue;
            }

            for (; i < hap->length && hap->list[i].site != hap->snp_stat.a[l].site; i++);
            assert(i < hap->length && hap->list[i].site == hap->snp_stat.a[l].site);
            m_off = l - m_snp_stat; 
            for (; i < hap->length && hap->list[i].site == hap->snp_stat.a[l].site; i++) {
                assert(hap->list[i].overlapSite>=l && hap->list[i].overlapSite < k);
                // assert(hap->snp_stat.a[hap->list[i].overlapSite].site==hap->list[i].site);
                hap->list[m_list] = hap->list[i]; hap->list[m_list++].overlapSite -= m_off;
            }
        
            for (; l < k; l++) hap->snp_stat.a[m_snp_stat++] = hap->snp_stat.a[l];
        }
    }
    hap->snp_stat.n = m_snp_stat; hap->length = m_list;
    if(hap->snp_stat.n == 0 || hap->length == 0) return;

    hap->snp_srt.n = 0;
    radix_sort_haplotype_evdience_id_srt(hap->list, hap->list + hap->length);
    for (k = 1, l = 0; k <= hap->length; ++k) {  
        if (k == hap->length || hap->list[k].overlapID != hap->list[l].overlapID) {
            for (i = l, o = 0; i < k; i++) {
                if(hap->list[i].type!=1) continue;///mismatch
                s = &(hap->snp_stat.a[hap->list[i].overlapSite]); 
                assert(s->site == hap->list[i].site);
                if(s->occ_0 < 2 || s->occ_1 < 2) continue;
                if(s->occ_0 >= asm_opt.s_hap_cov && s->occ_1 >= asm_opt.infor_cov) o++;///allels must be real
            }
            if(o > 0) {
                o = ((uint32_t)-1) - o;
                o <<= 32; o += l; 
                if(!km) kv_push(uint64_t, hap->snp_srt, o);
                else kv_push_km(km, uint64_t, hap->snp_srt, o);
            }
            l = k;
        }
    }
    
    if (hap->snp_srt.n > 0) {
        radix_sort_bc64(hap->snp_srt.a, hap->snp_srt.a + hap->snp_srt.n);///sort by how many snps in one overlap
        for (k = 0; k < hap->snp_srt.n; k++) {
            o = 0; l = (uint32_t)hap->snp_srt.a[k];
            for (i = l; i < hap->length && hap->list[i].overlapID == hap->list[l].overlapID; i++) {
                if(hap->list[i].type!=1) continue;
                s = &(hap->snp_stat.a[hap->list[i].overlapSite]);
                if(s->occ_0 < 2 || s->occ_1 < 2) continue;
                if(s->occ_0 >= asm_opt.s_hap_cov && s->occ_1 >= asm_opt.infor_cov) o++;
            }
            if(o == 0) continue;

            ii = hap->list[l].overlapID;
            if(overlap_list->list[ii].is_match == 1) overlap_list->list[ii].is_match = 2;
            for (i = l; i < hap->length && hap->list[i].overlapID == hap->list[l].overlapID; i++) {
                if(hap->list[i].type==1){
                    s = &(hap->snp_stat.a[hap->list[i].overlapSite]);
                    s->score = 1; 
                } ///else if((hap->list[i].type==0) && (o>=(overlap_list->list[ii].align_length*up))) {
                else if(hap->list[i].type==0) {
                    ///not real allels
                    z = hap->list[i].overlapSite; s = &(hap->snp_stat.a[z]);
                    for (z = hap->list[i].overlapSite; z >= 0; z--) {
                        t = &(hap->snp_stat.a[z]);
                        if(s->site!=t->site) break;
                        t->occ_0 -= hap->list[i].cov;
                        assert(t->occ_0 >= 1);
                    }
                }
            }
        }

        for (k = 0; k < hap->snp_srt.n; k++) {///sorted by how many allels in each overlap; more -> less
            o = 0; l = (uint32_t)hap->snp_srt.a[k];
            for (i = l; i < hap->length && hap->list[i].overlapID == hap->list[l].overlapID; i++) {
                if(hap->list[i].type!=1) continue;
                s = &(hap->snp_stat.a[hap->list[i].overlapSite]);
                if(s->occ_0 < 2 || s->occ_1 < 2) continue;
                if(s->score == 1) o++;
            }
            ii = hap->list[l].overlapID;
            ///for HiFi, do not flip trans to cis
            // if(overlap_list->list[ii].is_match == 2 && o == 0) {
            //     overlap_list->list[ii].is_match = 1;
            // }
            if(overlap_list->list[ii].is_match == 1 && o > 0) {
                overlap_list->list[ii].is_match = 2;
            }
        }


        for (k = 1, l = 0; k <= hap->length; ++k) {  ///reset snp_stat
            if (k == hap->length || hap->list[k].overlapID != hap->list[l].overlapID) {
                ii = hap->list[l].overlapID;
                if(overlap_list->list[ii].is_match==1) {
                    for (i = l; i < k; i++) {
                        if(hap->list[i].type==1) {
                            hap->snp_stat.a[hap->list[i].overlapSite].score = -1;
                        }
                    }
                }
                l = k;
            }
        } 
    }

    

    hap->snp_srt.n = 0;
    for (k = 1, l = 0; k <= hap->length; ++k) {  
        if (k == hap->length || hap->list[k].overlapID != hap->list[l].overlapID) {
            if(overlap_list->list[hap->list[l].overlapID].is_match == 2) {
                l = k;
                continue;
            }
            for (i = l, o = 0; i < k; i++) {
                if(hap->list[i].type!=1) continue;
                s = &(hap->snp_stat.a[hap->list[i].overlapSite]);
                if(s->occ_0 < 2 || s->occ_1 < 2) continue;
                if(s->occ_0 >= asm_opt.s_hap_cov && s->occ_1 >= asm_opt.infor_cov) continue;
                if(s->score == 1) continue;
                o++; 
                if(!km) kv_push(uint64_t, hap->snp_srt, hap->list[i].overlapSite);
                else kv_push_km(km, uint64_t, hap->snp_srt, hap->list[i].overlapSite);
            }
            hap->snp_srt.n -= o;
            ///there are at least two variants at one read
            if(o>=(overlap_list->list[hap->list[l].overlapID].align_length*up)) {
                radix_sort_bc64(hap->snp_srt.a + hap->snp_srt.n, hap->snp_srt.a + hap->snp_srt.n + o);
                a = hap->snp_srt.a + hap->snp_srt.n;
                for (i = z = 0; i < o; i++) {
                    if(i > 0) s = &(hap->snp_stat.a[a[i-1]]);
                    if(i + 1 < o) t = &(hap->snp_stat.a[a[i+1]]);
                    if(s && s->site + 32 > hap->snp_stat.a[a[i]].site) continue;
                    if(t && hap->snp_stat.a[a[i]].site + 32 > t->site) continue;
                    a[z] = a[i];
                    z++;
                }
                if(z >= 2) hap->snp_srt.n += z; 
            }
            l = k;
        }
    }
    if (hap->snp_srt.n > 0) {
        radix_sort_bc64(hap->snp_srt.a, hap->snp_srt.a + hap->snp_srt.n);
        for (k = 1, l = 0; k <= hap->snp_srt.n; ++k) {  
            if(k == hap->snp_srt.n || hap->snp_srt.a[k] != hap->snp_srt.a[l]) {
                if(k - l >= 2) hap->snp_stat.a[hap->snp_srt.a[l]].score = 1;
            }
            l = k;
        }
    }

    for (k = 1, l = 0; k <= hap->length; ++k) {  
        if (k == hap->length || hap->list[k].overlapID != hap->list[l].overlapID) {
            ii = hap->list[l].overlapID;
            if(overlap_list->list[ii].is_match==2) {
                overlap_list->list[ii].strong = 1;
                overlap_list->mapped_overlaps_length -= 
                                            overlap_list->list[ii].x_pos_e + 1 - overlap_list->list[ii].x_pos_s;
            } else if(overlap_list->list[ii].is_match==1) {
                for (i = l; i < k; i++) {
                    if(hap->list[i].type==1 || hap->list[i].type==0) {
                        s = &(hap->snp_stat.a[hap->list[i].overlapSite]);
                        if(s->score == 1 && (!(s->occ_0 < 2 || s->occ_1 < 2))) {
                            overlap_list->list[ii].strong = 1;
                            if(hap->list[i].type==1) {
                                overlap_list->list[ii].is_match = 2;
                                overlap_list->mapped_overlaps_length -= 
                                            overlap_list->list[ii].x_pos_e + 1 - overlap_list->list[ii].x_pos_s;
                                break;
                            }
                        }
                    }

                }
            }
            l = k;
        }
    }    
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movsd %xmm0, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jne 0x47aeb
jmp 0x49116
movq $0x0, -0x78(%rbp)
movq $0x0, -0x80(%rbp)
movq $0x1, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq $0x0, -0x60(%rbp)
movq $0x0, -0x58(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x28(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x220(%rcx), %rax
ja 0x47ea6
movq -0x28(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x220(%rcx), %rax
je 0x47b7b
movq -0x8(%rbp), %rax
movq 0x218(%rax), %rax
imulq $0x28, -0x28(%rbp), %rcx
addq %rcx, %rax
movl 0x20(%rax), %eax
movq -0x8(%rbp), %rcx
movq 0x218(%rcx), %rcx
imulq $0x28, -0x30(%rbp), %rdx
addq %rdx, %rcx
cmpl 0x20(%rcx), %eax
je 0x47e93
cmpq $0x0, -0x30(%rbp)
jbe 0x47bc9
movq -0x8(%rbp), %rax
movq 0x218(%rax), %rax
imulq $0x28, -0x30(%rbp), %rcx
addq %rcx, %rax
movl 0x20(%rax), %eax
movq -0x8(%rbp), %rcx
movq 0x218(%rcx), %rcx
movq -0x30(%rbp), %rdx
subq $0x1, %rdx
imulq $0x28, %rdx, %rdx
addq %rdx, %rcx
movl 0x20(%rcx), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jne 0x47bc9
movq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x47e95
movq -0x28(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x220(%rcx), %rax
jae 0x47c18
movq -0x8(%rbp), %rax
movq 0x218(%rax), %rax
imulq $0x28, -0x30(%rbp), %rcx
addq %rcx, %rax
movl 0x20(%rax), %eax
addl $0x1, %eax
movq -0x8(%rbp), %rcx
movq 0x218(%rcx), %rcx
imulq $0x28, -0x28(%rbp), %rdx
addq %rdx, %rcx
cmpl 0x20(%rcx), %eax
jne 0x47c18
movq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x47e95
jmp 0x47c1a
movq -0x38(%rbp), %rcx
movq -0x8(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, %edx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, -0x81(%rbp)
jae 0x47c64
movq -0x8(%rbp), %rax
movq (%rax), %rax
imulq $0x18, -0x38(%rbp), %rcx
addq %rcx, %rax
movl (%rax), %eax
movq -0x8(%rbp), %rcx
movq 0x218(%rcx), %rcx
imulq $0x28, -0x30(%rbp), %rdx
addq %rdx, %rcx
cmpl 0x20(%rcx), %eax
setne %al
movb %al, -0x81(%rbp)
movb -0x81(%rbp), %al
testb $0x1, %al
jne 0x47c70
jmp 0x47c80
jmp 0x47c72
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x47c1a
movq -0x38(%rbp), %rcx
movq -0x8(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, %edx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, -0x82(%rbp)
jae 0x47cca
movq -0x8(%rbp), %rax
movq (%rax), %rax
imulq $0x18, -0x38(%rbp), %rcx
addq %rcx, %rax
movl (%rax), %eax
movq -0x8(%rbp), %rcx
movq 0x218(%rcx), %rcx
imulq $0x28, -0x30(%rbp), %rdx
addq %rdx, %rcx
cmpl 0x20(%rcx), %eax
sete %al
movb %al, -0x82(%rbp)
movb -0x82(%rbp), %al
testb $0x1, %al
jne 0x47cd6
jmp 0x47cd8
jmp 0x47cf7
leaq 0x33abf1(%rip), %rdi    # 0x3828d0
leaq 0x33a635(%rip), %rsi    # 0x38231b
movl $0x26c9, %edx           # imm = 0x26C9
leaq 0x33af7b(%rip), %rcx    # 0x382c6d
callq 0x2130
movq -0x30(%rbp), %rax
subq -0x58(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x38(%rbp), %rcx
movq -0x8(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, %edx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, -0x83(%rbp)
jae 0x47d4d
movq -0x8(%rbp), %rax
movq (%rax), %rax
imulq $0x18, -0x38(%rbp), %rcx
addq %rcx, %rax
movl (%rax), %eax
movq -0x8(%rbp), %rcx
movq 0x218(%rcx), %rcx
imulq $0x28, -0x30(%rbp), %rdx
addq %rdx, %rcx
cmpl 0x20(%rcx), %eax
sete %al
movb %al, -0x83(%rbp)
movb -0x83(%rbp), %al
testb $0x1, %al
jne 0x47d5c
jmp 0x47e39
movq -0x8(%rbp), %rax
movq (%rax), %rax
imulq $0x18, -0x38(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl %eax, %ecx
xorl %eax, %eax
cmpq -0x30(%rbp), %rcx
movb %al, -0x84(%rbp)
jb 0x47d9d
movq -0x8(%rbp), %rax
movq (%rax), %rax
imulq $0x18, -0x38(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
cmpq -0x28(%rbp), %rax
setb %al
movb %al, -0x84(%rbp)
movb -0x84(%rbp), %al
testb $0x1, %al
jne 0x47da9
jmp 0x47dab
jmp 0x47dca
leaq 0x33abe5(%rip), %rdi    # 0x382997
leaq 0x33a562(%rip), %rsi    # 0x38231b
movl $0x26cc, %edx           # imm = 0x26CC
leaq 0x33aea8(%rip), %rcx    # 0x382c6d
callq 0x2130
movq -0x8(%rbp), %rax
movq (%rax), %rcx
imulq $0x18, -0x38(%rbp), %rax
addq %rax, %rcx
movq -0x8(%rbp), %rax
movq (%rax), %rax
imulq $0x18, -0x60(%rbp), %rdx
addq %rdx, %rax
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%rcx), %rcx
movq %rcx, 0x10(%rax)
movq -0x68(%rbp), %rdx
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x60(%rbp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, -0x60(%rbp)
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %ecx
subq %rdx, %rcx
movl %ecx, 0x8(%rax)
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x47d03
jmp 0x47e3b
movq -0x30(%rbp), %rax
cmpq -0x28(%rbp), %rax
jae 0x47e91
movq -0x8(%rbp), %rax
movq 0x218(%rax), %rsi
imulq $0x28, -0x30(%rbp), %rax
addq %rax, %rsi
movq -0x8(%rbp), %rax
movq 0x218(%rax), %rdi
movq -0x58(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x58(%rbp)
imulq $0x28, %rax, %rax
addq %rax, %rdi
movl $0x28, %edx
callq 0x2180
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x47e3b
jmp 0x47e93
jmp 0x47e95
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x47b23
movq -0x58(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x220(%rax)
movq -0x60(%rbp), %rax
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x220(%rax)
je 0x47eda
movq -0x8(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jne 0x47edf
jmp 0x49116
movq -0x8(%rbp), %rax
movq $0x0, 0x238(%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rsi
movq -0x8(%rbp), %rax
movl 0x10(%rax), %eax
imulq $0x18, %rax, %rax
addq %rax, %rsi
callq 0x2e440
movq $0x1, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x28(%rbp), %rax
movq -0x8(%rbp), %rcx
movl 0x10(%rcx), %ecx
cmpq %rcx, %rax
ja 0x48241
movq -0x28(%rbp), %rax
movq -0x8(%rbp), %rcx
movl 0x10(%rcx), %ecx
cmpq %rcx, %rax
je 0x47f6d
movq -0x8(%rbp), %rax
movq (%rax), %rax
imulq $0x18, -0x28(%rbp), %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movq -0x8(%rbp), %rcx
movq (%rcx), %rcx
imulq $0x18, -0x30(%rbp), %rdx
addq %rdx, %rcx
cmpl 0x4(%rcx), %eax
je 0x4822e
movq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x28(%rbp), %rax
jae 0x4806e
movq -0x8(%rbp), %rax
movq (%rax), %rax
imulq $0x18, -0x38(%rbp), %rcx
addq %rcx, %rax
movzbl 0xc(%rax), %eax
cmpl $0x1, %eax
je 0x47fa8
jmp 0x4805d
movq -0x8(%rbp), %rax
movq 0x218(%rax), %rax
movq -0x8(%rbp), %rcx
movq (%rcx), %rcx
imulq $0x18, -0x38(%rbp), %rdx
addq %rdx, %rcx
movl 0x8(%rcx), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
movl 0x20(%rax), %eax
movq -0x8(%rbp), %rcx
movq (%rcx), %rcx
imulq $0x18, -0x38(%rbp), %rdx
addq %rdx, %rcx
cmpl (%rcx), %eax
jne 0x47fec
jmp 0x4800b
leaq 0x33a9e0(%rip), %rdi    # 0x3829d3
leaq 0x33a321(%rip), %rsi    # 0x38231b
movl $0x26de, %edx           # imm = 0x26DE
leaq 0x33ac67(%rip), %rcx    # 0x382c6d
callq 0x2130
movq -0x78(%rbp), %rax
cmpl $0x2, 0x8(%rax)
jb 0x4801f
movq -0x78(%rbp), %rax
cmpl $0x2, 0xc(%rax)
jae 0x48021
jmp 0x4805d
movq -0x78(%rbp), %rax
movl 0x8(%rax), %eax
leaq 0x37c7c9(%rip), %rcx    # 0x3c47f8
cmpq 0x218(%rcx), %rax
jl 0x4805b
movq -0x78(%rbp), %rax
movl 0xc(%rax), %eax
leaq 0x37c7b2(%rip), %rcx    # 0x3c47f8
cmpq 0x210(%rcx), %rax
jl 0x4805b
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x4805d
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x47f7d
cmpq $0x0, -0x40(%rbp)
jbe 0x48226
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
subq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
shlq $0x20, %rax
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rax
addq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x48166
jmp 0x480ab
movq -0x8(%rbp), %rax
movq 0x238(%rax), %rax
movq -0x8(%rbp), %rcx
cmpq 0x240(%rcx), %rax
jne 0x48135
movq -0x8(%rbp), %rax
cmpq $0x0, 0x240(%rax)
je 0x480e8
movq -0x8(%rbp), %rax
movq 0x240(%rax), %rax
shlq %rax
movq %rax, -0x90(%rbp)
jmp 0x480f6
movl $0x2, %eax
movq %rax, -0x90(%rbp)
jmp 0x480f6
movq -0x90(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x240(%rax)
movq -0x8(%rbp), %rax
movq 0x248(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x240(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x248(%rax)
movq -0x40(%rbp), %rdx
movq -0x8(%rbp), %rax
movq 0x248(%rax), %rax
movq -0x8(%rbp), %rsi
movq 0x238(%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, 0x238(%rsi)
movq %rdx, (%rax,%rcx,8)
jmp 0x48224
jmp 0x48168
movq -0x8(%rbp), %rax
movq 0x238(%rax), %rax
movq -0x8(%rbp), %rcx
cmpq 0x240(%rcx), %rax
jne 0x481f6
movq -0x8(%rbp), %rax
cmpq $0x0, 0x240(%rax)
je 0x481a5
movq -0x8(%rbp), %rax
movq 0x240(%rax), %rax
shlq %rax
movq %rax, -0x98(%rbp)
jmp 0x481b3
movl $0x2, %eax
movq %rax, -0x98(%rbp)
jmp 0x481b3
movq -0x98(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x240(%rax)
movq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x248(%rax), %rsi
movq -0x8(%rbp), %rax
movq 0x240(%rax), %rdx
shlq $0x3, %rdx
callq 0x30e740
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x248(%rax)
movq -0x40(%rbp), %rdx
movq -0x8(%rbp), %rax
movq 0x248(%rax), %rax
movq -0x8(%rbp), %rsi
movq 0x238(%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, 0x238(%rsi)
movq %rdx, (%rax,%rcx,8)
jmp 0x48224
jmp 0x48226
movq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x48230
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x47f1f
movq -0x8(%rbp), %rax
cmpq $0x0, 0x238(%rax)
jbe 0x4886c
movq -0x8(%rbp), %rax
movq 0x248(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x248(%rax), %rsi
movq -0x8(%rbp), %rax
movq 0x238(%rax), %rax
shlq $0x3, %rax
addq %rax, %rsi
callq 0x2da20
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x238(%rcx), %rax
jae 0x485db
movq $0x0, -0x40(%rbp)
movq -0x8(%rbp), %rax
movq 0x248(%rax), %rax
movq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, %eax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rcx
movq -0x8(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, %edx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, -0x99(%rbp)
jae 0x4830d
movq -0x8(%rbp), %rax
movq (%rax), %rax
imulq $0x18, -0x38(%rbp), %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movq -0x8(%rbp), %rcx
movq (%rcx), %rcx
imulq $0x18, -0x30(%rbp), %rdx
addq %rdx, %rcx
cmpl 0x4(%rcx), %eax
sete %al
movb %al, -0x99(%rbp)
movb -0x99(%rbp), %al
testb $0x1, %al
jne 0x4831c
jmp 0x483c1
movq -0x8(%rbp), %rax
movq (%rax), %rax
imulq $0x18, -0x38(%rbp), %rcx
addq %rcx, %rax
movzbl 0xc(%rax), %eax
cmpl $0x1, %eax
je 0x48336
jmp 0x483b0
movq -0x8(%rbp), %rax
movq 0x218(%rax), %rax
movq -0x8(%rbp), %rcx
movq (%rcx), %rcx
imulq $0x18, -0x38(%rbp), %rdx
addq %rdx, %rcx
movl 0x8(%rcx), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
cmpl $0x2, 0x8(%rax)
jb 0x48372
movq -0x78(%rbp), %rax
cmpl $0x2, 0xc(%rax)
jae 0x48374
jmp 0x483b0
movq -0x78(%rbp), %rax
movl 0x8(%rax), %eax
leaq 0x37c476(%rip), %rcx    # 0x3c47f8
cmpq 0x218(%rcx), %rax
jl 0x483ae
movq -0x78(%rbp), %rax
movl 0xc(%rax), %eax
leaq 0x37c45f(%rip), %rcx    # 0x3c47f8
cmpq 0x210(%rcx), %rax
jl 0x483ae
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x483b0
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x482c6
cmpq $0x0, -0x40(%rbp)
jne 0x483cd
jmp 0x485ca
movq -0x8(%rbp), %rax
movq (%rax), %rax
imulq $0x18, -0x30(%rbp), %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x50(%rbp), %rcx
addq %rcx, %rax
movzbl 0x2c(%rax), %eax
cmpl $0x1, %eax
jne 0x48414
movq -0x10(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x50(%rbp), %rcx
addq %rcx, %rax
movb $0x2, 0x2c(%rax)
movq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rcx
movq -0x8(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, %edx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, -0x9a(%rbp)
jae 0x48463
movq -0x8(%rbp), %rax
movq (%rax), %rax
imulq $0x18, -0x38(%rbp), %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movq -0x8(%rbp), %rcx
movq (%rcx), %rcx
imulq $0x18, -0x30(%rbp), %rdx
addq %rdx, %rcx
cmpl 0x4(%rcx), %eax
sete %al
movb %al, -0x9a(%rbp)
movb -0x9a(%rbp), %al
testb $0x1, %al
jne 0x48472
jmp 0x485c8
movq -0x8(%rbp), %rax
movq (%rax), %rax
imulq $0x18, -0x38(%rbp), %rcx
addq %rcx, %rax
movzbl 0xc(%rax), %eax
cmpl $0x1, %eax
jne 0x484c2
movq -0x8(%rbp), %rax
movq 0x218(%rax), %rax
movq -0x8(%rbp), %rcx
movq (%rcx), %rcx
imulq $0x18, -0x38(%rbp), %rdx
addq %rdx, %rcx
movl 0x8(%rcx), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
movl $0x1, 0x1c(%rax)
jmp 0x485b5
movq -0x8(%rbp), %rax
movq (%rax), %rax
imulq $0x18, -0x38(%rbp), %rcx
addq %rcx, %rax
movzbl 0xc(%rax), %eax
cmpl $0x0, %eax
jne 0x485b3
movq -0x8(%rbp), %rax
movq (%rax), %rax
imulq $0x18, -0x38(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movq %rax, -0x70(%rbp)
movq -0x8(%rbp), %rax
movq 0x218(%rax), %rax
imulq $0x28, -0x70(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x78(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
imulq $0x18, -0x38(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movq %rax, -0x70(%rbp)
cmpq $0x0, -0x70(%rbp)
jl 0x485b1
movq -0x8(%rbp), %rax
movq 0x218(%rax), %rax
imulq $0x28, -0x70(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x80(%rbp)
movq -0x78(%rbp), %rax
movl 0x20(%rax), %eax
movq -0x80(%rbp), %rcx
cmpl 0x20(%rcx), %eax
je 0x48555
jmp 0x485b1
movq -0x8(%rbp), %rax
movq (%rax), %rax
imulq $0x18, -0x38(%rbp), %rcx
addq %rcx, %rax
movl 0x10(%rax), %edx
movq -0x80(%rbp), %rax
movl 0x8(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0x8(%rax)
movq -0x80(%rbp), %rax
cmpl $0x1, 0x8(%rax)
jb 0x4857f
jmp 0x4859e
leaq 0x33a28c(%rip), %rdi    # 0x382812
leaq 0x339d8e(%rip), %rsi    # 0x38231b
movl $0x2706, %edx           # imm = 0x2706
leaq 0x33a6d4(%rip), %rcx    # 0x382c6d
callq 0x2130
jmp 0x485a0
movq -0x70(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x70(%rbp)
jmp 0x48521
jmp 0x485b3
jmp 0x485b5
jmp 0x485b7
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x4841c
jmp 0x485ca
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x48288
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x238(%rcx), %rax
jae 0x48759
movq $0x0, -0x40(%rbp)
movq -0x8(%rbp), %rax
movq 0x248(%rax), %rax
movq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, %eax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rcx
movq -0x8(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, %edx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, -0x9b(%rbp)
jae 0x48668
movq -0x8(%rbp), %rax
movq (%rax), %rax
imulq $0x18, -0x38(%rbp), %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movq -0x8(%rbp), %rcx
movq (%rcx), %rcx
imulq $0x18, -0x30(%rbp), %rdx
addq %rdx, %rcx
cmpl 0x4(%rcx), %eax
sete %al
movb %al, -0x9b(%rbp)
movb -0x9b(%rbp), %al
testb $0x1, %al
jne 0x48677
jmp 0x486f8
movq -0x8(%rbp), %rax
movq (%rax), %rax
imulq $0x18, -0x38(%rbp), %rcx
addq %rcx, %rax
movzbl 0xc(%rax), %eax
cmpl $0x1, %eax
je 0x48691
jmp 0x486e7
movq -0x8(%rbp), %rax
movq 0x218(%rax), %rax
movq -0x8(%rbp), %rcx
movq (%rcx), %rcx
imulq $0x18, -0x38(%rbp), %rdx
addq %rdx, %rcx
movl 0x8(%rcx), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
cmpl $0x2, 0x8(%rax)
jb 0x486cd
movq -0x78(%rbp), %rax
cmpl $0x2, 0xc(%rax)
jae 0x486cf
jmp 0x486e7
movq -0x78(%rbp), %rax
cmpl $0x1, 0x1c(%rax)
jne 0x486e5
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x486e7
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x48621
movq -0x8(%rbp), %rax
movq (%rax), %rax
imulq $0x18, -0x30(%rbp), %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x50(%rbp), %rcx
addq %rcx, %rax
movzbl 0x2c(%rax), %eax
cmpl $0x1, %eax
jne 0x48746
cmpq $0x0, -0x40(%rbp)
jbe 0x48746
movq -0x10(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x50(%rbp), %rcx
addq %rcx, %rax
movb $0x2, 0x2c(%rax)
jmp 0x48748
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x485e3
movq $0x1, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x28(%rbp), %rax
movq -0x8(%rbp), %rcx
movl 0x10(%rcx), %ecx
cmpq %rcx, %rax
ja 0x4886a
movq -0x28(%rbp), %rax
movq -0x8(%rbp), %rcx
movl 0x10(%rcx), %ecx
cmpq %rcx, %rax
je 0x487b7
movq -0x8(%rbp), %rax
movq (%rax), %rax
imulq $0x18, -0x28(%rbp), %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movq -0x8(%rbp), %rcx
movq (%rcx), %rcx
imulq $0x18, -0x30(%rbp), %rdx
addq %rdx, %rcx
cmpl 0x4(%rcx), %eax
je 0x48857
movq -0x8(%rbp), %rax
movq (%rax), %rax
imulq $0x18, -0x30(%rbp), %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x50(%rbp), %rcx
addq %rcx, %rax
movzbl 0x2c(%rax), %eax
cmpl $0x1, %eax
jne 0x4884f
movq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x28(%rbp), %rax
jae 0x4884d
movq -0x8(%rbp), %rax
movq (%rax), %rax
imulq $0x18, -0x38(%rbp), %rcx
addq %rcx, %rax
movzbl 0xc(%rax), %eax
cmpl $0x1, %eax
jne 0x4883d
movq -0x8(%rbp), %rax
movq 0x218(%rax), %rax
movq -0x8(%rbp), %rcx
movq (%rcx), %rcx
imulq $0x18, -0x38(%rbp), %rdx
addq %rdx, %rcx
movl 0x8(%rcx), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl $0xffffffff, 0x1c(%rax) # imm = 0xFFFFFFFF
jmp 0x4883f
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x487f0
jmp 0x4884f
movq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x48859
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x48769
jmp 0x4886c
movq -0x8(%rbp), %rax
movq $0x0, 0x238(%rax)
movq $0x1, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x28(%rbp), %rax
movq -0x8(%rbp), %rcx
movl 0x10(%rcx), %ecx
cmpq %rcx, %rax
ja 0x48dc4
movq -0x28(%rbp), %rax
movq -0x8(%rbp), %rcx
movl 0x10(%rcx), %ecx
cmpq %rcx, %rax
je 0x488d9
movq -0x8(%rbp), %rax
movq (%rax), %rax
imulq $0x18, -0x28(%rbp), %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movq -0x8(%rbp), %rcx
movq (%rcx), %rcx
imulq $0x18, -0x30(%rbp), %rdx
addq %rdx, %rcx
cmpl 0x4(%rcx), %eax
je 0x48db1
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rbp), %rcx
movq (%rcx), %rcx
imulq $0x18, -0x30(%rbp), %rdx
addq %rdx, %rcx
movl 0x4(%rcx), %ecx
imulq $0xa8, %rcx, %rcx
addq %rcx, %rax
movzbl 0x2c(%rax), %eax
cmpl $0x2, %eax
jne 0x48912
movq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x48db3
movq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x28(%rbp), %rax
jae 0x48b95
movq -0x8(%rbp), %rax
movq (%rax), %rax
imulq $0x18, -0x38(%rbp), %rcx
addq %rcx, %rax
movzbl 0xc(%rax), %eax
cmpl $0x1, %eax
je 0x4894d
jmp 0x48b84
movq -0x8(%rbp), %rax
movq 0x218(%rax), %rax
movq -0x8(%rbp), %rcx
movq (%rcx), %rcx
imulq $0x18, -0x38(%rbp), %rdx
addq %rdx, %rcx
movl 0x8(%rcx), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
cmpl $0x2, 0x8(%rax)
jb 0x48989
movq -0x78(%rbp), %rax
cmpl $0x2, 0xc(%rax)
jae 0x4898e
jmp 0x48b84
movq -0x78(%rbp), %rax
movl 0x8(%rax), %eax
leaq 0x37be5c(%rip), %rcx    # 0x3c47f8
cmpq 0x218(%rcx), %rax
jl 0x489c1
movq -0x78(%rbp), %rax
movl 0xc(%rax), %eax
leaq 0x37be45(%rip), %rcx    # 0x3c47f8
cmpq 0x210(%rcx), %rax
jl 0x489c1
jmp 0x48b84
movq -0x78(%rbp), %rax
cmpl $0x1, 0x1c(%rax)
jne 0x489d0
jmp 0x48b84
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x48ab4
jmp 0x489e9
movq -0x8(%rbp), %rax
movq 0x238(%rax), %rax
movq -0x8(%rbp), %rcx
cmpq 0x240(%rcx), %rax
jne 0x48a73
movq -0x8(%rbp), %rax
cmpq $0x0, 0x240(%rax)
je 0x48a26
movq -0x8(%rbp), %rax
movq 0x240(%rax), %rax
shlq %rax
movq %rax, -0xa8(%rbp)
jmp 0x48a34
movl $0x2, %eax
movq %rax, -0xa8(%rbp)
jmp 0x48a34
movq -0xa8(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x240(%rax)
movq -0x8(%rbp), %rax
movq 0x248(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x240(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x248(%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rax
imulq $0x18, -0x38(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl %eax, %edx
movq -0x8(%rbp), %rax
movq 0x248(%rax), %rax
movq -0x8(%rbp), %rsi
movq 0x238(%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, 0x238(%rsi)
movq %rdx, (%rax,%rcx,8)
jmp 0x48b82
jmp 0x48ab6
movq -0x8(%rbp), %rax
movq 0x238(%rax), %rax
movq -0x8(%rbp), %rcx
cmpq 0x240(%rcx), %rax
jne 0x48b44
movq -0x8(%rbp), %rax
cmpq $0x0, 0x240(%rax)
je 0x48af3
movq -0x8(%rbp), %rax
movq 0x240(%rax), %rax
shlq %rax
movq %rax, -0xb0(%rbp)
jmp 0x48b01
movl $0x2, %eax
movq %rax, -0xb0(%rbp)
jmp 0x48b01
movq -0xb0(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x240(%rax)
movq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x248(%rax), %rsi
movq -0x8(%rbp), %rax
movq 0x240(%rax), %rdx
shlq $0x3, %rdx
callq 0x30e740
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x248(%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rax
imulq $0x18, -0x38(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl %eax, %edx
movq -0x8(%rbp), %rax
movq 0x248(%rax), %rax
movq -0x8(%rbp), %rsi
movq 0x238(%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, 0x238(%rsi)
movq %rdx, (%rax,%rcx,8)
jmp 0x48b82
jmp 0x48b84
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x48922
movq -0x40(%rbp), %rdx
movq -0x8(%rbp), %rax
movq 0x238(%rax), %rcx
subq %rdx, %rcx
movq %rcx, 0x238(%rax)
movaps 0x33945b(%rip), %xmm1   # 0x382010
movq -0x40(%rbp), %xmm0
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x33945a(%rip), %xmm1   # 0x382020
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rbp), %rcx
movq (%rcx), %rcx
movq -0x30(%rbp), %rdx
leaq (%rdx,%rdx,2), %rdx
movl 0x4(%rcx,%rdx,8), %ecx
imulq $0xa8, %rcx, %rcx
movl 0x28(%rax,%rcx), %eax
cvtsi2sd %rax, %xmm1
mulsd -0x18(%rbp), %xmm1
ucomisd %xmm1, %xmm0
jb 0x48da9
movq -0x8(%rbp), %rax
movq 0x248(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x238(%rax), %rax
shlq $0x3, %rax
addq %rax, %rdi
movq -0x8(%rbp), %rax
movq 0x248(%rax), %rsi
movq -0x8(%rbp), %rax
movq 0x238(%rax), %rax
shlq $0x3, %rax
addq %rax, %rsi
movq -0x40(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rsi
callq 0x2da20
movq -0x8(%rbp), %rax
movq 0x248(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x238(%rcx), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movq $0x0, -0x70(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x40(%rbp), %rax
jae 0x48d8a
cmpq $0x0, -0x38(%rbp)
jbe 0x48cc1
movq -0x8(%rbp), %rax
movq 0x218(%rax), %rax
movq -0x48(%rbp), %rcx
movq -0x38(%rbp), %rdx
subq $0x1, %rdx
imulq $0x28, (%rcx,%rdx,8), %rcx
addq %rcx, %rax
movq %rax, -0x78(%rbp)
movq -0x38(%rbp), %rax
addq $0x1, %rax
cmpq -0x40(%rbp), %rax
jae 0x48cef
movq -0x8(%rbp), %rax
movq 0x218(%rax), %rax
movq -0x48(%rbp), %rcx
movq -0x38(%rbp), %rdx
imulq $0x28, 0x8(%rcx,%rdx,8), %rcx
addq %rcx, %rax
movq %rax, -0x80(%rbp)
cmpq $0x0, -0x78(%rbp)
je 0x48d22
movq -0x78(%rbp), %rax
movl 0x20(%rax), %eax
addl $0x20, %eax
movq -0x8(%rbp), %rcx
movq 0x218(%rcx), %rcx
movq -0x48(%rbp), %rdx
movq -0x38(%rbp), %rsi
imulq $0x28, (%rdx,%rsi,8), %rdx
addq %rdx, %rcx
cmpl 0x20(%rcx), %eax
jbe 0x48d22
jmp 0x48d79
cmpq $0x0, -0x80(%rbp)
je 0x48d55
movq -0x8(%rbp), %rax
movq 0x218(%rax), %rax
movq -0x48(%rbp), %rcx
movq -0x38(%rbp), %rdx
imulq $0x28, (%rcx,%rdx,8), %rcx
addq %rcx, %rax
movl 0x20(%rax), %eax
addl $0x20, %eax
movq -0x80(%rbp), %rcx
cmpl 0x20(%rcx), %eax
jbe 0x48d55
jmp 0x48d79
movq -0x48(%rbp), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movq -0x48(%rbp), %rax
movq -0x70(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x70(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x70(%rbp)
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x48c89
cmpq $0x2, -0x70(%rbp)
jl 0x48da7
movq -0x70(%rbp), %rcx
movq -0x8(%rbp), %rax
addq 0x238(%rax), %rcx
movq %rcx, 0x238(%rax)
jmp 0x48da9
movq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x48db3
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x4888b
movq -0x8(%rbp), %rax
cmpq $0x0, 0x238(%rax)
jbe 0x48eb5
movq -0x8(%rbp), %rax
movq 0x248(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x248(%rax), %rsi
movq -0x8(%rbp), %rax
movq 0x238(%rax), %rax
shlq $0x3, %rax
addq %rax, %rsi
callq 0x2da20
movq $0x1, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x28(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x238(%rcx), %rax
ja 0x48eb3
movq -0x28(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x238(%rcx), %rax
je 0x48e61
movq -0x8(%rbp), %rax
movq 0x248(%rax), %rax
movq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x8(%rbp), %rcx
movq 0x248(%rcx), %rcx
movq -0x30(%rbp), %rdx
cmpq (%rcx,%rdx,8), %rax
je 0x48e9a
movq -0x28(%rbp), %rax
subq -0x30(%rbp), %rax
cmpq $0x2, %rax
jb 0x48e98
movq -0x8(%rbp), %rax
movq 0x218(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x248(%rcx), %rcx
movq -0x30(%rbp), %rdx
imulq $0x28, (%rcx,%rdx,8), %rcx
addq %rcx, %rax
movl $0x1, 0x1c(%rax)
jmp 0x48e9a
movq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x48e13
jmp 0x48eb5
movq $0x1, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x28(%rbp), %rax
movq -0x8(%rbp), %rcx
movl 0x10(%rcx), %ecx
cmpq %rcx, %rax
ja 0x49116
movq -0x28(%rbp), %rax
movq -0x8(%rbp), %rcx
movl 0x10(%rcx), %ecx
cmpq %rcx, %rax
je 0x48f13
movq -0x8(%rbp), %rax
movq (%rax), %rax
imulq $0x18, -0x28(%rbp), %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movq -0x8(%rbp), %rcx
movq (%rcx), %rcx
imulq $0x18, -0x30(%rbp), %rdx
addq %rdx, %rcx
cmpl 0x4(%rcx), %eax
je 0x49103
movq -0x8(%rbp), %rax
movq (%rax), %rax
imulq $0x18, -0x30(%rbp), %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x50(%rbp), %rcx
addq %rcx, %rax
movzbl 0x2c(%rax), %eax
cmpl $0x2, %eax
jne 0x48f9f
movq -0x10(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x50(%rbp), %rcx
addq %rcx, %rax
movb $0x1, 0x2e(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x50(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
addl $0x1, %eax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
imulq $0xa8, -0x50(%rbp), %rdx
addq %rdx, %rcx
subl 0x4(%rcx), %eax
movl %eax, %eax
movl %eax, %edx
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rcx
subq %rdx, %rcx
movq %rcx, 0x18(%rax)
jmp 0x490fb
movq -0x10(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x50(%rbp), %rcx
addq %rcx, %rax
movzbl 0x2c(%rax), %eax
cmpl $0x1, %eax
jne 0x490f9
movq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x28(%rbp), %rax
jae 0x490f7
movq -0x8(%rbp), %rax
movq (%rax), %rax
imulq $0x18, -0x38(%rbp), %rcx
addq %rcx, %rax
movzbl 0xc(%rax), %eax
cmpl $0x1, %eax
je 0x49008
movq -0x8(%rbp), %rax
movq (%rax), %rax
imulq $0x18, -0x38(%rbp), %rcx
addq %rcx, %rax
movzbl 0xc(%rax), %eax
cmpl $0x0, %eax
jne 0x490e4
movq -0x8(%rbp), %rax
movq 0x218(%rax), %rax
movq -0x8(%rbp), %rcx
movq (%rcx), %rcx
imulq $0x18, -0x38(%rbp), %rdx
addq %rdx, %rcx
movl 0x8(%rcx), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
cmpl $0x1, 0x1c(%rax)
jne 0x490e2
movq -0x78(%rbp), %rax
cmpl $0x2, 0x8(%rax)
jb 0x490e2
movq -0x78(%rbp), %rax
cmpl $0x2, 0xc(%rax)
jb 0x490e2
movq -0x10(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x50(%rbp), %rcx
addq %rcx, %rax
movb $0x1, 0x2e(%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rax
imulq $0x18, -0x38(%rbp), %rcx
addq %rcx, %rax
movzbl 0xc(%rax), %eax
cmpl $0x1, %eax
jne 0x490e0
movq -0x10(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x50(%rbp), %rcx
addq %rcx, %rax
movb $0x2, 0x2c(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x50(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
addl $0x1, %eax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
imulq $0xa8, -0x50(%rbp), %rdx
addq %rdx, %rcx
subl 0x4(%rcx), %eax
movl %eax, %eax
movl %eax, %edx
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rcx
subq %rdx, %rcx
movq %rcx, 0x18(%rax)
jmp 0x490f7
jmp 0x490e2
jmp 0x490e4
jmp 0x490e6
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x48fc6
jmp 0x490f9
jmp 0x490fb
movq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x49105
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x48ec5
addq $0xb0, %rsp
popq %rbp
retq
nop