// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movl %r9d, 0x3c(%rsp)
movl %r8d, %r15d
movl %ecx, %ebx
movq %rdx, %r13
movq %rsi, %r12
movq %rdi, %r14
movl $0x1, %esi
movl $0x28, %edx
xorl %edi, %edi
callq 0x40c0
movq %rax, 0x48(%rsp)
movq %r13, %rdi
xorl %esi, %esi
callq 0x5df2
movq %rax, %r13
movq %rax, %rdi
testq %r12, %r12
jne 0xc4e5
callq 0x6398
jmp 0xc4f2
movq %r12, %rsi
movl $0x1, %edx
callq 0x6814
movq %rax, 0x50(%rsp)
leaq 0x3766(%rip), %rsi      # 0xfc64
movq %r14, %rdi
callq 0x3feb
testq %rax, %rax
movq 0x48(%rsp), %r12
je 0xcda7
movq %rax, 0x30(%rsp)
movq %rax, %rdi
callq 0x399a
movq %rax, %r14
movl $0x1, %edi
movl $0x38, %esi
callq 0x2200
movq %rax, %rbp
movq %r14, 0xa0(%rsp)
movq %r14, %rdi
callq 0x3e37
xorl %ecx, %ecx
movq %rcx, 0x88(%rsp)
movq %rcx, 0x90(%rsp)
movl %ecx, 0x40(%rsp)
movl %ecx, 0x44(%rsp)
movl %ecx, 0x10(%rsp)
movl %ecx, 0x14(%rsp)
movl %ecx, 0x20(%rsp)
movl %ecx, 0x24(%rsp)
movq %rcx, 0x68(%rsp)
movq %rcx, 0x70(%rsp)
movzbl %bl, %ecx
movl %ecx, 0x18(%rsp)
cmpl $0x1, %eax
movq %r13, 0xa8(%rsp)
jne 0xc947
addq $0x18, %r12
movq %r12, 0xb0(%rsp)
movl %r15d, %eax
movq %rax, 0x78(%rsp)
movabsq $0x431bde82d7b634db, %r13 # imm = 0x431BDE82D7B634DB
xorl %r14d, %r14d
movq $0x0, 0x60(%rsp)
xorl %r12d, %r12d
movq $0x0, (%rsp)
incq %r12
movq %r12, %rax
movq %rax, %r12
mulq %r13
movq %rdx, %rbx
movq 0x30(%rsp), %rdi
movq %rbp, %rsi
callq 0x3b96
testl %eax, %eax
js 0xcca4
shrq $0x12, %rbx
imulq $0xf4240, %rbx, %rsi    # imm = 0xF4240
movq %r12, %rax
mulq %r13
cmpq %r12, %rsi
je 0xc63b
movq %rbp, %rdi
testb %r14b, %r14b
je 0xc668
movq 0xa0(%rsp), %rsi
movl 0x18(%rsp), %edx
leaq 0x10(%rsp), %rcx
leaq 0x40(%rsp), %r8
leaq 0x88(%rsp), %r9
callq 0xdab6
movq %rax, %r15
leaq 0x1(%r12), %rax
testq %r15, %r15
je 0xc5cd
jmp 0xc6a9
movq %rdx, %rcx
shrq $0x12, %rcx
movq 0x89af(%rip), %rax      # 0x14ff8
movq (%rax), %rdi
leaq 0x42f9(%rip), %rsi      # 0x1094c
leaq 0x42d4(%rip), %rdx      # 0x1092e
movq 0x60(%rsp), %r8
xorl %eax, %eax
callq 0x2230
jmp 0xc601
movq 0xa0(%rsp), %rsi
movl 0x18(%rsp), %edx
leaq 0x14(%rsp), %rcx
leaq 0x44(%rsp), %r8
leaq 0x90(%rsp), %r9
callq 0xdab6
movl $0x0, %ecx
movq %rcx, (%rsp)
testq %rax, %rax
je 0xc5c7
movb $0x1, %r14b
movq %rax, (%rsp)
jmp 0xc5c7
movq (%rsp), %rdi
movq %r15, %rsi
callq 0x2210
testl %eax, %eax
je 0xc6e5
movq 0x88(%rsp), %rax
movq %rax, 0x90(%rsp)
movl 0x10(%rsp), %eax
movl %eax, 0x14(%rsp)
movl 0x40(%rsp), %eax
movl %eax, 0x44(%rsp)
movb $0x1, %r14b
movq (%rsp), %rdi
jmp 0xc939
movq 0x90(%rsp), %rsi
movq 0xa8(%rsp), %rbx
movq %rbx, %rdi
movq %rsi, 0x28(%rsp)
callq 0x57b5
movl 0x14(%rsp), %edx
movl %edx, %ecx
shrl $0x1f, %ecx
addl %edx, %ecx
sarl %ecx
movl 0x44(%rsp), %edi
movl %edi, %esi
shrl $0x1f, %esi
addl %edi, %esi
sarl %esi
addl %ecx, %esi
andl %edi, %edx
andl $0x1, %edx
addl %esi, %edx
movq 0x50(%rsp), %r14
movq %r14, %rdi
movl %eax, %esi
movl %edx, 0x98(%rsp)
leaq 0x24(%rsp), %rcx
leaq 0x70(%rsp), %r8
movl 0x3c(%rsp), %r9d
callq 0x7bc0
movl %eax, 0x58(%rsp)
movq 0x88(%rsp), %rsi
movq %rbx, %rdi
movq %rsi, 0x80(%rsp)
callq 0x57b5
movl 0x10(%rsp), %ebx
movl %ebx, %ecx
shrl $0x1f, %ecx
addl %ebx, %ecx
sarl %ecx
movl 0x40(%rsp), %edx
movl %edx, %esi
shrl $0x1f, %esi
addl %edx, %esi
sarl %esi
addl %ecx, %esi
andl %edx, %ebx
andl $0x1, %ebx
addl %esi, %ebx
movq %r14, %rdi
movl %eax, %esi
movl %ebx, %edx
leaq 0x20(%rsp), %rcx
leaq 0x68(%rsp), %r8
movl 0x3c(%rsp), %r9d
callq 0x7bc0
movl 0x58(%rsp), %ecx
testl %ecx, %ecx
je 0xc7e1
cmpl $0x1, %ecx
je 0xc826
cmpl $0x2, %ecx
movq 0x28(%rsp), %rcx
jne 0xc927
movq 0x8832(%rip), %rax      # 0x14ff8
movq (%rax), %rdi
leaq 0x41d6(%rip), %rsi      # 0x109a6
leaq 0x4157(%rip), %rdx      # 0x1092e
movl 0x98(%rsp), %r8d
jmp 0xc81a
movq 0x80(%rsp), %rcx
testl %eax, %eax
je 0xc85f
cmpl $0x1, %eax
je 0xc8be
cmpl $0x2, %eax
jne 0xc927
movq 0x87f2(%rip), %rax      # 0x14ff8
movq (%rax), %rdi
leaq 0x4196(%rip), %rsi      # 0x109a6
leaq 0x4117(%rip), %rdx      # 0x1092e
movl %ebx, %r8d
xorl %eax, %eax
callq 0x2230
jmp 0xc927
movq 0x48(%rsp), %rdi
movq 0x28(%rsp), %rbx
movq %rbx, %rsi
leaq 0xc(%rsp), %rdx
callq 0xdb26
cmpl $0x0, 0xc(%rsp)
je 0xc927
movq %rbx, %rdi
movq 0xb0(%rsp), %rsi
movl %eax, %edx
callq 0x2e1c
jmp 0xc927
movq 0x50(%rsp), %rax
movq 0x8(%rax), %rax
movl 0x24(%rsp), %ecx
imulq $0x58, %rcx, %rcx
movq (%rax,%rcx), %r14
movl 0x20(%rsp), %ecx
imulq $0x58, %rcx, %rcx
movq (%rax,%rcx), %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2210
testl %eax, %eax
jg 0xc8ee
movq 0x70(%rsp), %rax
movq 0x78(%rsp), %rcx
shrq %cl, %rax
movq 0x68(%rsp), %r9
shrq %cl, %r9
movq 0xf0(%rsp), %rdi
leaq 0x4124(%rip), %rsi      # 0x109d7
movq %r14, %rdx
movq %rax, %rcx
movq %rbx, %r8
jmp 0xc91b
movq 0x48(%rsp), %rdi
movq %rcx, %rbx
movq %rcx, %rsi
leaq 0xc(%rsp), %rdx
callq 0xdb26
cmpl $0x0, 0xc(%rsp)
je 0xc927
movq %rbx, %rdi
movq 0xb0(%rsp), %rsi
movl %eax, %edx
callq 0x2e5d
jmp 0xc927
movq 0x68(%rsp), %rax
movq 0x78(%rsp), %rcx
shrq %cl, %rax
movq 0x70(%rsp), %r9
shrq %cl, %r9
movq 0xf0(%rsp), %rdi
leaq 0x40dc(%rip), %rsi      # 0x109ee
movq %rbx, %rdx
movq %rax, %rcx
movq %r14, %r8
xorl %eax, %eax
callq 0x2230
incq 0x60(%rsp)
movq (%rsp), %rdi
callq 0x2060
xorl %r14d, %r14d
movq %r15, %rdi
xorl %r15d, %r15d
callq 0x2060
movq %r15, (%rsp)
jmp 0xc5c7
testb %bl, %bl
je 0xc954
movl 0x18(%rsp), %edi
callq 0x2d77
movq 0x90(%rsp), %rax
movq %rax, 0x28(%rsp)
movl 0x14(%rsp), %eax
movl %eax, 0x80(%rsp)
movq 0x88(%rsp), %rax
movq %rax, 0x18(%rsp)
movl 0x10(%rsp), %r13d
addq $0x18, %r12
movq %r12, 0x78(%rsp)
movl %r15d, %eax
movq %rax, 0x98(%rsp)
movabsq $0x431bde82d7b634db, %r14 # imm = 0x431BDE82D7B634DB
movq $0x0, 0x60(%rsp)
xorl %r15d, %r15d
movq 0x30(%rsp), %rbx
incq %r15
movq %r15, %rax
mulq %r14
movq %rdx, %r12
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x3b96
testl %eax, %eax
js 0xcc72
shrq $0x12, %r12
imulq $0xf4240, %r12, %rsi    # imm = 0xF4240
movq %r15, %rax
mulq %r14
cmpq %r15, %rsi
je 0xca01
movq 0x8(%rbp), %rax
shrq $0x20, %rax
testl $0xf4c, %eax            # imm = 0xF4C
setne %cl
testw %ax, %ax
sete %al
incq %r15
orb %cl, %al
jne 0xc9b0
jmp 0xca2e
movq %rdx, %rcx
shrq $0x12, %rcx
movq 0x85e9(%rip), %rax      # 0x14ff8
movq (%rax), %rdi
leaq 0x3f33(%rip), %rsi      # 0x1094c
leaq 0x3f0e(%rip), %rdx      # 0x1092e
movq 0x60(%rsp), %r8
xorl %eax, %eax
callq 0x2230
jmp 0xc9e2
movq 0xa0(%rsp), %rax
movq 0x8(%rax), %rax
movslq (%rbp), %rcx
movq (%rax,%rcx,8), %rsi
movl 0x4(%rbp), %r12d
movl 0x18(%rbp), %ecx
movl %ecx, (%rsp)
movslq 0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x18(%rsp)
movq 0xa8(%rsp), %r13
movq %r13, %rdi
movq %rsi, 0x28(%rsp)
callq 0x57b5
movq 0x50(%rsp), %rbx
movq %rbx, %rdi
movl %eax, %esi
movl %r12d, 0x80(%rsp)
movl %r12d, %edx
leaq 0x24(%rsp), %rcx
leaq 0x70(%rsp), %r8
movl 0x3c(%rsp), %r12d
movl %r12d, %r9d
callq 0x7bc0
movl %eax, 0x58(%rsp)
movq %r13, %rdi
movl (%rsp), %r13d
movq 0x18(%rsp), %rsi
callq 0x57b5
movq %rbx, %rdi
movl %eax, %esi
movl %r13d, %edx
leaq 0x20(%rsp), %rcx
leaq 0x68(%rsp), %r8
movl %r12d, %r9d
callq 0x7bc0
movl 0x58(%rsp), %ecx
decq %r15
testl %ecx, %ecx
je 0xcb0e
cmpl $0x1, %ecx
je 0xcb55
cmpl $0x2, %ecx
movq 0x30(%rsp), %rbx
jne 0xc9ad
movq 0x850a(%rip), %rax      # 0x14ff8
movq (%rax), %rdi
leaq 0x3eae(%rip), %rsi      # 0x109a6
leaq 0x3e2f(%rip), %rdx      # 0x1092e
movq 0x28(%rsp), %rcx
movl 0x80(%rsp), %r8d
jmp 0xcb49
testl %eax, %eax
je 0xcb8f
cmpl $0x1, %eax
movq 0x30(%rsp), %rbx
je 0xcbfa
cmpl $0x2, %eax
jne 0xc9ad
movq 0x84c8(%rip), %rax      # 0x14ff8
movq (%rax), %rdi
leaq 0x3e6c(%rip), %rsi      # 0x109a6
leaq 0x3ded(%rip), %rdx      # 0x1092e
movq 0x18(%rsp), %rcx
movl %r13d, %r8d
xorl %eax, %eax
callq 0x2230
jmp 0xc9ad
movq 0x48(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq 0xc(%rsp), %rdx
callq 0xdb26
cmpl $0x0, 0xc(%rsp)
movq 0x30(%rsp), %rbx
je 0xc9ad
movq 0x28(%rsp), %rdi
movq 0x78(%rsp), %rsi
movl %eax, %edx
callq 0x2d9a
jmp 0xc9ad
movq 0x50(%rsp), %rax
movq 0x8(%rax), %rax
movl 0x24(%rsp), %ecx
imulq $0x58, %rcx, %rcx
movq (%rax,%rcx), %r12
movl 0x20(%rsp), %ecx
imulq $0x58, %rcx, %rcx
movq (%rax,%rcx), %rsi
movq %r12, %rdi
movq %rsi, 0x58(%rsp)
callq 0x2210
testl %eax, %eax
movq 0x30(%rsp), %rbx
jg 0xcc2f
movq 0x70(%rsp), %rax
movq 0x98(%rsp), %rcx
shrq %cl, %rax
movq 0x68(%rsp), %r9
shrq %cl, %r9
movq 0xf0(%rsp), %rdi
leaq 0x3dea(%rip), %rsi      # 0x109d7
movq %r12, %rdx
movq %rax, %rcx
movq 0x58(%rsp), %r8
jmp 0xcc61
movq 0x48(%rsp), %rdi
movq 0x18(%rsp), %rsi
leaq 0xc(%rsp), %rdx
callq 0xdb26
cmpl $0x0, 0xc(%rsp)
je 0xc9ad
movq 0x18(%rsp), %rdi
movq 0x78(%rsp), %rsi
movl %eax, %edx
callq 0x2ddb
jmp 0xc9ad
movq 0x68(%rsp), %rax
movq 0x98(%rsp), %rcx
shrq %cl, %rax
movq 0x70(%rsp), %r9
shrq %cl, %r9
movq 0xf0(%rsp), %rdi
leaq 0x3d98(%rip), %rsi      # 0x109ee
movq 0x58(%rsp), %rdx
movq %rax, %rcx
movq %r12, %r8
xorl %eax, %eax
callq 0x2230
incq 0x60(%rsp)
jmp 0xc9ad
movq 0x28(%rsp), %rax
movq %rax, 0x90(%rsp)
movl 0x80(%rsp), %eax
movl %eax, 0x14(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x88(%rsp)
movl %r13d, 0x10(%rsp)
movq $0x0, (%rsp)
movq 0x834d(%rip), %rax      # 0x14ff8
movq (%rax), %rdi
leaq 0x3dac(%rip), %rsi      # 0x10a61
leaq 0x3c72(%rip), %rdx      # 0x1092e
xorl %ebx, %ebx
movq 0x60(%rsp), %rcx
xorl %eax, %eax
callq 0x2230
movq 0x48(%rsp), %r12
cmpl $0x0, (%r12)
movq 0xa8(%rsp), %r15
je 0xcd17
xorl %r14d, %r14d
movq 0x10(%r12), %rax
movl %r14d, %ecx
shrl $0x4, %ecx
movl (%rax,%rcx,4), %eax
movl %ebx, %ecx
andb $0x1e, %cl
shrl %cl, %eax
testb $0x3, %al
jne 0xcd08
movq 0x18(%r12), %rax
movq (%rax,%r14,8), %rdi
callq 0x2060
incq %r14
movl (%r12), %eax
addl $0x2, %ebx
cmpq %rax, %r14
jb 0xcce1
movq 0x18(%r12), %rsi
xorl %edi, %edi
callq 0x4162
movq 0x10(%r12), %rsi
xorl %edi, %edi
callq 0x4162
movq 0x20(%r12), %rsi
xorl %edi, %edi
callq 0x4162
xorl %edi, %edi
movq %r12, %rsi
callq 0x4162
movq (%rsp), %rdi
testq %rdi, %rdi
movq 0x30(%rsp), %rbx
je 0xcd58
callq 0x2060
testq %rbp, %rbp
je 0xcd6e
movq 0x30(%rbp), %rdi
callq 0x2060
movq %rbp, %rdi
callq 0x2060
movq 0xa0(%rsp), %rdi
callq 0x392d
movq %rbx, %rdi
callq 0x4072
movq 0x50(%rsp), %rdi
callq 0x5398
movq %r15, %rdi
callq 0x52fc
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
callq 0x2e9e