// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/multipart.c
// Function: parse_ga4gh_body_json
static char
parse_ga4gh_body_json(hFILE_multipart *fp, hFILE *json,
                      kstring_t *b, kstring_t *header)
{
    hts_json_token t;

    if (hts_json_fnext(json, &t, b) != '{') return t.type;
    while (hts_json_fnext(json, &t, b) != '}') {
        if (t.type != 's') return '?';

        if (strcmp(t.str, "urls") == 0) {
            if (hts_json_fnext(json, &t, b) != '[') return t.type;

            while (hts_json_fnext(json, &t, b) != ']') {
                hfile_part *part;
                size_t n = 0, max = 0;

                hts_expand(hfile_part, fp->nparts+1, fp->maxparts, fp->parts);
                part = &fp->parts[fp->nparts++];
                part->url = NULL;
                part->headers = NULL;

                if (t.type != '{') return t.type;
                while (hts_json_fnext(json, &t, b) != '}') {
                    if (t.type != 's') return '?';

                    if (strcmp(t.str, "url") == 0) {
                        if (hts_json_fnext(json, &t, b) != 's') return t.type;
                        part->url = ks_release(b);
                    }
                    else if (strcmp(t.str, "headers") == 0) {
                        if (hts_json_fnext(json, &t, b) != '{') return t.type;

                        while (hts_json_fnext(json, &t, header) != '}') {
                            if (t.type != 's') return '?';

                            if (hts_json_fnext(json, &t, b) != 's')
                                return t.type;

                            kputs(": ", header);
                            kputs(t.str, header);
                            n++;
                            hts_expand(char *, n+1, max, part->headers);
                            part->headers[n-1] = ks_release(header);
                            part->headers[n] = NULL;
                        }
                    }
                    else if (hts_json_fskip_value(json, '\0') != 'v')
                        return '?';
                }

                if (! part->url) return 'i';
            }
        }
        else if (strcmp(t.str, "format") == 0) {
            if (hts_json_fnext(json, &t, b) != 's') return t.type;

            hts_log_debug("GA4GH JSON redirection to multipart %s data", t.str);
        }
        else if (hts_json_fskip_value(json, '\0') != 'v') return '?';
    }

    return 'v';
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rdx
leaq -0x38(%rbp), %rsi
callq 0x4bed0
movsbl %al, %eax
cmpl $0x7b, %eax
je 0x2cf0c
movb -0x38(%rbp), %al
movb %al, -0x1(%rbp)
jmp 0x2d316
jmp 0x2cf0e
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rdx
leaq -0x38(%rbp), %rsi
callq 0x4bed0
movsbl %al, %eax
cmpl $0x7d, %eax
je 0x2d312
movsbl -0x38(%rbp), %eax
cmpl $0x73, %eax
je 0x2cf3d
movb $0x3f, -0x1(%rbp)
jmp 0x2d316
movq -0x30(%rbp), %rdi
leaq 0xc409a(%rip), %rsi     # 0xf0fe2
callq 0x4690
cmpl $0x0, %eax
jne 0x2d29a
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rdx
leaq -0x38(%rbp), %rsi
callq 0x4bed0
movsbl %al, %eax
cmpl $0x5b, %eax
je 0x2cf7a
movb -0x38(%rbp), %al
movb %al, -0x1(%rbp)
jmp 0x2d316
jmp 0x2cf7c
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rdx
leaq -0x38(%rbp), %rsi
callq 0x4bed0
movsbl %al, %eax
cmpl $0x5d, %eax
je 0x2d298
movq $0x0, -0x48(%rbp)
movq $0x0, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
addq $0x1, %rax
movq -0x10(%rbp), %rcx
cmpq 0x48(%rcx), %rax
jbe 0x2d02a
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
addq $0x1, %rax
cmpq $0x1, %rax
jb 0x2cfe3
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0x2cfee
movl $0x1, %eax
movq %rax, -0x58(%rbp)
jmp 0x2cfee
movq -0x58(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rsi
movq -0x10(%rbp), %r9
addq $0x38, %r9
movl $0x8, %edx
movl $0x10, %ecx
xorl %r8d, %r8d
leaq 0xc3fd1(%rip), %rax     # 0xf0fe7
movq %rax, (%rsp)
callq 0x26a20
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x48(%rax)
jmp 0x2d02c
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq -0x10(%rbp), %rdx
movq 0x40(%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, 0x40(%rdx)
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq $0x0, (%rax)
movq -0x40(%rbp), %rax
movq $0x0, 0x8(%rax)
movsbl -0x38(%rbp), %eax
cmpl $0x7b, %eax
je 0x2d07d
movb -0x38(%rbp), %al
movb %al, -0x1(%rbp)
jmp 0x2d316
jmp 0x2d07f
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rdx
leaq -0x38(%rbp), %rsi
callq 0x4bed0
movsbl %al, %eax
cmpl $0x7d, %eax
je 0x2d280
movsbl -0x38(%rbp), %eax
cmpl $0x73, %eax
je 0x2d0ae
movb $0x3f, -0x1(%rbp)
jmp 0x2d316
movq -0x30(%rbp), %rdi
leaq 0xc90bb(%rip), %rsi     # 0xf6174
callq 0x4690
cmpl $0x0, %eax
jne 0x2d0ff
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rdx
leaq -0x38(%rbp), %rsi
callq 0x4bed0
movsbl %al, %eax
cmpl $0x73, %eax
je 0x2d0e7
movb -0x38(%rbp), %al
movb %al, -0x1(%rbp)
jmp 0x2d316
movq -0x20(%rbp), %rdi
callq 0x2d320
movq %rax, %rcx
movq -0x40(%rbp), %rax
movq %rcx, (%rax)
jmp 0x2d27b
movq -0x30(%rbp), %rdi
leaq 0xc06ef(%rip), %rsi     # 0xed7f9
callq 0x4690
cmpl $0x0, %eax
jne 0x2d25b
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rdx
leaq -0x38(%rbp), %rsi
callq 0x4bed0
movsbl %al, %eax
cmpl $0x7b, %eax
je 0x2d13c
movb -0x38(%rbp), %al
movb %al, -0x1(%rbp)
jmp 0x2d316
jmp 0x2d13e
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rdx
leaq -0x38(%rbp), %rsi
callq 0x4bed0
movsbl %al, %eax
cmpl $0x7d, %eax
je 0x2d259
movsbl -0x38(%rbp), %eax
cmpl $0x73, %eax
je 0x2d16d
movb $0x3f, -0x1(%rbp)
jmp 0x2d316
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rdx
leaq -0x38(%rbp), %rsi
callq 0x4bed0
movsbl %al, %eax
cmpl $0x73, %eax
je 0x2d191
movb -0x38(%rbp), %al
movb %al, -0x1(%rbp)
jmp 0x2d316
movq -0x28(%rbp), %rsi
leaq 0xc2fb2(%rip), %rdi     # 0xf014e
callq 0x2d360
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x2d360
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
addq $0x1, %rax
cmpq -0x50(%rbp), %rax
jbe 0x2d21e
movq -0x48(%rbp), %rax
addq $0x1, %rax
cmpq $0x1, %rax
jb 0x2d1e4
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x60(%rbp)
jmp 0x2d1ef
movl $0x1, %eax
movq %rax, -0x60(%rbp)
jmp 0x2d1ef
movq -0x60(%rbp), %rdi
movq -0x50(%rbp), %rsi
movq -0x40(%rbp), %r9
addq $0x8, %r9
movl $0x8, %ecx
xorl %r8d, %r8d
leaq 0xc3dd9(%rip), %rax     # 0xf0fe7
movq %rcx, %rdx
movq %rax, (%rsp)
callq 0x26a20
movq %rax, -0x50(%rbp)
jmp 0x2d220
movq -0x28(%rbp), %rdi
callq 0x2d320
movq %rax, %rdx
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x48(%rbp), %rcx
subq $0x1, %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x48(%rbp), %rcx
movq $0x0, (%rax,%rcx,8)
jmp 0x2d13e
jmp 0x2d279
movq -0x18(%rbp), %rdi
xorl %esi, %esi
callq 0x4c680
movsbl %al, %eax
cmpl $0x76, %eax
je 0x2d277
movb $0x3f, -0x1(%rbp)
jmp 0x2d316
jmp 0x2d279
jmp 0x2d27b
jmp 0x2d07f
movq -0x40(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x2d293
movb $0x69, -0x1(%rbp)
jmp 0x2d316
jmp 0x2cf7c
jmp 0x2d30d
movq -0x30(%rbp), %rdi
leaq 0xc1e7e(%rip), %rsi     # 0xef123
callq 0x4690
cmpl $0x0, %eax
jne 0x2d2f0
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rdx
leaq -0x38(%rbp), %rsi
callq 0x4bed0
movsbl %al, %eax
cmpl $0x73, %eax
je 0x2d2d0
movb -0x38(%rbp), %al
movb %al, -0x1(%rbp)
jmp 0x2d316
movq -0x30(%rbp), %rcx
movl $0x5, %edi
leaq 0xc3d07(%rip), %rsi     # 0xf0fe7
leaq 0xc3d16(%rip), %rdx     # 0xf0ffd
movb $0x0, %al
callq 0x1b030
jmp 0x2d30b
movq -0x18(%rbp), %rdi
xorl %esi, %esi
callq 0x4c680
movsbl %al, %eax
cmpl $0x76, %eax
je 0x2d309
movb $0x3f, -0x1(%rbp)
jmp 0x2d316
jmp 0x2d30b
jmp 0x2d30d
jmp 0x2cf0e
movb $0x76, -0x1(%rbp)
movb -0x1(%rbp), %al
addq $0x70, %rsp
popq %rbp
retq
nop