// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/textutils.c
// Function: hts_json_fnext
HTSLIB_EXPORT
char hts_json_fnext(struct hFILE *fp, hts_json_token *token, kstring_t *kstr)
{
    char peek;
    int c;

    for (;;) switch (c = hgetc(fp)) {
    case ' ':
    case '\t':
    case '\r':
    case '\n':
    case ',':
    case ':':
        continue;

    case EOF:
        return token->type = '\0';

    case '{':
    case '[':
    case '}':
    case ']':
        return token->type = c;

    case '"':
        kstr->l = 0;
        fscan_string(fp, kstr);
        if (kstr->l == 0) kputsn("", 0, kstr);
        token->str = kstr->s;
        return token->type = 's';

    default:
        kstr->l = 0;
        kputc(c, kstr);
        while (hpeek(fp, &peek, 1) == 1 && !strchr(" \t\r\n,]}", peek)) {
            if ((c = hgetc(fp)) == EOF) break;
            kputc(c, kstr);
        }
        token->str = kstr->s;
        return token->type = token_type(token);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r15
movabsq $0x800200200004c00, %rbx # imm = 0x800200200004C00
movq %r15, %rdi
callq 0x2b680
leal 0x1(%rax), %ecx
cmpl $0x3b, %ecx
ja 0x2b5a4
btq %rcx, %rbx
jb 0x2b41c
testq %rcx, %rcx
je 0x2b653
cmpq $0x23, %rcx
jne 0x2b5a4
movq %r12, 0x8(%rsp)
andq $0x0, (%r14)
leaq 0x4f8d7(%rip), %r12     # 0x7ad30
movq %r15, %rdi
callq 0x2b680
cmpl $0x5c, %eax
je 0x2b47f
cmpl $-0x1, %eax
je 0x2b62a
cmpl $0x22, %eax
je 0x2b62a
movl %eax, %edi
jmp 0x2b597
movq %r15, %rdi
callq 0x2b680
leal -0x6e(%rax), %ecx
cmpl $0x7, %ecx
ja 0x2b49f
movslq (%r12,%rcx,4), %rcx
addq %r12, %rcx
jmpq *%rcx
pushq $0xa
jmp 0x2b596
cmpl $0x62, %eax
je 0x2b590
cmpl $0x66, %eax
je 0x2b594
cmpl $-0x1, %eax
je 0x2b62a
movl %eax, %edi
jmp 0x2b597
pushq $0x9
jmp 0x2b596
pushq $0xd
jmp 0x2b596
movq %r15, %rdi
callq 0x2b680
cmpl $-0x1, %eax
je 0x2b459
movsbl %al, %edi
callq 0x2affa
testl %eax, %eax
js 0x2b459
movl %eax, %r13d
movq %r15, %rdi
callq 0x2b680
cmpl $-0x1, %eax
je 0x2b459
movsbl %al, %edi
callq 0x2affa
testl %eax, %eax
js 0x2b459
movl %eax, %ebp
movq %r15, %rdi
callq 0x2b680
cmpl $-0x1, %eax
je 0x2b459
movsbl %al, %edi
callq 0x2affa
testl %eax, %eax
js 0x2b459
movl %eax, %ebx
movq %r15, %rdi
callq 0x2b680
cmpl $-0x1, %eax
je 0x2b459
movsbl %al, %edi
callq 0x2affa
testl %eax, %eax
js 0x2b459
shll $0xc, %r13d
shll $0x8, %ebp
orl %r13d, %ebp
shll $0x4, %ebx
orl %eax, %ebx
orl %ebp, %ebx
leaq 0x10(%rsp), %r13
movq %r13, %rdi
movl %ebx, %esi
callq 0x2ba67
subq %r13, %rax
movq %r13, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x2b69a
jmp 0x2b459
pushq $0x8
jmp 0x2b596
pushq $0xc
popq %rdi
movq %r14, %rsi
callq 0x2b6f7
jmp 0x2b459
movl %eax, %ecx
addl $-0x5b, %ecx
cmpl $0x22, %ecx
ja 0x2b5c2
movabsq $0x500000005, %rdx      # imm = 0x500000005
btq %rcx, %rdx
jb 0x2b66d
movq %r12, 0x8(%rsp)
andq $0x0, (%r14)
movl %eax, %edi
movq %r14, %rsi
callq 0x2b6f7
leaq 0x7(%rsp), %r12
pushq $0x1
popq %r13
leaq 0x4f770(%rip), %rbp     # 0x7ad55
pushq $0x8
popq %rbx
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0xd4e0
cmpq $0x1, %rax
jne 0x2b657
movsbl 0x7(%rsp), %esi
movq %rbp, %rdi
movq %rbx, %rdx
callq 0x4550
testq %rax, %rax
jne 0x2b657
movq %r15, %rdi
callq 0x2b680
cmpl $-0x1, %eax
je 0x2b657
movl %eax, %edi
movq %r14, %rsi
callq 0x2b6f7
jmp 0x2b5e8
cmpq $0x0, (%r14)
jne 0x2b641
leaq 0x4c71f(%rip), %rdi     # 0x77d56
xorl %esi, %esi
movq %r14, %rdx
callq 0x2b69a
movq 0x10(%r14), %rax
movq 0x8(%rsp), %r12
movq %rax, 0x8(%r12)
movb $0x73, %al
jmp 0x2b66d
xorl %eax, %eax
jmp 0x2b66d
movq 0x10(%r14), %rax
movq 0x8(%rsp), %r12
movq %rax, 0x8(%r12)
movq %r12, %rdi
callq 0x2b39d
movb %al, (%r12)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq