// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/test/hfile.c
// Function: main
int main(void)
{
    static const int size[] = { 1, 13, 403, 999, 30000 };

    char buffer[40000];
    char *original;
    int c, i;
    ssize_t n;
    off_t off;

    reopen("vcf.c", "test/hfile1.tmp");
    while ((c = hgetc(fin)) != EOF) {
        if (hputc(c, fout) == EOF) fail("hputc");
    }
    if (herrno(fin)) { errno = herrno(fin); fail("hgetc"); }

    reopen("test/hfile1.tmp", "test/hfile2.tmp");
    if (hpeek(fin, buffer, 50) < 0) fail("hpeek");
    while ((n = hread(fin, buffer, 17)) > 0) {
        if (hwrite(fout, buffer, n) != n) fail("hwrite");
    }
    if (n < 0) fail("hread");

    reopen("test/hfile2.tmp", "test/hfile3.tmp");
    while ((n = hread(fin, buffer, sizeof buffer)) > 0) {
        if (hwrite(fout, buffer, n) != n) fail("hwrite");
        if (hpeek(fin, buffer, 700) < 0) fail("hpeek");
    }
    if (n < 0) fail("hread");

    reopen("test/hfile3.tmp", "test/hfile4.tmp");
    i = 0;
    off = 0;
    while ((n = hread(fin, buffer, size[i++ % 5])) > 0) {
        off += n;
        buffer[n] = '\0';
        check_offset(fin, off, "pre-peek");
        if (hputs(buffer, fout) == EOF) fail("hputs");
        if ((n = hpeek(fin, buffer, size[(i+3) % 5])) < 0) fail("hpeek");
        check_offset(fin, off, "post-peek");
    }
    if (n < 0) fail("hread");

    reopen("test/hfile4.tmp", "test/hfile5.tmp");
    while (hgets(buffer, 80, fin) != NULL) {
        size_t l = strlen(buffer);
        if (l > 79) fail("hgets read %zu bytes, should be < 80", l);
        if (hwrite(fout, buffer, l) != l) fail("hwrite");
    }
    if (herrno(fin)) fail("hgets");

    reopen("test/hfile5.tmp", "test/hfile6.tmp");
    n = hread(fin, buffer, 200);
    if (n < 0) fail("hread");
    else if (n != 200) fail("hread only got %d", (int)n);
    if (hwrite(fout, buffer, 1000) != 1000) fail("hwrite");
    check_offset(fin, 200, "input/first200");
    check_offset(fout, 1000, "output/first200");

    if (hseek(fin, 800, SEEK_CUR) < 0) fail("hseek/cur");
    check_offset(fin, 1000, "input/seek");
    for (off = 1000; (n = hread(fin, buffer, sizeof buffer)) > 0; off += n)
        if (hwrite(fout, buffer, n) != n) fail("hwrite");
    if (n < 0) fail("hread");
    check_offset(fin, off, "input/eof");
    check_offset(fout, off, "output/eof");

    if (hseek(fin, 200, SEEK_SET) < 0) fail("hseek/set");
    if (hseek(fout, 200, SEEK_SET) < 0) fail("hseek(output)");
    check_offset(fin, 200, "input/backto200");
    check_offset(fout, 200, "output/backto200");
    n = hread(fin, buffer, 800);
    if (n < 0) fail("hread");
    else if (n != 800) fail("hread only got %d", (int)n);
    if (hwrite(fout, buffer, 800) != 800) fail("hwrite");
    check_offset(fin, 1000, "input/wrote800");
    check_offset(fout, 1000, "output/wrote800");

    if (hflush(fout) == EOF) fail("hflush");

    original = slurp("vcf.c");
    for (i = 1; i <= 6; i++) {
        char *text;
        snprintf(buffer, sizeof(buffer), "test/hfile%d.tmp", i);
        text = slurp(buffer);
        if (strcmp(original, text) != 0) {
            fprintf(stderr, "%s differs from vcf.c\n", buffer);
            free(text);
            free(original);
            return EXIT_FAILURE;
        }
        free(text);
    }
    free(original);

    if (hclose(fin) != 0) fail("hclose(input)");
    if (hclose(fout) != 0) fail("hclose(output)");

    fout = hopen("test/hfile_chars.tmp", "w");
    if (fout == NULL) fail("hopen(\"test/hfile_chars.tmp\")");
    for (i = 0; i < 256; i++)
        if (hputc(i, fout) != i) fail("chars: hputc (%d)", i);
    if (hclose(fout) != 0) fail("hclose(test/hfile_chars.tmp)");

    fin = hopen("test/hfile_chars.tmp", "r");
    if (fin == NULL) fail("hopen(\"test/hfile_chars.tmp\") for reading");
    for (i = 0; i < 256; i++)
        if ((c = hgetc(fin)) != i)
            fail("chars: hgetc (%d = 0x%x) returned %d = 0x%x", i, i, c, c);
    if ((c = hgetc(fin)) != EOF) fail("chars: hgetc (EOF) returned %d", c);
    if (hclose(fin) != 0) fail("hclose(test/hfile_chars.tmp) for reading");

    fin = hopen("preload:test/hfile_chars.tmp", "r");
    if (fin == NULL) fail("preloading \"test/hfile_chars.tmp\" for reading");
    for (i = 0; i < 256; i++)
        if ((c = hgetc(fin)) != i)
            fail("preloading chars: hgetc (%d = 0x%x) returned %d = 0x%x", i, i, c, c);
    if ((c = hgetc(fin)) != EOF) fail("preloading chars: hgetc (EOF) returned %d", c);
    if (hclose(fin) != 0) fail("preloading hclose(test/hfile_chars.tmp) for reading");

    char* test_string = strdup("Test string");
    fin = hopen("mem:", "r:", test_string, 12);
    if (fin == NULL) fail("hopen(\"mem:\", \"r:\", ...)");
    if (hread(fin, buffer, 12) != 12)
        fail("hopen('mem:', 'r') failed read");
    if(strcmp(buffer, test_string) != 0)
        fail("hopen('mem:', 'r') missread '%s' != '%s'", buffer, test_string);
    char* internal_buf;
    size_t interval_buf_len;
    if((internal_buf = hfile_mem_get_buffer(fin, &interval_buf_len)) == NULL){
        fail("hopen('mem:', 'r') failed to get internal buffer");
    }
    if (hclose(fin) != 0) fail("hclose mem for reading");

    test_string = strdup("Test string");
    fin = hopen("mem:", "wr:", test_string, 12);
    if (fin == NULL) fail("hopen(\"mem:\", \"w:\", ...)");
    if (hseek(fin, -1, SEEK_END) < 0)
        fail("hopen('mem:', 'wr') failed seek");
    if (hwrite(fin, " extra", 7) != 7)
        fail("hopen('mem:', 'wr') failed write");
    if (hseek(fin, 0, SEEK_SET) < 0)
        fail("hopen('mem:', 'wr') failed seek");
    if (hread(fin, buffer, 18) != 18)
        fail("hopen('mem:', 'wr') failed read");
    if (strcmp(buffer, "Test string extra") != 0)
        fail("hopen('mem:', 'wr') misswrote '%s' != '%s'", buffer, "Test string extra");
    if((internal_buf = hfile_mem_steal_buffer(fin, &interval_buf_len)) == NULL){
        fail("hopen('mem:', 'wr') failed to get internal buffer");
    }
    free(internal_buf);
    if (hclose(fin) != 0) fail("hclose mem for writing");

    fin = hopen("data:,hello, world!%0A", "r");
    if (fin == NULL) fail("hopen(\"data:...\")");
    n = hread(fin, buffer, 300);
    if (n < 0) fail("hread");
    buffer[n] = '\0';
    if (strcmp(buffer, "hello, world!\x0A") != 0) fail("hread result");
    if (hclose(fin) != 0) fail("hclose(\"data:...\")");

    fin = hopen("test/emptyfile", "r");
    if (fin == NULL) fail("hopen(\"test/emptyfile\") for reading");
    if (hread(fin, buffer, 100) != 0) fail("test/emptyfile is non-empty");
    if (hclose(fin) != 0) fail("hclose(\"test/emptyfile\") for reading");

    fin = hopen("data:,", "r");
    if (fin == NULL) fail("hopen(\"data:\") for reading");
    if (hread(fin, buffer, 100) != 0) fail("empty data: URL is non-empty");
    if (hclose(fin) != 0) fail("hclose(\"data:\") for reading");

    fin = hopen("data:;base64,"
// Wikipedia's example quote from Thomas Hobbes' Leviathan
"TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb24sIGJ1dCBieSB0aGlz"
"IHNpbmd1bGFyIHBhc3Npb24gZnJvbSBvdGhlciBhbmltYWxzLCB3aGljaCBpcyBhIGx1c3Qgb2Yg"
"dGhlIG1pbmQsIHRoYXQgYnkgYSBwZXJzZXZlcmFuY2Ugb2YgZGVsaWdodCBpbiB0aGUgY29udGlu"
"dWVkIGFuZCBpbmRlZmF0aWdhYmxlIGdlbmVyYXRpb24gb2Yga25vd2xlZGdlLCBleGNlZWRzIHRo"
"ZSBzaG9ydCB2ZWhlbWVuY2Ugb2YgYW55IGNhcm5hbCBwbGVhc3VyZS4=", "r");
    if (fin == NULL) fail("hopen(\"data:;base64,...\")");
    n = hread(fin, buffer, 300);
    if (n < 0) fail("hread for base64");
    buffer[n] = '\0';
    if (strcmp(buffer, "Man is distinguished, not only by his reason, but by "
"this singular passion from other animals, which is a lust of the mind, that "
"by a perseverance of delight in the continued and indefatigable generation "
"of knowledge, exceeds the short vehemence of any carnal pleasure.") != 0)
        fail("hread result for base64");
    if (hclose(fin) != 0) fail("hclose(\"data:;base64,...\")");

    kstring_t kstr = { 0, 0, NULL };

    if (strcmp(haddextension(&kstr, "foo/bar.bam", 0, ".bai"),
               "foo/bar.bam.bai") != 0) fail("haddextension foo/bar.bam[.bai]");
    if (strcmp(haddextension(&kstr, "foo/bar.bam", 1, ".bai"),
               "foo/bar.bai") != 0) fail("haddextension foo/bar[.bai]");
    if (strcmp(haddextension(&kstr, "foo.bar/baz", 1, ".bai"),
               "foo.bar/baz.bai") != 0) fail("haddextension foo.bar/baz[.bai]");
    if (strcmp(haddextension(&kstr, "foo#bar.bam", 0, ".bai"),
               "foo#bar.bam.bai") != 0) fail("haddextension foo#bar.bam[.bai]");
    if (strcmp(haddextension(&kstr, ".bam", 1, ".bai"),
               ".bai") != 0) fail("haddextension [.bai]");
    if (strcmp(haddextension(&kstr, "foo", 1, ".csi"),
               "foo.csi") != 0) fail("haddextension foo[.csi]");

    if (strcmp(haddextension(&kstr, "http://host/bar.cram?a&b&c", 0, ".crai"),
               "http://host/bar.cram.crai?a&b&c") != 0)
        fail("haddextension http://host/bar.cram[.crai]?a&b&c");

    if (strcmp(haddextension(&kstr, "http://host/bar.cram#frag", 1, ".crai"),
               "http://host/bar.crai#frag") != 0)
        fail("haddextension http://host/bar[.crai]#frag");

    free(ks_release(&kstr));

    return EXIT_SUCCESS;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x9c98, %rsp           # imm = 0x9C98
leaq 0x6c36f(%rip), %rdi     # 0x7209a
leaq 0x6c36e(%rip), %rsi     # 0x720a0
callq 0x5c69
movq 0x937ca(%rip), %rdi     # 0x99508
callq 0x6c04
cmpl $-0x1, %eax
je 0x5d67
movq 0x937c1(%rip), %rsi     # 0x99510
movl %eax, %edi
callq 0x6c1e
cmpl $-0x1, %eax
jne 0x5d37
leaq 0x6c34e(%rip), %rdi     # 0x720b0
jmp 0x602b
movq 0x9379a(%rip), %rax     # 0x99508
movl 0x34(%rax), %ebx
testl %ebx, %ebx
jne 0x69ab
leaq 0x6c320(%rip), %rdi     # 0x720a0
leaq 0x6c335(%rip), %rsi     # 0x720bc
callq 0x5c69
movq 0x93775(%rip), %rdi     # 0x99508
leaq 0x50(%rsp), %rsi
pushq $0x32
popq %rdx
callq 0x7104
testq %rax, %rax
js 0x5e56
leaq 0x50(%rsp), %rbx
pushq $0x11
popq %r14
movq 0x9374f(%rip), %rdi     # 0x99508
movq %rbx, %rsi
movq %r14, %rdx
callq 0x6c3a
testq %rax, %rax
jle 0x5de8
movq %rax, %r15
movq 0x9373d(%rip), %rdi     # 0x99510
movq %rbx, %rsi
movq %rax, %rdx
callq 0x6ca3
cmpq %r15, %rax
je 0x5db2
jmp 0x6024
js 0x6988
leaq 0x6c2c7(%rip), %rdi     # 0x720bc
leaq 0x6c2dd(%rip), %rsi     # 0x720d9
callq 0x5c69
leaq 0x50(%rsp), %rbx
movq 0x936fb(%rip), %rdi     # 0x99508
movl $0x9c40, %edx           # imm = 0x9C40
movq %rbx, %rsi
callq 0x6c3a
testq %rax, %rax
jle 0x5e62
movq %rax, %r14
movq 0x936e7(%rip), %rdi     # 0x99510
movq %rbx, %rsi
movq %rax, %rdx
callq 0x6ca3
cmpq %r14, %rax
jne 0x6024
movq 0x936c4(%rip), %rdi     # 0x99508
movl $0x2bc, %edx            # imm = 0x2BC
movq %rbx, %rsi
callq 0x7104
testq %rax, %rax
jns 0x5e06
leaq 0x6c26f(%rip), %rdi     # 0x720cc
jmp 0x602b
js 0x6988
leaq 0x6c26a(%rip), %rdi     # 0x720d9
leaq 0x6c273(%rip), %rsi     # 0x720e9
callq 0x5c69
leaq 0x6ccde(%rip), %rbx     # 0x72b60
pushq $0x4
popq %r14
leaq 0x6ccc3(%rip), %r15     # 0x72b50
xorl %r13d, %r13d
movq $0x0, 0x8(%rsp)
movq %r14, %rax
xorl %edx, %edx
pushq $0x5
popq %rcx
divq %rcx
movq %rax, %r12
movq %r13, %rax
xorl %edx, %edx
divq %rcx
imulq $-0x14, %rax, %rax
movq 0x9364e(%rip), %rdi     # 0x99508
movslq (%r15,%rax), %rdx
leaq 0x50(%rsp), %rbp
movq %rbp, %rsi
callq 0x6c3a
testq %rax, %rax
jle 0x5fc1
movq %r13, 0x28(%rsp)
movq %r15, 0x30(%rsp)
movq %r14, 0x38(%rsp)
movq %rbx, 0x40(%rsp)
movq 0x8(%rsp), %rsi
addq %rax, %rsi
movb $0x0, 0x50(%rsp,%rax)
movq 0x9360c(%rip), %rdi     # 0x99508
movq %rsi, 0x8(%rsp)
leaq 0x6c1f1(%rip), %rdx     # 0x720f9
callq 0x5b6d
movq 0x935fc(%rip), %r13     # 0x99510
movq %rbp, %rdi
callq 0x41c0
movq %rax, %rbx
movq 0x8(%r13), %rdi
movq 0x18(%r13), %r14
subq %rdi, %r14
cmpq %rax, %r14
movq %rax, %r15
cmovbq %r14, %r15
movq %rbp, %rsi
movq %r15, %rdx
callq 0x43b0
addq %r15, 0x8(%r13)
cmpq %r14, %rbx
jbe 0x5f62
movq %rbp, %rdi
movq %rbx, %rsi
movq %r15, %rdx
movq %r13, %rcx
callq 0x73d4
cmpl $-0x1, %eax
je 0x697c
imulq $-0x14, %r12, %rax
movq 0x9359b(%rip), %rdi     # 0x99508
movq 0x40(%rsp), %rbx
movslq (%rbx,%rax), %rdx
movq %rbp, %rsi
callq 0x7104
testq %rax, %rax
js 0x5e56
movq 0x9357a(%rip), %rdi     # 0x99508
movq 0x8(%rsp), %rsi
leaq 0x6c16e(%rip), %rdx     # 0x72108
callq 0x5b6d
addq $0x4, %rbx
movq 0x38(%rsp), %r14
incq %r14
movq 0x30(%rsp), %r15
addq $0x4, %r15
movq 0x28(%rsp), %r13
incq %r13
jmp 0x5e99
js 0x6988
leaq 0x6c11b(%rip), %rdi     # 0x720e9
leaq 0x6c13d(%rip), %rsi     # 0x72112
callq 0x5c69
leaq 0x50(%rsp), %rbx
pushq $0x50
popq %rbp
movq 0x9351f(%rip), %rdx     # 0x99508
movq %rbx, %rdi
movl %ebp, %esi
callq 0x70c4
testq %rax, %rax
je 0x6032
movq %rbx, %rdi
callq 0x41c0
movq %rax, %r14
cmpq $0x50, %rax
jae 0x693b
movq 0x934fc(%rip), %rdi     # 0x99510
movq %rbx, %rsi
movq %r14, %rdx
callq 0x6ca3
cmpq %r14, %rax
je 0x5fe2
leaq 0x6c0a7(%rip), %rdi     # 0x720d2
xorl %eax, %eax
callq 0x5a9c
movq 0x934cf(%rip), %rax     # 0x99508
cmpl $0x0, 0x34(%rax)
jne 0x69be
leaq 0x6c0c8(%rip), %rdi     # 0x72112
leaq 0x6c0fc(%rip), %rsi     # 0x7214d
callq 0x5c69
movq 0x934ab(%rip), %rdi     # 0x99508
leaq 0x50(%rsp), %rsi
movl $0xc8, %edx
callq 0x6c3a
testq %rax, %rax
js 0x6988
cmpq $0xc8, %rax
jne 0x6994
movq 0x93488(%rip), %rdi     # 0x99510
leaq 0x50(%rsp), %rsi
movl $0x3e8, %edx            # imm = 0x3E8
callq 0x6ca3
cmpq $0x3e8, %rax            # imm = 0x3E8
jne 0x6024
movq 0x93462(%rip), %rdi     # 0x99508
leaq 0x6c0c2(%rip), %rdx     # 0x7216f
movl $0xc8, %esi
callq 0x5b6d
movq 0x93452(%rip), %rdi     # 0x99510
leaq 0x6c0b9(%rip), %rdx     # 0x7217e
movl $0x3e8, %r14d           # imm = 0x3E8
movl $0x3e8, %esi            # imm = 0x3E8
callq 0x5b6d
movq 0x9342c(%rip), %rdi     # 0x99508
pushq $0x1
popq %rbx
movl $0x320, %esi            # imm = 0x320
movl %ebx, %edx
callq 0x73ef
testq %rax, %rax
js 0x69ca
movq 0x9340d(%rip), %rdi     # 0x99508
leaq 0x6c096(%rip), %rdx     # 0x72198
movl $0x3e8, %esi            # imm = 0x3E8
callq 0x5b6d
leaq 0x50(%rsp), %r15
movq 0x933f0(%rip), %rdi     # 0x99508
movl $0x9c40, %edx           # imm = 0x9C40
movq %r15, %rsi
callq 0x6c3a
testq %rax, %rax
jle 0x614d
movq %rax, %r12
movq 0x933dc(%rip), %rdi     # 0x99510
movq %r15, %rsi
movq %rax, %rdx
callq 0x6ca3
cmpq %r12, %rax
jne 0x6024
addq %r12, %r14
jmp 0x6111
js 0x6988
movq 0x933ae(%rip), %rdi     # 0x99508
leaq 0x6c042(%rip), %rdx     # 0x721a3
movq %r14, %rsi
callq 0x5b6d
movq 0x933a0(%rip), %rdi     # 0x99510
leaq 0x6c036(%rip), %rdx     # 0x721ad
movq %r14, %rsi
callq 0x5b6d
movq 0x93382(%rip), %rdi     # 0x99508
movl $0xc8, %esi
xorl %edx, %edx
callq 0x73ef
testq %rax, %rax
js 0x69d6
movq 0x9336e(%rip), %rdi     # 0x99510
movl $0xc8, %esi
xorl %edx, %edx
callq 0x73ef
testq %rax, %rax
js 0x69e2
movq 0x9334a(%rip), %rdi     # 0x99508
leaq 0x6c00b(%rip), %rdx     # 0x721d0
movl $0xc8, %esi
callq 0x5b6d
movq 0x9333a(%rip), %rdi     # 0x99510
leaq 0x6c003(%rip), %rdx     # 0x721e0
movl $0xc8, %esi
callq 0x5b6d
movq 0x9331a(%rip), %rdi     # 0x99508
leaq 0x50(%rsp), %rsi
movl $0x320, %edx            # imm = 0x320
callq 0x6c3a
testq %rax, %rax
js 0x6988
cmpq $0x320, %rax            # imm = 0x320
jne 0x6994
movq 0x932f7(%rip), %rdi     # 0x99510
leaq 0x50(%rsp), %rsi
movl $0x320, %edx            # imm = 0x320
callq 0x6ca3
cmpq $0x320, %rax            # imm = 0x320
jne 0x6024
movq 0x932cd(%rip), %rdi     # 0x99508
leaq 0x6bfaf(%rip), %rdx     # 0x721f1
movl $0x3e8, %esi            # imm = 0x3E8
callq 0x5b6d
movq 0x932bd(%rip), %rdi     # 0x99510
leaq 0x6bfa6(%rip), %rdx     # 0x72200
movl $0x3e8, %esi            # imm = 0x3E8
callq 0x5b6d
movq 0x932a5(%rip), %rdi     # 0x99510
callq 0x7273
cmpl $-0x1, %eax
je 0x69ee
leaq 0x6be1a(%rip), %rdi     # 0x7209a
callq 0x5bb6
movq %rax, %r14
leaq 0x6bf88(%rip), %r15     # 0x72217
leaq 0x50(%rsp), %r12
cmpl $0x7, %ebx
je 0x62d7
movl $0x9c40, %esi           # imm = 0x9C40
movq %r12, %rdi
movq %r15, %rdx
movl %ebx, %ecx
xorl %eax, %eax
callq 0x47f0
movq %r12, %rdi
callq 0x5bb6
movq %rax, %r13
movq %r14, %rdi
movq %rax, %rsi
callq 0x46b0
testl %eax, %eax
jne 0x6909
movq %r13, %rdi
callq 0x45b0
incl %ebx
jmp 0x6294
movq %r14, %rdi
callq 0x45b0
movq 0x93222(%rip), %rdi     # 0x99508
callq 0x7512
testl %eax, %eax
jne 0x69fa
movq 0x93216(%rip), %rdi     # 0x99510
callq 0x7512
testl %eax, %eax
jne 0x6a06
leaq 0x6bfb0(%rip), %rdi     # 0x722be
leaq 0x6eaec(%rip), %rsi     # 0x74e01
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x7dbf
movq %rax, 0x931eb(%rip)     # 0x99510
testq %rax, %rax
je 0x6a12
movq 0x931db(%rip), %rsi     # 0x99510
cmpl $0x100, %ebx            # imm = 0x100
je 0x6350
movl %ebx, %edi
callq 0x6c1e
cmpl %eax, %ebx
jne 0x694c
incl %ebx
jmp 0x632e
movq %rsi, %rdi
callq 0x7512
testl %eax, %eax
jne 0x6a1e
leaq 0x6bf57(%rip), %rdi     # 0x722be
leaq 0x6f879(%rip), %rsi     # 0x75be7
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x7dbf
movq %rax, 0x9318a(%rip)     # 0x99508
testq %rax, %rax
je 0x6a2a
movq 0x9317a(%rip), %rdi     # 0x99508
callq 0x6c04
cmpl $0x100, %ebx            # imm = 0x100
je 0x63a7
cmpl %eax, %ebx
jne 0x695c
incl %ebx
jmp 0x6387
cmpl $-0x1, %eax
jne 0x6a36
movq 0x93151(%rip), %rdi     # 0x99508
callq 0x7512
testl %eax, %eax
jne 0x6a3f
leaq 0x6beeb(%rip), %rdi     # 0x722b6
leaq 0x6f815(%rip), %rsi     # 0x75be7
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x7dbf
movq %rax, 0x93126(%rip)     # 0x99508
testq %rax, %rax
je 0x6a4b
movq 0x93116(%rip), %rdi     # 0x99508
callq 0x6c04
cmpl $0x100, %ebx            # imm = 0x100
je 0x640b
cmpl %eax, %ebx
jne 0x6965
incl %ebx
jmp 0x63eb
cmpl $-0x1, %eax
jne 0x6a57
movq 0x930ed(%rip), %rdi     # 0x99508
callq 0x7512
testl %eax, %eax
jne 0x6a65
leaq 0x6bf67(%rip), %rdi     # 0x72396
callq 0x4900
movq %rax, %rbx
leaq 0x6bf64(%rip), %rdi     # 0x723a2
leaq 0x6c00c(%rip), %rsi     # 0x72451
pushq $0xc
popq %rcx
movq %rax, %rdx
xorl %eax, %eax
callq 0x7dbf
movq %rax, 0x930af(%rip)     # 0x99508
testq %rax, %rax
je 0x6a71
leaq 0x50(%rsp), %rsi
pushq $0xc
popq %rdx
movq %rax, %rdi
callq 0x6c3a
cmpq $0xc, %rax
jne 0x6a7d
leaq 0x50(%rsp), %rdi
movq %rbx, %rsi
callq 0x46b0
testl %eax, %eax
jne 0x6a89
movq 0x93070(%rip), %rdi     # 0x99508
leaq 0x48(%rsp), %rsi
callq 0x76ad
testq %rax, %rax
je 0x6a9a
movq 0x93056(%rip), %rdi     # 0x99508
callq 0x7512
testl %eax, %eax
jne 0x6aa6
leaq 0x6bed0(%rip), %rdi     # 0x72396
callq 0x4900
leaq 0x6bed0(%rip), %rdi     # 0x723a2
leaq 0x6bf77(%rip), %rsi     # 0x72450
pushq $0xc
popq %rcx
movq %rax, %rdx
xorl %eax, %eax
callq 0x7dbf
movq %rax, 0x9301b(%rip)     # 0x99508
testq %rax, %rax
je 0x6ab2
pushq $-0x1
popq %rsi
pushq $0x2
popq %rdx
movq %rax, %rdi
callq 0x73ef
testq %rax, %rax
js 0x699f
movq 0x92ff4(%rip), %rdi     # 0x99508
leaq 0x6bfbe(%rip), %rsi     # 0x724d9
pushq $0x7
popq %rdx
callq 0x6ca3
cmpq $0x7, %rax
jne 0x6abe
movq 0x92fd4(%rip), %rdi     # 0x99508
xorl %esi, %esi
xorl %edx, %edx
callq 0x73ef
testq %rax, %rax
js 0x699f
movq 0x92fbb(%rip), %rdi     # 0x99508
leaq 0x50(%rsp), %rsi
pushq $0x12
popq %rdx
callq 0x6c3a
cmpq $0x12, %rax
jne 0x6aca
leaq 0x6bf63(%rip), %rsi     # 0x724ce
leaq 0x50(%rsp), %rdi
pushq $0x12
popq %rdx
callq 0x44c0
testl %eax, %eax
jne 0x6ad6
movq 0x92f81(%rip), %rdi     # 0x99508
leaq 0x48(%rsp), %rsi
callq 0x76e0
testq %rax, %rax
je 0x6af0
movq %rax, %rdi
callq 0x45b0
movq 0x92f5f(%rip), %rdi     # 0x99508
callq 0x7512
testl %eax, %eax
jne 0x6afc
leaq 0x6bf97(%rip), %rdi     # 0x72554
leaq 0x6f623(%rip), %rsi     # 0x75be7
xorl %eax, %eax
callq 0x7dbf
movq %rax, 0x92f36(%rip)     # 0x99508
testq %rax, %rax
je 0x6b08
leaq 0x50(%rsp), %rsi
movl $0x12c, %edx            # imm = 0x12C
movq %rax, %rdi
callq 0x6c3a
testq %rax, %rax
js 0x6988
movb $0x0, 0x50(%rsp,%rax)
leaq 0x6bf7b(%rip), %rsi     # 0x7257d
leaq 0x50(%rsp), %rdi
pushq $0xf
popq %rdx
callq 0x44c0
testl %eax, %eax
jne 0x6b14
movq 0x92eea(%rip), %rdi     # 0x99508
callq 0x7512
testl %eax, %eax
jne 0x6b20
leaq 0x6bf7a(%rip), %rdi     # 0x725ac
leaq 0x6f5ae(%rip), %rsi     # 0x75be7
xorl %eax, %eax
callq 0x7dbf
movq %rax, 0x92ec1(%rip)     # 0x99508
testq %rax, %rax
je 0x6b2c
leaq 0x50(%rsp), %rsi
pushq $0x64
popq %rdx
movq %rax, %rdi
callq 0x6c3a
testq %rax, %rax
jne 0x6b38
movq 0x92e98(%rip), %rdi     # 0x99508
callq 0x7512
testl %eax, %eax
jne 0x6b44
leaq 0x6bf9c(%rip), %rdi     # 0x72620
leaq 0x6f55c(%rip), %rsi     # 0x75be7
xorl %eax, %eax
callq 0x7dbf
movq %rax, 0x92e6f(%rip)     # 0x99508
testq %rax, %rax
je 0x6b50
leaq 0x50(%rsp), %rsi
pushq $0x64
popq %rdx
movq %rax, %rdi
callq 0x6c3a
testq %rax, %rax
jne 0x6b5c
movq 0x92e46(%rip), %rdi     # 0x99508
callq 0x7512
testl %eax, %eax
jne 0x6b68
leaq 0x6bfa5(%rip), %rdi     # 0x7267b
leaq 0x6f50a(%rip), %rsi     # 0x75be7
xorl %eax, %eax
callq 0x7dbf
movq %rax, 0x92e1d(%rip)     # 0x99508
testq %rax, %rax
je 0x6b74
leaq 0x50(%rsp), %rsi
movl $0x12c, %edx            # imm = 0x12C
movq %rax, %rdi
callq 0x6c3a
testq %rax, %rax
js 0x6b80
movb $0x0, 0x50(%rsp,%rax)
leaq 0x6c101(%rip), %rsi     # 0x7281c
leaq 0x50(%rsp), %rdi
movl $0x10e, %edx            # imm = 0x10E
callq 0x44c0
testl %eax, %eax
jne 0x6b8c
movq 0x92dcf(%rip), %rdi     # 0x99508
callq 0x7512
testl %eax, %eax
jne 0x6b98
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rdi
movaps %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
leaq 0x6c200(%rip), %rsi     # 0x7295d
leaq 0x6c2b0(%rip), %rcx     # 0x72a14
xorl %edx, %edx
callq 0x812f
leaq 0x6c1f7(%rip), %rsi     # 0x72969
movq %rax, %rdi
callq 0x46b0
testl %eax, %eax
jne 0x6ba4
leaq 0x6c1d4(%rip), %rsi     # 0x7295d
leaq 0x6c284(%rip), %rcx     # 0x72a14
leaq 0x10(%rsp), %rdi
pushq $0x1
popq %rdx
callq 0x812f
leaq 0x6c1f5(%rip), %rsi     # 0x72999
movq %rax, %rdi
callq 0x46b0
testl %eax, %eax
jne 0x6bb0
leaq 0x6c206(%rip), %rsi     # 0x729c1
leaq 0x6c252(%rip), %rcx     # 0x72a14
leaq 0x10(%rsp), %rdi
pushq $0x1
popq %rdx
callq 0x812f
leaq 0x6c1f7(%rip), %rsi     # 0x729cd
movq %rax, %rdi
callq 0x46b0
testl %eax, %eax
jne 0x6bbc
leaq 0x6c210(%rip), %rsi     # 0x729fd
leaq 0x6c220(%rip), %rcx     # 0x72a14
leaq 0x10(%rsp), %rdi
xorl %edx, %edx
callq 0x812f
leaq 0x6c202(%rip), %rsi     # 0x72a09
movq %rax, %rdi
callq 0x46b0
testl %eax, %eax
jne 0x6bc8
leaq 0x6c1e6(%rip), %rsi     # 0x72a04
leaq 0x6c1ef(%rip), %rbx     # 0x72a14
leaq 0x10(%rsp), %rdi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x812f
movq %rax, %rdi
movq %rbx, %rsi
callq 0x46b0
testl %eax, %eax
jne 0x6bd4
leaq 0x6c1ff(%rip), %rsi     # 0x72a4e
leaq 0x6c1ff(%rip), %rcx     # 0x72a55
leaq 0x10(%rsp), %rdi
pushq $0x1
popq %rdx
callq 0x812f
leaq 0x6c1e8(%rip), %rsi     # 0x72a52
movq %rax, %rdi
callq 0x46b0
testl %eax, %eax
jne 0x6be0
leaq 0x6c1f1(%rip), %rsi     # 0x72a72
leaq 0x6c205(%rip), %rcx     # 0x72a8d
leaq 0x10(%rsp), %rdi
xorl %edx, %edx
callq 0x812f
leaq 0x6c1f8(%rip), %rsi     # 0x72a93
movq %rax, %rdi
callq 0x46b0
testl %eax, %eax
jne 0x6bec
leaq 0x6c231(%rip), %rsi     # 0x72ae3
leaq 0x6c1d4(%rip), %rcx     # 0x72a8d
leaq 0x10(%rsp), %rdi
pushq $0x1
popq %rdx
callq 0x812f
leaq 0x6c230(%rip), %rsi     # 0x72afd
movq %rax, %rdi
callq 0x46b0
testl %eax, %eax
jne 0x6bf8
movq 0x20(%rsp), %rdi
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
andq $0x0, 0x20(%rsp)
callq 0x45b0
xorl %eax, %eax
addq $0x9c98, %rsp           # imm = 0x9C98
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x926d0(%rip), %rax     # 0x98fe0
movq (%rax), %rdi
leaq 0x6b90e(%rip), %rsi     # 0x72228
leaq 0x50(%rsp), %rdx
xorl %eax, %eax
callq 0x46f0
movq %r13, %rdi
callq 0x45b0
movq %r14, %rdi
callq 0x45b0
pushq $0x1
popq %rax
jmp 0x68f7
leaq 0x6b7e0(%rip), %rdi     # 0x72122
movq %r14, %rsi
xorl %eax, %eax
callq 0x5a9c
leaq 0x6b90a(%rip), %rdi     # 0x7225d
movl %ebx, %esi
xorl %eax, %eax
callq 0x5a9c
leaq 0x6b9a9(%rip), %rdi     # 0x7230c
jmp 0x696c
leaq 0x6b995(%rip), %rdi     # 0x72301
movl %ebx, %esi
movl %ebx, %edx
movl %eax, %ecx
movl %eax, %r8d
xorl %eax, %eax
callq 0x5a9c
leaq 0x6b77f(%rip), %rdi     # 0x72102
jmp 0x602b
leaq 0x71cd6(%rip), %rdi     # 0x78665
jmp 0x602b
leaq 0x6b7c2(%rip), %rdi     # 0x7215d
movl %eax, %esi
jmp 0x6955
leaq 0x6bac7(%rip), %rdi     # 0x7246d
jmp 0x602b
callq 0x4050
movl %ebx, (%rax)
leaq 0x6b6fd(%rip), %rdi     # 0x720b6
jmp 0x602b
leaq 0x6b782(%rip), %rdi     # 0x72147
jmp 0x602b
leaq 0x6b7bd(%rip), %rdi     # 0x7218e
jmp 0x602b
leaq 0x6b7db(%rip), %rdi     # 0x721b8
jmp 0x602b
leaq 0x6b7d9(%rip), %rdi     # 0x721c2
jmp 0x602b
leaq 0x6b81b(%rip), %rdi     # 0x72210
jmp 0x602b
leaq 0x6b670(%rip), %rdi     # 0x72071
jmp 0x602b
leaq 0x6b672(%rip), %rdi     # 0x7207f
jmp 0x602b
leaq 0x6b826(%rip), %rdi     # 0x7223f
jmp 0x602b
leaq 0x6b84a(%rip), %rdi     # 0x7226f
jmp 0x602b
leaq 0x6b85b(%rip), %rdi     # 0x7228c
jmp 0x602b
leaq 0x6b906(%rip), %rdi     # 0x72343
jmp 0x6a5e
leaq 0x6b927(%rip), %rdi     # 0x7236d
jmp 0x602b
leaq 0x6b881(%rip), %rdi     # 0x722d3
jmp 0x602b
leaq 0x6b8da(%rip), %rdi     # 0x72338
movl %eax, %esi
jmp 0x6955
leaq 0x6b8f6(%rip), %rdi     # 0x72362
jmp 0x602b
leaq 0x6b92f(%rip), %rdi     # 0x723a7
jmp 0x602b
leaq 0x6b93c(%rip), %rdi     # 0x723c0
jmp 0x602b
leaq 0x6b94f(%rip), %rdi     # 0x723df
leaq 0x50(%rsp), %rsi
movq %rbx, %rdx
jmp 0x6ae9
leaq 0x6b967(%rip), %rdi     # 0x72408
jmp 0x602b
leaq 0x6b98c(%rip), %rdi     # 0x72439
jmp 0x602b
leaq 0x6b99b(%rip), %rdi     # 0x72454
jmp 0x602b
leaq 0x6b9c8(%rip), %rdi     # 0x7248d
jmp 0x602b
leaq 0x6b9dd(%rip), %rdi     # 0x724ae
jmp 0x602b
leaq 0x6ba03(%rip), %rdi     # 0x724e0
leaq 0x6b9ea(%rip), %rdx     # 0x724ce
leaq 0x50(%rsp), %rsi
xorl %eax, %eax
callq 0x5a9c
leaq 0x6ba14(%rip), %rdi     # 0x7250b
jmp 0x602b
leaq 0x6ba3a(%rip), %rdi     # 0x7253d
jmp 0x602b
leaq 0x6ba5c(%rip), %rdi     # 0x7256b
jmp 0x602b
leaq 0x6ba71(%rip), %rdi     # 0x7258c
jmp 0x602b
leaq 0x6ba72(%rip), %rdi     # 0x72599
jmp 0x602b
leaq 0x6ba88(%rip), %rdi     # 0x725bb
jmp 0x602b
leaq 0x6baa0(%rip), %rdi     # 0x725df
jmp 0x602b
leaq 0x6bab0(%rip), %rdi     # 0x725fb
jmp 0x602b
leaq 0x6bad0(%rip), %rdi     # 0x72627
jmp 0x602b
leaq 0x6badf(%rip), %rdi     # 0x72642
jmp 0x602b
leaq 0x6baf0(%rip), %rdi     # 0x7265f
jmp 0x602b
leaq 0x6bc76(%rip), %rdi     # 0x727f1
jmp 0x602b
leaq 0x6bc84(%rip), %rdi     # 0x7280b
jmp 0x602b
leaq 0x6bd97(%rip), %rdi     # 0x7292a
jmp 0x602b
leaq 0x6bda3(%rip), %rdi     # 0x72942
jmp 0x602b
leaq 0x6bdce(%rip), %rdi     # 0x72979
jmp 0x602b
leaq 0x6bdee(%rip), %rdi     # 0x729a5
jmp 0x602b
leaq 0x6be1a(%rip), %rdi     # 0x729dd
jmp 0x602b
leaq 0x6be4a(%rip), %rdi     # 0x72a19
jmp 0x602b
leaq 0x6be5e(%rip), %rdi     # 0x72a39
jmp 0x602b
leaq 0x6be73(%rip), %rdi     # 0x72a5a
jmp 0x602b
leaq 0x6bec0(%rip), %rdi     # 0x72ab3
jmp 0x602b
leaq 0x6bf18(%rip), %rdi     # 0x72b17
jmp 0x602b