// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/textutils.c
// Function: hts_json_snext
HTSLIB_EXPORT
char hts_json_snext(char *str, size_t *state, hts_json_token *token)
{
    char *s = &str[*state >> 2];
    int hidden = *state & 3;

    if (hidden) {
        *state &= ~3;
        return token->type = "?}]?"[hidden];
    }

#define STATE(s,h)  (((s) - str) << 2 | (h))

    for (;;) switch (*s) {
    case ' ':
    case '\t':
    case '\r':
    case '\n':
    case ',':
    case ':':
        s++;
        continue;

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

    case '{':
    case '[':
    case '}':
    case ']':
        *state = STATE(s+1, 0);
        return token->type = *s;

    case '"':
        token->str = s+1;
        *state = STATE(sscan_string(s+1), 0);
        return token->type = 's';

    default:
        token->str = s;
        s += strcspn(s, " \t\r\n,]}");
        hidden = (*s == '}')? 1 : (*s == ']')? 2 : 0;
        if (*s != '\0') *s++ = '\0';
        *state = STATE(s, hidden);
        return token->type = token_type(token);
    }

#undef STATE
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rcx
movq (%rcx), %rcx
shrq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
andq $0x3, %rax
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x4b9a8
movq -0x18(%rbp), %rax
movq (%rax), %rcx
andq $-0x4, %rcx
movq %rcx, (%rax)
movslq -0x2c(%rbp), %rcx
leaq 0xa7a59(%rip), %rax     # 0xf33f0
movb (%rax,%rcx), %al
movq -0x20(%rbp), %rcx
movb %al, (%rcx)
movb %al, -0x1(%rbp)
jmp 0x4bb69
jmp 0x4b9aa
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0x30(%rbp)
testl %eax, %eax
je 0x4ba3d
jmp 0x4b9be
movl -0x30(%rbp), %eax
addl $-0x9, %eax
subl $0x2, %eax
jb 0x4ba2c
jmp 0x4b9cb
movl -0x30(%rbp), %eax
subl $0xd, %eax
je 0x4ba2c
jmp 0x4b9d5
movl -0x30(%rbp), %eax
subl $0x20, %eax
je 0x4ba2c
jmp 0x4b9df
movl -0x30(%rbp), %eax
subl $0x22, %eax
je 0x4ba7f
jmp 0x4b9ed
movl -0x30(%rbp), %eax
subl $0x2c, %eax
je 0x4ba2c
jmp 0x4b9f7
movl -0x30(%rbp), %eax
subl $0x3a, %eax
je 0x4ba2c
jmp 0x4ba01
movl -0x30(%rbp), %eax
subl $0x5b, %eax
je 0x4ba4d
jmp 0x4ba0b
movl -0x30(%rbp), %eax
subl $0x5d, %eax
je 0x4ba4d
jmp 0x4ba15
movl -0x30(%rbp), %eax
subl $0x7b, %eax
je 0x4ba4d
jmp 0x4ba1f
movl -0x30(%rbp), %eax
subl $0x7d, %eax
je 0x4ba4d
jmp 0x4bac5
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x4b9aa
movq -0x20(%rbp), %rax
movb $0x0, (%rax)
movb $0x0, -0x1(%rbp)
jmp 0x4bb69
movq -0x28(%rbp), %rcx
addq $0x1, %rcx
movq -0x10(%rbp), %rax
subq %rax, %rcx
shlq $0x2, %rcx
orq $0x0, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
movb (%rax), %al
movq -0x20(%rbp), %rcx
movb %al, (%rcx)
movb %al, -0x1(%rbp)
jmp 0x4bb69
movq -0x28(%rbp), %rcx
addq $0x1, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x28(%rbp), %rdi
addq $0x1, %rdi
callq 0x4bb80
movq %rax, %rcx
movq -0x10(%rbp), %rax
subq %rax, %rcx
shlq $0x2, %rcx
orq $0x0, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
movb $0x73, (%rax)
movb $0x73, -0x1(%rbp)
jmp 0x4bb69
movq -0x28(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x28(%rbp), %rdi
leaq 0xa7919(%rip), %rsi     # 0xf33f5
callq 0x4090
addq -0x28(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x7d, %eax
jne 0x4baff
movl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x4bb16
movq -0x28(%rbp), %rax
movsbl (%rax), %edx
xorl %eax, %eax
movl $0x2, %ecx
cmpl $0x5d, %edx
cmovel %ecx, %eax
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0x2c(%rbp)
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x4bb3a
movq -0x28(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x28(%rbp)
movb $0x0, (%rax)
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rax
subq %rax, %rcx
shlq $0x2, %rcx
movslq -0x2c(%rbp), %rax
orq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rdi
callq 0x4be00
movq -0x20(%rbp), %rcx
movb %al, (%rcx)
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)