// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/vcf.c
// Function: vcf_hdr_read
bcf_hdr_t *vcf_hdr_read(htsFile *fp)
{
    kstring_t txt, *s = &fp->line;
    int ret;
    bcf_hdr_t *h;
    tbx_t *idx = NULL;
    const char **names = NULL;
    h = bcf_hdr_init("r");
    if (!h) {
        hts_log_error("Failed to allocate bcf header");
        return NULL;
    }
    txt.l = txt.m = 0; txt.s = 0;
    while ((ret = hts_getline(fp, KS_SEP_LINE, s)) >= 0) {
        int e = 0;
        if (s->l == 0) continue;
        if (s->s[0] != '#') {
            hts_log_error("No sample line");
            goto error;
        }
        if (s->s[1] != '#' && fp->fn_aux) { // insert contigs here
            kstring_t tmp = { 0, 0, NULL };
            hFILE *f = hopen(fp->fn_aux, "r");
            if (f == NULL) {
                hts_log_error("Couldn't open \"%s\"", fp->fn_aux);
                goto error;
            }
            while (tmp.l = 0, kgetline(&tmp, (kgets_func *) hgets, f) >= 0) {
                char *tab = strchr(tmp.s, '\t');
                if (tab == NULL) continue;
                e |= (kputs("##contig=<ID=", &txt) < 0);
                e |= (kputsn(tmp.s, tab - tmp.s, &txt) < 0);
                e |= (kputs(",length=", &txt) < 0);
                e |= (kputl(atol(tab), &txt) < 0);
                e |= (kputsn(">\n", 2, &txt) < 0);
            }
            free(tmp.s);
            if (hclose(f) != 0) {
                hts_log_error("Error on closing %s", fp->fn_aux);
                goto error;
            }
            if (e) goto error;
        }
        if (kputsn(s->s, s->l, &txt) < 0) goto error;
        if (kputc('\n', &txt) < 0) goto error;
        if (s->s[1] != '#') break;
    }
    if ( ret < -1 ) goto error;
    if ( !txt.s )
    {
        hts_log_error("Could not read the header");
        goto error;
    }
    if ( bcf_hdr_parse(h, txt.s) < 0 ) goto error;

    // check tabix index, are all contigs listed in the header? add the missing ones
    idx = tbx_index_load3(fp->fn, NULL, HTS_IDX_SILENT_FAIL);
    if ( idx )
    {
        int i, n, need_sync = 0;
        names = tbx_seqnames(idx, &n);
        if (!names) goto error;
        for (i=0; i<n; i++)
        {
            bcf_hrec_t *hrec = bcf_hdr_get_hrec(h, BCF_HL_CTG, "ID", (char*) names[i], NULL);
            if ( hrec ) continue;
            if (add_missing_contig_hrec(h, names[i]) < 0) goto error;
            need_sync = 1;
        }
        if ( need_sync ) {
            if (bcf_hdr_sync(h) < 0) goto error;
        }
        free(names);
        tbx_destroy(idx);
    }
    free(txt.s);
    return h;

 error:
    if (idx) tbx_destroy(idx);
    free(names);
    free(txt.s);
    if (h) bcf_hdr_destroy(h);
    return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
leaq 0x7b9f3(%rip), %rdi     # 0xaa1da
callq 0x2df79
testq %rax, %rax
je 0x2efe7
movq %rax, 0x28(%rsp)
leaq 0x10(%rbx), %r12
movq %rbx, %rdi
movl $0x2, %esi
movq %r12, %rdx
callq 0xad7a
testl %eax, %eax
js 0x2f008
movq $0x0, 0x18(%rsp)
leaq 0x7d36c(%rip), %r13     # 0xabb92
leaq 0x7a123(%rip), %rbp     # 0xa8950
movq $0x0, (%rsp)
movq $0x0, 0x8(%rsp)
xorl %ecx, %ecx
movq %rbx, 0x50(%rsp)
movq %r12, 0x58(%rsp)
movq (%r12), %r14
testq %r14, %r14
je 0x2e875
movq 0x20(%rbx), %r15
cmpb $0x23, (%r15)
jne 0x2f01f
cmpb $0x23, 0x1(%r15)
movl %eax, 0x48(%rsp)
jne 0x2e880
movq (%rsp), %r12
jmp 0x2eece
movq %rcx, %r14
movq %rcx, %r15
jmp 0x2efc7
movq 0x30(%rbx), %rdi
testq %rdi, %rdi
movq (%rsp), %r12
je 0x2eece
movq %rcx, 0x10(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
leaq 0x7b92c(%rip), %rsi     # 0xaa1da
xorl %eax, %eax
callq 0x991b4
testq %rax, %rax
je 0x2f237
movq %rax, %r14
movq $0x0, 0x30(%rsp)
leaq 0x30(%rsp), %rdi
leaq 0x69aff(%rip), %rsi     # 0x983d5
movq %rax, %rdx
callq 0x898a8
testl %eax, %eax
js 0x2ee9b
xorl %r15d, %r15d
movq %r14, 0x60(%rsp)
movq 0x40(%rsp), %rdi
movl $0x9, %esi
callq 0x4180
testq %rax, %rax
je 0x2ee68
movq %rax, %r13
movq %r12, %rax
subq $-0xf, %rax
movl %r15d, 0x4c(%rsp)
jae 0x2e963
movq 0x8(%rsp), %r14
cmpq %rax, %r14
movq 0x10(%rsp), %rdi
jae 0x2e982
movq %rax, %rcx
shrq %rcx
movabsq $0x3fffffffffffffff, %rdx # imm = 0x3FFFFFFFFFFFFFFF
cmpq %rdx, %rax
movl $0x0, %r14d
cmovbeq %rcx, %r14
addq %rax, %r14
movq %r14, %rsi
movq %rdi, %rbx
callq 0x4860
testq %rax, %rax
jne 0x2e985
movl $0xffffffff, 0x24(%rsp) # imm = 0xFFFFFFFF
movq %rbx, %rdi
jmp 0x2e97b
callq 0x4050
movl $0x4b, (%rax)
movl $0xffffffff, 0x24(%rsp) # imm = 0xFFFFFFFF
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rcx
jmp 0x2e9ba
movq %rdi, %rax
movabsq $0x3d44493c3d676974, %rcx # imm = 0x3D44493C3D676974
movq %rcx, 0x5(%rax,%r12)
movabsq $0x6769746e6f632323, %rcx # imm = 0x6769746E6F632323
movq %rcx, (%rax,%r12)
movb $0x0, 0xd(%rax,%r12)
addq $0xd, %r12
movl $0xd, 0x24(%rsp)
movq %rax, %rdi
movq %r14, %rcx
movq 0x40(%rsp), %r14
movq %r13, %r15
subq %r14, %r15
leaq (%r15,%r12), %rax
addq $0x2, %rax
cmpq %r12, %rax
jbe 0x2ea30
movq %r12, %rbx
cmpq %rax, %rcx
jae 0x2ea4c
movq %rcx, 0x8(%rsp)
movq %rax, %rcx
shrq %rcx
movabsq $0x3fffffffffffffff, %rdx # imm = 0x3FFFFFFFFFFFFFFF
cmpq %rdx, %rax
movl $0x0, %r12d
cmovbeq %rcx, %r12
addq %rax, %r12
movq %r12, %rsi
movq %rdi, 0x10(%rsp)
callq 0x4860
movq %rax, %rbp
testq %rax, %rax
jne 0x2ea52
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
leaq 0x79f2f(%rip), %rbp     # 0xa8950
movq %rbx, %r12
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %r14
jmp 0x2ea7b
movq %rdi, %rbx
movq %rcx, %r14
callq 0x4050
movq %rbx, %rdi
movl $0x4b, (%rax)
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
jmp 0x2ea7b
movq %rdi, %rbp
movq %rcx, %r12
movq %rbx, %rdi
addq %r15, %rbx
addq %rbp, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x43c0
movb $0x0, (%rbp,%rbx)
movq %rbp, %rdi
movq %r12, %r14
movq %rbx, %r12
leaq 0x79ed5(%rip), %rbp     # 0xa8950
movq %r12, %rax
subq $-0xa, %rax
jae 0x2eacd
cmpq %rax, %r14
jae 0x2eae5
movq %r14, 0x8(%rsp)
movq %rax, %rcx
shrq %rcx
movabsq $0x3fffffffffffffff, %rdx # imm = 0x3FFFFFFFFFFFFFFF
cmpq %rdx, %rax
movl $0x0, %r14d
cmovbeq %rcx, %r14
addq %rax, %r14
movq %r14, %rsi
movq %rdi, %rbx
callq 0x4860
testq %rax, %rax
jne 0x2eae8
movl $0xffffffff, 0x20(%rsp) # imm = 0xFFFFFFFF
movq 0x8(%rsp), %r14
jmp 0x2eb0b
movq %rdi, %rbx
callq 0x4050
movl $0x4b, (%rax)
movl $0xffffffff, 0x20(%rsp) # imm = 0xFFFFFFFF
jmp 0x2eb0b
movq %rdi, %rax
movabsq $0x3d6874676e656c2c, %rcx # imm = 0x3D6874676E656C2C
movq %rcx, (%rax,%r12)
movb $0x0, 0x8(%rax,%r12)
addq $0x8, %r12
movl $0x8, 0x20(%rsp)
movq %rax, %rbx
movq %r13, %rdi
callq 0x45d0
movq %rax, %r13
movq %r12, (%rsp)
leaq 0x17(%r12), %rax
cmpq %rax, %r14
jae 0x2eb7c
movq %rax, %rcx
shrq %rcx
movabsq $0x3fffffffffffffff, %rdx # imm = 0x3FFFFFFFFFFFFFFF
cmpq %rdx, %rax
movl $0x0, %r12d
cmovbeq %rcx, %r12
addq %rax, %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0x4860
movq %rax, %r10
testq %rax, %rax
movabsq $0x28f5c28f5c28f5c3, %r9 # imm = 0x28F5C28F5C28F5C3
jne 0x2eb8c
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
movq %rbx, %r10
movq %r14, %rcx
movabsq $0x3fffffffffffffff, %r14 # imm = 0x3FFFFFFFFFFFFFFF
jmp 0x2edbc
movq %rbx, %r10
movq %r14, %r12
movabsq $0x28f5c28f5c28f5c3, %r9 # imm = 0x28F5C28F5C28F5C3
testq %r13, %r13
jns 0x2eba4
negq %r13
movq (%rsp), %rax
movb $0x2d, (%r10,%rax)
incq %rax
movq %rax, (%rsp)
movabsq $0x3fffffffffffffff, %r14 # imm = 0x3FFFFFFFFFFFFFFF
movq %r13, %rax
shrq $0x20, %rax
jne 0x2ec19
cmpq $0x9, %r13
ja 0x2ec9a
movq (%rsp), %rax
addq $0x2, %rax
cmpq %rax, %r12
jae 0x2ed2c
movq %rax, %rcx
shrq %rcx
cmpq %r14, %rax
movl $0x0, %ebx
cmovbeq %rcx, %rbx
addq %rax, %rbx
movq %r10, %rdi
movq %rbx, %rsi
movq %r10, 0x10(%rsp)
callq 0x4860
movq %rbx, %rcx
movq %rax, %r10
testq %rax, %rax
jne 0x2ed2f
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
movq 0x10(%rsp), %r10
movq %r12, %rcx
jmp 0x2edbc
movl $0x1, %eax
xorl %ecx, %ecx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl %edx, %esi
incl %ecx
addq %rax, %rax
leaq (%rax,%rax,4), %rax
leal 0x1(%rsi), %edx
cmpq %rax, %r13
jae 0x2ec25
movq (%rsp), %rax
leaq (%r10,%rax), %rdi
movq %r13, %r8
movq %r13, %rax
shrq $0x2, %rax
mulq %r9
movq %rdx, %r13
shrq $0x2, %r13
imulq $0x64, %r13, %rax
movq %r8, %rdx
subq %rax, %rdx
movl %esi, %eax
movzwl (%rbp,%rdx,2), %edx
movw %dx, (%rdi,%rax)
addl $-0x2, %esi
cmpq $0x3e7, %r8             # imm = 0x3E7
ja 0x2ec40
cmpl $-0x1, %esi
jne 0x2ec81
orb $0x30, %r13b
movb %r13b, (%rdi)
movl %ecx, %eax
movq (%rsp), %rcx
addq %rax, %rcx
movq %rcx, (%rsp)
leaq (%r10,%rcx), %rax
movq %r12, %rcx
jmp 0x2edb6
bsrl %r13d, %eax
xorl $0x1f, %eax
shll $0x2, %eax
leaq 0x7c2f5(%rip), %rcx     # 0xaafa0
movl (%rax,%rcx), %edx
xorl %ebp, %ebp
leaq 0x7c369(%rip), %rcx     # 0xab020
cmpl %r13d, (%rax,%rcx)
seta %bpl
movl %edx, %ebx
subl %ebp, %ebx
movq (%rsp), %rax
addq %rbx, %rax
addq $0x2, %rax
cmpq %rax, %r12
jae 0x2ed4b
movq %rax, %rcx
shrq %rcx
cmpq %r14, %rax
movl $0x0, %esi
cmovbeq %rcx, %rsi
addq %rax, %rsi
movq %r10, %rdi
movq %rsi, 0x8(%rsp)
movq %r10, 0x10(%rsp)
movq %rdx, %r14
callq 0x4860
movq %r14, %rdx
movabsq $0x3fffffffffffffff, %r14 # imm = 0x3FFFFFFFFFFFFFFF
movq %rax, %r10
testq %rax, %rax
jne 0x2ed50
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
movq 0x10(%rsp), %r10
movq %r12, %rcx
leaq 0x79c29(%rip), %rbp     # 0xa8950
jmp 0x2edbc
movq %r12, %rcx
orb $0x30, %r13b
movq (%rsp), %rdx
leaq (%r10,%rdx), %rax
incq %rax
incq %rdx
movq %rdx, (%rsp)
movb %r13b, -0x1(%rax)
jmp 0x2edb6
movq %r12, 0x8(%rsp)
negl %ebp
movq (%rsp), %r8
leaq (%r10,%r8), %rax
leal (%rdx,%rbp), %ecx
addl $-0x2, %ecx
leaq 0x79be9(%rip), %rbp     # 0xa8950
movl %r13d, %edx
movl %r13d, %esi
imulq $0x51eb851f, %rsi, %r13 # imm = 0x51EB851F
shrq $0x25, %r13
imull $0x64, %r13d, %esi
movl %edx, %r9d
subl %esi, %r9d
movl %ecx, %esi
movzwl (%rbp,%r9,2), %r9d
movw %r9w, (%rax,%rsi)
addl $-0x2, %ecx
cmpl $0x3e7, %edx            # imm = 0x3E7
ja 0x2ed67
cmpl $-0x1, %ecx
jne 0x2eda6
orb $0x30, %r13b
movb %r13b, (%rax)
addq %rbx, %r8
movq %r8, (%rsp)
leaq (%r10,%r8), %rax
movq 0x8(%rsp), %rcx
movb $0x0, (%rax)
xorl %r13d, %r13d
movq (%rsp), %r12
movq %r12, %rax
subq $-0x4, %rax
jae 0x2ee06
cmpq %rax, %rcx
jae 0x2ee22
movq %rcx, 0x8(%rsp)
movq %rax, %rcx
shrq %rcx
cmpq %r14, %rax
movl $0x0, %r14d
cmovbeq %rcx, %r14
addq %rax, %r14
movq %r10, %rdi
movq %r14, %rsi
movq %r10, %rbx
callq 0x4860
movq %rax, %r10
testq %rax, %rax
jne 0x2ee25
movq %rbx, 0x10(%rsp)
jmp 0x2ee1b
movq %rcx, 0x8(%rsp)
movq %r10, 0x10(%rsp)
callq 0x4050
movl $0x4b, (%rax)
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
jmp 0x2ee45
movq %rcx, %r14
movw $0xa3e, (%r10,%r12)     # imm = 0xA3E
movb $0x0, 0x2(%r10,%r12)
addq $0x2, %r12
movl $0x2, %ecx
movq %r10, 0x10(%rsp)
movq %r14, 0x8(%rsp)
orl 0x24(%rsp), %r15d
orl 0x20(%rsp), %r15d
orl %r13d, %r15d
orl %ecx, %r15d
shrl $0x1f, %r15d
movl 0x4c(%rsp), %eax
orl %r15d, %eax
movl %eax, %r15d
movq 0x60(%rsp), %r14
movq $0x0, 0x30(%rsp)
leaq 0x30(%rsp), %rdi
leaq 0x69558(%rip), %rsi     # 0x983d5
movq %r14, %rdx
callq 0x898a8
testl %eax, %eax
jns 0x2e8ee
testl %r15d, %r15d
sete %bpl
movq 0x50(%rsp), %rbx
jmp 0x2ee9e
movb $0x1, %bpl
movq 0x40(%rsp), %rdi
callq 0x45c0
movq %r14, %rdi
callq 0x9884f
testl %eax, %eax
jne 0x2f230
testb %bpl, %bpl
movq 0x10(%rsp), %rcx
je 0x2f261
movq 0x10(%rbx), %r14
movq 0x20(%rbx), %r15
leaq (%r14,%r12), %r13
addq $0x2, %r13
cmpq %r12, %r13
movabsq $0x3fffffffffffffff, %rbx # imm = 0x3FFFFFFFFFFFFFFF
jbe 0x2f04a
movq %r12, %rbp
cmpq %r13, 0x8(%rsp)
jae 0x2ef25
movq %r13, %rsi
shrq %rsi
cmpq %rbx, %r13
movl $0x0, %eax
cmovaq %rax, %rsi
addq %r13, %rsi
movq %rcx, %rdi
movq %rsi, 0x8(%rsp)
movq %rcx, %rbx
callq 0x4860
movq %rax, %r12
testq %rax, %rax
jne 0x2ef28
jmp 0x2f200
movq %rcx, %r12
movq %rbp, %rdi
addq %r14, %rbp
addq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x43c0
movb $0x0, (%r12,%rbp)
testl %r14d, %r14d
js 0x2f066
cmpq %r13, 0x8(%rsp)
jae 0x2ef8d
movq %r13, %rsi
shrq %rsi
movabsq $0x3fffffffffffffff, %rax # imm = 0x3FFFFFFFFFFFFFFF
cmpq %rax, %r13
movl $0x0, %eax
cmovaq %rax, %rsi
addq %r13, %rsi
movq %r12, %rdi
movq %rsi, 0x8(%rsp)
callq 0x4860
movq %rax, %r15
movq %r12, %rbx
testq %rax, %rax
jne 0x2ef90
jmp 0x2f200
movq %r12, %r15
movw $0xa, (%r15,%rbp)
movq 0x50(%rsp), %rbx
movq 0x20(%rbx), %rax
cmpb $0x23, 0x1(%rax)
jne 0x2f06e
incq %rbp
movq %rbp, (%rsp)
movq %r15, %r14
movq 0x58(%rsp), %r12
leaq 0x7cbd2(%rip), %r13     # 0xabb92
leaq 0x79989(%rip), %rbp     # 0xa8950
movq %rbx, %rdi
movl $0x2, %esi
movq %r12, %rdx
callq 0xad7a
testl %eax, %eax
movq %r14, %rcx
jns 0x2e84a
jmp 0x2f072
leaq 0x7cb88(%rip), %rsi     # 0xabb76
leaq 0x7c9c6(%rip), %rdx     # 0xab9bb
xorl %ebx, %ebx
movl $0x1, %edi
xorl %eax, %eax
callq 0x942d
jmp 0x2f21e
cmpl $-0x1, %eax
je 0x2f1db
movq $0x0, 0x18(%rsp)
jmp 0x2f1fe
leaq 0x7cb50(%rip), %rsi     # 0xabb76
leaq 0x7cb56(%rip), %rdx     # 0xabb83
movq $0x0, 0x18(%rsp)
movl $0x1, %edi
xorl %eax, %eax
movq %rcx, %rbx
callq 0x942d
jmp 0x2f200
movq %rcx, %rbx
callq 0x4050
movl $0x4b, (%rax)
movq $0x0, 0x18(%rsp)
jmp 0x2f200
movq %r12, %rbx
jmp 0x2f200
movl 0x48(%rsp), %eax
cmpl $-0x1, %eax
jge 0x2f088
movq $0x0, 0x18(%rsp)
movq %r15, %rbx
jmp 0x2f200
testq %r15, %r15
je 0x2f1db
movq 0x28(%rsp), %rdi
movq %r15, %rsi
callq 0x2d4f2
testl %eax, %eax
js 0x2f077
movq 0x28(%rbx), %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x9bd32
testq %rax, %rax
je 0x2f28c
movq %rax, %rbx
leaq 0x30(%rsp), %rsi
movq %rax, %rdi
callq 0x9bf1b
movq %rax, 0x18(%rsp)
testq %rax, %rax
je 0x2f2dd
cmpl $0x0, 0x30(%rsp)
jle 0x2f27a
movb $0x1, %r12b
xorl %ebp, %ebp
leaq 0x7ac1a(%rip), %r14     # 0xa9d0a
movq 0x18(%rsp), %rax
movq (%rax,%rbp,8), %rcx
movq 0x28(%rsp), %rdi
movl $0x3, %esi
movq %r14, %rdx
xorl %r8d, %r8d
callq 0x2ce51
testq %rax, %rax
je 0x2f125
incq %rbp
movslq 0x30(%rsp), %rax
cmpq %rax, %rbp
jl 0x2f0f0
jmp 0x2f266
movq %rbx, (%rsp)
movq 0x18(%rsp), %rax
movq (%rax,%rbp,8), %rbx
movl $0x1, %edi
movl $0x30, %esi
callq 0x42f0
movq %rax, %r13
testq %rax, %rax
je 0x2f29b
leaq 0x7df39(%rip), %rdi     # 0xad08d
callq 0x4930
movq %rax, 0x8(%r13)
testq %rax, %rax
je 0x2f29b
movl $0x2, %edx
movq %r13, %rdi
movq %r14, %rsi
callq 0x2af5d
testl %eax, %eax
js 0x2f29b
movl 0x18(%r13), %r12d
decl %r12d
movq %rbx, %rdi
callq 0x41c0
movq %r13, %rdi
movl %r12d, %esi
movq %rbx, %rdx
movq %rax, %rcx
xorl %r8d, %r8d
callq 0x2b041
testl %eax, %eax
js 0x2f29b
movq 0x28(%rsp), %rdi
movq %r13, %rsi
callq 0x2bd95
testl %eax, %eax
js 0x2f29b
incq %rbp
movslq 0x30(%rsp), %rax
xorl %r12d, %r12d
cmpq %rax, %rbp
movq (%rsp), %rbx
jl 0x2f0f0
jmp 0x2f26c
leaq 0x7c994(%rip), %rsi     # 0xabb76
leaq 0x7c9ca(%rip), %rdx     # 0xabbb3
movq $0x0, 0x18(%rsp)
movl $0x1, %edi
xorl %eax, %eax
callq 0x942d
xorl %ebx, %ebx
movq 0x18(%rsp), %rdi
callq 0x45c0
movq %rbx, %rdi
callq 0x45c0
movq 0x28(%rsp), %rdi
callq 0x2e474
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x7ad01(%rip), %r13     # 0xa9f38
movq 0x30(%rbx), %rcx
leaq 0x7c934(%rip), %rsi     # 0xabb76
movq $0x0, 0x18(%rsp)
movl $0x1, %edi
movq %r13, %rdx
xorl %eax, %eax
callq 0x942d
movq 0x10(%rsp), %rbx
jmp 0x2f200
movq %rcx, %rbx
jmp 0x2f200
testb $0x1, %r12b
jne 0x2f27a
movq 0x28(%rsp), %rdi
callq 0x2ab97
testl %eax, %eax
js 0x2f2dd
movq 0x18(%rsp), %rdi
callq 0x45c0
movq %rbx, %rdi
callq 0x9bbe9
movq %r15, %rdi
callq 0x45c0
movq 0x28(%rsp), %rbx
jmp 0x2f21e
callq 0x4050
movq %rax, %r14
movl (%rax), %ebp
movl %ebp, %edi
callq 0x4140
leaq 0x7d666(%rip), %rsi     # 0xac919
leaq 0x7c2b6(%rip), %rdx     # 0xab570
movl $0x1, %edi
movq %rax, %rcx
xorl %eax, %eax
callq 0x942d
testq %r13, %r13
je 0x2f2d6
movq %r13, %rdi
callq 0x2ac82
movl %ebp, (%r14)
movq (%rsp), %rbx
movq %rbx, %rdi
callq 0x9bbe9
jmp 0x2f080