// File: /workspace/github_c_makefile_star2_O3/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), %r12
movq 0x30(%rbx), %rax
decq %rax
movq %rbx, %r13
movq %rax, 0x30(%rbx)
leaq (%rax,%rax,4), %rbx
movq 0x10(%r12,%rbx,8), %rax
movq %rax, -0x30(%rbp)
movq 0x18(%r12,%rbx,8), %rsi
movq %r15, %rax
movabsq $-0x800000000000, %rdx  # imm = 0xFFFF800000000000
andq %rdx, %rax
cmpq %r14, %rax
jne 0x3a2c2
movq %r15, %rdi
movq %rsi, %r14
callq 0x4ebc4
movq -0x30(%rbp), %rcx
movl %ecx, -0x8(%rax)
movq %r15, %rdi
callq 0x4ebc4
movq %r14, %rsi
movl %esi, -0x4(%rax)
leaq (%r12,%rbx,8), %r12
movl -0x20(%r12), %eax
btl $0x8, %eax
jb 0x3a3a2
testw %ax, %ax
jns 0x3a3f5
movq %r13, %rbx
movl $0x2, %edi
callq 0x47fa0
movq %rax, %r13
movzbl -0x20(%r12), %eax
cmpl $0x3a, %eax
jg 0x3a31d
leaq 0x2e8a8(%rip), %rdi     # 0x68ba8
cmpl $0x27, %eax
movabsq $-0x4000000000000, %r14 # imm = 0xFFFC000000000000
je 0x3a356
cmpl $0x2c, %eax
jne 0x3a33a
leaq 0x2d3bd(%rip), %rdi     # 0x676d8
jmp 0x3a356
cmpl $0x3b, %eax
movabsq $-0x4000000000000, %r14 # imm = 0xFFFC000000000000
je 0x3a34f
cmpl $0x7c, %eax
jne 0x3a33a
leaq 0x2d3a8(%rip), %rdi     # 0x676e0
jmp 0x3a356
leaq 0x2e828(%rip), %rdi     # 0x68b69
cmpl $0x7e, %eax
je 0x3a356
leaq 0x2d39c(%rip), %rdi     # 0x676e9
jmp 0x3a356
leaq 0x2e953(%rip), %rdi     # 0x68ca9
callq 0x47261
movq %rax, %rdi
movabsq $-0x5800000000000, %rsi # imm = 0xFFFA800000000000
callq 0x4ed39
movq %rax, (%r13)
movq %r15, 0x8(%r13)
movl -0x18(%r12), %eax
movl %eax, -0x8(%r13)
movl -0x10(%r12), %eax
movl %eax, -0x4(%r13)
movq %r13, %rdi
callq 0x47fd1
movq %rax, %rdi
movq %r14, %rsi
callq 0x4ed39
movq %rax, %r15
jmp 0x3a265
incl -0x24(%r12)
cmpq $0x1, 0x30(%r13)
jne 0x3a3ea
incq 0x60(%r13)
leaq -0x38(%rbp), %r12
movq %r12, %rdi
movq %rsi, %r14
movl $0x1, %esi
callq 0x47fef
movq -0x30(%rbp), %rcx
movl %ecx, -0x8(%rax)
movl %r14d, -0x4(%rax)
movq %rax, %rdi
movabsq $-0x4000000000000, %rsi # imm = 0xFFFC000000000000
callq 0x4ed39
movq %rax, %r15
movq %rax, (%r12)
movq %r13, %rdi
movq %r15, %rsi
callq 0x3992d
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq