// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/hfile_libcurl.c
// Function: libcurl_open
static hFILE *
libcurl_open(const char *url, const char *modes, http_headers *headers)
{
    hFILE_libcurl *fp;
    struct curl_slist *list;
    char mode;
    const char *s;
    CURLcode err;
    CURLMcode errm;
    int save, is_recursive;
    kstring_t in_header = {0, 0, NULL};
    long response;

    is_recursive = strchr(modes, 'R') != NULL;

    if ((s = strpbrk(modes, "rwa+")) != NULL) {
        mode = *s;
        if (strpbrk(&s[1], "rwa+")) mode = 'e';
    }
    else mode = '\0';

    if (mode != 'r' && mode != 'w') { errno = EINVAL; goto early_error; }

    fp = (hFILE_libcurl *) hfile_init(sizeof (hFILE_libcurl), modes, 0);
    if (fp == NULL) goto early_error;

    if (headers) {
        fp->headers = *headers;
    } else {
        memset(&fp->headers, 0, sizeof(fp->headers));
        fp->headers.fail_on_error = 1;
    }

    fp->file_size = -1;
    fp->buffer.ptr.rd = NULL;
    fp->buffer.len = 0;
    fp->final_result = (CURLcode) -1;
    fp->paused = fp->closing = fp->finished = fp->perform_again = 0;
    fp->can_seek = 1;
    fp->tried_seek = 0;
    fp->delayed_seek = fp->last_offset = -1;
    fp->preserved = NULL;
    fp->preserved_bytes = fp->preserved_size = 0;
    fp->is_recursive = is_recursive;
    fp->nrunning = 0;
    fp->easy = NULL;

    fp->multi = curl_multi_init();
    if (fp->multi == NULL) { errno = ENOMEM; goto error; }

    fp->easy = curl_easy_init();
    if (fp->easy == NULL) { errno = ENOMEM; goto error; }

    // Make a route to the hFILE_libcurl* given just a CURL* easy handle
    err = curl_easy_setopt(fp->easy, CURLOPT_PRIVATE, fp);

    // Avoid many repeated CWD calls with FTP, instead requesting the filename
    // by full path (but not strictly compliant with RFC1738).
    err |= curl_easy_setopt(fp->easy, CURLOPT_FTP_FILEMETHOD,
                            (long) CURLFTPMETHOD_NOCWD);

    if (mode == 'r') {
        err |= curl_easy_setopt(fp->easy, CURLOPT_WRITEFUNCTION, recv_callback);
        err |= curl_easy_setopt(fp->easy, CURLOPT_WRITEDATA, fp);
        fp->is_read = 1;
    }
    else {
        err |= curl_easy_setopt(fp->easy, CURLOPT_READFUNCTION, send_callback);
        err |= curl_easy_setopt(fp->easy, CURLOPT_READDATA, fp);
        err |= curl_easy_setopt(fp->easy, CURLOPT_UPLOAD, 1L);
        if (append_header(&fp->headers.fixed,
                          "Transfer-Encoding: chunked", 1) < 0)
            goto error;
        fp->is_read = 0;
    }

    err |= curl_easy_setopt(fp->easy, CURLOPT_SHARE, curl.share);
    err |= curl_easy_setopt(fp->easy, CURLOPT_URL, url);
    {
        char* env_curl_ca_bundle = getenv("CURL_CA_BUNDLE");
        if (env_curl_ca_bundle) {
            err |= curl_easy_setopt(fp->easy, CURLOPT_CAINFO, env_curl_ca_bundle);
        }
    }
    err |= curl_easy_setopt(fp->easy, CURLOPT_USERAGENT, curl.useragent.s);
    if (fp->headers.callback) {
        if (add_callback_headers(fp) != 0) goto error;
    }
    if (get_auth_token(fp, url) < 0)
        goto error;
    if ((list = get_header_list(fp)) != NULL)
        err |= curl_easy_setopt(fp->easy, CURLOPT_HTTPHEADER, list);

    if (hts_verbose <= 8 && fp->headers.fail_on_error)
        err |= curl_easy_setopt(fp->easy, CURLOPT_FAILONERROR, 1L);
    if (hts_verbose >= 8)
        err |= curl_easy_setopt(fp->easy, CURLOPT_VERBOSE, 1L);

    if (fp->headers.redirect) {
        err |= curl_easy_setopt(fp->easy, CURLOPT_HEADERFUNCTION, header_callback);
        err |= curl_easy_setopt(fp->easy, CURLOPT_HEADERDATA, (void *)&in_header);
    } else {
        err |= curl_easy_setopt(fp->easy, CURLOPT_FOLLOWLOCATION, 1L);
    }

    if (err != 0) { errno = ENOSYS; goto error; }

    errm = curl_multi_add_handle(fp->multi, fp->easy);
    if (errm != CURLM_OK) { errno = multi_errno(errm); goto error; }
    fp->nrunning++;

    while (! fp->paused && ! fp->finished) {
        if (wait_perform(fp) < 0) goto error_remove;
    }

    curl_easy_getinfo(fp->easy, CURLINFO_RESPONSE_CODE, &response);
    if (fp->headers.http_response_ptr) {
        *fp->headers.http_response_ptr = response;
    }

    if (fp->finished && fp->final_result != CURLE_OK) {
        errno = easy_errno(fp->easy, fp->final_result);
        goto error_remove;
    }

    if (fp->headers.redirect) {
        if (response >= 300 && response < 400) { // redirection
            kstring_t new_url = {0, 0, NULL};

            if (fp->headers.redirect(fp->headers.redirect_data, response,
                                     &in_header, &new_url)) {
                errno = ENOSYS;
                goto error;
            }

            err |= curl_easy_setopt(fp->easy, CURLOPT_URL, new_url.s);
            err |= curl_easy_setopt(fp->easy, CURLOPT_HEADERFUNCTION, NULL);
            err |= curl_easy_setopt(fp->easy, CURLOPT_HEADERDATA, NULL);
            free(ks_release(&in_header));

            if (err != 0) { errno = ENOSYS; goto error; }
            free(ks_release(&new_url));

            if (restart_from_position(fp, 0) < 0) {
                goto error_remove;
            }

            if (fp->headers.http_response_ptr) {
                curl_easy_getinfo(fp->easy, CURLINFO_RESPONSE_CODE,
                                  fp->headers.http_response_ptr);
            }

            if (fp->finished && fp->final_result != CURLE_OK) {
                errno = easy_errno(fp->easy, fp->final_result);
                goto error_remove;
            }
        } else {
            // we no longer need to look at the headers
            err |= curl_easy_setopt(fp->easy, CURLOPT_HEADERFUNCTION, NULL);
            err |= curl_easy_setopt(fp->easy, CURLOPT_HEADERDATA, NULL);
            free(ks_release(&in_header));

            if (err != 0) { errno = ENOSYS; goto error; }
        }
    }

    if (mode == 'r') {
#if LIBCURL_VERSION_NUM >= 0x073700 // 7.55.0
        curl_off_t offset;

        if (curl_easy_getinfo(fp->easy, CURLINFO_CONTENT_LENGTH_DOWNLOAD_T,
                              &offset) == CURLE_OK && offset > 0)
            fp->file_size = (off_t) offset;
#else
        double dval;

        if (curl_easy_getinfo(fp->easy, CURLINFO_CONTENT_LENGTH_DOWNLOAD,
                              &dval) == CURLE_OK && dval >= 0.0)
            fp->file_size = (off_t) (dval + 0.1);
#endif
    }
    fp->base.backend = &libcurl_backend;
    return &fp->base;

error_remove:
    save = errno;
    (void) curl_multi_remove_handle(fp->multi, fp->easy);
    fp->nrunning--;
    errno = save;

error:
    if (fp->headers.redirect) free(in_header.s);
    save = errno;
    if (fp->easy) curl_easy_cleanup(fp->easy);
    if (fp->multi) curl_multi_cleanup(fp->multi);
    free_headers(&fp->headers.extra, 1);
    hfile_destroy((hFILE *) fp);
    errno = save;
    return NULL;

early_error:
    return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdx, %r13
movq %rsi, %rbx
movq %rdi, %r15
pxor %xmm0, %xmm0
movdqa %xmm0, 0x70(%rsp)
andq $0x0, 0x80(%rsp)
pushq $0x52
popq %rsi
movq %rbx, %rdi
callq 0x4190
movq %rax, %r12
leaq 0x1e38a(%rip), %rsi     # 0x82bb9
movq %rbx, %rdi
callq 0x48f0
testq %rax, %rax
je 0x64856
movzbl (%rax), %ebp
incq %rax
leaq 0x1e370(%rip), %rsi     # 0x82bb9
movq %rax, %rdi
callq 0x48f0
testq %rax, %rax
je 0x64879
callq 0x4050
movl $0x16, (%rax)
xorl %r14d, %r14d
movq %r14, %rax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x72, %ebp
je 0x64883
cmpl $0x77, %ebp
jne 0x64856
xorl %r14d, %r14d
movl $0xf8, %edi
movq %rbx, %rsi
xorl %edx, %edx
callq 0xd11c
testq %rax, %rax
je 0x64864
movq %rax, %rbx
leaq 0x70(%rax), %r14
testq %r13, %r13
je 0x648b4
pushq $0xc
popq %rcx
movq %r14, %rdi
movq %r13, %rsi
rep  movsq (%rsi), %es:(%rdi)
jmp 0x648e5
pxor %xmm0, %xmm0
movdqu %xmm0, 0x50(%r14)
movdqu %xmm0, 0x40(%r14)
movdqu %xmm0, 0x30(%r14)
movdqu %xmm0, 0x20(%r14)
movdqu %xmm0, 0x10(%r14)
movdqu %xmm0, (%r14)
movl $0x1, 0xc8(%rbx)
testq %r12, %r12
setne %al
orq $-0x1, 0x48(%rbx)
pxor %xmm0, %xmm0
movdqu %xmm0, 0x50(%rbx)
orl $-0x1, 0x60(%rbx)
movb 0x64(%rbx), %cl
pcmpeqd %xmm1, %xmm1
movdqu %xmm1, 0xd0(%rbx)
shlb $0x6, %al
andb $0x10, %cl
orb %al, %cl
orb $0x20, %cl
movdqu %xmm0, 0xe0(%rbx)
andq $0x0, 0xf0(%rbx)
movb %cl, 0x64(%rbx)
andl $0x0, 0x68(%rbx)
andq $0x0, 0x38(%rbx)
callq 0x4820
movq %rax, 0x40(%rbx)
testq %rax, %rax
je 0x649c9
callq 0x4670
movq %rax, 0x38(%rbx)
testq %rax, %rax
je 0x649c9
movq %rax, %rdi
movl $0x2777, %esi           # imm = 0x2777
movq %rbx, %rdx
xorl %eax, %eax
callq 0x4580
movl %eax, %r12d
movq 0x38(%rbx), %rdi
pushq $0x2
popq %rdx
movl $0x8a, %esi
xorl %eax, %eax
callq 0x4580
movl %ebp, %ecx
movl %eax, %ebp
movq 0x38(%rbx), %rdi
movl %ecx, 0x24(%rsp)
cmpl $0x72, %ecx
jne 0x64a30
leaq 0x986(%rip), %rdx       # 0x6531d
movl $0x4e2b, %esi           # imm = 0x4E2B
xorl %eax, %eax
callq 0x4580
movl %eax, %r14d
movq 0x38(%rbx), %rdi
movl $0x2711, %esi           # imm = 0x2711
movq %rbx, %rdx
xorl %eax, %eax
callq 0x4580
movl %eax, %r13d
orl %r14d, %r13d
movb 0x64(%rbx), %al
orb $0x10, %al
jmp 0x64aa2
callq 0x4050
movl $0xc, (%rax)
cmpq $0x0, 0xb0(%rbx)
je 0x649eb
movq 0x80(%rsp), %rdi
callq 0x45c0
callq 0x4050
movq %rax, %r14
movl (%rax), %ebp
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0x64a03
callq 0x4620
movq 0x40(%rbx), %rdi
testq %rdi, %rdi
je 0x64a11
callq 0x4850
movq %rbx, %rdi
subq $-0x80, %rdi
pushq $0x1
popq %rsi
callq 0x65a9f
movq %rbx, %rdi
callq 0xd1c4
movl %ebp, (%r14)
jmp 0x64861
movl %r12d, 0x18(%rsp)
leaq 0x92c(%rip), %rdx       # 0x65368
movl $0x4e2c, %esi           # imm = 0x4E2C
xorl %eax, %eax
callq 0x4580
movl %eax, 0x4(%rsp)
movq 0x38(%rbx), %rdi
movl $0x2719, %esi           # imm = 0x2719
movq %rbx, %rdx
xorl %eax, %eax
callq 0x4580
movl %eax, %r13d
movq 0x38(%rbx), %rdi
pushq $0x2e
popq %rsi
pushq $0x1
popq %rdx
xorl %eax, %eax
callq 0x4580
movl %eax, %r12d
leaq 0x1e141(%rip), %rsi     # 0x82bbe
pushq $0x1
popq %rdx
movq %r14, %rdi
callq 0x653be
testl %eax, %eax
js 0x649d4
orl 0x4(%rsp), %r13d
orl %r12d, %r13d
movb 0x64(%rbx), %al
andb $-0x11, %al
movl 0x18(%rsp), %r12d
orl %r12d, %ebp
orl %r13d, %ebp
movb %al, 0x64(%rbx)
movq 0x38(%rbx), %rdi
movq 0x3a682(%rip), %rdx     # 0x9f138
movl $0x2774, %esi           # imm = 0x2774
xorl %eax, %eax
callq 0x4580
movl %eax, %r12d
movq 0x38(%rbx), %rdi
movl $0x2712, %esi           # imm = 0x2712
movq %r15, %rdx
xorl %eax, %eax
callq 0x4580
movl %eax, %r14d
orl %r12d, %r14d
orl %ebp, %r14d
leaq 0x1e0f1(%rip), %rdi     # 0x82bd9
callq 0x4600
testq %rax, %rax
je 0x64b08
movq 0x38(%rbx), %rdi
movl $0x2751, %esi           # imm = 0x2751
movq %rax, %rdx
xorl %eax, %eax
callq 0x4580
orl %eax, %r14d
movq 0x38(%rbx), %rdi
movq 0x3a61d(%rip), %rdx     # 0x9f130
movl $0x2722, %esi           # imm = 0x2722
xorl %eax, %eax
callq 0x4580
movl %eax, %r12d
cmpq $0x0, 0x90(%rbx)
je 0x64b3c
movq %rbx, %rdi
callq 0x65477
testl %eax, %eax
jne 0x649d4
andq $0x0, 0x40(%rsp)
pxor %xmm0, %xmm0
movdqa %xmm0, 0x30(%rsp)
movq 0x3a5ed(%rip), %rbp     # 0x9f140
testq %rbp, %rbp
je 0x64b6b
testb $0x40, 0x64(%rbx)
jne 0x64b6b
cmpl $0x0, 0xa8(%rbx)
je 0x64c8d
orl %r14d, %r12d
cmpl $0x0, 0x78(%rbx)
je 0x64b79
pushq $0x70
popq %rax
jmp 0x64b87
movl $0x80, %eax
cmpl $0x0, 0x88(%rbx)
je 0x64ba3
movq (%rbx,%rax), %rdx
testq %rdx, %rdx
je 0x64ba3
movq 0x38(%rbx), %rdi
movl $0x2727, %esi           # imm = 0x2727
xorl %eax, %eax
callq 0x4580
orl %eax, %r12d
leaq 0x39bd6(%rip), %r14     # 0x9e780
movl (%r14), %eax
cmpl $0x8, %eax
jg 0x64bd7
cmpl $0x0, 0xc8(%rbx)
je 0x64bd2
movq 0x38(%rbx), %rdi
pushq $0x2d
popq %rsi
pushq $0x1
popq %rdx
xorl %eax, %eax
callq 0x4580
orl %eax, %r12d
movl (%r14), %eax
cmpl $0x8, %eax
jl 0x64beb
movq 0x38(%rbx), %rdi
pushq $0x29
popq %rsi
pushq $0x1
popq %rdx
xorl %eax, %eax
callq 0x4580
orl %eax, %r12d
cmpq $0x0, 0xb0(%rbx)
movq 0x38(%rbx), %rdi
je 0x64c27
leaq 0x9b0(%rip), %rdx       # 0x655b0
movl $0x4e6f, %esi           # imm = 0x4E6F
xorl %eax, %eax
callq 0x4580
movl %eax, %ebp
movq 0x38(%rbx), %rdi
leaq 0x70(%rsp), %rdx
movl $0x272d, %esi           # imm = 0x272D
xorl %eax, %eax
callq 0x4580
orl %ebp, %eax
jmp 0x64c34
pushq $0x34
popq %rsi
pushq $0x1
popq %rdx
xorl %eax, %eax
callq 0x4580
movl 0x24(%rsp), %ebp
orl %r12d, %eax
je 0x64c4d
callq 0x4050
movl $0x26, (%rax)
jmp 0x649d4
movq 0x38(%rbx), %rsi
movq 0x40(%rbx), %rdi
callq 0x4940
testl %eax, %eax
je 0x64c73
movl %eax, %edi
callq 0x655d1
movl %eax, %ebp
callq 0x4050
movl %ebp, (%rax)
jmp 0x649d4
incl 0x68(%rbx)
testb $0x5, 0x64(%rbx)
jne 0x64cd5
movq %rbx, %rdi
callq 0x6561b
testl %eax, %eax
jns 0x64c76
jmp 0x64d23
cmpl $0x0, 0x3a4bc(%rip)     # 0x9f150
je 0x64e64
leaq 0x12845(%rip), %rsi     # 0x774e6
movq %r15, %rdi
callq 0x40e0
testq %rax, %rax
movl %r12d, 0x4(%rsp)
je 0x64e83
movq %rax, %r15
addq $0x3, %r15
leaq 0x12977(%rip), %rsi     # 0x7763c
movq %r15, %rdi
callq 0x4090
movq %rax, %r13
jmp 0x64e89
movq 0x38(%rbx), %rdi
leaq 0x90(%rsp), %rdx
movl $0x200002, %esi         # imm = 0x200002
xorl %eax, %eax
callq 0x4290
movq 0xc0(%rbx), %rax
testq %rax, %rax
je 0x64d04
movq 0x90(%rsp), %rcx
movq %rcx, (%rax)
testb $0x4, 0x64(%rbx)
je 0x64d45
movl 0x60(%rbx), %esi
testl %esi, %esi
je 0x64d45
movq 0x38(%rbx), %rdi
callq 0x645af
movl %eax, %ebp
callq 0x4050
movl %ebp, (%rax)
callq 0x4050
movq %rax, %r14
movl (%rax), %ebp
movq 0x38(%rbx), %rsi
movq 0x40(%rbx), %rdi
callq 0x4160
decl 0x68(%rbx)
movl %ebp, (%r14)
jmp 0x649d4
movq 0xb0(%rbx), %rax
testq %rax, %rax
je 0x65030
movq 0x90(%rsp), %rsi
leaq -0x12c(%rsi), %rcx
cmpq $0x63, %rcx
ja 0x64fda
pxor %xmm0, %xmm0
leaq 0x30(%rsp), %rcx
movdqa %xmm0, (%rcx)
andq $0x0, 0x10(%rcx)
movq 0xb8(%rbx), %rdi
leaq 0x70(%rsp), %rdx
callq *%rax
testl %eax, %eax
jne 0x64c3d
movq 0x38(%rbx), %rdi
movq 0x40(%rsp), %rdx
movl $0x2712, %esi           # imm = 0x2712
xorl %eax, %eax
callq 0x4580
movl %eax, %ebp
movq 0x38(%rbx), %rdi
movl $0x4e6f, %esi           # imm = 0x4E6F
xorl %edx, %edx
xorl %eax, %eax
callq 0x4580
movl %eax, %r14d
orl %ebp, %r14d
movq 0x38(%rbx), %rdi
movl $0x272d, %esi           # imm = 0x272D
xorl %edx, %edx
xorl %eax, %eax
callq 0x4580
movl %eax, %ebp
movq 0x80(%rsp), %rdi
pxor %xmm0, %xmm0
movdqa %xmm0, 0x70(%rsp)
andq $0x0, 0x80(%rsp)
callq 0x45c0
orl %r14d, %ebp
jne 0x64c3d
movq 0x40(%rsp), %rdi
pxor %xmm0, %xmm0
movdqa %xmm0, 0x30(%rsp)
andq $0x0, 0x40(%rsp)
callq 0x45c0
movq %rbx, %rdi
xorl %esi, %esi
callq 0x657ce
testl %eax, %eax
js 0x64d23
movq 0xc0(%rbx), %rdx
testq %rdx, %rdx
je 0x64e4a
movq 0x38(%rbx), %rdi
movl $0x200002, %esi         # imm = 0x200002
xorl %eax, %eax
callq 0x4290
testb $0x4, 0x64(%rbx)
je 0x64e5b
movl 0x60(%rbx), %esi
testl %esi, %esi
jne 0x64d11
movl 0x24(%rsp), %ebp
jmp 0x65030
leaq 0x1268d(%rip), %rsi     # 0x774f8
pushq $0x8
popq %rdx
movq %r15, %rdi
callq 0x4210
testl %eax, %eax
jne 0x64b6b
jmp 0x64c9a
xorl %r15d, %r15d
xorl %r13d, %r13d
movq %rbp, %rdi
leaq 0x1dd64(%rip), %rsi     # 0x82bf7
callq 0x40e0
testq %rax, %rax
je 0x64ef5
movq %rax, %r12
movq %rax, %rsi
subq %rbp, %rsi
cmpq $0x7fffffff, %rsi       # imm = 0x7FFFFFFF
jg 0x64fcb
cmpq $0x7fffffff, %r13       # imm = 0x7FFFFFFF
ja 0x64fcb
movq %rbp, %rdi
leaq 0x30(%rsp), %rdx
callq 0x65b1a
testl %eax, %eax
js 0x64fcb
movq %r15, %rdi
movq %r13, %rsi
leaq 0x30(%rsp), %rdx
callq 0x65b1a
addq $0x2, %r12
movq %r12, %rbp
testl %eax, %eax
jns 0x64e89
jmp 0x64fcb
leaq 0x30(%rsp), %rsi
movq %rbp, %rdi
callq 0x65b73
testl %eax, %eax
js 0x64fcb
leaq 0x3a247(%rip), %rdi     # 0x9f158
callq 0x4750
movq 0x3a22b(%rip), %r12     # 0x9f148
movq 0x40(%rsp), %rdi
movl (%r12), %eax
testl %eax, %eax
movq %rdi, 0x10(%rsp)
je 0x6508d
movq %rax, 0x60(%rsp)
leal -0x1(%rax), %ebp
callq 0x6630d
movl %eax, %esi
movl %ebp, 0x18(%rsp)
andl %ebp, %esi
movq 0x10(%r12), %rdi
movl %esi, %r15d
pushq $0x1
popq %rdx
movq %r12, 0x28(%rsp)
movl %esi, 0x8(%rsp)
movq %rdi, 0x68(%rsp)
movl %r15d, %eax
shrl $0x4, %eax
movl (%rdi,%rax,4), %r13d
leal (%r15,%r15), %ebp
andl $0x1e, %ebp
movl %r13d, %eax
movl %ebp, %ecx
shrl %cl, %eax
testb $0x2, %al
jne 0x65079
testb $0x1, %al
jne 0x64fb7
movq 0x18(%r12), %rax
movl %r15d, %ecx
movq (%rax,%rcx,8), %rdi
movq 0x10(%rsp), %rsi
movl %edx, %r12d
callq 0x46c0
movq 0x68(%rsp), %rdi
movl 0x8(%rsp), %esi
movl %r12d, %edx
movq 0x28(%rsp), %r12
testl %eax, %eax
je 0x65079
addl %edx, %r15d
andl 0x18(%rsp), %r15d
incl %edx
cmpl %esi, %r15d
jne 0x64f61
jmp 0x650a3
movq 0x40(%rsp), %rdi
callq 0x45c0
jmp 0x649d4
movq 0x38(%rbx), %rdi
movl $0x4e6f, %esi           # imm = 0x4E6F
xorl %edx, %edx
xorl %eax, %eax
callq 0x4580
movl %eax, %ebp
movq 0x38(%rbx), %rdi
movl $0x272d, %esi           # imm = 0x272D
xorl %edx, %edx
xorl %eax, %eax
callq 0x4580
movl %eax, %r14d
movq 0x80(%rsp), %rdi
pxor %xmm0, %xmm0
movdqa %xmm0, 0x70(%rsp)
andq $0x0, 0x80(%rsp)
callq 0x45c0
orl %ebp, %r14d
movl 0x24(%rsp), %ebp
jne 0x64c3d
cmpl $0x72, %ebp
jne 0x65066
movq 0x38(%rbx), %rdi
leaq 0x30(%rsp), %r14
movl $0x60000f, %esi         # imm = 0x60000F
movq %r14, %rdx
xorl %eax, %eax
callq 0x4290
testl %eax, %eax
sete %cl
movq (%r14), %rax
testq %rax, %rax
setg %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x65066
movq %rax, 0x48(%rbx)
leaq 0x38913(%rip), %rax     # 0x9d980
movq %rax, 0x20(%rbx)
movq %rbx, %r14
jmp 0x64864
movl %ebp, %ecx
shrl %cl, %r13d
testb $0x3, %r13b
movq 0x60(%rsp), %rax
cmovnel %eax, %r15d
jmp 0x65090
xorl %r15d, %r15d
cmpl %eax, %r15d
jae 0x650a3
movq 0x20(%r12), %rax
movl %r15d, %ecx
movq (%rax,%rcx,8), %r13
jmp 0x650d3
pushq $0x1
popq %rdi
pushq $0x48
popq %rsi
callq 0x4300
testq %rax, %rax
je 0x650d0
movq %rax, %r15
movq %rax, %rdi
addq $0x20, %rdi
xorl %esi, %esi
callq 0x4780
testl %eax, %eax
je 0x6510d
movq %r15, %rdi
callq 0x45c0
xorl %r13d, %r13d
movl 0x4(%rsp), %r12d
movq 0x10(%rsp), %r15
leaq 0x3a074(%rip), %rdi     # 0x9f158
callq 0x4340
movq %r13, 0xa0(%rbx)
movq %r15, %rdi
callq 0x45c0
movq %rbx, %rdi
callq 0x65be9
testl %eax, %eax
jns 0x64b6b
jmp 0x649d4
movq 0x10(%rsp), %rax
movq %rax, (%r15)
andq $0x0, 0x8(%r15)
movq %r15, 0x58(%rsp)
movq $0x1, 0x10(%r15)
movq 0x3a01a(%rip), %rcx     # 0x9f148
movl 0x8(%rcx), %eax
movq %rcx, 0x8(%rsp)
cmpl 0xc(%rcx), %eax
jb 0x65163
movq 0x8(%rsp), %rax
movl (%rax), %esi
movl 0x4(%rax), %eax
addl %eax, %eax
cmpl %eax, %esi
jbe 0x6514f
decl %esi
jmp 0x65151
incl %esi
movq 0x8(%rsp), %rdi
callq 0x66327
testl %eax, %eax
js 0x65234
movq 0x8(%rsp), %r15
movl (%r15), %eax
movq %rax, 0x50(%rsp)
leal -0x1(%rax), %ebp
movq 0x10(%rsp), %rdi
callq 0x6630d
movl %ebp, 0x68(%rsp)
andl %ebp, %eax
movq 0x10(%r15), %rcx
movl %eax, %edx
shrl $0x4, %edx
movq %rcx, 0x28(%rsp)
movl (%rcx,%rdx,4), %edx
movq %rax, 0x18(%rsp)
leal (%rax,%rax), %ecx
shrl %cl, %edx
testb $0x2, %dl
je 0x651ad
movq 0x18(%rsp), %r15
jmp 0x6527b
pushq $0x1
popq %r12
movq 0x18(%rsp), %r15
movq 0x50(%rsp), %rdx
movl %r15d, %eax
shrl $0x4, %eax
movq 0x28(%rsp), %rcx
movl (%rcx,%rax,4), %r13d
leal (%r15,%r15), %ebp
andl $0x1e, %ebp
movl %r13d, %eax
movl %ebp, %ecx
shrl %cl, %eax
testb $0x2, %al
jne 0x65254
testb $0x1, %al
jne 0x65208
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rax
movl %r15d, %ecx
movq (%rax,%rcx,8), %rdi
movq 0x10(%rsp), %rsi
movq %rdx, 0x60(%rsp)
callq 0x46c0
movq 0x60(%rsp), %rdx
testl %eax, %eax
je 0x65254
btl %ebp, %r13d
cmovbl %r15d, %edx
addl %r12d, %r15d
andl 0x68(%rsp), %r15d
incl %r12d
cmpl 0x18(%rsp), %r15d
jne 0x651bb
movb $0x1, %al
movq 0x50(%rsp), %rsi
movl %esi, %ecx
movq %rdx, %r15
cmpl %esi, %edx
je 0x65267
jmp 0x6527b
movq 0x8(%rsp), %rax
movl (%rax), %r15d
movq 0x58(%rsp), %rdi
callq 0x65bb2
movq $0x0, 0x58(%rsp)
jmp 0x652f9
movl %ebp, %ecx
shrl %cl, %r13d
testb $0x2, %r13b
sete %al
movl %edx, %ecx
movq %r15, 0x18(%rsp)
cmpl 0x50(%rsp), %ecx
movq 0x18(%rsp), %rdx
cmovel %edx, %ecx
testb %al, %al
cmovnel %edx, %ecx
movl %ecx, %r15d
movq %r15, %rdx
movl %edx, %eax
shrl $0x4, %eax
movq 0x28(%rsp), %rcx
movl (%rcx,%rax,4), %esi
leal (%r15,%r15), %ecx
andl $0x1e, %ecx
shrl %cl, %esi
movl %edx, %edi
pushq $0x3
popq %rdx
testb $0x2, %sil
jne 0x652c8
testb $0x1, %sil
je 0x652f9
movq 0x8(%rsp), %r9
movq 0x18(%r9), %rsi
movq 0x10(%rsp), %r8
movq %r8, (%rsi,%rdi,8)
shll %cl, %edx
notl %edx
movq 0x10(%r9), %rcx
andl %edx, (%rcx,%rax,4)
incl 0x4(%r9)
jmp 0x652f9
movq 0x8(%rsp), %r9
movq 0x18(%r9), %rsi
movq 0x10(%rsp), %r8
movq %r8, (%rsi,%rdi,8)
shll %cl, %edx
notl %edx
movq 0x10(%r9), %rcx
andl %edx, (%rcx,%rax,4)
movq 0x4(%r9), %xmm0
pcmpeqd %xmm1, %xmm1
psubd %xmm1, %xmm0
movq %xmm0, 0x4(%r9)
movq 0x39e48(%rip), %rax     # 0x9f148
movq 0x20(%rax), %rax
movl %r15d, %ecx
movq 0x58(%rsp), %r13
movq %r13, (%rax,%rcx,8)
xorl %r15d, %r15d
movl 0x4(%rsp), %r12d
jmp 0x650dd