// File: /workspace/github_c_makefile_star2_O0/janet-lang[P]janet/src/core/parse.c
// Function: root
static int root(JanetParser *p, JanetParseState *state, uint8_t c) {
    switch (c) {
        default:
            if (is_whitespace(c)) return 1;
            if (!janet_is_symbol_char(c)) {
                p->error = "unexpected character";
                return 1;
            }
            pushstate(p, tokenchar, PFLAG_TOKEN);
            return 0;
        case '\'':
        case ',':
        case ';':
        case '~':
        case '|':
            pushstate(p, root, PFLAG_READERMAC | c);
            return 1;
        case '"':
            pushstate(p, stringchar, PFLAG_STRING);
            return 1;
        case '#':
            pushstate(p, comment, PFLAG_COMMENT);
            return 1;
        case '@':
            pushstate(p, atsign, PFLAG_ATSYM);
            return 1;
        case '`':
            pushstate(p, longstring, PFLAG_LONGSTRING);
            return 1;
        case ')':
        case ']':
        case '}': {
            Janet ds;
            if (p->statecount == 1) {
                delim_error(p, 0, c, "unexpected closing delimiter ");
                return 1;
            }
            if ((c == ')' && (state->flags & PFLAG_PARENS)) ||
                    (c == ']' && (state->flags & PFLAG_SQRBRACKETS))) {
                if (state->flags & PFLAG_ATSYM) {
                    ds = close_array(p, state);
                } else {
                    ds = close_tuple(p, state, c == ']' ? JANET_TUPLE_FLAG_BRACKETCTOR : 0);
                }
            } else if (c == '}' && (state->flags & PFLAG_CURLYBRACKETS)) {
                if (state->argn & 1) {
                    p->error = "struct and table literals expect even number of arguments";
                    return 1;
                }
                if (state->flags & PFLAG_ATSYM) {
                    ds = close_table(p, state);
                } else {
                    ds = close_struct(p, state);
                }
            } else {
                delim_error(p, p->statecount - 1, c, "mismatched delimiter ");
                return 1;
            }
            popstate(p, ds);
        }
        return 1;
        case '(':
            pushstate(p, root, PFLAG_CONTAINER | PFLAG_PARENS);
            return 1;
        case '[':
            pushstate(p, root, PFLAG_CONTAINER | PFLAG_SQRBRACKETS);
            return 1;
        case '{':
            pushstate(p, root, PFLAG_CONTAINER | PFLAG_CURLYBRACKETS);
            return 1;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movb %dl, %al
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movb %al, -0x19(%rbp)
movzbl -0x19(%rbp), %eax
addl $-0x22, %eax
movl %eax, %ecx
movq %rcx, -0x50(%rbp)
subl $0x5c, %eax
ja 0x5013b
movq -0x50(%rbp), %rax
leaq 0x4369e(%rip), %rcx     # 0x937d0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movzbl -0x19(%rbp), %edi
callq 0x518b0
cmpl $0x0, %eax
je 0x50155
movl $0x1, -0x4(%rbp)
jmp 0x5042f
movzbl -0x19(%rbp), %edi
callq 0x4f7b0
cmpl $0x0, %eax
jne 0x5017e
movq -0x10(%rbp), %rax
leaq 0x447bd(%rip), %rcx     # 0x9492b
movq %rcx, 0x8(%rax)
movl $0x1, -0x4(%rbp)
jmp 0x5042f
movq -0x10(%rbp), %rdi
leaq 0xad7(%rip), %rsi       # 0x50c60
movl $0x40000, %edx          # imm = 0x40000
callq 0x50090
movl $0x0, -0x4(%rbp)
jmp 0x5042f
movq -0x10(%rbp), %rdi
movzbl -0x19(%rbp), %edx
orl $0x8000, %edx           # imm = 0x8000
leaq -0xb4(%rip), %rsi       # 0x50100
callq 0x50090
movl $0x1, -0x4(%rbp)
jmp 0x5042f
movq -0x10(%rbp), %rdi
leaq 0x1760(%rip), %rsi      # 0x51930
movl $0x2000, %edx           # imm = 0x2000
callq 0x50090
movl $0x1, -0x4(%rbp)
jmp 0x5042f
movq -0x10(%rbp), %rdi
leaq 0x17bf(%rip), %rsi      # 0x519b0
movl $0x20000, %edx          # imm = 0x20000
callq 0x50090
movl $0x1, -0x4(%rbp)
jmp 0x5042f
movq -0x10(%rbp), %rdi
leaq 0x17fe(%rip), %rsi      # 0x51a10
movl $0x10000, %edx          # imm = 0x10000
callq 0x50090
movl $0x1, -0x4(%rbp)
jmp 0x5042f
movq -0x10(%rbp), %rdi
leaq 0x191d(%rip), %rsi      # 0x51b50
movl $0x4000, %edx           # imm = 0x4000
callq 0x50090
movl $0x1, -0x4(%rbp)
jmp 0x5042f
movq -0x10(%rbp), %rax
cmpq $0x1, 0x30(%rax)
jne 0x50278
movq -0x10(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
leaq 0x446dd(%rip), %rcx     # 0x94940
movsbl -0x19(%rbp), %edx
callq 0x4fb60
movl $0x1, -0x4(%rbp)
jmp 0x5042f
movzbl -0x19(%rbp), %eax
cmpl $0x29, %eax
jne 0x50292
movq -0x18(%rbp), %rax
movl 0x8(%rax), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
jne 0x502ac
movzbl -0x19(%rbp), %eax
cmpl $0x5d, %eax
jne 0x50307
movq -0x18(%rbp), %rax
movl 0x8(%rax), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x50307
movq -0x18(%rbp), %rax
movl 0x8(%rax), %eax
andl $0x10000, %eax          # imm = 0x10000
cmpl $0x0, %eax
je 0x502d8
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x51cf0
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x28(%rbp)
jmp 0x50302
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movzbl -0x19(%rbp), %ecx
xorl %edx, %edx
movl $0x10000, %eax          # imm = 0x10000
cmpl $0x5d, %ecx
cmovel %eax, %edx
callq 0x51d90
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x28(%rbp)
jmp 0x503c1
movzbl -0x19(%rbp), %eax
cmpl $0x7d, %eax
jne 0x50396
movq -0x18(%rbp), %rax
movl 0x8(%rax), %eax
andl $0x1000, %eax           # imm = 0x1000
cmpl $0x0, %eax
je 0x50396
movq -0x18(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x5034f
movq -0x10(%rbp), %rax
leaq 0x4461f(%rip), %rcx     # 0x9495e
movq %rcx, 0x8(%rax)
movl $0x1, -0x4(%rbp)
jmp 0x5042f
movq -0x18(%rbp), %rax
movl 0x8(%rax), %eax
andl $0x10000, %eax          # imm = 0x10000
cmpl $0x0, %eax
je 0x5037b
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x51e40
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x28(%rbp)
jmp 0x50394
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x51f10
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x28(%rbp)
jmp 0x503bf
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rsi
subq $0x1, %rsi
leaq 0x445eb(%rip), %rcx     # 0x94998
movsbl -0x19(%rbp), %edx
callq 0x4fb60
movl $0x1, -0x4(%rbp)
jmp 0x5042f
jmp 0x503c1
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x51fe0
movl $0x1, -0x4(%rbp)
jmp 0x5042f
movq -0x10(%rbp), %rdi
leaq -0x2e2(%rip), %rsi      # 0x50100
movl $0x500, %edx            # imm = 0x500
callq 0x50090
movl $0x1, -0x4(%rbp)
jmp 0x5042f
movq -0x10(%rbp), %rdi
leaq -0x300(%rip), %rsi      # 0x50100
movl $0x900, %edx            # imm = 0x900
callq 0x50090
movl $0x1, -0x4(%rbp)
jmp 0x5042f
movq -0x10(%rbp), %rdi
leaq -0x31e(%rip), %rsi      # 0x50100
movl $0x1100, %edx           # imm = 0x1100
callq 0x50090
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)