// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/test/test-vcf-api.c
// Function: write_bcf
void write_bcf(char *fname)
{
    // Init
    htsFile *fp    = hts_open(fname,"wb");
    if (!fp) error("Failed to open \"%s\" : %s", fname, strerror(errno));
    bcf_hdr_t *hdr = bcf_hdr_init("w");
    if (!hdr) error("bcf_hdr_init : %s", strerror(errno));
    bcf1_t *rec    = bcf_init1();
    if (!rec) error("bcf_init1 : %s", strerror(errno));

    // Check no-op on fresh bcf1_t
    check0(bcf_update_alleles(hdr, rec, NULL, 0));

    // Create VCF header
    kstring_t str = {0,0,0};
    check0(bcf_hdr_append(hdr, "##fileDate=20090805"));
    check0(bcf_hdr_append(hdr, "##FORMAT=<ID=UF,Number=1,Type=Integer,Description=\"Unused FORMAT\">"));
    check0(bcf_hdr_append(hdr, "##INFO=<ID=UI,Number=1,Type=Integer,Description=\"Unused INFO\">"));
    check0(bcf_hdr_append(hdr, "##FILTER=<ID=Flt,Description=\"Unused FILTER\">"));
    check0(bcf_hdr_append(hdr, "##unused=<XX=AA,Description=\"Unused generic\">"));
    check0(bcf_hdr_append(hdr, "##unused=<ID=BB,Description=\"Unused generic with ID\">"));
    check0(bcf_hdr_append(hdr, "##unused=unformatted text 1"));
    check0(bcf_hdr_append(hdr, "##unused=unformatted text 2"));
    check0(bcf_hdr_append(hdr, "##contig=<ID=Unused,length=1>"));
    check0(bcf_hdr_append(hdr, "##source=myImputationProgramV3.1"));
    check0(bcf_hdr_append(hdr, "##reference=file:///seq/references/1000GenomesPilot-NCBI36.fasta"));
    check0(bcf_hdr_append(hdr, "##contig=<ID=20,length=62435964,assembly=B36,md5=f126cdf8a6e0c7f379d618ff66beb2da,species=\"Homo sapiens\",taxonomy=x>"));
    check0(bcf_hdr_append(hdr, "##phasing=partial"));
    check0(bcf_hdr_append(hdr, "##INFO=<ID=NS,Number=1,Type=Integer,Description=\"Number of Samples With Data\">"));
    check0(bcf_hdr_append(hdr, "##INFO=<ID=DP,Number=1,Type=Integer,Description=\"Total Depth\">"));
    check0(bcf_hdr_append(hdr, "##INFO=<ID=NEG,Number=.,Type=Integer,Description=\"Test -ve Numbers\">"));
    check0(bcf_hdr_append(hdr, "##INFO=<ID=AF,Number=A,Type=Float,Description=\"Allele Frequency\">"));
    check0(bcf_hdr_append(hdr, "##INFO=<ID=AA,Number=1,Type=String,Description=\"Ancestral Allele\">"));
    check0(bcf_hdr_append(hdr, "##INFO=<ID=DB,Number=0,Type=Flag,Description=\"dbSNP membership, build 129\">"));
    check0(bcf_hdr_append(hdr, "##INFO=<ID=H2,Number=0,Type=Flag,Description=\"HapMap2 membership\">"));
    check0(bcf_hdr_append(hdr, "##FILTER=<ID=q10,Description=\"Quality below 10\">"));
    check0(bcf_hdr_append(hdr, "##FILTER=<ID=s50,Description=\"Less than half of samples have data\">"));
    check0(bcf_hdr_append(hdr, "##FORMAT=<ID=GT,Number=1,Type=String,Description=\"Genotype\">"));
    check0(bcf_hdr_append(hdr, "##FORMAT=<ID=GQ,Number=1,Type=Integer,Description=\"Genotype Quality\">"));
    check0(bcf_hdr_append(hdr, "##FORMAT=<ID=DP,Number=1,Type=Integer,Description=\"Read Depth\">"));
    check0(bcf_hdr_append(hdr, "##FORMAT=<ID=HQ,Number=2,Type=Integer,Description=\"Haplotype Quality\">"));
    check0(bcf_hdr_append(hdr, "##FORMAT=<ID=TS,Number=1,Type=String,Description=\"Test String 1\">"));

    // Try a few header modifications
    bcf_hdr_remove(hdr, BCF_HL_CTG, "Unused");
    check0(bcf_hdr_append(hdr, "##contig=<ID=Unused,length=62435964>"));
    bcf_hdr_remove(hdr, BCF_HL_FMT, "TS");
    check0(bcf_hdr_append(hdr, "##FORMAT=<ID=TS,Number=1,Type=String,Description=\"Test String\">"));
    bcf_hdr_remove(hdr, BCF_HL_INFO, "NEG");
    check0(bcf_hdr_append(hdr, "##INFO=<ID=NEG,Number=.,Type=Integer,Description=\"Test Negative Numbers\">"));
    bcf_hdr_remove(hdr, BCF_HL_FLT, "s50");
    check0(bcf_hdr_append(hdr, "##FILTER=<ID=s50,Description=\"Less than 50% of samples have data\">"));

    check0(bcf_hdr_add_sample(hdr, "NA00001"));
    check0(bcf_hdr_add_sample(hdr, "NA00002"));
    check0(bcf_hdr_add_sample(hdr, "NA00003"));
    check0(bcf_hdr_add_sample(hdr, NULL));      // to update internal structures
    if ( bcf_hdr_write(fp, hdr)!=0 ) error("Failed to write to %s\n", fname);


    // Add a record
    // 20     14370   rs6054257 G      A       29   PASS   NS=3;DP=14;NEG=-127;AF=0.5;DB;H2           GT:GQ:DP:HQ 0|0:48:1:51,51 1|0:48:8:51,51 1/1:43:5:.,.
    // .. CHROM
    rec->rid = bcf_hdr_name2id(hdr, "20");
    // .. POS
    rec->pos = 14369;
    // .. ID
    check0(bcf_update_id(hdr, rec, "rs6054257"));
    // .. REF and ALT
    test_update_alleles(hdr, rec);
    const char *alleles[2] = { "G", "A" };
    check0(bcf_update_alleles_str(hdr, rec, "G,A"));
    check0(check_alleles(rec, alleles, 2));
    // .. QUAL
    rec->qual = 29;
    // .. FILTER
    int32_t tmpi = bcf_hdr_id2int(hdr, BCF_DT_ID, "PASS");
    check0(bcf_update_filter(hdr, rec, &tmpi, 1));
    // .. INFO
    tmpi = 3;
    check0(bcf_update_info_int32(hdr, rec, "NS", &tmpi, 1));
    tmpi = 500;
    check0(bcf_update_info_int32(hdr, rec, "DP", &tmpi, 1));
    tmpi = 100000;
    check0(bcf_update_info_int32(hdr, rec, "DP", &tmpi, 1));
    tmpi = 14;
    check0(bcf_update_info_int32(hdr, rec, "DP", &tmpi, 1));
    tmpi = -127;
    check0(bcf_update_info_int32(hdr, rec, "NEG", &tmpi, 1));
    float tmpf = 0.5;
    check0(bcf_update_info_float(hdr, rec, "AF", &tmpf, 1));
    check0(bcf_update_info_flag(hdr, rec, "DB", NULL, 1));
    check0(bcf_update_info_flag(hdr, rec, "H2", NULL, 1));
    // .. FORMAT
    int32_t *tmpia = (int*)malloc(bcf_hdr_nsamples(hdr)*2*sizeof(int));
    tmpia[0] = bcf_gt_phased(0);
    tmpia[1] = bcf_gt_phased(0);
    tmpia[2] = bcf_gt_phased(1);
    tmpia[3] = bcf_gt_phased(0);
    tmpia[4] = bcf_gt_unphased(1);
    tmpia[5] = bcf_gt_unphased(1);
    check0(bcf_update_genotypes(hdr, rec, tmpia, bcf_hdr_nsamples(hdr)*2));
    tmpia[0] = 48;
    tmpia[1] = 48;
    tmpia[2] = 43;
    check0(bcf_update_format_int32(hdr, rec, "GQ", tmpia, bcf_hdr_nsamples(hdr)));
    tmpia[0] = 0;
    tmpia[1] = 0;
    tmpia[2] = 1;
    check0(bcf_update_format_int32(hdr, rec, "DP", tmpia, bcf_hdr_nsamples(hdr)));
    tmpia[0] = 1;
    tmpia[1] = 100000;
    tmpia[2] = 1;
    check0(bcf_update_format_int32(hdr, rec, "DP", tmpia, bcf_hdr_nsamples(hdr)));
    tmpia[0] = 1;
    tmpia[1] = 8;
    tmpia[2] = 5;
    check0(bcf_update_format_int32(hdr, rec, "DP", tmpia, bcf_hdr_nsamples(hdr)));
    tmpia[0] = 51;
    tmpia[1] = 51;
    tmpia[2] = 51;
    tmpia[3] = 51;
    tmpia[4] = bcf_int32_missing;
    tmpia[5] = bcf_int32_missing;
    check0(bcf_update_format_int32(hdr, rec, "HQ", tmpia, bcf_hdr_nsamples(hdr)*2));
    char *tmp_str[] = {"String1","SomeOtherString2","YetAnotherString3"};
    check0(bcf_update_format_string(hdr, rec, "TS", (const char**)tmp_str, 3));
    tmp_str[0] = "LongerStringRequiringBufferReallocation";
    check0(bcf_update_format_string(hdr, rec, "TS", (const char**)tmp_str, 3));
    tmp_str[0] = "String1";
    check0(bcf_update_format_string(hdr, rec, "TS", (const char**)tmp_str, 3));
    if ( bcf_write1(fp, hdr, rec)!=0 ) error("Failed to write to %s\n", fname);

    // 20     1110696 . A      G,T     67   .   NS=2;DP=10;NEG=-128;AF=0.333,.;AA=T;DB GT 2 1   ./.
    bcf_clear1(rec);
    rec->rid = bcf_hdr_name2id(hdr, "20");
    rec->pos = 1110695;
    check0(bcf_update_alleles_str(hdr, rec, "A,G,T"));
    rec->qual = 67;
    tmpi = 2;
    check0(bcf_update_info_int32(hdr, rec, "NS", &tmpi, 1));
    tmpi = 10;
    check0(bcf_update_info_int32(hdr, rec, "DP", &tmpi, 1));
    tmpi = -128;
    check0(bcf_update_info_int32(hdr, rec, "NEG", &tmpi, 1));
    float *tmpfa = (float*)malloc(2*sizeof(float));
    tmpfa[0] = 0.333;
    bcf_float_set_missing(tmpfa[1]);
    check0(bcf_update_info_float(hdr, rec, "AF", tmpfa, 2));
    check0(bcf_update_info_string(hdr, rec, "AA", "SHORT"));
    check0(bcf_update_info_string(hdr, rec, "AA", "LONGSTRING"));
    check0(bcf_update_info_string(hdr, rec, "AA", "T"));
    check0(bcf_update_info_flag(hdr, rec, "DB", NULL, 1));
    tmpia[0] = bcf_gt_phased(2);
    tmpia[1] = bcf_int32_vector_end;
    tmpia[2] = bcf_gt_phased(1);
    tmpia[3] = bcf_int32_vector_end;
    tmpia[4] = bcf_gt_missing;
    tmpia[5] = bcf_gt_missing;
    check0(bcf_update_genotypes(hdr, rec, tmpia, bcf_hdr_nsamples(hdr)*2));
    if ( bcf_write1(fp, hdr, rec)!=0 ) error("Failed to write to %s\n", fname);

    free(tmpia);
    free(tmpfa);

    // Clean
    free(str.s);
    bcf_destroy1(rec);
    bcf_hdr_destroy(hdr);
    int ret;
    if ( (ret=hts_close(fp)) )
    {
        fprintf(stderr,"hts_close(%s): non-zero status %d\n",fname,ret);
        exit(ret);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdi, %rbx
leaq 0xa3f4c(%rip), %rsi     # 0xaa04c
callq 0xbbc0
testq %rax, %rax
je 0x6e17
movq %rax, %r14
leaq 0xa8659(%rip), %rdi     # 0xae771
callq 0x305f9
testq %rax, %rax
je 0x6e37
movq %rax, %r15
callq 0x31d1e
testq %rax, %rax
je 0x6e4c
movq %rax, %r12
movq %r15, %rdi
movq %rax, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x42388
testl %eax, %eax
jne 0x6d94
leaq 0xa3f68(%rip), %rsi     # 0xaa0c0
movq %r15, %rdi
callq 0x2fdb9
testl %eax, %eax
jne 0x6e67
leaq 0xa3f90(%rip), %rsi     # 0xaa0ff
movq %r15, %rdi
callq 0x2fdb9
testl %eax, %eax
jne 0x6e7a
leaq 0xa4018(%rip), %rsi     # 0xaa19e
movq %r15, %rdi
callq 0x2fdb9
testl %eax, %eax
jne 0x6e8d
leaq 0xa4098(%rip), %rsi     # 0xaa235
movq %r15, %rdi
callq 0x2fdb9
testl %eax, %eax
jne 0x6ea0
leaq 0xa40f6(%rip), %rsi     # 0xaa2aa
movq %r15, %rdi
callq 0x2fdb9
testl %eax, %eax
jne 0x6eb3
leaq 0xa4154(%rip), %rsi     # 0xaa31f
movq %r15, %rdi
callq 0x2fdb9
testl %eax, %eax
jne 0x6ec6
leaq 0xa560b(%rip), %rsi     # 0xab7ed
movq %r15, %rdi
callq 0x2fdb9
testl %eax, %eax
jne 0x6ed9
leaq 0xa41de(%rip), %rsi     # 0xaa3d7
movq %r15, %rdi
callq 0x2fdb9
testl %eax, %eax
jne 0x6eec
leaq 0xa5717(%rip), %rsi     # 0xab927
movq %r15, %rdi
callq 0x2fdb9
testl %eax, %eax
jne 0x6eff
leaq 0xa4234(%rip), %rsi     # 0xaa45b
movq %r15, %rdi
callq 0x2fdb9
testl %eax, %eax
jne 0x6f12
leaq 0xa4276(%rip), %rsi     # 0xaa4b4
movq %r15, %rdi
callq 0x2fdb9
testl %eax, %eax
jne 0x6f25
leaq 0xa42f8(%rip), %rsi     # 0xaa54d
movq %r15, %rdi
callq 0x2fdb9
testl %eax, %eax
jne 0x6f38
leaq 0xa43e4(%rip), %rsi     # 0xaa650
movq %r15, %rdi
callq 0x2fdb9
testl %eax, %eax
jne 0x6f4b
leaq 0xa4408(%rip), %rsi     # 0xaa68b
movq %r15, %rdi
callq 0x2fdb9
testl %eax, %eax
jne 0x6f5e
leaq 0xa44a8(%rip), %rsi     # 0xaa742
movq %r15, %rdi
callq 0x2fdb9
testl %eax, %eax
jne 0x6f71
leaq 0xa4528(%rip), %rsi     # 0xaa7d9
movq %r15, %rdi
callq 0x2fdb9
testl %eax, %eax
jne 0x6f84
leaq 0xa45b4(%rip), %rsi     # 0xaa87c
movq %r15, %rdi
callq 0x2fdb9
testl %eax, %eax
jne 0x6f97
leaq 0xa463a(%rip), %rsi     # 0xaa919
movq %r15, %rdi
callq 0x2fdb9
testl %eax, %eax
jne 0x6faa
leaq 0xa46c2(%rip), %rsi     # 0xaa9b8
movq %r15, %rdi
callq 0x2fdb9
testl %eax, %eax
jne 0x6fbd
leaq 0xa475c(%rip), %rsi     # 0xaaa69
movq %r15, %rdi
callq 0x2fdb9
testl %eax, %eax
jne 0x6fd0
leaq 0xa47e4(%rip), %rsi     # 0xaab08
movq %r15, %rdi
callq 0x2fdb9
testl %eax, %eax
jne 0x6fe3
leaq 0xa4848(%rip), %rsi     # 0xaab83
movq %r15, %rdi
callq 0x2fdb9
testl %eax, %eax
jne 0x6ff6
leaq 0xa48d2(%rip), %rsi     # 0xaac24
movq %r15, %rdi
callq 0x2fdb9
testl %eax, %eax
jne 0x7009
leaq 0xa494e(%rip), %rsi     # 0xaacb7
movq %r15, %rdi
callq 0x2fdb9
testl %eax, %eax
jne 0x701c
leaq 0xa49dc(%rip), %rsi     # 0xaad5c
movq %r15, %rdi
callq 0x2fdb9
testl %eax, %eax
jne 0x702f
leaq 0xa4a5e(%rip), %rsi     # 0xaadf5
movq %r15, %rdi
callq 0x2fdb9
testl %eax, %eax
jne 0x7042
leaq 0xa4aee(%rip), %rsi     # 0xaae9c
movq %r15, %rdi
callq 0x2fdb9
testl %eax, %eax
jne 0x7055
leaq 0xa4b74(%rip), %rdx     # 0xaaf39
movq %r15, %rdi
movl $0x3, %esi
callq 0x2fdeb
leaq 0xa4b67(%rip), %rsi     # 0xaaf40
movq %r15, %rdi
callq 0x2fdb9
testl %eax, %eax
jne 0x7068
leaq 0xa4bb1(%rip), %rdx     # 0xaafa1
movq %r15, %rdi
movl $0x2, %esi
callq 0x2fdeb
leaq 0xa4ba0(%rip), %rsi     # 0xaafa4
movq %r15, %rdi
callq 0x2fdb9
testl %eax, %eax
jne 0x707b
leaq 0xa4c22(%rip), %rdx     # 0xab03d
movq %r15, %rdi
movl $0x1, %esi
callq 0x2fdeb
leaq 0xa4c12(%rip), %rsi     # 0xab041
movq %r15, %rdi
callq 0x2fdb9
testl %eax, %eax
jne 0x708e
leaq 0xa4ca8(%rip), %rdx     # 0xab0ee
movq %r15, %rdi
xorl %esi, %esi
callq 0x2fdeb
leaq 0xa4c9b(%rip), %rsi     # 0xab0f2
movq %r15, %rdi
callq 0x2fdb9
testl %eax, %eax
jne 0x70a1
leaq 0xa4d23(%rip), %rsi     # 0xab191
movq %r15, %rdi
callq 0x2cf88
testl %eax, %eax
jne 0x70b4
leaq 0xa4d37(%rip), %rsi     # 0xab1bc
movq %r15, %rdi
callq 0x2cf88
testl %eax, %eax
jne 0x70c7
leaq 0xa4d4b(%rip), %rsi     # 0xab1e7
movq %r15, %rdi
callq 0x2cf88
testl %eax, %eax
jne 0x70da
movq %r15, %rdi
xorl %esi, %esi
callq 0x2cf88
testl %eax, %eax
jne 0x70ed
movq %r14, %rdi
movq %r15, %rsi
callq 0x3196a
testl %eax, %eax
jne 0x7100
leaq 0xa4d75(%rip), %rdx     # 0xab24d
movq %r15, %rdi
movl $0x1, %esi
callq 0x2fa59
movl %eax, 0x10(%r12)
movq $0x3821, (%r12)         # imm = 0x3821
leaq 0xa4d57(%rip), %rdx     # 0xab250
movq %r15, %rdi
movq %r12, %rsi
callq 0x427c1
testl %eax, %eax
jne 0x710f
movaps 0xcb1ed(%rip), %xmm0    # 0xd1700
leaq 0x60(%rsp), %rdx
movaps %xmm0, (%rdx)
movq 0xcb1fe(%rip), %rax     # 0xd1720
movq %rax, 0x30(%rsp)
movaps 0xcb1e2(%rip), %xmm0    # 0xd1710
movaps %xmm0, 0x20(%rsp)
movq 0xcb206(%rip), %rax     # 0xd1740
movq %rax, 0x10(%rsp)
movaps 0xcb1ea(%rip), %xmm0    # 0xd1730
movaps %xmm0, (%rsp)
leaq 0xa5d98(%rip), %rax     # 0xac2e9
movq %rax, 0x40(%rsp)
leaq 0xa5d27(%rip), %rax     # 0xac284
movq %rax, 0x50(%rsp)
movq %r15, %rdi
movq %r12, %rsi
movl $0x2, %ecx
callq 0x42388
testl %eax, %eax
jne 0x7122
leaq 0x60(%rsp), %rsi
movq %r12, %rdi
movl $0x2, %edx
callq 0x72b4
testl %eax, %eax
jne 0x7135
movq %r15, %rdi
movq %r12, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x42388
testl %eax, %eax
jne 0x6d94
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x72b4
testl %eax, %eax
jne 0x7148
leaq 0x20(%rsp), %rdx
movq %r15, %rdi
movq %r12, %rsi
movl $0x3, %ecx
callq 0x42388
testl %eax, %eax
jne 0x715b
leaq 0x20(%rsp), %rsi
movq %r12, %rdi
movl $0x3, %edx
callq 0x72b4
testl %eax, %eax
jne 0x6da7
movq %rsp, %rdx
movq %r15, %rdi
movq %r12, %rsi
movl $0x3, %ecx
callq 0x42388
testl %eax, %eax
jne 0x716e
movq %rsp, %rsi
movq %r12, %rdi
movl $0x3, %edx
callq 0x72b4
testl %eax, %eax
jne 0x7181
movq 0x88(%r12), %rax
movq 0x8(%rax), %rax
leaq 0x40(%rsp), %rdx
movq %rax, 0x8(%rdx)
movq %r15, %rdi
movq %r12, %rsi
movl $0x3, %ecx
callq 0x42388
testl %eax, %eax
jne 0x7194
movq %rbx, 0x18(%rsp)
movq 0x8(%rsp), %rax
leaq 0x40(%rsp), %rsi
movq %rax, 0x8(%rsi)
movq %r12, %rdi
movl $0x3, %edx
callq 0x72b4
testl %eax, %eax
jne 0x71a7
movq 0x88(%r12), %rbp
movq (%rbp), %r13
movq %r13, %rdi
callq 0x41c0
leaq (%rax,%r13), %rbx
addq $-0x4, %rbx
movq 0x10(%rbp), %r13
movq %r13, %rdi
callq 0x41c0
addq %r13, %rax
decq %rax
movq %rax, (%rbp)
movq 0x88(%r12), %rax
movq %rbx, 0x10(%rax)
movq 0x88(%r12), %rdx
movq %r15, %rdi
movq %r12, %rsi
movl $0x3, %ecx
callq 0x42388
testl %eax, %eax
jne 0x71ba
leaq 0x20(%rsp), %rsi
movq %r12, %rdi
movl $0x3, %edx
callq 0x72b4
testl %eax, %eax
jne 0x6da7
leaq 0xa4b82(%rip), %rdx     # 0xab27f
movq %r15, %rdi
movq %r12, %rsi
callq 0x4263b
testl %eax, %eax
jne 0x71cd
leaq 0xcafe9(%rip), %rsi     # 0xd1700
movq %r12, %rdi
movl $0x2, %edx
callq 0x72b4
testl %eax, %eax
jne 0x71e0
movl $0x41e80000, 0x14(%r12) # imm = 0x41E80000
leaq 0xa4b8e(%rip), %rdx     # 0xab2ca
movq %r15, %rdi
xorl %esi, %esi
callq 0x2fa59
movq %rsp, %rdx
movl %eax, (%rdx)
movq %r15, %rdi
movq %r12, %rsi
movl $0x1, %ecx
callq 0x42103
testl %eax, %eax
jne 0x71f3
movq %rsp, %rcx
movl $0x3, (%rcx)
leaq 0xa68ab(%rip), %rdx     # 0xad01e
movq %r15, %rdi
movq %r12, %rsi
movl $0x1, %r8d
movl $0x1, %r9d
callq 0x40f50
testl %eax, %eax
jne 0x6dba
movq %rsp, %rcx
movl $0x1f4, (%rcx)          # imm = 0x1F4
leaq 0xa4b85(%rip), %rdx     # 0xab327
movq %r15, %rdi
movq %r12, %rsi
movl $0x1, %r8d
movl $0x1, %r9d
callq 0x40f50
testl %eax, %eax
jne 0x6d5b
movq %rsp, %rcx
movl $0x186a0, (%rcx)        # imm = 0x186A0
leaq 0xa4b56(%rip), %rdx     # 0xab327
movq %r15, %rdi
movq %r12, %rsi
movl $0x1, %r8d
movl $0x1, %r9d
callq 0x40f50
testl %eax, %eax
jne 0x6d5b
movq %rsp, %rcx
movl $0xe, (%rcx)
leaq 0xa4b27(%rip), %rdx     # 0xab327
movq %r15, %rdi
movq %r12, %rsi
movl $0x1, %r8d
movl $0x1, %r9d
callq 0x40f50
testl %eax, %eax
jne 0x6d5b
movq %rsp, %rcx
movl $0xffffff81, (%rcx)     # imm = 0xFFFFFF81
leaq 0xa480e(%rip), %rdx     # 0xab03d
movq %r15, %rdi
movq %r12, %rsi
movl $0x1, %r8d
movl $0x1, %r9d
callq 0x40f50
testl %eax, %eax
jne 0x6dcd
leaq 0x40(%rsp), %rcx
movl $0x3f000000, (%rcx)     # imm = 0x3F000000
leaq 0xb6037(%rip), %rdx     # 0xbc897
movq %r15, %rdi
movq %r12, %rsi
movl $0x1, %r8d
movl $0x2, %r9d
callq 0x40f50
testl %eax, %eax
jne 0x7206
leaq 0xa4b3b(%rip), %rdx     # 0xab3c1
movq %r15, %rdi
movq %r12, %rsi
xorl %ecx, %ecx
movl $0x1, %r8d
xorl %r9d, %r9d
callq 0x40f50
testl %eax, %eax
jne 0x6de0
leaq 0xa4b50(%rip), %rdx     # 0xab3fb
movq %r15, %rdi
movq %r12, %rsi
xorl %ecx, %ecx
movl $0x1, %r8d
xorl %r9d, %r9d
callq 0x40f50
testl %eax, %eax
jne 0x7216
movslq 0x8(%r15), %rdi
shlq $0x3, %rdi
callq 0x46a0
movq %rax, %r13
movaps 0xa3730(%rip), %xmm0    # 0xaa010
movups %xmm0, (%rax)
movabsq $0x400000004, %rax      # imm = 0x400000004
movq %rax, 0x10(%r13)
movl 0x8(%r15), %r8d
addl %r8d, %r8d
leaq 0xac7c1(%rip), %rdx     # 0xb30c0
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rcx
movl $0x1, %r9d
callq 0x4168f
testl %eax, %eax
jne 0x6df3
movabsq $0x3000000030, %rax     # imm = 0x3000000030
movq %rax, (%r13)
movl $0x2b, 0x8(%r13)
movl 0x8(%r15), %r8d
leaq 0xa4b37(%rip), %rdx     # 0xab473
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rcx
movl $0x1, %r9d
callq 0x4168f
testl %eax, %eax
jne 0x7226
movq $0x0, (%r13)
movl $0x1, 0x8(%r13)
movl 0x8(%r15), %r8d
leaq 0xa49b4(%rip), %rdx     # 0xab327
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rcx
movl $0x1, %r9d
callq 0x4168f
testl %eax, %eax
jne 0x6d6e
movabsq $0x186a000000001, %rax  # imm = 0x186A000000001
movq %rax, (%r13)
movl $0x1, 0x8(%r13)
movl 0x8(%r15), %r8d
leaq 0xa4977(%rip), %rdx     # 0xab327
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rcx
movl $0x1, %r9d
callq 0x4168f
testl %eax, %eax
jne 0x6d6e
movabsq $0x800000001, %rax      # imm = 0x800000001
movq %rax, (%r13)
movl $0x5, 0x8(%r13)
movl 0x8(%r15), %r8d
leaq 0xa493a(%rip), %rdx     # 0xab327
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rcx
movl $0x1, %r9d
callq 0x4168f
testl %eax, %eax
jne 0x6d6e
movaps 0xa3610(%rip), %xmm0    # 0xaa020
movups %xmm0, (%r13)
movabsq $-0x7fffffff80000000, %rax # imm = 0x8000000080000000
movq %rax, 0x10(%r13)
movl 0x8(%r15), %r8d
addl %r8d, %r8d
leaq 0xa4ac1(%rip), %rdx     # 0xab4f2
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rcx
movl $0x1, %r9d
callq 0x4168f
testl %eax, %eax
jne 0x7236
movq 0xcac7c(%rip), %rax     # 0xd16d0
leaq 0x20(%rsp), %rcx
movq %rax, 0x10(%rcx)
movaps 0xcac5c(%rip), %xmm0    # 0xd16c0
movaps %xmm0, (%rcx)
leaq 0xa4533(%rip), %rdx     # 0xaafa1
movq %r15, %rdi
movq %r12, %rsi
movl $0x3, %r8d
callq 0x41557
testl %eax, %eax
jne 0x6d81
leaq 0xa4b15(%rip), %rax     # 0xab5a3
leaq 0x20(%rsp), %rcx
movq %rax, (%rcx)
leaq 0xa4504(%rip), %rdx     # 0xaafa1
movq %r15, %rdi
movq %r12, %rsi
movl $0x3, %r8d
callq 0x41557
testl %eax, %eax
jne 0x6d81
leaq 0xa4a78(%rip), %rax     # 0xab535
leaq 0x20(%rsp), %rcx
movq %rax, (%rcx)
leaq 0xa44d5(%rip), %rdx     # 0xaafa1
movq %r15, %rdi
movq %r12, %rsi
movl $0x3, %r8d
callq 0x41557
testl %eax, %eax
jne 0x6d81
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x33c66
testl %eax, %eax
jne 0x6e06
movq %r12, %rdi
callq 0x31d2d
leaq 0xa4743(%rip), %rdx     # 0xab24d
movq %r15, %rdi
movl $0x1, %esi
callq 0x2fa59
movl %eax, 0x10(%r12)
movq $0x10f2a7, (%r12)       # imm = 0x10F2A7
leaq 0xa4aa0(%rip), %rdx     # 0xab5cb
movq %r15, %rdi
movq %r12, %rsi
callq 0x4263b
testl %eax, %eax
jne 0x7246
movl $0x42860000, 0x14(%r12) # imm = 0x42860000
movq %rsp, %rcx
movl $0x2, (%rcx)
leaq 0xa64c7(%rip), %rdx     # 0xad01e
movq %r15, %rdi
movq %r12, %rsi
movl $0x1, %r8d
movl $0x1, %r9d
callq 0x40f50
testl %eax, %eax
jne 0x6dba
movq %rsp, %rcx
movl $0xa, (%rcx)
leaq 0xa47a1(%rip), %rdx     # 0xab327
movq %r15, %rdi
movq %r12, %rsi
movl $0x1, %r8d
movl $0x1, %r9d
callq 0x40f50
testl %eax, %eax
jne 0x6d5b
movq %rsp, %rcx
movl $0xffffff80, (%rcx)     # imm = 0xFFFFFF80
leaq 0xa4488(%rip), %rdx     # 0xab03d
movq %r15, %rdi
movq %r12, %rsi
movl $0x1, %r8d
movl $0x1, %r9d
callq 0x40f50
testl %eax, %eax
jne 0x6dcd
movl $0x8, %edi
callq 0x46a0
movq %rax, %rbp
movl $0x3eaa7efa, (%rax)     # imm = 0x3EAA7EFA
leaq 0xcc8e2(%rip), %rax     # 0xd34d0
movl (%rax), %eax
movl %eax, 0x4(%rbp)
leaq 0xb5c9d(%rip), %rdx     # 0xbc897
movq %r15, %rdi
movq %r12, %rsi
movq %rbp, %rcx
movl $0x2, %r8d
movl $0x2, %r9d
callq 0x40f50
testl %eax, %eax
jne 0x7256
leaq 0xa4a0a(%rip), %rdx     # 0xab62d
leaq 0xa4a06(%rip), %rcx     # 0xab630
movq %r15, %rdi
movq %r12, %rsi
movl $0x1, %r8d
movl $0x3, %r9d
callq 0x40f50
testl %eax, %eax
jne 0x7266
leaq 0xa49dd(%rip), %rdx     # 0xab62d
leaq 0xa4a11(%rip), %rcx     # 0xab668
movq %r15, %rdi
movq %r12, %rsi
movl $0x1, %r8d
movl $0x3, %r9d
callq 0x40f50
testl %eax, %eax
jne 0x7276
leaq 0xa49b0(%rip), %rdx     # 0xab62d
leaq 0xa494b(%rip), %rcx     # 0xab5cf
movq %r15, %rdi
movq %r12, %rsi
movl $0x1, %r8d
movl $0x3, %r9d
callq 0x40f50
testl %eax, %eax
jne 0x7286
leaq 0xa4717(%rip), %rdx     # 0xab3c1
movq %r15, %rdi
movq %r12, %rsi
xorl %ecx, %ecx
movl $0x1, %r8d
xorl %r9d, %r9d
callq 0x40f50
testl %eax, %eax
jne 0x6de0
movaps 0xa3361(%rip), %xmm0    # 0xaa030
movups %xmm0, (%r13)
movq $0x0, 0x10(%r13)
movl 0x8(%r15), %r8d
addl %r8d, %r8d
leaq 0xac3d6(%rip), %rdx     # 0xb30c0
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rcx
movl $0x1, %r9d
callq 0x4168f
testl %eax, %eax
jne 0x6df3
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x33c66
testl %eax, %eax
jne 0x6e06
movq %r13, %rdi
callq 0x45c0
movq %rbp, %rdi
callq 0x45c0
movq %r12, %rdi
callq 0x31ec9
movq %r15, %rdi
callq 0x30af4
movq %r14, %rdi
callq 0xce22
testl %eax, %eax
jne 0x729b
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xa3327(%rip), %rdi     # 0xaa089
leaq 0xa45c1(%rip), %rsi     # 0xab32a
jmp 0x7294
leaq 0xa3314(%rip), %rdi     # 0xaa089
leaq 0xa4738(%rip), %rsi     # 0xab4b4
jmp 0x7294
leaq 0xa3301(%rip), %rdi     # 0xaa089
leaq 0xa47d1(%rip), %rsi     # 0xab560
jmp 0x7294
leaq 0xa32ee(%rip), %rdi     # 0xaa089
leaq 0xa32f2(%rip), %rsi     # 0xaa094
jmp 0x7294
leaq 0xa32db(%rip), %rdi     # 0xaa089
leaq 0xa5693(%rip), %rsi     # 0xac448
jmp 0x7294
leaq 0xa32c8(%rip), %rdi     # 0xaa089
leaq 0xa452d(%rip), %rsi     # 0xab2f5
jmp 0x7294
leaq 0xa32b5(%rip), %rdi     # 0xaa089
leaq 0xa4581(%rip), %rsi     # 0xab35c
jmp 0x7294
leaq 0xa32a2(%rip), %rdi     # 0xaa089
leaq 0xa45d6(%rip), %rsi     # 0xab3c4
jmp 0x7294
leaq 0xa328f(%rip), %rdi     # 0xaa089
leaq 0xa4634(%rip), %rsi     # 0xab435
jmp 0x7294
leaq 0xa4429(%rip), %rdi     # 0xab236
movq 0x18(%rsp), %rsi
jmp 0x7294
callq 0x4050
movl (%rax), %edi
callq 0x4140
leaq 0xa3225(%rip), %rdi     # 0xaa04f
movq %rbx, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x602c
callq 0x4050
movl (%rax), %edi
callq 0x4140
leaq 0xa321e(%rip), %rdi     # 0xaa068
jmp 0x6e5f
callq 0x4050
movl (%rax), %edi
callq 0x4140
leaq 0xa321b(%rip), %rdi     # 0xaa07a
movq %rax, %rsi
jmp 0x7294
leaq 0xa321b(%rip), %rdi     # 0xaa089
leaq 0xa325f(%rip), %rsi     # 0xaa0d4
jmp 0x7294
leaq 0xa3208(%rip), %rdi     # 0xaa089
leaq 0xa32ba(%rip), %rsi     # 0xaa142
jmp 0x7294
leaq 0xa31f5(%rip), %rdi     # 0xaa089
leaq 0xa3342(%rip), %rsi     # 0xaa1dd
jmp 0x7294
leaq 0xa31e2(%rip), %rdi     # 0xaa089
leaq 0xa33b5(%rip), %rsi     # 0xaa263
jmp 0x7294
leaq 0xa31cf(%rip), %rdi     # 0xaa089
leaq 0xa3417(%rip), %rsi     # 0xaa2d8
jmp 0x7294
leaq 0xa31bc(%rip), %rdi     # 0xaa089
leaq 0xa3481(%rip), %rsi     # 0xaa355
jmp 0x7294
leaq 0xa31a9(%rip), %rdi     # 0xaa089
leaq 0xa34bd(%rip), %rsi     # 0xaa3a4
jmp 0x7294
leaq 0xa3196(%rip), %rdi     # 0xaa089
leaq 0xa34f9(%rip), %rsi     # 0xaa3f3
jmp 0x7294
leaq 0xa3183(%rip), %rdi     # 0xaa089
leaq 0xa3519(%rip), %rsi     # 0xaa426
jmp 0x7294
leaq 0xa3170(%rip), %rdi     # 0xaa089
leaq 0xa355c(%rip), %rsi     # 0xaa47c
jmp 0x7294
leaq 0xa315d(%rip), %rdi     # 0xaa089
leaq 0xa35c2(%rip), %rsi     # 0xaa4f5
jmp 0x7294
leaq 0xa314a(%rip), %rdi     # 0xaa089
leaq 0xa367c(%rip), %rsi     # 0xaa5c2
jmp 0x7294
leaq 0xa3137(%rip), %rdi     # 0xaa089
leaq 0xa3709(%rip), %rsi     # 0xaa662
jmp 0x7294
leaq 0xa3124(%rip), %rdi     # 0xaa089
leaq 0xa376e(%rip), %rsi     # 0xaa6da
jmp 0x7294
leaq 0xa3111(%rip), %rdi     # 0xaa089
leaq 0xa3802(%rip), %rsi     # 0xaa781
jmp 0x7294
leaq 0xa30fe(%rip), %rdi     # 0xaa089
leaq 0xa388c(%rip), %rsi     # 0xaa81e
jmp 0x7294
leaq 0xa30eb(%rip), %rdi     # 0xaa089
leaq 0xa3919(%rip), %rsi     # 0xaa8be
jmp 0x7294
leaq 0xa30d8(%rip), %rdi     # 0xaa089
leaq 0xa39a4(%rip), %rsi     # 0xaa95c
jmp 0x7294
leaq 0xa30c5(%rip), %rdi     # 0xaa089
leaq 0xa3a39(%rip), %rsi     # 0xaaa04
jmp 0x7294
leaq 0xa30b2(%rip), %rdi     # 0xaa089
leaq 0xa3ace(%rip), %rsi     # 0xaaaac
jmp 0x7294
leaq 0xa309f(%rip), %rdi     # 0xaa089
leaq 0xa3b48(%rip), %rsi     # 0xaab39
jmp 0x7294
leaq 0xa308c(%rip), %rdi     # 0xaa089
leaq 0xa3bc3(%rip), %rsi     # 0xaabc7
jmp 0x7294
leaq 0xa3079(%rip), %rdi     # 0xaa089
leaq 0xa3c4a(%rip), %rsi     # 0xaac61
jmp 0x7294
leaq 0xa3066(%rip), %rdi     # 0xaa089
leaq 0xa3cd3(%rip), %rsi     # 0xaacfd
jmp 0x7294
leaq 0xa3053(%rip), %rdi     # 0xaa089
leaq 0xa3d5f(%rip), %rsi     # 0xaad9c
jmp 0x7294
leaq 0xa3040(%rip), %rdi     # 0xaa089
leaq 0xa3dec(%rip), %rsi     # 0xaae3c
jmp 0x7294
leaq 0xa302d(%rip), %rdi     # 0xaa089
leaq 0xa3e7b(%rip), %rsi     # 0xaaede
jmp 0x7294
leaq 0xa301a(%rip), %rdi     # 0xaa089
leaq 0xa3eef(%rip), %rsi     # 0xaaf65
jmp 0x7294
leaq 0xa3007(%rip), %rdi     # 0xaa089
leaq 0xa3f5b(%rip), %rsi     # 0xaafe4
jmp 0x7294
leaq 0xa2ff4(%rip), %rdi     # 0xaa089
leaq 0xa3fef(%rip), %rsi     # 0xab08b
jmp 0x7294
leaq 0xa2fe1(%rip), %rdi     # 0xaa089
leaq 0xa4086(%rip), %rsi     # 0xab135
jmp 0x7294
leaq 0xa2fce(%rip), %rdi     # 0xaa089
leaq 0xa40d7(%rip), %rsi     # 0xab199
jmp 0x7294
leaq 0xa2fbb(%rip), %rdi     # 0xaa089
leaq 0xa40ef(%rip), %rsi     # 0xab1c4
jmp 0x7294
leaq 0xa2fa8(%rip), %rdi     # 0xaa089
leaq 0xa4107(%rip), %rsi     # 0xab1ef
jmp 0x7294
leaq 0xa2f95(%rip), %rdi     # 0xaa089
leaq 0xa4117(%rip), %rsi     # 0xab212
jmp 0x7294
leaq 0xa412f(%rip), %rdi     # 0xab236
movq %rbx, %rsi
jmp 0x7294
leaq 0xa2f73(%rip), %rdi     # 0xaa089
leaq 0xa413d(%rip), %rsi     # 0xab25a
jmp 0x7294
leaq 0xa2f60(%rip), %rdi     # 0xaa089
leaq 0xa5282(%rip), %rsi     # 0xac3b2
jmp 0x7294
leaq 0xa2f4d(%rip), %rdi     # 0xaa089
leaq 0xa5299(%rip), %rsi     # 0xac3dc
jmp 0x7294
leaq 0xa2f3a(%rip), %rdi     # 0xaa089
leaq 0xa52a6(%rip), %rsi     # 0xac3fc
jmp 0x7294
leaq 0xa2f27(%rip), %rdi     # 0xaa089
leaq 0xa52b5(%rip), %rsi     # 0xac41e
jmp 0x7294
leaq 0xa2f14(%rip), %rdi     # 0xaa089
leaq 0xa52ec(%rip), %rsi     # 0xac468
jmp 0x7294
leaq 0xa2f01(%rip), %rdi     # 0xaa089
leaq 0xa5303(%rip), %rsi     # 0xac492
jmp 0x7294
leaq 0xa2eee(%rip), %rdi     # 0xaa089
leaq 0xa5310(%rip), %rsi     # 0xac4b2
jmp 0x7294
leaq 0xa2edb(%rip), %rdi     # 0xaa089
leaq 0xa5327(%rip), %rsi     # 0xac4dc
jmp 0x7294
leaq 0xa2ec8(%rip), %rdi     # 0xaa089
leaq 0xa5334(%rip), %rsi     # 0xac4fc
jmp 0x7294
leaq 0xa2eb5(%rip), %rdi     # 0xaa089
leaq 0xa40a8(%rip), %rsi     # 0xab283
jmp 0x7294
leaq 0xa2ea2(%rip), %rdi     # 0xaa089
leaq 0xa40bd(%rip), %rsi     # 0xab2ab
jmp 0x7294
leaq 0xa2e8f(%rip), %rdi     # 0xaa089
leaq 0xa40ce(%rip), %rsi     # 0xab2cf
jmp 0x7294
leaq 0xa2e7c(%rip), %rdi     # 0xaa089
leaq 0xa417b(%rip), %rsi     # 0xab38f
jmp 0x7294
leaq 0xa2e6c(%rip), %rdi     # 0xaa089
leaq 0xa41da(%rip), %rsi     # 0xab3fe
jmp 0x7294
leaq 0xa2e5c(%rip), %rdi     # 0xaa089
leaq 0xa4242(%rip), %rsi     # 0xab476
jmp 0x7294
leaq 0xa2e4c(%rip), %rdi     # 0xaa089
leaq 0xa42b1(%rip), %rsi     # 0xab4f5
jmp 0x7294
leaq 0xa2e3c(%rip), %rdi     # 0xaa089
leaq 0xa437d(%rip), %rsi     # 0xab5d1
jmp 0x7294
leaq 0xa2e2c(%rip), %rdi     # 0xaa089
leaq 0xa4397(%rip), %rsi     # 0xab5fb
jmp 0x7294
leaq 0xa2e1c(%rip), %rdi     # 0xaa089
leaq 0xa43c2(%rip), %rsi     # 0xab636
jmp 0x7294
leaq 0xa2e0c(%rip), %rdi     # 0xaa089
leaq 0xa43ef(%rip), %rsi     # 0xab673
jmp 0x7294
leaq 0xa2dfc(%rip), %rdi     # 0xaa089
leaq 0xa4416(%rip), %rsi     # 0xab6aa
xorl %eax, %eax
callq 0x602c
movq 0x18(%rsp), %rdi
movl %eax, %esi
callq 0x49e0