// File: chhylp123[P]hifiasm/Correct.cpp
// Function: gen_affine_traceback(overlap_region*, ul_idx_t const*, hpc_t*, All_reads*, char*, char*, unsigned long, unsigned long*, unsigned long, Candidates_list*, unsigned int, unsigned int, unsigned int)
uint64_t gen_affine_traceback(overlap_region *o, const ul_idx_t *uref, hpc_t *hpc_g, All_reads *rref, char* qstr, char *tstr, uint64_t ql, 
uint64_t *qhp, uint64_t qhp_l, Candidates_list *ac, uint32_t hpc_max, uint32_t min_ach, uint32_t block)
{
    if(o->w_list.n <= 0) return 0;
    int64_t nw = o->w_list.n, snw, k, t, qi, ti, ci, p_qi, p_ti, cn, qs, qe, ts, te, tl; 
    window_list *z; uint8_t c; uint32_t cl, pcl, id = o->y_id, rev = o->y_pos_strand; k_mer_hit *p;
    uint64_t hm, aocc = 0, bocc = 0; qi = ti = 0; p_qi = p_ti = INT32_MIN; pcl = 0;
    clear_Candidates_list(ac); 
    if(o->w_list.n > (uint64_t)ac->size) {
        ac->size = o->w_list.n; REALLOC(ac->list, ac->size);
    }

    if(hpc_g) tl = hpc_len(*hpc_g, id);
    else if(uref) tl = uref->ug->u.a[id].len;
    else tl = Get_READ_LENGTH((*rref), id);
    for (k = 0; k < nw; k++) {
        z = &(o->w_list.a[k]); ci = 0; cn = z->clen;
        qi = z->x_start; ti = z->y_start;
        for (ci = 0; ci < cn; ci++) {
            get_cigar_cell(z, &(o->w_list), ci, &c, &cl);
            if (c == 0) { //match   
                if((p_qi == qi) && (p_ti == ti)) {
                    pcl += cl;
                } else {
                    ///push
                    if(pcl > 0) {
                        hm = 0; qs = qi - pcl; qe = qi; ts = ti - pcl; te = ti;
                        if(pcl > min_ach) hm = trim_hpc(uref, hpc_g, rref, qstr, tstr, hpc_max, ql, tl, id, rev, &qs, &qe, &ts, &te);
                        if(hm) aocc++;
                        if(hm || aocc == 0) {
                            cl_pushp(k_mer_hit, *ac, &p);
                            p->readID = p->strand = !!hm;
                            p->cnt = qe - qs; p->self_offset = qe; p->offset = te;
                            if(p->cnt > min_ach) bocc++;
                        }
                    }
                    ///push
                    pcl = 0;
                }
                qi += cl; ti += cl;
                p_qi = qi; p_ti = ti;
            } else {
                ///push
                if(pcl > 0) {
                    hm = 0; qs = qi - pcl; qe = qi; ts = ti - pcl; te = ti;
                    if(pcl > min_ach) hm = trim_hpc(uref, hpc_g, rref, qstr, tstr, hpc_max, ql, tl, id, rev, &qs, &qe, &ts, &te);
                    if(hm) aocc++;
                    if(hm || aocc == 0) {
                        cl_pushp(k_mer_hit, *ac, &p);
                        p->readID = p->strand = !!hm;
                        p->cnt = qe - qs; p->self_offset = qe; p->offset = te;
                        if(p->cnt > min_ach) bocc++;
                    }
                }
                pcl = 0;
                ///push
                if (c == 1) {
                    qi += cl; ti += cl; 
                } if (c == 2) {///t has more bases than p
                    ti += cl; 
                } if (c == 3) {///p has more bases than t
                    qi += cl; 
                }
            } 
        }
    }

    ///push
    if(pcl > 0) {
        hm = 0; qs = qi - pcl; qe = qi; ts = ti - pcl; te = ti;
        if(pcl > min_ach) hm = trim_hpc(uref, hpc_g, rref, qstr, tstr, hpc_max, ql, tl, id, rev, &qs, &qe, &ts, &te);
        if(hm) aocc++;
        if(hm || aocc == 0) {
            cl_pushp(k_mer_hit, *ac, &p);
            p->readID = p->strand = !!hm;
            p->cnt = qe - qs; p->self_offset = qe; p->offset = te;
            if(p->cnt > min_ach) bocc++;
        }
    }
    ///push

    nw = ac->length; snw = -1;
    if(aocc > 0) {
        if(aocc < (uint64_t)ac->length) {
            for (k = t = snw = 0; k < nw; k++) {
                if(ac->list[k].readID) {
                    ac->list[t] = ac->list[k]; 
                    if(ac->list[t].cnt <= block) snw++;
                    else snw += (ac->list[t].cnt/block) + (((ac->list[t].cnt%block) > 0)?1:0);
                    t++;
                }
            }
            ac->length = t;
        }
    } else if (bocc > 0) {
        if(bocc < (uint64_t)ac->length) {
            for (k = t = snw = 0; k < nw; k++) {
                if(ac->list[k].cnt > min_ach) {
                    ac->list[t] = ac->list[k]; 
                    if(ac->list[t].cnt <= block) snw++;
                    else snw += (ac->list[t].cnt/block) + (((ac->list[t].cnt%block) > 0)?1:0);
                    t++;
                }
            }
            ac->length = t;
        }
    }
    nw = ac->length;
    gen_affine_traceback_dp(ac, 25, 5000, 5000, block, snw);
    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x158, %rsp            # imm = 0x158
movl 0x40(%rbp), %eax
movl 0x38(%rbp), %eax
movl 0x30(%rbp), %eax
movq 0x28(%rbp), %rax
movq 0x20(%rbp), %rax
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x38(%rbp)
movq %rsi, -0x40(%rbp)
movq %rdx, -0x48(%rbp)
movq %rcx, -0x50(%rbp)
movq %r8, -0x58(%rbp)
movq %r9, -0x60(%rbp)
movq -0x38(%rbp), %rax
cmpq $0x0, 0x48(%rax)
ja 0x54aed
movq $0x0, -0x30(%rbp)
jmp 0x55863
movq -0x38(%rbp), %rax
movq 0x48(%rax), %rax
movq %rax, -0x68(%rbp)
movq -0x38(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0xf0(%rbp)
movq -0x38(%rbp), %rax
movl 0x1c(%rax), %eax
movl %eax, -0xf4(%rbp)
movq $0x0, -0x110(%rbp)
movq $0x0, -0x118(%rbp)
movq $0x0, -0x90(%rbp)
movq $0x0, -0x88(%rbp)
movq $-0x80000000, -0xa8(%rbp) # imm = 0x80000000
movq $-0x80000000, -0xa0(%rbp) # imm = 0x80000000
movl $0x0, -0xec(%rbp)
movq 0x28(%rbp), %rdi
callq 0x23090
movq -0x38(%rbp), %rax
movq 0x48(%rax), %rax
movq 0x28(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jbe 0x54bac
movq -0x38(%rbp), %rax
movq 0x48(%rax), %rcx
movq 0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
movq 0x28(%rbp), %rax
movq (%rax), %rdi
movq 0x28(%rbp), %rax
movq 0x10(%rax), %rsi
shlq $0x4, %rsi
callq 0x2360
movq %rax, %rcx
movq 0x28(%rbp), %rax
movq %rcx, (%rax)
cmpq $0x0, -0x48(%rbp)
je 0x54bdf
movq -0x48(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movl -0xf0(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
sarl %eax
cltq
movq %rax, -0xd8(%rbp)
jmp 0x54c2b
cmpq $0x0, -0x40(%rbp)
je 0x54c10
movq -0x40(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movl -0xf0(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
movq %rax, -0xd8(%rbp)
jmp 0x54c29
movq -0x50(%rbp), %rax
movq 0x18(%rax), %rax
movl -0xf0(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, -0xd8(%rbp)
jmp 0x54c2b
movq $0x0, -0x78(%rbp)
movq -0x78(%rbp), %rax
cmpq -0x68(%rbp), %rax
jge 0x5530e
movq -0x38(%rbp), %rax
movq 0x58(%rax), %rax
movq -0x78(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0xe0(%rbp)
movq $0x0, -0x98(%rbp)
movq -0xe0(%rbp), %rax
movl 0x1c(%rax), %eax
movq %rax, -0xb0(%rbp)
movq -0xe0(%rbp), %rax
movslq (%rax), %rax
movq %rax, -0x88(%rbp)
movq -0xe0(%rbp), %rax
movslq 0x8(%rax), %rax
movq %rax, -0x90(%rbp)
movq $0x0, -0x98(%rbp)
movq -0x98(%rbp), %rax
cmpq -0xb0(%rbp), %rax
jge 0x552fb
movq -0xe0(%rbp), %rdi
movq -0x38(%rbp), %rsi
addq $0x48, %rsi
movq -0x98(%rbp), %rax
movl %eax, %edx
leaq -0xe1(%rbp), %rcx
leaq -0xe8(%rbp), %r8
callq 0x2c960
movzbl -0xe1(%rbp), %eax
cmpl $0x0, %eax
jne 0x54ff0
movq -0xa0(%rbp), %rax
cmpq -0x88(%rbp), %rax
jne 0x54d2b
movq -0xa8(%rbp), %rax
cmpq -0x90(%rbp), %rax
jne 0x54d2b
movl -0xe8(%rbp), %eax
addl -0xec(%rbp), %eax
movl %eax, -0xec(%rbp)
jmp 0x54fa7
cmpl $0x0, -0xec(%rbp)
jbe 0x54f9d
movq $0x0, -0x108(%rbp)
movq -0x88(%rbp), %rax
movl -0xec(%rbp), %ecx
subq %rcx, %rax
movq %rax, -0xb8(%rbp)
movq -0x88(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0x90(%rbp), %rax
movl -0xec(%rbp), %ecx
subq %rcx, %rax
movq %rax, -0xc8(%rbp)
movq -0x90(%rbp), %rax
movq %rax, -0xd0(%rbp)
movl -0xec(%rbp), %eax
cmpl 0x38(%rbp), %eax
jbe 0x54e22
movq -0x40(%rbp), %rdi
movq -0x48(%rbp), %rsi
movq -0x50(%rbp), %rdx
movq -0x58(%rbp), %rcx
movq -0x60(%rbp), %r8
movl 0x30(%rbp), %eax
movl %eax, %r9d
movq 0x10(%rbp), %r13
movq -0xd8(%rbp), %r12
movl -0xf0(%rbp), %eax
movl %eax, %r15d
movl -0xf4(%rbp), %eax
movl %eax, %r14d
leaq -0xb8(%rbp), %rbx
leaq -0xc0(%rbp), %r11
leaq -0xc8(%rbp), %r10
leaq -0xd0(%rbp), %rax
movq %r13, (%rsp)
movq %r12, 0x8(%rsp)
movq %r15, 0x10(%rsp)
movq %r14, 0x18(%rsp)
movq %rbx, 0x20(%rsp)
movq %r11, 0x28(%rsp)
movq %r10, 0x30(%rsp)
movq %rax, 0x38(%rsp)
callq 0x53ce0
movq %rax, -0x108(%rbp)
cmpq $0x0, -0x108(%rbp)
je 0x54e3e
movq -0x110(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x110(%rbp)
cmpq $0x0, -0x108(%rbp)
jne 0x54e56
cmpq $0x0, -0x110(%rbp)
jne 0x54f9b
jmp 0x54e58
movq 0x28(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x28(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jne 0x54ec8
movq 0x28(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x54e89
movq 0x28(%rbp), %rax
movq 0x10(%rax), %rax
shlq %rax
movq %rax, -0x120(%rbp)
jmp 0x54e97
movl $0x2, %eax
movq %rax, -0x120(%rbp)
jmp 0x54e97
movq -0x120(%rbp), %rcx
movq 0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
movq 0x28(%rbp), %rax
movq (%rax), %rdi
movq 0x28(%rbp), %rax
movq 0x10(%rax), %rsi
shlq $0x4, %rsi
callq 0x2360
movq %rax, %rcx
movq 0x28(%rbp), %rax
movq %rcx, (%rax)
movq 0x28(%rbp), %rax
movq (%rax), %rax
movq 0x28(%rbp), %rdx
movq 0x8(%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, 0x8(%rdx)
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x100(%rbp)
cmpq $0x0, -0x108(%rbp)
setne %al
xorb $-0x1, %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %edx
movq -0x100(%rbp), %rax
movl (%rax), %ecx
andl $0x1, %edx
movl %edx, %esi
shll $0x1f, %esi
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
orl %esi, %ecx
movl %ecx, (%rax)
movq -0x100(%rbp), %rax
movl (%rax), %ecx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
andl $0x80000000, %ecx       # imm = 0x80000000
orl %edx, %ecx
movl %ecx, (%rax)
movq -0xc0(%rbp), %rax
subq -0xb8(%rbp), %rax
movl %eax, %ecx
movq -0x100(%rbp), %rax
movl %ecx, 0xc(%rax)
movq -0xc0(%rbp), %rax
movl %eax, %ecx
movq -0x100(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0xd0(%rbp), %rax
movl %eax, %ecx
movq -0x100(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x100(%rbp), %rax
movl 0xc(%rax), %eax
cmpl 0x38(%rbp), %eax
jbe 0x54f99
movq -0x118(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x118(%rbp)
jmp 0x54f9b
jmp 0x54f9d
movl $0x0, -0xec(%rbp)
movl -0xe8(%rbp), %eax
addq -0x88(%rbp), %rax
movq %rax, -0x88(%rbp)
movl -0xe8(%rbp), %eax
addq -0x90(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x88(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0x90(%rbp), %rax
movq %rax, -0xa8(%rbp)
jmp 0x552e2
cmpl $0x0, -0xec(%rbp)
jbe 0x55262
movq $0x0, -0x108(%rbp)
movq -0x88(%rbp), %rax
movl -0xec(%rbp), %ecx
subq %rcx, %rax
movq %rax, -0xb8(%rbp)
movq -0x88(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0x90(%rbp), %rax
movl -0xec(%rbp), %ecx
subq %rcx, %rax
movq %rax, -0xc8(%rbp)
movq -0x90(%rbp), %rax
movq %rax, -0xd0(%rbp)
movl -0xec(%rbp), %eax
cmpl 0x38(%rbp), %eax
jbe 0x550e7
movq -0x40(%rbp), %rdi
movq -0x48(%rbp), %rsi
movq -0x50(%rbp), %rdx
movq -0x58(%rbp), %rcx
movq -0x60(%rbp), %r8
movl 0x30(%rbp), %eax
movl %eax, %r9d
movq 0x10(%rbp), %r13
movq -0xd8(%rbp), %r12
movl -0xf0(%rbp), %eax
movl %eax, %r15d
movl -0xf4(%rbp), %eax
movl %eax, %r14d
leaq -0xb8(%rbp), %rbx
leaq -0xc0(%rbp), %r11
leaq -0xc8(%rbp), %r10
leaq -0xd0(%rbp), %rax
movq %r13, (%rsp)
movq %r12, 0x8(%rsp)
movq %r15, 0x10(%rsp)
movq %r14, 0x18(%rsp)
movq %rbx, 0x20(%rsp)
movq %r11, 0x28(%rsp)
movq %r10, 0x30(%rsp)
movq %rax, 0x38(%rsp)
callq 0x53ce0
movq %rax, -0x108(%rbp)
cmpq $0x0, -0x108(%rbp)
je 0x55103
movq -0x110(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x110(%rbp)
cmpq $0x0, -0x108(%rbp)
jne 0x5511b
cmpq $0x0, -0x110(%rbp)
jne 0x55260
jmp 0x5511d
movq 0x28(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x28(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jne 0x5518d
movq 0x28(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x5514e
movq 0x28(%rbp), %rax
movq 0x10(%rax), %rax
shlq %rax
movq %rax, -0x128(%rbp)
jmp 0x5515c
movl $0x2, %eax
movq %rax, -0x128(%rbp)
jmp 0x5515c
movq -0x128(%rbp), %rcx
movq 0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
movq 0x28(%rbp), %rax
movq (%rax), %rdi
movq 0x28(%rbp), %rax
movq 0x10(%rax), %rsi
shlq $0x4, %rsi
callq 0x2360
movq %rax, %rcx
movq 0x28(%rbp), %rax
movq %rcx, (%rax)
movq 0x28(%rbp), %rax
movq (%rax), %rax
movq 0x28(%rbp), %rdx
movq 0x8(%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, 0x8(%rdx)
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x100(%rbp)
cmpq $0x0, -0x108(%rbp)
setne %al
xorb $-0x1, %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %edx
movq -0x100(%rbp), %rax
movl (%rax), %ecx
andl $0x1, %edx
movl %edx, %esi
shll $0x1f, %esi
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
orl %esi, %ecx
movl %ecx, (%rax)
movq -0x100(%rbp), %rax
movl (%rax), %ecx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
andl $0x80000000, %ecx       # imm = 0x80000000
orl %edx, %ecx
movl %ecx, (%rax)
movq -0xc0(%rbp), %rax
subq -0xb8(%rbp), %rax
movl %eax, %ecx
movq -0x100(%rbp), %rax
movl %ecx, 0xc(%rax)
movq -0xc0(%rbp), %rax
movl %eax, %ecx
movq -0x100(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0xd0(%rbp), %rax
movl %eax, %ecx
movq -0x100(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x100(%rbp), %rax
movl 0xc(%rax), %eax
cmpl 0x38(%rbp), %eax
jbe 0x5525e
movq -0x118(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x118(%rbp)
jmp 0x55260
jmp 0x55262
movl $0x0, -0xec(%rbp)
movzbl -0xe1(%rbp), %eax
cmpl $0x1, %eax
jne 0x552a0
movl -0xe8(%rbp), %eax
addq -0x88(%rbp), %rax
movq %rax, -0x88(%rbp)
movl -0xe8(%rbp), %eax
addq -0x90(%rbp), %rax
movq %rax, -0x90(%rbp)
movzbl -0xe1(%rbp), %eax
cmpl $0x2, %eax
jne 0x552c0
movl -0xe8(%rbp), %eax
addq -0x90(%rbp), %rax
movq %rax, -0x90(%rbp)
movzbl -0xe1(%rbp), %eax
cmpl $0x3, %eax
jne 0x552e0
movl -0xe8(%rbp), %eax
addq -0x88(%rbp), %rax
movq %rax, -0x88(%rbp)
jmp 0x552e2
jmp 0x552e4
movq -0x98(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x98(%rbp)
jmp 0x54ca5
jmp 0x552fd
movq -0x78(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x78(%rbp)
jmp 0x54c33
cmpl $0x0, -0xec(%rbp)
jbe 0x55580
movq $0x0, -0x108(%rbp)
movq -0x88(%rbp), %rax
movl -0xec(%rbp), %ecx
subq %rcx, %rax
movq %rax, -0xb8(%rbp)
movq -0x88(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0x90(%rbp), %rax
movl -0xec(%rbp), %ecx
subq %rcx, %rax
movq %rax, -0xc8(%rbp)
movq -0x90(%rbp), %rax
movq %rax, -0xd0(%rbp)
movl -0xec(%rbp), %eax
cmpl 0x38(%rbp), %eax
jbe 0x55405
movq -0x40(%rbp), %rdi
movq -0x48(%rbp), %rsi
movq -0x50(%rbp), %rdx
movq -0x58(%rbp), %rcx
movq -0x60(%rbp), %r8
movl 0x30(%rbp), %eax
movl %eax, %r9d
movq 0x10(%rbp), %r13
movq -0xd8(%rbp), %r12
movl -0xf0(%rbp), %eax
movl %eax, %r15d
movl -0xf4(%rbp), %eax
movl %eax, %r14d
leaq -0xb8(%rbp), %rbx
leaq -0xc0(%rbp), %r11
leaq -0xc8(%rbp), %r10
leaq -0xd0(%rbp), %rax
movq %r13, (%rsp)
movq %r12, 0x8(%rsp)
movq %r15, 0x10(%rsp)
movq %r14, 0x18(%rsp)
movq %rbx, 0x20(%rsp)
movq %r11, 0x28(%rsp)
movq %r10, 0x30(%rsp)
movq %rax, 0x38(%rsp)
callq 0x53ce0
movq %rax, -0x108(%rbp)
cmpq $0x0, -0x108(%rbp)
je 0x55421
movq -0x110(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x110(%rbp)
cmpq $0x0, -0x108(%rbp)
jne 0x55439
cmpq $0x0, -0x110(%rbp)
jne 0x5557e
jmp 0x5543b
movq 0x28(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x28(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jne 0x554ab
movq 0x28(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x5546c
movq 0x28(%rbp), %rax
movq 0x10(%rax), %rax
shlq %rax
movq %rax, -0x130(%rbp)
jmp 0x5547a
movl $0x2, %eax
movq %rax, -0x130(%rbp)
jmp 0x5547a
movq -0x130(%rbp), %rcx
movq 0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
movq 0x28(%rbp), %rax
movq (%rax), %rdi
movq 0x28(%rbp), %rax
movq 0x10(%rax), %rsi
shlq $0x4, %rsi
callq 0x2360
movq %rax, %rcx
movq 0x28(%rbp), %rax
movq %rcx, (%rax)
movq 0x28(%rbp), %rax
movq (%rax), %rax
movq 0x28(%rbp), %rdx
movq 0x8(%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, 0x8(%rdx)
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x100(%rbp)
cmpq $0x0, -0x108(%rbp)
setne %al
xorb $-0x1, %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %edx
movq -0x100(%rbp), %rax
movl (%rax), %ecx
andl $0x1, %edx
movl %edx, %esi
shll $0x1f, %esi
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
orl %esi, %ecx
movl %ecx, (%rax)
movq -0x100(%rbp), %rax
movl (%rax), %ecx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
andl $0x80000000, %ecx       # imm = 0x80000000
orl %edx, %ecx
movl %ecx, (%rax)
movq -0xc0(%rbp), %rax
subq -0xb8(%rbp), %rax
movl %eax, %ecx
movq -0x100(%rbp), %rax
movl %ecx, 0xc(%rax)
movq -0xc0(%rbp), %rax
movl %eax, %ecx
movq -0x100(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0xd0(%rbp), %rax
movl %eax, %ecx
movq -0x100(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x100(%rbp), %rax
movl 0xc(%rax), %eax
cmpl 0x38(%rbp), %eax
jbe 0x5557c
movq -0x118(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x118(%rbp)
jmp 0x5557e
jmp 0x55580
movq 0x28(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x68(%rbp)
movq $-0x1, -0x70(%rbp)
cmpq $0x0, -0x110(%rbp)
jbe 0x556e4
movq -0x110(%rbp), %rax
movq 0x28(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jae 0x556df
movq $0x0, -0x70(%rbp)
movq $0x0, -0x80(%rbp)
movq $0x0, -0x78(%rbp)
movq -0x78(%rbp), %rax
cmpq -0x68(%rbp), %rax
jge 0x556d3
movq 0x28(%rbp), %rax
movq (%rax), %rax
movq -0x78(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
cmpl $0x0, %eax
je 0x556c0
movq 0x28(%rbp), %rax
movq (%rax), %rcx
movq -0x78(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rcx
movq 0x28(%rbp), %rax
movq (%rax), %rax
movq -0x80(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0x8(%rax)
movq 0x28(%rbp), %rax
movq (%rax), %rax
movq -0x80(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
cmpl 0x40(%rbp), %eax
ja 0x55659
movq -0x70(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x70(%rbp)
jmp 0x556b4
movq 0x28(%rbp), %rax
movq (%rax), %rax
movq -0x80(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
xorl %edx, %edx
divl 0x40(%rbp)
movl %eax, -0x134(%rbp)
movq 0x28(%rbp), %rax
movq (%rax), %rax
movq -0x80(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
xorl %edx, %edx
divl 0x40(%rbp)
movl -0x134(%rbp), %eax
movl %edx, %esi
xorl %ecx, %ecx
movl $0x1, %edx
cmpl $0x0, %esi
cmoval %edx, %ecx
addl %ecx, %eax
movl %eax, %eax
addq -0x70(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x80(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x80(%rbp)
jmp 0x556c2
movq -0x78(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x78(%rbp)
jmp 0x555cf
movq -0x80(%rbp), %rcx
movq 0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0x5582f
cmpq $0x0, -0x118(%rbp)
jbe 0x5582d
movq -0x118(%rbp), %rax
movq 0x28(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jae 0x5582b
movq $0x0, -0x70(%rbp)
movq $0x0, -0x80(%rbp)
movq $0x0, -0x78(%rbp)
movq -0x78(%rbp), %rax
cmpq -0x68(%rbp), %rax
jge 0x5581f
movq 0x28(%rbp), %rax
movq (%rax), %rax
movq -0x78(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
cmpl 0x38(%rbp), %eax
jbe 0x5580c
movq 0x28(%rbp), %rax
movq (%rax), %rcx
movq -0x78(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rcx
movq 0x28(%rbp), %rax
movq (%rax), %rax
movq -0x80(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0x8(%rax)
movq 0x28(%rbp), %rax
movq (%rax), %rax
movq -0x80(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
cmpl 0x40(%rbp), %eax
ja 0x557a5
movq -0x70(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x70(%rbp)
jmp 0x55800
movq 0x28(%rbp), %rax
movq (%rax), %rax
movq -0x80(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
xorl %edx, %edx
divl 0x40(%rbp)
movl %eax, -0x138(%rbp)
movq 0x28(%rbp), %rax
movq (%rax), %rax
movq -0x80(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
xorl %edx, %edx
divl 0x40(%rbp)
movl -0x138(%rbp), %eax
movl %edx, %esi
xorl %ecx, %ecx
movl $0x1, %edx
cmpl $0x0, %esi
cmoval %edx, %ecx
addl %ecx, %eax
movl %eax, %eax
addq -0x70(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x80(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x80(%rbp)
jmp 0x5580e
movq -0x78(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x78(%rbp)
jmp 0x5571f
movq -0x80(%rbp), %rcx
movq 0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0x5582d
jmp 0x5582f
movq 0x28(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x68(%rbp)
movq 0x28(%rbp), %rdi
movl 0x40(%rbp), %eax
movl %eax, %r8d
movq -0x70(%rbp), %r9
movl $0x19, %esi
movl $0x1388, %ecx           # imm = 0x1388
movq %rcx, %rdx
callq 0x543c0
movq $0x1, -0x30(%rbp)
movq -0x30(%rbp), %rax
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)