// File: /workspace/github_c_makefile_star2_O1/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 %rdi, %r14
movabsq $-0x4000000000000, %rcx # imm = 0xFFFC000000000000
movq %rsi, -0x30(%rbp)
movq 0x10(%r14), %r15
movq 0x30(%r14), %rax
decq %rax
movq %r14, %r12
movq %rax, 0x30(%r14)
leaq (%rax,%rax,4), %r14
movq 0x10(%r15,%r14,8), %rax
movq %rax, -0x38(%rbp)
movq 0x18(%r15,%r14,8), %r13
movq -0x30(%rbp), %rdi
movq %rdi, %rax
movabsq $-0x800000000000, %rdx  # imm = 0xFFFF800000000000
andq %rdx, %rax
movq %rcx, %rbx
cmpq %rcx, %rax
jne 0x3a79f
callq 0x4f838
movq -0x38(%rbp), %rcx
movl %ecx, -0x8(%rax)
movq -0x30(%rbp), %rdi
callq 0x4f838
movl %r13d, -0x4(%rax)
leaq (%r15,%r14,8), %r15
movl -0x20(%r15), %eax
btl $0x8, %eax
jb 0x3a872
testw %ax, %ax
jns 0x3a8bb
movq %r12, %r14
movl $0x2, %edi
callq 0x48a50
movq %rax, %r12
movzbl -0x20(%r15), %eax
cmpl $0x3a, %eax
jg 0x3a7ee
leaq 0x2f3ed(%rip), %rdi     # 0x69bc8
cmpl $0x27, %eax
je 0x3a81d
cmpl $0x2c, %eax
jne 0x3a801
leaq 0x2df0c(%rip), %rdi     # 0x686f8
jmp 0x3a81d
cmpl $0x3b, %eax
je 0x3a816
cmpl $0x7c, %eax
jne 0x3a801
leaq 0x2df01(%rip), %rdi     # 0x68700
jmp 0x3a81d
leaq 0x2f381(%rip), %rdi     # 0x69b89
cmpl $0x7e, %eax
je 0x3a81d
leaq 0x2def5(%rip), %rdi     # 0x68709
jmp 0x3a81d
leaq 0x2f4ac(%rip), %rdi     # 0x69cc9
callq 0x47cd3
movq %rax, %rdi
movabsq $-0x5800000000000, %rsi # imm = 0xFFFA800000000000
callq 0x4f9ad
movq %rax, (%r12)
movq -0x30(%rbp), %rax
movq %rax, 0x8(%r12)
movl -0x18(%r15), %eax
movl %eax, -0x8(%r12)
movl -0x10(%r15), %eax
movl %eax, -0x4(%r12)
movq %r12, %rdi
callq 0x48a81
movq %rax, %rdi
movq %rbx, %rsi
callq 0x4f9ad
movq %rax, -0x30(%rbp)
movq %rbx, %rcx
jmp 0x3a746
incl -0x24(%r15)
movq %r12, %r14
cmpq $0x1, 0x30(%r12)
jne 0x3a8af
incq 0x60(%r14)
leaq -0x30(%rbp), %r15
movq %r15, %rdi
movl $0x1, %esi
callq 0x48a9f
movq -0x38(%rbp), %rcx
movl %ecx, -0x8(%rax)
movl %r13d, -0x4(%rax)
movq %rax, %rdi
movq %rbx, %rsi
callq 0x4f9ad
movq %rax, (%r15)
movq -0x30(%rbp), %rsi
movq %r14, %rdi
callq 0x39de6
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq