// File: /workspace/github_c_makefile_star2_O2/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, 0x20(%rsp)
andq $0x0, 0x30(%rsp)
movaps %xmm0, 0x60(%rsp)
andq $0x0, 0x70(%rsp)
xorl %r15d, %r15d
pushq $0x60
popq %rdi
xorl %edx, %edx
callq 0xd11c
testq %rax, %rax
je 0x1afbf
movq %rax, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x38(%rax)
andq $0x0, 0x48(%rax)
leaq 0x50(%rsp), %rsi
leaq 0x20(%rsp), %rdx
movq %r14, %rdi
callq 0x2b3fb
cmpb $0x7b, %al
jne 0x1af2d
movq %rbx, %rax
addq $0x38, %rax
movq %rax, 0x80(%rsp)
leaq 0x20(%rsp), %r13
leaq 0x10(%rsp), %rbp
movq %r14, %rdi
leaq 0x50(%rsp), %rsi
movq %r13, %rdx
callq 0x2b3fb
cmpb $0x7d, %al
je 0x1af34
movb $0x3f, %r15b
cmpb $0x73, 0x50(%rsp)
jne 0x1af61
movq 0x58(%rsp), %rdi
leaq 0x5d1e1(%rip), %rsi     # 0x77e14
callq 0x46c0
testl %eax, %eax
jne 0x1af61
movq %r14, %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x2b3fb
cmpb $0x7b, %al
jne 0x1af17
movq %r14, %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x2b3fb
cmpb $0x7d, %al
je 0x1af28
movb $0x3f, 0xf(%rsp)
cmpb $0x73, 0x10(%rsp)
jne 0x1af5a
movq 0x18(%rsp), %r15
movq %r15, %rdi
leaq 0x5e197(%rip), %rsi     # 0x78e22
callq 0x46c0
testl %eax, %eax
je 0x1acbe
movq %r15, %rdi
leaq 0x5c26b(%rip), %rsi     # 0x76f09
callq 0x46c0
movq %r14, %rdi
testl %eax, %eax
je 0x1aee6
xorl %esi, %esi
callq 0x2b7f6
cmpb $0x76, %al
je 0x1ac56
jmp 0x1af5a
movq %r14, %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x2b3fb
cmpb $0x5b, %al
jne 0x1af17
movq %r14, %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x2b3fb
cmpb $0x5d, %al
je 0x1ac56
movq 0x40(%rbx), %rax
movq 0x48(%rbx), %rsi
leaq 0x1(%rax), %rdi
cmpq %rsi, %rdi
jbe 0x1ad28
leaq 0x5e125(%rip), %rax     # 0x78e27
movq %rax, (%rsp)
pushq $0x8
popq %rdx
pushq $0x10
popq %rcx
xorl %r8d, %r8d
movq 0x80(%rsp), %r9
callq 0x17ee3
movq %rax, 0x48(%rbx)
movq 0x40(%rbx), %rax
leaq 0x1(%rax), %rdi
movq 0x38(%rbx), %rcx
movq %rdi, 0x40(%rbx)
shlq $0x4, %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rcx,%rax)
movb 0x10(%rsp), %r15b
cmpb $0x7b, %r15b
jne 0x1af1c
leaq (%rcx,%rax), %rdx
movq %rdx, 0x48(%rsp)
addq %rcx, %rax
addq $0x8, %rax
movq %rax, 0x38(%rsp)
xorl %r15d, %r15d
movq $0x0, 0x40(%rsp)
movq %r14, %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x2b3fb
cmpb $0x7d, %al
je 0x1aed5
cmpb $0x73, 0x10(%rsp)
jne 0x1af5a
movq 0x18(%rsp), %r12
movq %r12, %rdi
leaq 0x62a01(%rip), %rsi     # 0x7d79c
callq 0x46c0
testl %eax, %eax
je 0x1adca
movq %r12, %rdi
leaq 0x5a822(%rip), %rsi     # 0x755d0
callq 0x46c0
movq %r14, %rdi
testl %eax, %eax
je 0x1ae00
xorl %esi, %esi
callq 0x2b7f6
cmpb $0x76, %al
je 0x1ad6b
jmp 0x1af5a
movq %r14, %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x2b3fb
cmpb $0x73, %al
jne 0x1af17
movq 0x30(%rsp), %rax
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
andq $0x0, 0x30(%rsp)
movq 0x48(%rsp), %rcx
movq %rax, (%rcx)
jmp 0x1ad6b
movq %rbp, %rsi
movq %r13, %rdx
callq 0x2b3fb
cmpb $0x7b, %al
jne 0x1af17
movq %r14, %rdi
movq %rbp, %rsi
leaq 0x60(%rsp), %rdx
callq 0x2b3fb
cmpb $0x7d, %al
je 0x1ad6b
cmpb $0x73, 0x10(%rsp)
jne 0x1af5a
movq %r14, %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x2b3fb
cmpb $0x73, %al
jne 0x1af17
leaq 0x5d0b4(%rip), %rdi     # 0x77f07
leaq 0x60(%rsp), %r12
movq %r12, %rsi
callq 0x1b007
movq 0x18(%rsp), %rdi
movq %r12, %rsi
callq 0x1b007
leaq 0x2(%r15), %rdi
movq 0x40(%rsp), %rsi
cmpq %rsi, %rdi
jbe 0x1aea3
leaq 0x5dfa5(%rip), %rax     # 0x78e27
movq %rax, (%rsp)
pushq $0x8
popq %rcx
movq %rcx, %rdx
xorl %r8d, %r8d
movq 0x38(%rsp), %r12
movq %r12, %r9
callq 0x17ee3
movq %rax, 0x40(%rsp)
jmp 0x1aea8
movq 0x38(%rsp), %r12
movq 0x70(%rsp), %rax
andq $0x0, 0x70(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x60(%rsp)
movq (%r12), %rcx
movq %rax, (%rcx,%r15,8)
movq (%r12), %rax
andq $0x0, 0x8(%rax,%r15,8)
incq %r15
jmp 0x1ae13
movq 0x48(%rsp), %rax
cmpq $0x0, (%rax)
jne 0x1acd4
jmp 0x1af55
movq %rbp, %rsi
movq %r13, %rdx
callq 0x2b3fb
cmpb $0x73, %al
jne 0x1af17
movq 0x18(%rsp), %rcx
pushq $0x5
popq %rdi
leaq 0x5df23(%rip), %rsi     # 0x78e27
leaq 0x5df32(%rip), %rdx     # 0x78e3d
xorl %eax, %eax
callq 0x110c6
jmp 0x1ac56
movb 0x10(%rsp), %r15b
cmpb $0x76, %r15b
je 0x1ac01
jmp 0x1af61
movb $0x76, %r15b
jmp 0x1af1c
movb 0x50(%rsp), %r15b
jmp 0x1af61
leaq 0x50(%rsp), %rsi
leaq 0x20(%rsp), %rdx
movq %r14, %rdi
callq 0x2b3fb
testb %al, %al
pushq $0x76
popq %rax
pushq $0x3f
popq %r15
cmovel %eax, %r15d
jmp 0x1af61
movb $0x69, 0xf(%rsp)
movb 0xf(%rsp), %al
movl %eax, %r15d
movq 0x30(%rsp), %rdi
callq 0x45c0
movq 0x70(%rsp), %rdi
callq 0x45c0
cmpb $0x76, %r15b
jne 0x1af92
xorps %xmm0, %xmm0
movups %xmm0, 0x50(%rbx)
leaq 0x829a7(%rip), %rax     # 0x9d930
movq %rax, 0x20(%rbx)
movq %rbx, %r15
jmp 0x1afbf
movq %rbx, %rdi
callq 0x1afd4
movq %rbx, %rdi
callq 0xd1c4
testb %r15b, %r15b
pushq $0x47
popq %rax
pushq $0x16
popq %rbx
cmovel %eax, %ebx
cmpb $0x3f, %r15b
cmovel %eax, %ebx
callq 0x4050
movl %ebx, (%rax)
xorl %r15d, %r15d
movq %r15, %rax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq