// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/multipart.c
// Function: hopen_htsget_redirect
hFILE *hopen_htsget_redirect(hFILE *hfile, const char *mode)
{
    hFILE_multipart *fp;
    kstring_t s1 = { 0, 0, NULL }, s2 = { 0, 0, NULL };
    char ret;

    fp = (hFILE_multipart *) hfile_init(sizeof (hFILE_multipart), mode, 0);
    if (fp == NULL) return NULL;

    fp->parts = NULL;
    fp->nparts = fp->maxparts = 0;

    ret = parse_ga4gh_redirect_json(fp, hfile, &s1, &s2);
    free(s1.s);
    free(s2.s);
    if (ret != 'v') {
        free_all_parts(fp);
        hfile_destroy((hFILE *) fp);
        errno = (ret == '?' || ret == '\0')? EPROTO : EINVAL;
        return NULL;
    }

    fp->current = 0;
    fp->currentfp = NULL;
    fp->base.backend = &multipart_backend;
    return &fp->base;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdi, %r14
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
xorl %r15d, %r15d
movq %r15, 0x50(%rsp)
movq %r15, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
movl $0x60, %edi
xorl %edx, %edx
callq 0xecc0
testq %rax, %rax
je 0x1f648
movq %rax, %r12
xorps %xmm0, %xmm0
movups %xmm0, 0x38(%rax)
movq $0x0, 0x48(%rax)
leaq 0x68(%rsp), %rsi
leaq 0x40(%rsp), %rdx
movq %r14, %rdi
callq 0x350a9
cmpb $0x7b, %al
jne 0x1f5d5
movq %r12, %rax
addq $0x38, %rax
movq %rax, 0x78(%rsp)
leaq 0x40(%rsp), %r13
leaq 0x28(%rsp), %rbp
movq %r12, 0x38(%rsp)
movq %r14, %rdi
leaq 0x68(%rsp), %rsi
movq %r13, %rdx
callq 0x350a9
cmpb $0x7d, %al
je 0x1f65d
movb $0x3f, %bl
cmpb $0x73, 0x68(%rsp)
jne 0x1f5e6
movq 0x70(%rsp), %rdi
leaq 0x76cb0(%rip), %rsi     # 0x95e23
callq 0x46c0
testl %eax, %eax
jne 0x1f5e6
movq %r14, %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x350a9
cmpb $0x7b, %al
jne 0x1f5bd
movq %r14, %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x350a9
cmpb $0x7d, %al
je 0x1f5c3
movb $0x3f, 0xf(%rsp)
cmpb $0x73, 0x28(%rsp)
jne 0x1f5e0
movq 0x30(%rsp), %rbx
movq %rbx, %rdi
leaq 0x77c85(%rip), %rsi     # 0x96e50
callq 0x46c0
testl %eax, %eax
je 0x1f1fe
movq %rbx, %rdi
leaq 0x75d7b(%rip), %rsi     # 0x94f59
callq 0x46c0
movq %r14, %rdi
testl %eax, %eax
je 0x1f58a
xorl %esi, %esi
callq 0x3595d
cmpb $0x76, %al
je 0x1f196
jmp 0x1f5e0
movq %r14, %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x350a9
cmpb $0x5b, %al
jne 0x1f5bd
movq %r14, %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x350a9
cmpb $0x5d, %al
je 0x1f196
movq 0x40(%r12), %r15
movq 0x48(%r12), %rsi
leaq 0x1(%r15), %rdi
cmpq %rsi, %rdi
jbe 0x1f26d
leaq 0x77c11(%rip), %rax     # 0x96e55
movq %rax, (%rsp)
movl $0x8, %edx
movl $0x10, %ecx
xorl %r8d, %r8d
movq 0x78(%rsp), %r9
callq 0x1be69
movq %rax, 0x48(%r12)
movq 0x40(%r12), %r15
leaq 0x1(%r15), %rdi
movq %r12, %rax
movq 0x38(%r12), %r12
movq %rdi, 0x40(%rax)
shlq $0x4, %r15
xorps %xmm0, %xmm0
movups %xmm0, (%r12,%r15)
movb 0x28(%rsp), %bl
cmpb $0x7b, %bl
jne 0x1f5c5
leaq (%r12,%r15), %rax
movq %rax, 0x58(%rsp)
movq %r14, %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x350a9
cmpb $0x7d, %al
jne 0x1f2c6
movq 0x58(%rsp), %rax
cmpq $0x0, (%rax)
movq 0x38(%rsp), %r12
jne 0x1f214
jmp 0x1f683
addq %r12, %r15
addq $0x8, %r15
movq $0x0, 0x60(%rsp)
xorl %r12d, %r12d
cmpb $0x73, 0x28(%rsp)
jne 0x1f5db
movq 0x30(%rsp), %rbx
movq %rbx, %rdi
leaq 0x7c6ae(%rip), %rsi     # 0x9b9a1
callq 0x46c0
testl %eax, %eax
je 0x1f326
movq %rbx, %rdi
leaq 0x742ca(%rip), %rsi     # 0x935d0
callq 0x46c0
movq %r14, %rdi
testl %eax, %eax
je 0x1f35f
xorl %esi, %esi
callq 0x3595d
cmpb $0x76, %al
je 0x1f56f
jmp 0x1f5db
movq %r14, %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x350a9
cmpb $0x73, %al
jne 0x1f5bd
movq 0x50(%rsp), %rax
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
movq $0x0, 0x50(%rsp)
movq 0x58(%rsp), %rcx
movq %rax, (%rcx)
jmp 0x1f56f
movq %rbp, %rsi
movq %r13, %rdx
callq 0x350a9
cmpb $0x7b, %al
jne 0x1f5bd
movq %r14, %rdi
movq %rbp, %rsi
leaq 0x10(%rsp), %rdx
callq 0x350a9
cmpb $0x7d, %al
je 0x1f56f
movq %r14, 0x80(%rsp)
cmpb $0x73, 0x28(%rsp)
jne 0x1f5db
movq %r14, %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x350a9
cmpb $0x73, %al
jne 0x1f5bd
movq 0x10(%rsp), %rcx
movq %rcx, %rax
subq $-0x4, %rax
jae 0x1f40b
cmpq %rax, 0x18(%rsp)
jae 0x1f418
movq %rax, %rcx
shrq %rcx
movabsq $0x3fffffffffffffff, %rdx # imm = 0x3FFFFFFFFFFFFFFF
cmpq %rdx, %rax
movl $0x0, %r13d
cmovbeq %rcx, %r13
addq %rax, %r13
movq 0x20(%rsp), %rdi
movq %r13, %rsi
callq 0x4840
testq %rax, %rax
je 0x1f43b
movq %rax, 0x20(%rsp)
movq %r13, 0x18(%rsp)
movq 0x10(%rsp), %rcx
jmp 0x1f41d
callq 0x4050
movl $0x4b, (%rax)
jmp 0x1f43b
movq 0x20(%rsp), %rax
movw $0x203a, (%rax,%rcx)    # imm = 0x203A
movq 0x10(%rsp), %rax
movq 0x20(%rsp), %rcx
leaq 0x2(%rax), %rdx
movq %rdx, 0x10(%rsp)
movb $0x0, 0x2(%rcx,%rax)
movq %rbp, %r14
movq 0x30(%rsp), %r13
testq %r13, %r13
je 0x1f4ad
movq %r13, %rdi
callq 0x41d0
movq %rax, %rbp
movq 0x10(%rsp), %rdi
addq %rdi, %rax
addq $0x2, %rax
cmpq %rdi, %rax
jbe 0x1f4ba
cmpq %rax, 0x18(%rsp)
jae 0x1f4c7
movq %rax, %rcx
shrq %rcx
movabsq $0x3fffffffffffffff, %rdx # imm = 0x3FFFFFFFFFFFFFFF
cmpq %rdx, %rax
movl $0x0, %ebx
cmovbeq %rcx, %rbx
addq %rax, %rbx
movq 0x20(%rsp), %rdi
movq %rbx, %rsi
callq 0x4840
testq %rax, %rax
je 0x1f4ed
movq %rax, 0x20(%rsp)
movq %rbx, 0x18(%rsp)
movq 0x10(%rsp), %rdi
jmp 0x1f4cc
callq 0x4050
movl $0xe, (%rax)
jmp 0x1f4ed
callq 0x4050
movl $0x4b, (%rax)
jmp 0x1f4ed
movq 0x20(%rsp), %rax
addq %rax, %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0x43c0
addq 0x10(%rsp), %rbp
movq %rbp, 0x10(%rsp)
movq 0x20(%rsp), %rax
movb $0x0, (%rax,%rbp)
leaq 0x2(%r12), %rdi
movq 0x60(%rsp), %rsi
cmpq %rsi, %rdi
jbe 0x1f521
leaq 0x77952(%rip), %rax     # 0x96e55
movq %rax, (%rsp)
movl $0x8, %edx
movl $0x8, %ecx
xorl %r8d, %r8d
movq %r15, %r9
callq 0x1be69
movq %rax, 0x60(%rsp)
leaq 0x40(%rsp), %r13
movq %r14, %rbp
movq 0x20(%rsp), %rax
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
xorl %edx, %edx
movq %rdx, 0x20(%rsp)
movq (%r15), %rcx
movq %rax, (%rcx,%r12,8)
movq (%r15), %rax
movq %rdx, 0x8(%rax,%r12,8)
movq 0x80(%rsp), %r14
movq %r14, %rdi
movq %rbp, %rsi
leaq 0x10(%rsp), %rdx
callq 0x350a9
incq %r12
cmpb $0x7d, %al
jne 0x1f392
movq %r14, %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x350a9
cmpb $0x7d, %al
jne 0x1f2d9
jmp 0x1f2ad
movq %rbp, %rsi
movq %r13, %rdx
callq 0x350a9
cmpb $0x73, %al
jne 0x1f5bd
movq 0x30(%rsp), %rcx
movl $0x5, %edi
leaq 0x778ab(%rip), %rsi     # 0x96e55
leaq 0x778ba(%rip), %rdx     # 0x96e6b
xorl %eax, %eax
callq 0x13de5
jmp 0x1f196
movb 0x28(%rsp), %bl
jmp 0x1f5c5
movb $0x76, %bl
cmpb $0x76, %bl
movq 0x38(%rsp), %r12
je 0x1f142
jmp 0x1f5e6
movb 0x68(%rsp), %bl
jmp 0x1f5e6
movq 0x38(%rsp), %r12
movb 0xf(%rsp), %al
movl %eax, %ebx
movq 0x50(%rsp), %rdi
callq 0x45c0
movq 0x20(%rsp), %rdi
callq 0x45c0
cmpb $0x76, %bl
jne 0x1f619
xorps %xmm0, %xmm0
movups %xmm0, 0x50(%r12)
leaq 0x96321(%rip), %rax     # 0xb5930
movq %rax, 0x20(%r12)
movq %r12, %r15
jmp 0x1f648
movq %r12, %rdi
callq 0x1f68d
movq %r12, %rdi
callq 0xed72
testb %bl, %bl
movl $0x47, %eax
movl $0x16, %ebp
cmovel %eax, %ebp
cmpb $0x3f, %bl
cmovel %eax, %ebp
callq 0x4050
movl %ebp, (%rax)
xorl %r15d, %r15d
movq %r15, %rax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x68(%rsp), %rsi
leaq 0x40(%rsp), %rdx
movq %r14, %rdi
callq 0x350a9
testb %al, %al
movl $0x76, %eax
movl $0x3f, %ebx
cmovel %eax, %ebx
jmp 0x1f5e6
movb $0x69, 0xf(%rsp)
jmp 0x1f5e0