// File: /workspace/github_c_makefile_star2_O2/janet-lang[P]janet/src/core/parse.c
// Function: popstate
static void popstate(JanetParser *p, Janet val) {
    for (;;) {
        JanetParseState top = p->states[--p->statecount];
        JanetParseState *newtop = p->states + p->statecount - 1;
        /* Source mapping info */
        if (janet_checktype(val, JANET_TUPLE)) {
            janet_tuple_sm_line(janet_unwrap_tuple(val)) = (int32_t) top.line;
            janet_tuple_sm_column(janet_unwrap_tuple(val)) = (int32_t) top.column;
        }
        if (newtop->flags & PFLAG_CONTAINER) {
            newtop->argn++;
            /* Keep track of number of values in the root state */
            if (p->statecount == 1) {
                p->pending++;
                /* Root items are always wrapped in a tuple for source map info. */
                const Janet *tup = janet_tuple_n(&val, 1);
                janet_tuple_sm_line(tup) = (int32_t) top.line;
                janet_tuple_sm_column(tup) = (int32_t) top.column;
                val = janet_wrap_tuple(tup);
            }
            push_arg(p, val);
            return;
        } else if (newtop->flags & PFLAG_READERMAC) {
            Janet *t = janet_tuple_begin(2);
            int c = newtop->flags & 0xFF;
            const char *which =
                (c == '\'') ? "quote" :
                (c == ',') ? "unquote" :
                (c == ';') ? "splice" :
                (c == '|') ? "short-fn" :
                (c == '~') ? "quasiquote" : "<unknown>";
            t[0] = janet_csymbolv(which);
            t[1] = val;
            /* Quote source mapping info */
            janet_tuple_sm_line(t) = (int32_t) newtop->line;
            janet_tuple_sm_column(t) = (int32_t) newtop->column;
            val = janet_wrap_tuple(janet_tuple_end(t));
        } else {
            return;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r15
movq %rdi, %rbx
movabsq $-0x4000000000000, %r14 # imm = 0xFFFC000000000000
movq %r15, -0x38(%rbp)
movq 0x10(%rbx), %r13
movq 0x30(%rbx), %rax
decq %rax
movq %rbx, %r12
movq %rax, 0x30(%rbx)
imulq $0x28, %rax, %rbx
movq 0x10(%r13,%rbx), %rax
movq %rax, -0x30(%rbp)
movq 0x18(%r13,%rbx), %rsi
movq %r15, %rax
movabsq $-0x800000000000, %rdx  # imm = 0xFFFF800000000000
andq %rdx, %rax
cmpq %r14, %rax
jne 0x370ee
movq %r15, %rdi
movq %rsi, %r14
callq 0x4b1f1
movq -0x30(%rbp), %rcx
movl %ecx, -0x8(%rax)
movq %r15, %rdi
callq 0x4b1f1
movq %r14, %rsi
movl %esi, -0x4(%rax)
addq %rbx, %r13
movl -0x20(%r13), %eax
btl $0x8, %eax
jb 0x371bc
testw %ax, %ax
jns 0x3720e
movq %r12, %rbx
pushq $0x2
popq %rdi
callq 0x44648
movq %rax, %r12
movl -0x20(%r13), %eax
leaq 0x2daa7(%rip), %rdi     # 0x64bc8
cmpb $0x27, %al
movabsq $-0x4000000000000, %r14 # imm = 0xFFFC000000000000
je 0x3716f
movzbl %al, %eax
cmpl $0x2c, %eax
je 0x3714a
cmpl $0x3b, %eax
je 0x37153
cmpl $0x7c, %eax
jne 0x3715c
leaq 0x2c5b8(%rip), %rdi     # 0x63700
jmp 0x3716f
leaq 0x2c5a7(%rip), %rdi     # 0x636f8
jmp 0x3716f
leaq 0x2db6f(%rip), %rdi     # 0x64cc9
jmp 0x3716f
leaq 0x2da26(%rip), %rdi     # 0x64b89
cmpl $0x7e, %eax
je 0x3716f
leaq 0x2c59a(%rip), %rdi     # 0x63709
callq 0x439c6
movq %rax, %rdi
movabsq $-0x5800000000000, %rsi # imm = 0xFFFA800000000000
callq 0x4b366
movq %rax, (%r12)
movq %r15, 0x8(%r12)
movl -0x18(%r13), %eax
movl %eax, -0x8(%r12)
movl -0x10(%r13), %eax
movl %eax, -0x4(%r12)
movq %r12, %rdi
callq 0x44674
movq %rax, %rdi
movq %r14, %rsi
callq 0x4b366
movq %rax, %r15
jmp 0x37091
incl -0x24(%r13)
cmpq $0x1, 0x30(%r12)
jne 0x37203
incq 0x60(%r12)
leaq -0x38(%rbp), %r13
movq %rsi, %r14
pushq $0x1
popq %rsi
movq %r13, %rdi
callq 0x44692
movq -0x30(%rbp), %rcx
movl %ecx, -0x8(%rax)
movl %r14d, -0x4(%rax)
movq %rax, %rdi
movabsq $-0x4000000000000, %rsi # imm = 0xFFFC000000000000
callq 0x4b366
movq %rax, %r15
movq %rax, (%r13)
movq %r12, %rdi
movq %r15, %rsi
callq 0x3696a
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq