// File: /workspace/github_c_makefile_star2_O0/c-zhou[P]yahs/juicer.c
// Function: make_juicer_pre_file_from_bam
static int make_juicer_pre_file_from_bam(char *f, char *agp, char *fai, uint8_t mq, int scale, int count_gap, FILE *fo)
{
    bamFile fp;
    bam_header_t *h;
    bam1_t *b;
    char *cname0, *cname1, *rname0, *rname1;
    int32_t s0, s1, e0, e1;
    uint32_t i0, i1;
    uint64_t p0, p1, rec_c, pair_c;
    int8_t buff;
    enum bam_sort_order so;
    CC_ERR_t err0, err1;

    khash_t(str) *hmseq; // for absent sequences
    khint_t k;
    int absent;
    hmseq = kh_init(str);

    sdict_t *sdict = make_sdict_from_index(fai, 0);
    asm_dict_t *dict = agp? make_asm_dict_from_agp(sdict, agp, 1) : make_asm_dict_from_sdict(sdict);

    fp = bam_open(f, "r");
    if (fp == NULL) {
        fprintf(stderr, "[E::%s] cannot open file %s for reading\n", __func__, f);
        exit(EXIT_FAILURE);
    }
    
    h = bam_header_read(fp);
    b = bam_init1();
    so = bam_hrecs_sort_order(h);
    cname0 = cname1 = rname0 = rname1 = 0;
    s0 = s1 = e0 = e1 = 0;
    i0 = i1 = 0;
    p0 = p1 = 0;
    rec_c = pair_c = 0;
    buff = 0;    
    
    if (so == ORDER_NAME) {
        // sorted by read names
        while (bam_read1(fp, b) >= 0 ) {

            if (++rec_c % 1000000 == 0)
                fprintf(stderr, "[I::%s] %lu million records processed, %lu read pairs \n", __func__, rec_c / 1000000, pair_c);

            if (buff == 0) {
                rname0 = parse_bam_rec(b, h, mq, &s0, &e0, &cname0);
                if (!rname0)
                    continue;
                ++buff;
            } else if (buff == 1) {
                rname1 = parse_bam_rec(b, h, mq, &s1, &e1, &cname1);
                if (!rname1)
                    continue;
                if (strcmp(rname0, rname1) == 0) {
                    buff = 0;

                    err0 = sd_coordinate_conversion(dict, sd_get(sdict, cname0), s0 / 2 + e0 / 2 + (s0 & 1 && e0 & 1), &i0, &p0, count_gap);
                    err1 = sd_coordinate_conversion(dict, sd_get(sdict, cname1), s1 / 2 + e1 / 2 + (s1 & 1 && e1 & 1), &i1, &p1, count_gap);

                    if (err0 != CC_SUCCESS) {
                        if (err0 == SEQ_NOT_FOUND) {
                            k = kh_put(str, hmseq, cname0, &absent);
                            if (absent) {
                                kh_key(hmseq, k) = strdup(cname0);
                                fprintf(stderr, "[W::%s] sequence \"%s\" not found \n", __func__, cname0);
                            }
                        } else if (err0 == POS_NOT_IN_RANGE) {
                            fprintf(stderr, "[W::%s] sequence position \"%s:%u\" not in range \n", __func__,
                                    cname0, s0 / 2 + e0 / 2 + (s0 & 1 && e0 & 1));
                        }
                    } else if (err1 != CC_SUCCESS) {
                        if (err1 == SEQ_NOT_FOUND) {
                            k = kh_put(str, hmseq, cname1, &absent);
                            if (absent) {
                                kh_key(hmseq, k) = strdup(cname1);
                                fprintf(stderr, "[W::%s] sequence \"%s\" not found \n", __func__, cname1);
                            }
                        } else if (err1 == POS_NOT_IN_RANGE) {
                            fprintf(stderr, "[W::%s] sequence position \"%s:%u\" not in range \n", __func__,
                                    cname1, s1 / 2 + e1 / 2 + (s1 & 1 && e1 & 1));
                        }
                    } else {
                        if (strcmp(dict->s[i0].name, dict->s[i1].name) <= 0)
                            fprintf(fo, "0\t%s\t%lu\t0\t1\t%s\t%lu\t1\n", dict->s[i0].name, p0 >> scale, dict->s[i1].name, p1 >> scale);
                        else
                            fprintf(fo, "0\t%s\t%lu\t1\t1\t%s\t%lu\t0\n", dict->s[i1].name, p1 >> scale, dict->s[i0].name, p0 >> scale);

                        ++pair_c;
                    }

                    free(rname0);
                    free(rname1);
                    rname0 = 0;
                    rname1 = 0;
                } else {
                    buff = 1;

                    cname0 = cname1;
                    s0 = s1;
                    e0 = e1;
                    free(rname0);
                    rname0 = rname1;
                    rname1 = 0;
                }
            }
        }
    } else {
        // sorted by coordinates or others
        if (mq > 0)
            fprintf(stderr, "[W::%s] BAM file is not sorted by read name. Filtering by mapping quality %hhu suppressed \n", __func__, mq);

        while (bam_read1(fp, b) >= 0 ) {
            
            if (++rec_c % 1000000 == 0)
                fprintf(stderr, "[I::%s] %lu million records processed, %lu read pairs \n", __func__, rec_c / 1000000, pair_c); 
            
            if(parse_bam_rec1(b, h, &cname0, &s0, &cname1, &s1))
                continue;

            err0 = sd_coordinate_conversion(dict, sd_get(sdict, cname0), s0, &i0, &p0, count_gap);
            err1 = sd_coordinate_conversion(dict, sd_get(sdict, cname1), s1, &i1, &p1, count_gap);

            if (err0 != CC_SUCCESS) {
                if (err0 == SEQ_NOT_FOUND) {
                    k = kh_put(str, hmseq, cname0, &absent);
                    if (absent) {
                        kh_key(hmseq, k) = strdup(cname0);
                        fprintf(stderr, "[W::%s] sequence \"%s\" not found \n", __func__, cname0);
                    }
                } else if (err0 == POS_NOT_IN_RANGE) {
                    fprintf(stderr, "[W::%s] sequence position \"%s:%u\" not in range \n", __func__, cname0, s0);
                }
            } else if (err1 != CC_SUCCESS) {
                if (err1 == SEQ_NOT_FOUND) {
                    k = kh_put(str, hmseq, cname1, &absent);
                    if (absent) {
                        kh_key(hmseq, k) = strdup(cname1);
                        fprintf(stderr, "[W::%s] sequence \"%s\" not found \n", __func__, cname1);
                    }
                } else if (err1 == POS_NOT_IN_RANGE) {
                    fprintf(stderr, "[W::%s] sequence position \"%s:%u\" not in range \n", __func__, cname1, s1);
                }
            } else {
                if (strcmp(dict->s[i0].name, dict->s[i1].name) <= 0)
                    fprintf(fo, "0\t%s\t%lu\t0\t1\t%s\t%lu\t1\n", dict->s[i0].name, p0 >> scale, dict->s[i1].name, p1 >> scale);
                else
                    fprintf(fo, "0\t%s\t%lu\t1\t1\t%s\t%lu\t0\n", dict->s[i1].name, p1 >> scale, dict->s[i0].name, p0 >> scale);
        
                ++pair_c;
            }
        }
    }

    fprintf(stderr, "[I::%s] %lu read pairs processed\n", __func__, pair_c);

    for (k = 0; k < kh_end(hmseq); ++k)
        if (kh_exist(hmseq, k))
            free((char *) kh_key(hmseq, k));
    kh_destroy(str, hmseq);

    if (rname0)
        free(rname0);
    if (rname1)
        free(rname1);
    bam_destroy1(b);
    bam_header_destroy(h);
    bam_close(fp);
    asm_destroy(dict);
    sd_destroy(sdict);

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x170, %rsp            # imm = 0x170
movb %cl, %al
movq 0x10(%rbp), %rcx
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movb %al, -0x19(%rbp)
movl %r8d, -0x20(%rbp)
movl %r9d, -0x24(%rbp)
callq 0x111a0
movq %rax, -0xb0(%rbp)
movq -0x18(%rbp), %rdi
xorl %esi, %esi
callq 0x72b0
movq %rax, -0xc0(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0xee9b
movq -0xc0(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x1, %edx
callq 0x81b0
movq %rax, -0xd0(%rbp)
jmp 0xeeae
movq -0xc0(%rbp), %rdi
callq 0x7950
movq %rax, -0xd0(%rbp)
movq -0xd0(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x4ca7(%rip), %rsi      # 0x13b6e
callq 0x40e0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0xef04
movq 0x911a(%rip), %rax      # 0x17ff8
movq (%rax), %rdi
movq -0x8(%rbp), %rcx
leaq 0x4544(%rip), %rsi      # 0x13430
leaq 0x57bb(%rip), %rdx      # 0x146ae
movb $0x0, %al
callq 0x2230
movl $0x1, %edi
callq 0x23e0
movq -0x30(%rbp), %rdi
callq 0x3530
movq %rax, -0x38(%rbp)
movl $0x1, %edi
movl $0x38, %esi
callq 0x2200
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rdi
callq 0x3dc0
movl %eax, -0xa0(%rbp)
movq $0x0, -0x60(%rbp)
movq $0x0, -0x58(%rbp)
movq $0x0, -0x50(%rbp)
movq $0x0, -0x48(%rbp)
movl $0x0, -0x70(%rbp)
movl $0x0, -0x6c(%rbp)
movl $0x0, -0x68(%rbp)
movl $0x0, -0x64(%rbp)
movl $0x0, -0x78(%rbp)
movl $0x0, -0x74(%rbp)
movq $0x0, -0x88(%rbp)
movq $0x0, -0x80(%rbp)
movq $0x0, -0x98(%rbp)
movq $0x0, -0x90(%rbp)
movb $0x0, -0x99(%rbp)
cmpl $0x1, -0xa0(%rbp)
jne 0xf633
jmp 0xefbc
movq -0x30(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x3870
cmpl $0x0, %eax
jl 0xf62e
movq -0x90(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x90(%rbp)
movl $0xf4240, %ecx          # imm = 0xF4240
xorl %edx, %edx
divq %rcx
cmpq $0x0, %rdx
jne 0xf02e
movq 0x8ffd(%rip), %rax      # 0x17ff8
movq (%rax), %rdi
movq -0x90(%rbp), %rax
movl $0xf4240, %ecx          # imm = 0xF4240
xorl %edx, %edx
divq %rcx
movq %rax, %rcx
movq -0x98(%rbp), %r8
leaq 0x56ac(%rip), %rsi      # 0x146cc
leaq 0x5687(%rip), %rdx      # 0x146ae
movb $0x0, %al
callq 0x2230
movsbl -0x99(%rbp), %eax
cmpl $0x0, %eax
jne 0xf07a
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rsi
leaq -0x64(%rbp), %rcx
leaq -0x6c(%rbp), %r8
leaq -0x48(%rbp), %r9
movzbl -0x19(%rbp), %edx
callq 0x111c0
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x58(%rbp)
jne 0xf067
jmp 0xefbc
movb -0x99(%rbp), %al
addb $0x1, %al
movb %al, -0x99(%rbp)
jmp 0xf629
movsbl -0x99(%rbp), %eax
cmpl $0x1, %eax
jne 0xf627
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rsi
leaq -0x68(%rbp), %rcx
leaq -0x70(%rbp), %r8
leaq -0x50(%rbp), %r9
movzbl -0x19(%rbp), %edx
callq 0x111c0
movq %rax, -0x60(%rbp)
cmpq $0x0, -0x60(%rbp)
jne 0xf0b7
jmp 0xefbc
movq -0x58(%rbp), %rdi
movq -0x60(%rbp), %rsi
callq 0x2210
cmpl $0x0, %eax
jne 0xf5f1
movb $0x0, -0x99(%rbp)
movq -0xc8(%rbp), %rax
movq %rax, -0xe8(%rbp)
movq -0xc0(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x6a60
movl %eax, -0xe0(%rbp)
movl -0x64(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, -0xdc(%rbp)
movl -0x6c(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0xdc(%rbp), %eax
addl %ecx, %eax
movl %eax, -0xd8(%rbp)
movl -0x64(%rbp), %ecx
andl $0x1, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0xd1(%rbp)
je 0xf149
movl -0x6c(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
setne %al
movb %al, -0xd1(%rbp)
movl -0xe0(%rbp), %esi
movq -0xe8(%rbp), %rdi
movl -0xd8(%rbp), %edx
movb -0xd1(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
addl %eax, %edx
movl -0x24(%rbp), %r9d
leaq -0x74(%rbp), %rcx
leaq -0x80(%rbp), %r8
callq 0x95d0
movl %eax, -0xa4(%rbp)
movq -0xc8(%rbp), %rax
movq %rax, -0x100(%rbp)
movq -0xc0(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0x6a60
movl %eax, -0xf8(%rbp)
movl -0x68(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, -0xf4(%rbp)
movl -0x70(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0xf4(%rbp), %eax
addl %ecx, %eax
movl %eax, -0xf0(%rbp)
movl -0x68(%rbp), %ecx
andl $0x1, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0xe9(%rbp)
je 0xf1f5
movl -0x70(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
setne %al
movb %al, -0xe9(%rbp)
movl -0xf8(%rbp), %esi
movq -0x100(%rbp), %rdi
movl -0xf0(%rbp), %edx
movb -0xe9(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
addl %eax, %edx
movl -0x24(%rbp), %r9d
leaq -0x78(%rbp), %rcx
leaq -0x88(%rbp), %r8
callq 0x95d0
movl %eax, -0xa8(%rbp)
cmpl $0x0, -0xa4(%rbp)
je 0xf36d
cmpl $0x1, -0xa4(%rbp)
jne 0xf2b4
movq -0xb0(%rbp), %rdi
movq -0x48(%rbp), %rsi
leaq -0xb8(%rbp), %rdx
callq 0x11290
movl %eax, -0xb4(%rbp)
cmpl $0x0, -0xb8(%rbp)
je 0xf2af
movq -0x48(%rbp), %rdi
callq 0x2430
movq %rax, %rdx
movq -0xb0(%rbp), %rax
movq 0x18(%rax), %rax
movl -0xb4(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movq 0x8d65(%rip), %rax      # 0x17ff8
movq (%rax), %rdi
movq -0x48(%rbp), %rcx
leaq 0x5463(%rip), %rsi      # 0x14704
leaq 0x5406(%rip), %rdx      # 0x146ae
movb $0x0, %al
callq 0x2230
jmp 0xf368
cmpl $0x2, -0xa4(%rbp)
jne 0xf366
movq 0x8d30(%rip), %rax      # 0x17ff8
movq (%rax), %rax
movq %rax, -0x120(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x118(%rbp)
movl -0x64(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, -0x10c(%rbp)
movl -0x6c(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x10c(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x108(%rbp)
movl -0x64(%rbp), %ecx
andl $0x1, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x101(%rbp)
je 0xf32e
movl -0x6c(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
setne %al
movb %al, -0x101(%rbp)
movq -0x118(%rbp), %rcx
movq -0x120(%rbp), %rdi
movl -0x108(%rbp), %r8d
movb -0x101(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
addl %eax, %r8d
leaq 0x53ce(%rip), %rsi      # 0x14726
leaq 0x534f(%rip), %rdx      # 0x146ae
movb $0x0, %al
callq 0x2230
jmp 0xf368
jmp 0xf5cd
cmpl $0x0, -0xa8(%rbp)
je 0xf4ab
cmpl $0x1, -0xa8(%rbp)
jne 0xf3f2
movq -0xb0(%rbp), %rdi
movq -0x50(%rbp), %rsi
leaq -0xb8(%rbp), %rdx
callq 0x11290
movl %eax, -0xb4(%rbp)
cmpl $0x0, -0xb8(%rbp)
je 0xf3ed
movq -0x50(%rbp), %rdi
callq 0x2430
movq %rax, %rdx
movq -0xb0(%rbp), %rax
movq 0x18(%rax), %rax
movl -0xb4(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movq 0x8c27(%rip), %rax      # 0x17ff8
movq (%rax), %rdi
movq -0x50(%rbp), %rcx
leaq 0x5325(%rip), %rsi      # 0x14704
leaq 0x52c8(%rip), %rdx      # 0x146ae
movb $0x0, %al
callq 0x2230
jmp 0xf4a6
cmpl $0x2, -0xa8(%rbp)
jne 0xf4a4
movq 0x8bf2(%rip), %rax      # 0x17ff8
movq (%rax), %rax
movq %rax, -0x140(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x138(%rbp)
movl -0x68(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, -0x12c(%rbp)
movl -0x70(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x12c(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x128(%rbp)
movl -0x68(%rbp), %ecx
andl $0x1, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x121(%rbp)
je 0xf46c
movl -0x70(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
setne %al
movb %al, -0x121(%rbp)
movq -0x138(%rbp), %rcx
movq -0x140(%rbp), %rdi
movl -0x128(%rbp), %r8d
movb -0x121(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
addl %eax, %r8d
leaq 0x5290(%rip), %rsi      # 0x14726
leaq 0x5211(%rip), %rdx      # 0x146ae
movb $0x0, %al
callq 0x2230
jmp 0xf4a6
jmp 0xf5cb
movq -0xc8(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x74(%rbp), %ecx
imulq $0x58, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rdi
movq -0xc8(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x78(%rbp), %ecx
imulq $0x58, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rsi
callq 0x2210
cmpl $0x0, %eax
jg 0xf550
movq 0x10(%rbp), %rdi
movq -0xc8(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x74(%rbp), %ecx
imulq $0x58, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rdx
movq -0x80(%rbp), %rax
movl -0x20(%rbp), %ecx
shrq %cl, %rax
movq %rax, -0x148(%rbp)
movq -0xc8(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x78(%rbp), %ecx
imulq $0x58, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %r8
movq -0x88(%rbp), %r9
movl -0x20(%rbp), %eax
movl %eax, %ecx
shrq %cl, %r9
movq -0x148(%rbp), %rcx
leaq 0x5210(%rip), %rsi      # 0x14757
movb $0x0, %al
callq 0x2230
jmp 0xf5b9
movq 0x10(%rbp), %rdi
movq -0xc8(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x78(%rbp), %ecx
imulq $0x58, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rdx
movq -0x88(%rbp), %rax
movl -0x20(%rbp), %ecx
shrq %cl, %rax
movq %rax, -0x150(%rbp)
movq -0xc8(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x74(%rbp), %ecx
imulq $0x58, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %r8
movq -0x80(%rbp), %r9
movl -0x20(%rbp), %eax
movl %eax, %ecx
shrq %cl, %r9
movq -0x150(%rbp), %rcx
leaq 0x51bc(%rip), %rsi      # 0x1476e
movb $0x0, %al
callq 0x2230
movq -0x98(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x98(%rbp)
jmp 0xf5cd
movq -0x58(%rbp), %rdi
callq 0x2050
movq -0x60(%rbp), %rdi
callq 0x2050
movq $0x0, -0x58(%rbp)
movq $0x0, -0x60(%rbp)
jmp 0xf625
movb $0x1, -0x99(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x48(%rbp)
movl -0x68(%rbp), %eax
movl %eax, -0x64(%rbp)
movl -0x70(%rbp), %eax
movl %eax, -0x6c(%rbp)
movq -0x58(%rbp), %rdi
callq 0x2050
movq -0x60(%rbp), %rax
movq %rax, -0x58(%rbp)
movq $0x0, -0x60(%rbp)
jmp 0xf627
jmp 0xf629
jmp 0xefbc
jmp 0xfa1a
movzbl -0x19(%rbp), %eax
cmpl $0x0, %eax
jle 0xf65f
movq 0x89b5(%rip), %rax      # 0x17ff8
movq (%rax), %rdi
movzbl -0x19(%rbp), %ecx
leaq 0x5134(%rip), %rsi      # 0x14785
leaq 0x5056(%rip), %rdx      # 0x146ae
movb $0x0, %al
callq 0x2230
jmp 0xf661
movq -0x30(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x3870
cmpl $0x0, %eax
jl 0xfa18
movq -0x90(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x90(%rbp)
movl $0xf4240, %ecx          # imm = 0xF4240
xorl %edx, %edx
divq %rcx
cmpq $0x0, %rdx
jne 0xf6d3
movq 0x8958(%rip), %rax      # 0x17ff8
movq (%rax), %rdi
movq -0x90(%rbp), %rax
movl $0xf4240, %ecx          # imm = 0xF4240
xorl %edx, %edx
divq %rcx
movq %rax, %rcx
movq -0x98(%rbp), %r8
leaq 0x5007(%rip), %rsi      # 0x146cc
leaq 0x4fe2(%rip), %rdx      # 0x146ae
movb $0x0, %al
callq 0x2230
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rsi
leaq -0x48(%rbp), %rdx
leaq -0x64(%rbp), %rcx
leaq -0x50(%rbp), %r8
leaq -0x68(%rbp), %r9
callq 0x115f0
cmpl $0x0, %eax
je 0xf6fa
jmp 0xf661
movq -0xc8(%rbp), %rax
movq %rax, -0x160(%rbp)
movq -0xc0(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x6a60
movq -0x160(%rbp), %rdi
movl %eax, %esi
movl -0x64(%rbp), %edx
movl -0x24(%rbp), %r9d
leaq -0x74(%rbp), %rcx
leaq -0x80(%rbp), %r8
callq 0x95d0
movl %eax, -0xa4(%rbp)
movq -0xc8(%rbp), %rax
movq %rax, -0x158(%rbp)
movq -0xc0(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0x6a60
movq -0x158(%rbp), %rdi
movl %eax, %esi
movl -0x68(%rbp), %edx
movl -0x24(%rbp), %r9d
leaq -0x78(%rbp), %rcx
leaq -0x88(%rbp), %r8
callq 0x95d0
movl %eax, -0xa8(%rbp)
cmpl $0x0, -0xa4(%rbp)
je 0xf838
cmpl $0x1, -0xa4(%rbp)
jne 0xf801
movq -0xb0(%rbp), %rdi
movq -0x48(%rbp), %rsi
leaq -0xb8(%rbp), %rdx
callq 0x11290
movl %eax, -0xb4(%rbp)
cmpl $0x0, -0xb8(%rbp)
je 0xf7ff
movq -0x48(%rbp), %rdi
callq 0x2430
movq %rax, %rdx
movq -0xb0(%rbp), %rax
movq 0x18(%rax), %rax
movl -0xb4(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movq 0x8815(%rip), %rax      # 0x17ff8
movq (%rax), %rdi
movq -0x48(%rbp), %rcx
leaq 0x4f13(%rip), %rsi      # 0x14704
leaq 0x4eb6(%rip), %rdx      # 0x146ae
movb $0x0, %al
callq 0x2230
jmp 0xf833
cmpl $0x2, -0xa4(%rbp)
jne 0xf831
movq 0x87e7(%rip), %rax      # 0x17ff8
movq (%rax), %rdi
movq -0x48(%rbp), %rcx
movl -0x64(%rbp), %r8d
leaq 0x4f03(%rip), %rsi      # 0x14726
leaq 0x4e84(%rip), %rdx      # 0x146ae
movb $0x0, %al
callq 0x2230
jmp 0xf833
jmp 0xfa13
cmpl $0x0, -0xa8(%rbp)
je 0xf8f1
cmpl $0x1, -0xa8(%rbp)
jne 0xf8ba
movq -0xb0(%rbp), %rdi
movq -0x50(%rbp), %rsi
leaq -0xb8(%rbp), %rdx
callq 0x11290
movl %eax, -0xb4(%rbp)
cmpl $0x0, -0xb8(%rbp)
je 0xf8b8
movq -0x50(%rbp), %rdi
callq 0x2430
movq %rax, %rdx
movq -0xb0(%rbp), %rax
movq 0x18(%rax), %rax
movl -0xb4(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movq 0x875c(%rip), %rax      # 0x17ff8
movq (%rax), %rdi
movq -0x50(%rbp), %rcx
leaq 0x4e5a(%rip), %rsi      # 0x14704
leaq 0x4dfd(%rip), %rdx      # 0x146ae
movb $0x0, %al
callq 0x2230
jmp 0xf8ec
cmpl $0x2, -0xa8(%rbp)
jne 0xf8ea
movq 0x872e(%rip), %rax      # 0x17ff8
movq (%rax), %rdi
movq -0x50(%rbp), %rcx
movl -0x68(%rbp), %r8d
leaq 0x4e4a(%rip), %rsi      # 0x14726
leaq 0x4dcb(%rip), %rdx      # 0x146ae
movb $0x0, %al
callq 0x2230
jmp 0xf8ec
jmp 0xfa11
movq -0xc8(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x74(%rbp), %ecx
imulq $0x58, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rdi
movq -0xc8(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x78(%rbp), %ecx
imulq $0x58, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rsi
callq 0x2210
cmpl $0x0, %eax
jg 0xf996
movq 0x10(%rbp), %rdi
movq -0xc8(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x74(%rbp), %ecx
imulq $0x58, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rdx
movq -0x80(%rbp), %rax
movl -0x20(%rbp), %ecx
shrq %cl, %rax
movq %rax, -0x168(%rbp)
movq -0xc8(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x78(%rbp), %ecx
imulq $0x58, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %r8
movq -0x88(%rbp), %r9
movl -0x20(%rbp), %eax
movl %eax, %ecx
shrq %cl, %r9
movq -0x168(%rbp), %rcx
leaq 0x4dca(%rip), %rsi      # 0x14757
movb $0x0, %al
callq 0x2230
jmp 0xf9ff
movq 0x10(%rbp), %rdi
movq -0xc8(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x78(%rbp), %ecx
imulq $0x58, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rdx
movq -0x88(%rbp), %rax
movl -0x20(%rbp), %ecx
shrq %cl, %rax
movq %rax, -0x170(%rbp)
movq -0xc8(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x74(%rbp), %ecx
imulq $0x58, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %r8
movq -0x80(%rbp), %r9
movl -0x20(%rbp), %eax
movl %eax, %ecx
shrq %cl, %r9
movq -0x170(%rbp), %rcx
leaq 0x4d76(%rip), %rsi      # 0x1476e
movb $0x0, %al
callq 0x2230
movq -0x98(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x98(%rbp)
jmp 0xfa13
jmp 0xf661
jmp 0xfa1a
movq 0x85d7(%rip), %rax      # 0x17ff8
movq (%rax), %rdi
movq -0x98(%rbp), %rcx
leaq 0x4daf(%rip), %rsi      # 0x147e1
leaq 0x4c75(%rip), %rdx      # 0x146ae
movb $0x0, %al
callq 0x2230
movl $0x0, -0xb4(%rbp)
movl -0xb4(%rbp), %eax
movq -0xb0(%rbp), %rcx
cmpl (%rcx), %eax
jae 0xfab6
movq -0xb0(%rbp), %rax
movq 0x10(%rax), %rax
movl -0xb4(%rbp), %ecx
shrl $0x4, %ecx
movl %ecx, %ecx
movl (%rax,%rcx,4), %eax
movl -0xb4(%rbp), %ecx
andl $0xf, %ecx
shll %ecx
shrl %cl, %eax
andl $0x3, %eax
cmpl $0x0, %eax
jne 0xfaa3
movq -0xb0(%rbp), %rax
movq 0x18(%rax), %rax
movl -0xb4(%rbp), %ecx
movq (%rax,%rcx,8), %rdi
callq 0x2050
jmp 0xfaa5
movl -0xb4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xb4(%rbp)
jmp 0xfa4a
movq -0xb0(%rbp), %rdi
callq 0x116b0
cmpq $0x0, -0x58(%rbp)
je 0xfad2
movq -0x58(%rbp), %rdi
callq 0x2050
cmpq $0x0, -0x60(%rbp)
je 0xfae2
movq -0x60(%rbp), %rdi
callq 0x2050
jmp 0xfae4
cmpq $0x0, -0x40(%rbp)
je 0xfb01
movq -0x40(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x2050
movq -0x40(%rbp), %rdi
callq 0x2050
jmp 0xfb03
movq -0x38(%rbp), %rdi
callq 0x3470
movq -0x30(%rbp), %rdi
callq 0x4250
movq -0xc8(%rbp), %rdi
callq 0x63d0
movq -0xc0(%rbp), %rdi
callq 0x62a0
xorl %eax, %eax
addq $0x170, %rsp            # imm = 0x170
popq %rbp
retq
nopl (%rax,%rax)