// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rdi
callq 0x4c090
movl %eax, -0x28(%rbp)
movl %eax, %ecx
movl %ecx, -0x2c(%rbp)
subl $-0x1, %eax
je 0x4bf68
jmp 0x4befc
movl -0x2c(%rbp), %eax
addl $-0x9, %eax
subl $0x2, %eax
jb 0x4bf63
jmp 0x4bf09
movl -0x2c(%rbp), %eax
subl $0xd, %eax
je 0x4bf63
jmp 0x4bf13
movl -0x2c(%rbp), %eax
subl $0x20, %eax
je 0x4bf63
jmp 0x4bf1d
movl -0x2c(%rbp), %eax
subl $0x22, %eax
je 0x4bf89
jmp 0x4bf27
movl -0x2c(%rbp), %eax
subl $0x2c, %eax
je 0x4bf63
jmp 0x4bf31
movl -0x2c(%rbp), %eax
subl $0x3a, %eax
je 0x4bf63
jmp 0x4bf3b
movl -0x2c(%rbp), %eax
subl $0x5b, %eax
je 0x4bf78
jmp 0x4bf45
movl -0x2c(%rbp), %eax
subl $0x5d, %eax
je 0x4bf78
jmp 0x4bf4f
movl -0x2c(%rbp), %eax
subl $0x7b, %eax
je 0x4bf78
jmp 0x4bf59
movl -0x2c(%rbp), %eax
subl $0x7d, %eax
je 0x4bf78
jmp 0x4bfdf
jmp 0x4bee4
movq -0x18(%rbp), %rax
movb $0x0, (%rax)
movb $0x0, -0x1(%rbp)
jmp 0x4c07e
movl -0x28(%rbp), %eax
movq -0x18(%rbp), %rcx
movb %al, (%rcx)
movb %al, -0x1(%rbp)
jmp 0x4c07e
movq -0x20(%rbp), %rax
movq $0x0, (%rax)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x4c0e0
movq -0x20(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x4bfbf
movq -0x20(%rbp), %rdx
leaq 0xa3fbf(%rip), %rdi     # 0xeff75
xorl %eax, %eax
movl %eax, %esi
callq 0x4c3a0
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movb $0x73, (%rax)
movb $0x73, -0x1(%rbp)
jmp 0x4c07e
movq -0x20(%rbp), %rax
movq $0x0, (%rax)
movl -0x28(%rbp), %edi
movq -0x20(%rbp), %rsi
callq 0x4c450
movq -0x10(%rbp), %rdi
leaq -0x21(%rbp), %rsi
movl $0x1, %edx
callq 0x140b0
movq %rax, %rcx
xorl %eax, %eax
cmpq $0x1, %rcx
movb %al, -0x2d(%rbp)
jne 0x4c032
movsbl -0x21(%rbp), %esi
leaq 0xa73d4(%rip), %rdi     # 0xf33f5
callq 0x4170
cmpq $0x0, %rax
setne %al
xorb $-0x1, %al
movb %al, -0x2d(%rbp)
movb -0x2d(%rbp), %al
testb $0x1, %al
jne 0x4c03b
jmp 0x4c05c
movq -0x10(%rbp), %rdi
callq 0x4c090
movl %eax, -0x28(%rbp)
cmpl $-0x1, %eax
jne 0x4c04e
jmp 0x4c05c
movl -0x28(%rbp), %edi
movq -0x20(%rbp), %rsi
callq 0x4c450
jmp 0x4bff6
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rdi
callq 0x4be00
movq -0x18(%rbp), %rcx
movb %al, (%rcx)
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)