// File: chhylp123[P]hifiasm/Overlaps.cpp
// Function: ma_scg_print(kvect_sec_t const*, All_reads*, asg_t*, ma_sub_t const*, ma_hit_t_alloc*, R_to_U*, int, char const*, _IO_FILE*)
void ma_scg_print(const kvect_sec_t *sc, All_reads *RNF, asg_t* read_g, const ma_sub_t *coverage_cut, ma_hit_t_alloc* sources, R_to_U* ruIndex, int print_seq, const char* prefix, FILE *fp)
{
    uint8_t* primary_flag = read_g?(uint8_t*)calloc(read_g->n_seq, sizeof(uint8_t)):NULL;
	uint64_t i, j, l, pc = read_g && coverage_cut && sources && ruIndex?1:0, tl, m, x; sec_t *scp;
	char name[32]; uint64_t Rb, Cb, tRb, tCb, Cov; ma_utg_t *z = NULL; uint8_t c;
	for (i = 0; i < sc->n; ++i) { // the Segment lines in GFA
        scp = &(sc->a[i]);
        ///debug
        // prt_scaf_stats(scp, sc->ctg, prefix, i);

        for (j = tl = tRb = tCb = 0; j < scp->n; j++) {
            z = &(sc->ctg->u.a[((uint32_t)scp->a[j])>>1]); tl += z->len; tl += (scp->a[j]>>32);
            if(pc) {
                get_ug_coverage(z, read_g, coverage_cut, sources, ruIndex, primary_flag, &Rb, &Cb); tRb += Rb; tCb += Cb;
            }
        }
        sprintf(name, "%s%.6lu%c", prefix, i + 1, "lc"[scp->is_c]); Cov = ((tRb==0)?(0):(tCb/tRb));

        if (!print_seq) {
            fprintf(fp, "S\t%s\t*\tLN:i:%lu\trd:i:%lu\n", name, tl, Cov);
        } else {
            fprintf(fp, "S\t%s\t", name);
            for (j = 0; j < scp->n; j++) {
                z = &(sc->ctg->u.a[((uint32_t)scp->a[j])>>1]); 
                if(!(((uint32_t)scp->a[j])&1)) {
                    fprintf(fp, "%s", z->s);
                } else {
                    for(l = 0; l < z->len; l++) {
                        c = (uint8_t)(z->s[z->len-1-l]);
                        fprintf(fp, "%c", ((c>=128)?'N':comp_tab[c]));
                    }
                }
                for(l = 0; l < (scp->a[j]>>32); l++) fprintf(fp, "N");
            }
            fprintf(fp, "\tLN:i:%lu\trd:i:%lu\n", tl, Cov);
        }


        for (j = tl = 0; j < scp->n; j++) {
            z = &(sc->ctg->u.a[((uint32_t)scp->a[j])>>1]); l = tl;
            if(!(((uint32_t)scp->a[j])&1)) {
                for (m = 0; m < z->n; m++) {
                    x = z->a[m]>>33;
                    if(x<RNF->total_reads) {
                        fprintf(fp, "A\t%s\t%lu\t%c\t%.*s\t%d\t%d\tid:i:%lu\tHG:A:%c\n", name, l, "+-"[(z->a[m]>>32)&1],
                        (int)Get_NAME_LENGTH((*RNF), x), Get_NAME((*RNF), x), 
                        coverage_cut?coverage_cut[x].s:0, coverage_cut?coverage_cut[x].e:(int)Get_READ_LENGTH((*RNF), x), x, 
                        "apmaaa"[((RNF->trio_flag[x]!=FATHER && RNF->trio_flag[x]!=MOTHER)?AMBIGU:RNF->trio_flag[x])]);
                    } else {
                        fprintf(fp, "A\t%s\t%lu\t%c\t%s\t%d\t%d\tid:i:%lu\tHG:A:%c\n", name, l, "+-"[(z->a[m]>>32)&1],
                            "FAKE", coverage_cut?coverage_cut[x].s:0, coverage_cut?coverage_cut[x].e:(int)Get_READ_LENGTH((*RNF), x), x, '*');
                    }
                    l += (uint32_t)(z->a[m]);
                }
            } else {
                for (m = 0; m < z->n; m++) {
                    x = z->a[z->n-m-1]>>33;
                    if(x<RNF->total_reads) {
                        fprintf(fp, "A\t%s\t%lu\t%c\t%.*s\t%d\t%d\tid:i:%lu\tHG:A:%c\n", name, l, "+-"[((z->a[z->n-m-1]>>32)&1)^1],
                        (int)Get_NAME_LENGTH((*RNF), x), Get_NAME((*RNF), x), 
                        coverage_cut?coverage_cut[x].s:0, coverage_cut?coverage_cut[x].e:(int)Get_READ_LENGTH((*RNF), x), x, 
                        "apmaaa"[((RNF->trio_flag[x]!=FATHER && RNF->trio_flag[x]!=MOTHER)?AMBIGU:RNF->trio_flag[x])]);
                    } else {
                        fprintf(fp, "A\t%s\t%lu\t%c\t%s\t%d\t%d\tid:i:%lu\tHG:A:%c\n", name, l, "+-"[((z->a[z->n-m-1]>>32)&1)^1],
                            "FAKE", coverage_cut?coverage_cut[x].s:0, coverage_cut?coverage_cut[x].e:(int)Get_READ_LENGTH((*RNF), x), x, '*');
                    }
                    l += (uint32_t)(z->a[z->n-m-1]);
                }
            }
            tl = l;

            if((scp->a[j]>>32) > 0) fprintf(fp, "A\t%s\t%lu\t+\tNs\t0\t%lu\tid:i:-1\tHG:A:a\n", name, l, (scp->a[j]>>32));

            tl += (scp->a[j]>>32);
        }
	}
    free(primary_flag);    
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x220, %rsp            # imm = 0x220
movq 0x20(%rbp), %rax
movq 0x18(%rbp), %rax
movl 0x10(%rbp), %eax
movq %rdi, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
movq %rdx, -0x28(%rbp)
movq %rcx, -0x30(%rbp)
movq %r8, -0x38(%rbp)
movq %r9, -0x40(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0xefdeb
movq -0x28(%rbp), %rax
movl 0x14(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
movl %eax, %edi
movl $0x1, %esi
callq 0x2140
movq %rax, -0xf0(%rbp)
jmp 0xefdf6
xorl %eax, %eax
movq %rax, -0xf0(%rbp)
jmp 0xefdf6
movq -0xf0(%rbp), %rax
movq %rax, -0x48(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x28(%rbp)
movb %al, -0xf1(%rbp)
je 0xefe3c
xorl %eax, %eax
cmpq $0x0, -0x30(%rbp)
movb %al, -0xf1(%rbp)
je 0xefe3c
xorl %eax, %eax
cmpq $0x0, -0x38(%rbp)
movb %al, -0xf1(%rbp)
je 0xefe3c
cmpq $0x0, -0x40(%rbp)
setne %al
movb %al, -0xf1(%rbp)
movb -0xf1(%rbp), %dl
xorl %eax, %eax
movl $0x1, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
cltq
movq %rax, -0x68(%rbp)
movq $0x0, -0xe0(%rbp)
movq $0x0, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq -0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jae 0xf0a6a
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x50(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x88(%rbp)
movq $0x0, -0xd0(%rbp)
movq $0x0, -0xc8(%rbp)
movq $0x0, -0x70(%rbp)
movq $0x0, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq -0x88(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jae 0xeffb1
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x10(%rax), %rax
movq -0x88(%rbp), %rcx
movq 0x18(%rcx), %rcx
movq -0x58(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
shrl %ecx
movl %ecx, %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xe0(%rbp)
movq -0xe0(%rbp), %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
addq -0x70(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x88(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x58(%rbp), %rcx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
addq -0x70(%rbp), %rax
movq %rax, -0x70(%rbp)
cmpq $0x0, -0x68(%rbp)
je 0xeff9e
movq -0xe0(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x38(%rbp), %rcx
movq -0x40(%rbp), %r8
movq -0x48(%rbp), %r9
leaq -0xb8(%rbp), %r10
leaq -0xc0(%rbp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0xee3e0
movq -0xb8(%rbp), %rax
addq -0xc8(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0xc0(%rbp), %rax
addq -0xd0(%rbp), %rax
movq %rax, -0xd0(%rbp)
jmp 0xeffa0
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0xefeb9
leaq -0xb0(%rbp), %rdi
movq 0x18(%rbp), %rdx
movq -0x50(%rbp), %rcx
addq $0x1, %rcx
movq -0x88(%rbp), %rax
movq 0x10(%rax), %rsi
leaq 0x29532d(%rip), %rax    # 0x385303
movsbl (%rax,%rsi), %r8d
leaq 0x296f5c(%rip), %rsi    # 0x386f3e
movb $0x0, %al
callq 0x2050
cmpq $0x0, -0xc8(%rbp)
jne 0xefffe
xorl %eax, %eax
movq %rax, -0x100(%rbp)
jmp 0xf0017
movq -0xd0(%rbp), %rax
xorl %ecx, %ecx
movl %ecx, %edx
divq -0xc8(%rbp)
movq %rax, -0x100(%rbp)
movq -0x100(%rbp), %rax
movq %rax, -0xd8(%rbp)
cmpl $0x0, 0x10(%rbp)
jne 0xf0054
movq 0x20(%rbp), %rdi
leaq -0xb0(%rbp), %rdx
movq -0x70(%rbp), %rcx
movq -0xd8(%rbp), %r8
leaq 0x296f73(%rip), %rsi    # 0x386fbb
movb $0x0, %al
callq 0x22a0
jmp 0xf0230
movq 0x20(%rbp), %rdi
leaq -0xb0(%rbp), %rdx
leaq 0x296f6f(%rip), %rsi    # 0x386fd5
movb $0x0, %al
callq 0x22a0
movq $0x0, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq -0x88(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jae 0xf0213
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x10(%rax), %rax
movq -0x88(%rbp), %rcx
movq 0x18(%rcx), %rcx
movq -0x58(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
shrl %ecx
movl %ecx, %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xe0(%rbp)
movq -0x88(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x58(%rbp), %rcx
movq (%rax,%rcx,8), %rax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0xf00f8
movq 0x20(%rbp), %rdi
movq -0xe0(%rbp), %rax
movq 0x20(%rax), %rdx
leaq 0x2ab4cb(%rip), %rsi    # 0x39b5b7
movb $0x0, %al
callq 0x22a0
jmp 0xf01b8
movq $0x0, -0x60(%rbp)
movq -0x60(%rbp), %rax
movq -0xe0(%rbp), %rcx
movl (%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movl %ecx, %ecx
cmpq %rcx, %rax
jae 0xf01b6
movq -0xe0(%rbp), %rax
movq 0x20(%rax), %rax
movq -0xe0(%rbp), %rcx
movl (%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
subl $0x1, %ecx
movslq %ecx, %rcx
subq -0x60(%rbp), %rcx
movb (%rax,%rcx), %al
movb %al, -0xe1(%rbp)
movq 0x20(%rbp), %rax
movq %rax, -0x108(%rbp)
movzbl -0xe1(%rbp), %eax
cmpl $0x80, %eax
jl 0xf016e
movb $0x4e, %al
movb %al, -0x109(%rbp)
jmp 0xf0187
movzbl -0xe1(%rbp), %eax
movl %eax, %ecx
leaq 0x2d45e2(%rip), %rax    # 0x3c4760
movb (%rax,%rcx), %al
movb %al, -0x109(%rbp)
movq -0x108(%rbp), %rdi
movb -0x109(%rbp), %al
movsbl %al, %edx
leaq 0x29ee2b(%rip), %rsi    # 0x38efc9
movb $0x0, %al
callq 0x22a0
movq -0x60(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x60(%rbp)
jmp 0xf0100
jmp 0xf01b8
movq $0x0, -0x60(%rbp)
movq -0x60(%rbp), %rax
movq -0x88(%rbp), %rcx
movq 0x18(%rcx), %rcx
movq -0x58(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
cmpq %rcx, %rax
jae 0xf0200
movq 0x20(%rbp), %rdi
leaq 0x296df0(%rip), %rsi    # 0x386fdb
movb $0x0, %al
callq 0x22a0
movq -0x60(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x60(%rbp)
jmp 0xf01c0
jmp 0xf0202
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0xf0075
movq 0x20(%rbp), %rdi
movq -0x70(%rbp), %rdx
movq -0xd8(%rbp), %rcx
leaq 0x296d98(%rip), %rsi    # 0x386fc1
movb $0x0, %al
callq 0x22a0
movq $0x0, -0x70(%rbp)
movq $0x0, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq -0x88(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jae 0xf0a57
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x10(%rax), %rax
movq -0x88(%rbp), %rcx
movq 0x18(%rcx), %rcx
movq -0x58(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
shrl %ecx
movl %ecx, %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xe0(%rbp)
movq -0x70(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x88(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x58(%rbp), %rcx
movq (%rax,%rcx,8), %rax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0xf061f
movq $0x0, -0x78(%rbp)
movq -0x78(%rbp), %rax
movq -0xe0(%rbp), %rcx
movl 0x10(%rcx), %ecx
cmpq %rcx, %rax
jae 0xf061a
movq -0xe0(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x78(%rbp), %rcx
movq (%rax,%rcx,8), %rax
shrq $0x21, %rax
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rax
movq -0x20(%rbp), %rcx
cmpq 0x50(%rcx), %rax
jae 0xf04d7
movq 0x20(%rbp), %rax
movq %rax, -0x138(%rbp)
leaq -0xb0(%rbp), %rax
movq %rax, -0x130(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x128(%rbp)
movq -0xe0(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x78(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
shrq $0x20, %rcx
andq $0x1, %rcx
leaq 0x292b5c(%rip), %rax    # 0x382e9b
movsbl (%rax,%rcx), %eax
movl %eax, -0x120(%rbp)
movq -0x20(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x80(%rbp), %rcx
movq 0x8(%rax,%rcx,8), %rax
movq -0x20(%rbp), %rcx
movq 0x40(%rcx), %rcx
movq -0x80(%rbp), %rdx
subq (%rcx,%rdx,8), %rax
movl %eax, -0x11c(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x20(%rbp), %rcx
movq 0x40(%rcx), %rcx
movq -0x80(%rbp), %rdx
addq (%rcx,%rdx,8), %rax
movq %rax, -0x118(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0xf03b1
movq -0x30(%rbp), %rax
imulq $0xc, -0x80(%rbp), %rcx
addq %rcx, %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, -0x13c(%rbp)
jmp 0xf03bb
xorl %eax, %eax
movl %eax, -0x13c(%rbp)
jmp 0xf03bb
movl -0x13c(%rbp), %eax
movl %eax, -0x140(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0xf03e5
movq -0x30(%rbp), %rax
imulq $0xc, -0x80(%rbp), %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movl %eax, -0x144(%rbp)
jmp 0xf03fb
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x80(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, -0x144(%rbp)
movl -0x144(%rbp), %eax
movl %eax, -0x154(%rbp)
movq -0x80(%rbp), %rax
movq %rax, -0x150(%rbp)
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x80(%rbp), %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x1, %eax
je 0xf0446
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x80(%rbp), %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x2, %eax
je 0xf0446
xorl %eax, %eax
movl %eax, -0x158(%rbp)
jmp 0xf045c
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x80(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x158(%rbp)
movq -0x150(%rbp), %r10
movl -0x154(%rbp), %r11d
movl -0x140(%rbp), %ebx
movq -0x118(%rbp), %r14
movl -0x11c(%rbp), %r9d
movl -0x120(%rbp), %r8d
movq -0x128(%rbp), %rcx
movq -0x130(%rbp), %rdx
movq -0x138(%rbp), %rdi
movl -0x158(%rbp), %eax
movslq %eax, %rsi
leaq 0x2969bf(%rip), %rax    # 0x386e69
movsbl (%rax,%rsi), %eax
leaq 0x296b28(%rip), %rsi    # 0x386fdd
movq %r14, (%rsp)
movl %ebx, 0x8(%rsp)
movl %r11d, 0x10(%rsp)
movq %r10, 0x18(%rsp)
movl %eax, 0x20(%rsp)
movb $0x0, %al
callq 0x22a0
jmp 0xf05ec
movq 0x20(%rbp), %rax
movq %rax, -0x178(%rbp)
leaq -0xb0(%rbp), %rax
movq %rax, -0x170(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x168(%rbp)
movq -0xe0(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x78(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
shrq $0x20, %rcx
andq $0x1, %rcx
leaq 0x29297e(%rip), %rax    # 0x382e9b
movsbl (%rax,%rcx), %eax
movl %eax, -0x15c(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0xf0549
movq -0x30(%rbp), %rax
imulq $0xc, -0x80(%rbp), %rcx
addq %rcx, %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, -0x17c(%rbp)
jmp 0xf0553
xorl %eax, %eax
movl %eax, -0x17c(%rbp)
jmp 0xf0553
movl -0x17c(%rbp), %eax
movl %eax, -0x180(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0xf057d
movq -0x30(%rbp), %rax
imulq $0xc, -0x80(%rbp), %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movl %eax, -0x184(%rbp)
jmp 0xf0593
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x80(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, -0x184(%rbp)
movl -0x180(%rbp), %r11d
movl -0x15c(%rbp), %r8d
movq -0x168(%rbp), %rcx
movq -0x170(%rbp), %rdx
movq -0x178(%rbp), %rdi
movl -0x184(%rbp), %r10d
movq -0x80(%rbp), %rax
leaq 0x296a3e(%rip), %rsi    # 0x387006
leaq 0x2968c6(%rip), %r9     # 0x386e95
movl %r11d, (%rsp)
movl %r10d, 0x8(%rsp)
movq %rax, 0x10(%rsp)
movl $0x2a, 0x18(%rsp)
movb $0x0, %al
callq 0x22a0
movq -0xe0(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x78(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, %eax
addq -0x60(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x78(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x78(%rbp)
jmp 0xf02b5
jmp 0xf09ce
movq $0x0, -0x78(%rbp)
movq -0x78(%rbp), %rax
movq -0xe0(%rbp), %rcx
movl 0x10(%rcx), %ecx
cmpq %rcx, %rax
jae 0xf09cc
movq -0xe0(%rbp), %rax
movq 0x18(%rax), %rax
movq -0xe0(%rbp), %rcx
movl 0x10(%rcx), %ecx
subq -0x78(%rbp), %rcx
subq $0x1, %rcx
movq (%rax,%rcx,8), %rax
shrq $0x21, %rax
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rax
movq -0x20(%rbp), %rcx
cmpq 0x50(%rcx), %rax
jae 0xf0869
movq 0x20(%rbp), %rax
movq %rax, -0x1b0(%rbp)
leaq -0xb0(%rbp), %rax
movq %rax, -0x1a8(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x1a0(%rbp)
movq -0xe0(%rbp), %rax
movq 0x18(%rax), %rax
movq -0xe0(%rbp), %rcx
movl 0x10(%rcx), %ecx
subq -0x78(%rbp), %rcx
subq $0x1, %rcx
movq (%rax,%rcx,8), %rcx
shrq $0x20, %rcx
andq $0x1, %rcx
xorq $0x1, %rcx
leaq 0x2927ca(%rip), %rax    # 0x382e9b
movsbl (%rax,%rcx), %eax
movl %eax, -0x198(%rbp)
movq -0x20(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x80(%rbp), %rcx
movq 0x8(%rax,%rcx,8), %rax
movq -0x20(%rbp), %rcx
movq 0x40(%rcx), %rcx
movq -0x80(%rbp), %rdx
subq (%rcx,%rdx,8), %rax
movl %eax, -0x194(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x20(%rbp), %rcx
movq 0x40(%rcx), %rcx
movq -0x80(%rbp), %rdx
addq (%rcx,%rdx,8), %rax
movq %rax, -0x190(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0xf0743
movq -0x30(%rbp), %rax
imulq $0xc, -0x80(%rbp), %rcx
addq %rcx, %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, -0x1b4(%rbp)
jmp 0xf074d
xorl %eax, %eax
movl %eax, -0x1b4(%rbp)
jmp 0xf074d
movl -0x1b4(%rbp), %eax
movl %eax, -0x1b8(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0xf0777
movq -0x30(%rbp), %rax
imulq $0xc, -0x80(%rbp), %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movl %eax, -0x1bc(%rbp)
jmp 0xf078d
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x80(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, -0x1bc(%rbp)
movl -0x1bc(%rbp), %eax
movl %eax, -0x1cc(%rbp)
movq -0x80(%rbp), %rax
movq %rax, -0x1c8(%rbp)
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x80(%rbp), %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x1, %eax
je 0xf07d8
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x80(%rbp), %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x2, %eax
je 0xf07d8
xorl %eax, %eax
movl %eax, -0x1d0(%rbp)
jmp 0xf07ee
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x80(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x1d0(%rbp)
movq -0x1c8(%rbp), %r10
movl -0x1cc(%rbp), %r11d
movl -0x1b8(%rbp), %ebx
movq -0x190(%rbp), %r14
movl -0x194(%rbp), %r9d
movl -0x198(%rbp), %r8d
movq -0x1a0(%rbp), %rcx
movq -0x1a8(%rbp), %rdx
movq -0x1b0(%rbp), %rdi
movl -0x1d0(%rbp), %eax
movslq %eax, %rsi
leaq 0x29662d(%rip), %rax    # 0x386e69
movsbl (%rax,%rsi), %eax
leaq 0x296796(%rip), %rsi    # 0x386fdd
movq %r14, (%rsp)
movl %ebx, 0x8(%rsp)
movl %r11d, 0x10(%rsp)
movq %r10, 0x18(%rsp)
movl %eax, 0x20(%rsp)
movb $0x0, %al
callq 0x22a0
jmp 0xf0990
movq 0x20(%rbp), %rax
movq %rax, -0x1f0(%rbp)
leaq -0xb0(%rbp), %rax
movq %rax, -0x1e8(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x1e0(%rbp)
movq -0xe0(%rbp), %rax
movq 0x18(%rax), %rax
movq -0xe0(%rbp), %rcx
movl 0x10(%rcx), %ecx
subq -0x78(%rbp), %rcx
subq $0x1, %rcx
movq (%rax,%rcx,8), %rcx
shrq $0x20, %rcx
andq $0x1, %rcx
xorq $0x1, %rcx
leaq 0x2925da(%rip), %rax    # 0x382e9b
movsbl (%rax,%rcx), %eax
movl %eax, -0x1d4(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0xf08ed
movq -0x30(%rbp), %rax
imulq $0xc, -0x80(%rbp), %rcx
addq %rcx, %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, -0x1f4(%rbp)
jmp 0xf08f7
xorl %eax, %eax
movl %eax, -0x1f4(%rbp)
jmp 0xf08f7
movl -0x1f4(%rbp), %eax
movl %eax, -0x1f8(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0xf0921
movq -0x30(%rbp), %rax
imulq $0xc, -0x80(%rbp), %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movl %eax, -0x1fc(%rbp)
jmp 0xf0937
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x80(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, -0x1fc(%rbp)
movl -0x1f8(%rbp), %r11d
movl -0x1d4(%rbp), %r8d
movq -0x1e0(%rbp), %rcx
movq -0x1e8(%rbp), %rdx
movq -0x1f0(%rbp), %rdi
movl -0x1fc(%rbp), %r10d
movq -0x80(%rbp), %rax
leaq 0x29669a(%rip), %rsi    # 0x387006
leaq 0x296522(%rip), %r9     # 0x386e95
movl %r11d, (%rsp)
movl %r10d, 0x8(%rsp)
movq %rax, 0x10(%rsp)
movl $0x2a, 0x18(%rsp)
movb $0x0, %al
callq 0x22a0
movq -0xe0(%rbp), %rax
movq 0x18(%rax), %rax
movq -0xe0(%rbp), %rcx
movl 0x10(%rcx), %ecx
subq -0x78(%rbp), %rcx
subq $0x1, %rcx
movq (%rax,%rcx,8), %rax
movl %eax, %eax
addq -0x60(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x78(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x78(%rbp)
jmp 0xf0627
jmp 0xf09ce
movq -0x60(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x88(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x58(%rbp), %rcx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
cmpq $0x0, %rax
jbe 0xf0a27
movq 0x20(%rbp), %rdi
leaq -0xb0(%rbp), %rdx
movq -0x60(%rbp), %rcx
movq -0x88(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x58(%rbp), %rsi
movq (%rax,%rsi,8), %r8
shrq $0x20, %r8
leaq 0x29660d(%rip), %rsi    # 0x38702d
movb $0x0, %al
callq 0x22a0
movq -0x88(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x58(%rbp), %rcx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
addq -0x70(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0xf0240
jmp 0xf0a59
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0xefe68
movq -0x48(%rbp), %rdi
callq 0x2210
addq $0x220, %rsp            # imm = 0x220
popq %rbx
popq %r14
popq %rbp
retq
nop