// File: /workspace/github_c_makefile_star2_O2/skoren[P]bacValidation/samToErrorRate.C
// Function: main
int
main (int argc, char **argv) {
    map<string, string> reference;
    // loadFasta
    FILE *in = fopen(argv[2], "r");
    gzFile f = gzdopen(fileno(in), "r");
    kseq_t *seq = kseq_init(f);
    int l = 0;
    while ((l=kseq_read(seq)) >= 0) {
       reference[seq->name.s] = seq->seq.s;
       string name = seq->name.s;
       name.append("rc");
       reference[name] = rc(seq->seq.s, strlen(seq->seq.s));
    }
    kseq_destroy(seq);
    gzclose(f);
    fclose(in);

    bam1_t *b = bam_init1();
    samfile_t * fp = open_alignment_file(argv[1]);
    if (fp == NULL) {
        exit(1);
    }
    bam_header_t* head = fp->header; // sam header
    while (samread(fp, b) >= 0) {
        //Get bam core.
        const bam1_core_t *core = &b->core;
        if (core == NULL) {
            printf("Input file is corrupt!");
            exit(1);
        }
        if (!is_mapped(core)) {
            continue;
        }

        string id = bam1_qname(b);
        string ref = head->target_name[core->tid];
        uint32_t* cigar = bam1_cigar(b);
        uint32_t refLen = head->target_len[core->tid];
        uint32_t refLo = core->pos + 1;
        uint32_t refHigh = bam_calend(core, cigar);
        uint32_t seqLow = 0;
        uint32_t seqHi = core->l_qseq; 
        uint32_t seqLen = core->l_qseq;
        bool isFwd = !(core->flag & BAM_FREVERSE);

        // now parse, we need both sequecnes for this
        if (strlen(reference[ref].c_str()) <= 0) { 
           fprintf(stderr, "Error: unknown reference sequence %s", ref.c_str());
           exit(1);
        }
        char *refSeq = (char*)reference[ref].c_str()+refLo-1;
        char *qrySeq = new char[core->l_qseq+1];
        char *orig = qrySeq;
        for (int i = 0; i < core->l_qseq; i++) {
          qrySeq[i] = bam_nt16_rev_table[bam1_seqi(bam1_seq(b), i)];
        }
        qrySeq[core->l_qseq]='\0';
        int errors = 0;
        int matches = 0;
        int indels = 0;
        uint32_t len = 0;
        for (int k = 0; k < core->n_cigar; ++k) {
            int cop = cigar[k] & BAM_CIGAR_MASK; // operation
            int cl = cigar[k] >> BAM_CIGAR_SHIFT; // length
            switch (cop) {
            // we don't care about clipping, not part of length
            case BAM_CSOFT_CLIP:
                 if (k == 0) seqLow+=cl;
                 else seqHi-=cl;
                 qrySeq+=cl;
                 break;
            case BAM_CHARD_CLIP:
                 if (k == 0) seqLow+=cl;
                 else seqHi-=cl;
                 seqLen+=cl;
                 seqHi+=cl;
                 break;
            // we don't care about matches either, not an error
            case BAM_CMATCH:
            case BAM_CEQUAL:
            case BAM_CDIFF: 
              for (int i = 0; i < cl; i++) {
                 if (toupper(*refSeq) == toupper(*qrySeq)) {
                    matches++;
                 } else {
                    errors++;
                 }
                 refSeq++;
                 qrySeq++;
             }
             len+=cl;
             break;
            case BAM_CINS:
               errors+=cl;
               indels+=cl;
               qrySeq+=cl;
               len+=cl;
               break;
            case BAM_CREF_SKIP:
               refSeq+=cl;
               len+=cl;
               break;
            case BAM_CDEL:
               errors+=cl;
               indels+=cl;
               refSeq+=cl;
               len+=cl;
               break;
            default:
                cerr << "Error: unknown base " << cop << " of len " << cl << endl;
                exit(1);
                break;
            }
        }

        double idy = (1-((double) errors / len /*(seqHi-seqLow)*/ /*(refHigh - refLo + 1)*/)) * 100;
        double idyMismatches =  (1-((double) (errors-indels) / len /*(seqHi-seqLow)*/ /*(refHigh - refLo + 1)*/)) * 100;
        cout << id << "\t" << ref << "\t" << int(ceil(-1*idy/100*len)) << "\t" << idy << "\t0\t" << (isFwd == true ? seqLow : seqLen-seqHi) << "\t" << (isFwd == true ? seqHi : seqLen-seqLow) << "\t" << seqLen << "\t" <<  (isFwd == true ? 0 : 1) << "\t" << (isFwd == true ? refLo : refLen-refHigh) << "\t" << (isFwd == true ? refHigh : refLen-refLo) << "\t" << refLen << "\t" << len << "\t" << (seqHi-seqLow) << "\t" << (refHigh-refLo) << "\t" << matches << "\t" << errors << "\t" << idyMismatches << "\t" << indels << endl;
        delete[] orig;
    }
    samclose(fp);
return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
leaq -0x128(%rbp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
movq %rsi, -0x38(%rbp)
movq 0x10(%rsi), %rdi
leaq 0x1dc0(%rip), %rbx      # 0xb3a2
movq %rbx, %rsi
callq 0x33c0
movq %rax, -0x48(%rbp)
movq %rax, %rdi
callq 0x3360
movl %eax, %edi
movq %rbx, %rsi
callq 0x35e0
movq %rax, %r15
pushq $0x1
popq %rbx
pushq $0x70
popq %rsi
movq %rbx, %rdi
callq 0x31c0
movq %rax, %r12
pushq $0x20
popq %rsi
movq %rbx, %rdi
callq 0x31c0
movq %rax, %r14
movq %r15, -0x68(%rbp)
movq %r15, 0x18(%rax)
movl $0x1000, %edi           # imm = 0x1000
callq 0x3470
movq %rax, (%r14)
movq %r14, 0x68(%r12)
leaq 0x18(%r12), %rax
movq %rax, -0x80(%rbp)
xorl %ebx, %ebx
leaq -0xb8(%rbp), %r13
xorl %eax, %eax
movq %r12, -0x40(%rbp)
testl %eax, %eax
jne 0x967e
movq %r14, %rdi
callq 0xa069
cmpl $-0x1, %eax
je 0x98d3
cmpl $0x40, %eax
je 0x9673
cmpl $0x3e, %eax
jne 0x9658
movl %eax, -0xb8(%rbp)
movl %eax, 0x60(%r12)
andq $0x0, 0x48(%r12)
andq $0x0, 0x30(%r12)
andq $0x0, 0x18(%r12)
movq %r14, %rdi
xorl %esi, %esi
movq %r12, %rdx
movq %r13, %rcx
callq 0xa0db
testl %eax, %eax
js 0x98de
cmpl $0xa, -0xb8(%rbp)
je 0x96c2
movq %r14, %rdi
pushq $0xa
popq %rsi
movq -0x80(%rbp), %rdx
xorl %ecx, %ecx
callq 0xa0db
movq %r14, -0x60(%rbp)
movq %r14, %rdi
callq 0xa069
movl %eax, %ebx
movl %eax, -0xb8(%rbp)
cmpl $-0x1, %eax
movq -0x40(%rbp), %r12
je 0x9785
cmpl $0x2b, %ebx
je 0x9785
cmpl $0x3e, %ebx
je 0x9780
cmpl $0x40, %ebx
je 0x9780
movl %ebx, %edi
callq 0x32b0
testl %eax, %eax
je 0x96c6
movq %r13, %r12
movq -0x40(%rbp), %r14
movq 0x30(%r14), %r15
movq 0x40(%r14), %rax
leaq 0x1(%r15), %r13
cmpq 0x38(%r14), %r13
jb 0x976c
movq %r13, %rcx
shrq %rcx
orq %r13, %rcx
movq %rcx, %rdx
shrq $0x2, %rdx
orq %rcx, %rdx
movq %rdx, %rcx
shrq $0x4, %rcx
orq %rdx, %rcx
movq %rcx, %rdx
shrq $0x8, %rdx
orq %rcx, %rdx
movq %rdx, %rsi
shrq $0x10, %rsi
orq %rdx, %rsi
incq %rsi
movq %rsi, 0x38(%r14)
movq %rax, %rdi
callq 0x3590
movq %rax, 0x40(%r14)
movl -0xb8(%rbp), %ebx
movq %r13, 0x30(%r14)
movb %bl, (%rax,%r15)
movq %r12, %r13
movq -0x60(%rbp), %r14
jmp 0x96c6
movl %ebx, 0x60(%r12)
movq 0x30(%r12), %r15
movq 0x40(%r12), %rbx
movb $0x0, (%rbx,%r15)
cmpl $0x2b, -0xb8(%rbp)
jne 0x982a
movq 0x38(%r12), %rsi
cmpq %rsi, 0x50(%r12)
jae 0x97c1
movq %rsi, 0x50(%r12)
movq 0x58(%r12), %rdi
callq 0x3590
movq %rax, 0x58(%r12)
movq %r14, %rdi
callq 0xa069
movl %eax, -0xb8(%rbp)
cmpl $-0x1, %eax
je 0x98d3
cmpl $0xa, %eax
jne 0x97c1
jmp 0x97f5
cmpl $0x21, %eax
jl 0x97f5
movq 0x58(%r12), %rdx
leaq 0x1(%rcx), %rsi
movq %rsi, 0x48(%r12)
movb %al, (%rdx,%rcx)
movq %r14, %rdi
callq 0xa069
movl %eax, -0xb8(%rbp)
movq 0x48(%r12), %rcx
cmpl $-0x1, %eax
je 0x9812
cmpq %r15, %rcx
jb 0x97df
movq 0x58(%r12), %rax
movb $0x0, (%rax,%rcx)
andl $0x0, 0x60(%r12)
cmpq %rcx, %r15
jne 0x98e3
testl %r15d, %r15d
js 0x98e3
movq 0x10(%r12), %r14
movq %r13, %rdi
movq %r14, %rsi
leaq -0x100(%rbp), %rdx
callq 0xa304
leaq -0x130(%rbp), %rdi
movq %r13, %rsi
callq 0xa340
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3640
movq %r13, %rdi
callq 0x3130
movq %r13, %rdi
movq %r14, %rsi
leaq -0x100(%rbp), %rdx
callq 0xa304
movq %r13, %rdi
leaq 0x21fe(%rip), %rsi      # 0xba86
callq 0x3630
movq %rbx, %rdi
callq 0x3120
movq %rbx, %rdi
movl %eax, %esi
callq 0x9484
movq %rax, %r14
leaq -0x130(%rbp), %rdi
movq %r13, %rsi
callq 0xa3aa
movq %rax, %rdi
movq %r14, %rsi
callq 0x3640
movq %r13, %rdi
callq 0x3130
movq 0x68(%r12), %r14
movl 0x60(%r12), %eax
jmp 0x9654
testq %r12, %r12
movq -0x68(%rbp), %r14
jne 0x98e7
jmp 0x992f
movq 0x40(%r12), %rbx
movq -0x68(%rbp), %r14
movq 0x10(%r12), %rdi
callq 0x33d0
movq 0x28(%r12), %rdi
callq 0x33d0
movq %rbx, %rdi
callq 0x33d0
movq 0x58(%r12), %rdi
callq 0x33d0
movq 0x68(%r12), %rbx
testq %rbx, %rbx
je 0x9927
movq (%rbx), %rdi
callq 0x33d0
movq %rbx, %rdi
callq 0x33d0
movq %r12, %rdi
callq 0x33d0
movq %r14, %rdi
callq 0x35a0
movq -0x48(%rbp), %rdi
callq 0x32e0
pushq $0x1
popq %rdi
pushq $0x38
popq %rsi
callq 0x31c0
movq %rax, %rbx
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rsi
leaq -0x150(%rbp), %rdi
leaq -0xb8(%rbp), %rdx
callq 0xa304
leaq -0x150(%rbp), %rdi
callq 0x94d5
movq %rax, %r14
leaq -0x150(%rbp), %rdi
callq 0x3130
testq %r14, %r14
je 0x9ff6
movq 0x10(%r14), %r12
movq %rbx, -0x98(%rbp)
movq %r14, -0xc8(%rbp)
movq %r12, -0xd8(%rbp)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4956
testl %eax, %eax
js 0x9f5d
testq %rbx, %rbx
je 0x9fc7
movzwl 0xc(%rbx), %eax
testw $0x104, %ax             # imm = 0x104
jne 0x99a6
movq 0x30(%rbx), %rsi
leaq -0xb8(%rbp), %rdi
leaq -0x100(%rbp), %r15
movq %r15, %rdx
callq 0xa304
movq 0x8(%r12), %rax
movslq (%rbx), %rcx
movq (%rax,%rcx,8), %rsi
movq %r15, %rdi
leaq -0x6d(%rbp), %rdx
callq 0xa304
movzbl 0xb(%rbx), %esi
addq 0x30(%rbx), %rsi
movq 0x10(%r12), %rax
movslq (%rbx), %rcx
movl (%rax,%rcx,4), %eax
movq %rax, -0x90(%rbp)
movl 0x4(%rbx), %r15d
movq %rbx, %rdi
movq %rsi, -0xc0(%rbp)
callq 0x57ca
movq %rax, -0x88(%rbp)
movl 0x14(%rbx), %eax
movq %rax, -0x58(%rbp)
movq 0x8(%rbx), %rcx
movabsq $0x1000000000, %rax     # imm = 0x1000000000
andq %rax, %rcx
movq %rcx, -0x78(%rbp)
leaq -0x130(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0xa3aa
movq (%rax), %rax
cmpb $0x0, (%rax)
je 0x9fd7
leaq -0x130(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0xa3aa
movq (%rax), %rbx
movq -0x98(%rbp), %rax
movslq 0x14(%rax), %r14
leaq 0x1(%r14), %rdi
callq 0x3030
movq %rax, -0x68(%rbp)
incl %r15d
movl %r15d, -0x6c(%rbp)
movl %r15d, %eax
addq %rbx, %rax
decq %rax
movq %rax, -0x40(%rbp)
leaq 0x5baa(%rip), %rax      # 0xf660
movq (%rax), %rax
xorl %edx, %edx
testl %r14d, %r14d
movl $0x0, %esi
cmovgl %r14d, %esi
xorl %edi, %edi
movq -0x98(%rbp), %rbx
cmpq %rdi, %rsi
je 0x9b12
movl 0x10(%rbx), %ecx
shll $0x2, %ecx
addq 0x30(%rbx), %rcx
movzbl 0xb(%rbx), %r8d
addq %rcx, %r8
movl %edi, %ecx
shrl %ecx
movzbl (%rcx,%r8), %r8d
movl %edx, %ecx
notb %cl
andb $0x4, %cl
shrl %cl, %r8d
andl $0xf, %r8d
movb (%rax,%r8), %cl
movq -0x68(%rbp), %r8
movb %cl, (%r8,%rdi)
incq %rdi
addl $0x4, %edx
jmp 0x9ad0
movq -0x68(%rbp), %rax
movb $0x0, (%rax,%r14)
movl 0x10(%rbx), %ecx
movq %rcx, -0xe0(%rbp)
xorl %edi, %edi
movq -0x58(%rbp), %rcx
movl %ecx, -0x4c(%rbp)
movl $0x0, -0x2c(%rbp)
movq %rax, %r14
movl $0x0, -0x60(%rbp)
movl $0x0, -0x80(%rbp)
movl $0x0, -0x50(%rbp)
movl $0x0, -0x48(%rbp)
movq -0xc0(%rbp), %rsi
cmpq -0xe0(%rbp), %rdi
je 0x9c97
movq %rdi, -0x38(%rbp)
movl (%rsi,%rdi,4), %r15d
movl %r15d, %r13d
andl $0xf, %r13d
movl %r15d, %r12d
shrl $0x4, %r12d
cmpl $0x8, %r13d
ja 0x9f85
leaq 0x1da1(%rip), %rax      # 0xb930
movslq (%rax,%r13,4), %rcx
addq %rax, %rcx
movl %r12d, %eax
jmpq *%rcx
shrl $0x4, %r15d
movq -0x40(%rbp), %rax
addq %r15, %rax
movq %rax, -0xd0(%rbp)
xorl %ebx, %ebx
cmpl %ebx, %r15d
je 0x9be6
movq -0x40(%rbp), %rax
movsbl (%rax,%rbx), %edi
callq 0x3610
movl %eax, %r13d
movsbl (%r14,%rbx), %edi
callq 0x3610
xorl %ecx, %ecx
xorl %edx, %edx
cmpl %eax, %r13d
sete %cl
setne %dl
addl %edx, -0x60(%rbp)
addl %ecx, -0x80(%rbp)
incq %rbx
jmp 0x9baf
addq %r15, %r14
addl -0x48(%rbp), %r12d
movq -0xd0(%rbp), %rax
movq %rax, -0x40(%rbp)
movl %r12d, -0x48(%rbp)
movq -0x98(%rbp), %rbx
movq -0xc0(%rbp), %rsi
jmp 0x9c5a
addl %r12d, -0x60(%rbp)
addl %r12d, -0x50(%rbp)
addq %rax, -0x40(%rbp)
jmp 0x9c56
addq %rax, -0x40(%rbp)
addl -0x48(%rbp), %r12d
movl %r12d, -0x48(%rbp)
jmp 0x9c5a
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
movl $0x0, %eax
cmovel %r12d, %eax
addl %eax, -0x2c(%rbp)
addl %r12d, -0x4c(%rbp)
movq -0x58(%rbp), %rcx
addl %eax, %ecx
movq %rcx, -0x58(%rbp)
jmp 0x9c5e
addl %r12d, -0x60(%rbp)
addl %r12d, -0x50(%rbp)
addq %rax, %r14
addl %r12d, -0x48(%rbp)
movq -0x38(%rbp), %rdi
incq %rdi
movq -0xd8(%rbp), %r12
jmp 0x9b5b
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
movl %r12d, %eax
movl $0x0, %edx
cmovel %edx, %eax
movl %r12d, %ecx
cmovnel %edx, %ecx
movq -0x58(%rbp), %rdx
subl %eax, %edx
movq %rdx, -0x58(%rbp)
addl %ecx, -0x2c(%rbp)
addq %r12, %r14
jmp 0x9c5e
movq 0x532a(%rip), %rdi      # 0xefc8
leaq -0xb8(%rbp), %rsi
callq 0x3290
leaq -0x100(%rbp), %r14
movq %rax, %rdi
leaq 0x1e2a(%rip), %rsi      # 0xbae5
callq 0x32d0
movq %rax, %rdi
movq %r14, %rsi
callq 0x3290
movq %rax, %rdi
leaq 0x1e10(%rip), %rsi      # 0xbae5
callq 0x32d0
movq %rax, %r15
cvtsi2sdl -0x60(%rbp), %xmm0
movl -0x48(%rbp), %r13d
cvtsi2sd %r13, %xmm2
divsd %xmm2, %xmm0
movsd 0x1c21(%rip), %xmm1     # 0xb918
subsd %xmm0, %xmm1
mulsd 0x1c1d(%rip), %xmm1     # 0xb920
movsd %xmm1, -0x40(%rbp)
movapd %xmm1, %xmm0
divsd 0x1c14(%rip), %xmm0     # 0xb928
movsd %xmm2, -0x38(%rbp)
mulsd %xmm2, %xmm0
callq 0x30a0
cvttsd2si %xmm0, %esi
movq %r15, %rdi
callq 0x35b0
movq %rax, %rdi
leaq 0x1dad(%rip), %rsi      # 0xbae5
callq 0x32d0
movq %rax, %rdi
movsd -0x40(%rbp), %xmm0
callq 0x3560
movq %rax, %rdi
leaq 0x1d8f(%rip), %rsi      # 0xbae3
callq 0x32d0
movl -0x4c(%rbp), %ecx
movl %ecx, %esi
subl -0x58(%rbp), %esi
cmpq $0x0, -0x78(%rbp)
cmovel -0x2c(%rbp), %esi
movq %rax, %rdi
callq 0x31d0
movq %rax, %rdi
leaq 0x1d69(%rip), %rsi      # 0xbae5
callq 0x32d0
movl -0x4c(%rbp), %ecx
movl %ecx, %esi
subl -0x2c(%rbp), %esi
cmpq $0x0, -0x78(%rbp)
cmovel -0x58(%rbp), %esi
movq %rax, %rdi
callq 0x31d0
movq %rax, %rdi
leaq 0x1d41(%rip), %rsi      # 0xbae5
callq 0x32d0
movl -0x4c(%rbp), %esi
movq %rax, %rdi
callq 0x31d0
movq %rax, %rdi
leaq 0x1d27(%rip), %rsi      # 0xbae5
callq 0x32d0
movq -0x78(%rbp), %rsi
shrq $0x24, %rsi
movq %rax, %rdi
callq 0x35b0
movq %rax, %rdi
leaq 0x1d08(%rip), %rsi      # 0xbae5
callq 0x32d0
movq -0x90(%rbp), %rsi
subl -0x88(%rbp), %esi
cmpq $0x0, -0x78(%rbp)
cmovel -0x6c(%rbp), %esi
movq %rax, %rdi
callq 0x31d0
movq %rax, %rdi
leaq 0x1cdb(%rip), %rsi      # 0xbae5
callq 0x32d0
movq -0x90(%rbp), %rsi
subl -0x6c(%rbp), %esi
cmpq $0x0, -0x78(%rbp)
cmovel -0x88(%rbp), %esi
movq %rax, %rdi
callq 0x31d0
movq %rax, %rdi
leaq 0x1cae(%rip), %rsi      # 0xbae5
callq 0x32d0
movq %rax, %rdi
movq -0x90(%rbp), %rsi
callq 0x31d0
movq %rax, %rdi
leaq 0x1c90(%rip), %rsi      # 0xbae5
callq 0x32d0
movq %rax, %rdi
movq %r13, %rsi
callq 0x31d0
movq %rax, %rdi
leaq 0x1c76(%rip), %rsi      # 0xbae5
callq 0x32d0
movq -0x58(%rbp), %rsi
subl -0x2c(%rbp), %esi
movq %rax, %rdi
callq 0x31d0
movq %rax, %rdi
leaq 0x1c58(%rip), %rsi      # 0xbae5
callq 0x32d0
movq -0x88(%rbp), %rsi
subl -0x6c(%rbp), %esi
movq %rax, %rdi
callq 0x31d0
movq %rax, %rdi
leaq 0x1c37(%rip), %rsi      # 0xbae5
callq 0x32d0
movq %rax, %rdi
movl -0x80(%rbp), %esi
callq 0x35b0
movq %rax, %rdi
leaq 0x1c1d(%rip), %rsi      # 0xbae5
callq 0x32d0
movq %rax, %rdi
movl -0x60(%rbp), %esi
callq 0x35b0
movq %rax, %rdi
leaq 0x1c03(%rip), %rsi      # 0xbae5
callq 0x32d0
movl -0x60(%rbp), %ecx
subl -0x50(%rbp), %ecx
cvtsi2sd %ecx, %xmm1
divsd -0x38(%rbp), %xmm1
movsd 0x1a1a(%rip), %xmm0     # 0xb918
subsd %xmm1, %xmm0
mulsd 0x1a16(%rip), %xmm0     # 0xb920
movq %rax, %rdi
callq 0x3560
movq %rax, %rdi
leaq 0x1bc9(%rip), %rsi      # 0xbae5
callq 0x32d0
movq %rax, %rdi
movl -0x50(%rbp), %esi
callq 0x35b0
movq %rax, %rdi
callq 0x3150
movq -0x68(%rbp), %rdi
callq 0x3440
movq %r14, %rdi
callq 0x3130
leaq -0xb8(%rbp), %rdi
callq 0x3130
movq -0xc8(%rbp), %r14
jmp 0x99a6
movq %r14, %rdi
callq 0x4730
leaq -0x130(%rbp), %rdi
callq 0xa422
xorl %eax, %eax
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x5064(%rip), %rdi      # 0xeff0
leaq 0x1b32(%rip), %rsi      # 0xbac5
callq 0x32d0
movq %rax, %rdi
movl %r13d, %esi
callq 0x35b0
leaq 0x1b30(%rip), %rsi      # 0xbada
movq %rax, %rdi
callq 0x32d0
movq %rax, %rdi
movl %r12d, %esi
callq 0x35b0
movq %rax, %rdi
callq 0x3150
jmp 0x9ff6
leaq 0x1abb(%rip), %rdi      # 0xba89
xorl %eax, %eax
callq 0x3050
jmp 0x9ff6
movq 0x4ff2(%rip), %rax      # 0xefd0
movq (%rax), %rdi
movq -0x100(%rbp), %rdx
leaq 0x1ab1(%rip), %rsi      # 0xbaa0
xorl %eax, %eax
callq 0x34c0
pushq $0x1
popq %rdi
callq 0x33f0
jmp 0xa033
movq %rax, %rbx
leaq -0x150(%rbp), %rdi
jmp 0xa050
jmp 0xa033
jmp 0xa033
jmp 0xa033
jmp 0xa033
jmp 0xa033
jmp 0xa026
jmp 0xa033
jmp 0xa026
jmp 0xa033
jmp 0xa03a
jmp 0xa03a
jmp 0xa03a
jmp 0xa03a
movq %rax, %rbx
jmp 0xa049
jmp 0xa033
jmp 0xa033
jmp 0xa033
jmp 0xa033
movq %rax, %rbx
jmp 0xa055
jmp 0xa03a
movq %rax, %rbx
leaq -0x100(%rbp), %rdi
callq 0x3130
leaq -0xb8(%rbp), %rdi
callq 0x3130
leaq -0x130(%rbp), %rdi
callq 0xa422
movq %rbx, %rdi
callq 0x35c0