// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/marsh.c
// Function: unmarshal_one_env
static const uint8_t *unmarshal_one_env(
    UnmarshalState *st,
    const uint8_t *data,
    JanetFuncEnv **out,
    int flags) {
    MARSH_EOS(st, data);
    if (*data == LB_FUNCENV_REF) {
        data++;
        int32_t index = readint(st, &data);
        if (index < 0 || index >= janet_v_count(st->lookup_envs))
            janet_panicf("invalid funcenv reference %d", index);
        *out = st->lookup_envs[index];
    } else {
        JanetFuncEnv *env = janet_gcalloc(JANET_MEMORY_FUNCENV, sizeof(JanetFuncEnv));
        env->length = 0;
        env->offset = 0;
        env->as.values = NULL;
        janet_v_push(st->lookup_envs, env);
        int32_t offset = readnat(st, &data);
        int32_t length = readnat(st, &data);
        if (offset > 0) {
            Janet fiberv;
            /* On stack variant */
            data = unmarshal_one(st, data, &fiberv, flags);
            janet_asserttype(fiberv, JANET_FIBER, st);
            env->as.fiber = janet_unwrap_fiber(fiberv);
            /* Negative offset indicates untrusted input */
            env->offset = -offset;
        } else {
            /* Off stack variant */
            if (length == 0) {
                janet_panic("invalid funcenv length");
            }
            env->as.values = janet_malloc(sizeof(Janet) * (size_t) length);
            if (!env->as.values) {
                JANET_OUT_OF_MEMORY;
            }
            env->offset = 0;
            for (int32_t i = 0; i < length; i++)
                data = unmarshal_one(st, data, env->as.values + i, flags);
        }
        env->length = length;
        *out = env;
    }
    return data;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, -0x30(%rbp)
cmpq %rsi, 0xf0(%rdi)
jbe 0x328ef
movq %rdx, %r14
movq %rdi, %r15
cmpb $-0x25, (%rsi)
jne 0x3277f
incq %rsi
leaq -0x30(%rbp), %rax
movq %rsi, (%rax)
movq %r15, %rdi
movq %rax, %rsi
callq 0x3007a
testl %eax, %eax
js 0x328df
movq 0xd8(%r15), %rcx
testq %rcx, %rcx
je 0x328df
cmpl -0x4(%rcx), %eax
jge 0x328df
movl %eax, %eax
movq (%rcx,%rax,8), %rax
movq -0x30(%rbp), %rbx
jmp 0x328ca
movl %ecx, -0x34(%rbp)
movl $0x20, %esi
movl $0xb, %edi
callq 0x2b686
movq %rax, %r12
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movq 0xd8(%r15), %rax
testq %rax, %rax
je 0x327b2
movl -0x4(%rax), %ecx
leal 0x1(%rcx), %edx
cmpl -0x8(%rax), %edx
jl 0x327d1
movq %rax, %rdi
movl $0x1, %esi
movl $0x8, %edx
callq 0x4b4e8
movq %rax, 0xd8(%r15)
movl -0x4(%rax), %ecx
leal 0x1(%rcx), %edx
movl %edx, -0x4(%rax)
movslq %ecx, %rcx
movq %r12, (%rax,%rcx,8)
leaq -0x30(%rbp), %rbx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x31b3b
movl %eax, %r13d
movq %r15, %rdi
movq %rbx, %rsi
callq 0x31b3b
testl %r13d, %r13d
movq %r14, -0x50(%rbp)
movq %r12, -0x48(%rbp)
movl %eax, -0x38(%rbp)
je 0x3284d
movq -0x30(%rbp), %rsi
leaq -0x58(%rbp), %r14
movq %r15, %rdi
movq %r14, %rdx
movl -0x34(%rbp), %ecx
callq 0x30284
movq %rax, %rbx
movq (%r14), %rdx
movq %rdx, %rax
shrq $0x2f, %rax
cmpl $0x1fff3, %eax          # imm = 0x1FFF3
jne 0x328fb
movq %rdx, %rdi
callq 0x4ebc4
movq %rax, 0x10(%r12)
negl %r13d
movl %r13d, 0x1c(%r12)
jmp 0x328bc
testl %eax, %eax
je 0x3290e
movq %r15, -0x40(%rbp)
movq %r12, %rbx
addq $0x10, %rbx
movl %eax, %r13d
shlq $0x3, %r13
movq %r13, %rdi
callq 0x12760
movq %rax, (%rbx)
testq %rax, %rax
je 0x3291a
movq %rbx, %rcx
movl $0x0, 0x1c(%r12)
movq -0x30(%rbp), %rbx
xorl %r12d, %r12d
movl -0x34(%rbp), %r15d
movq -0x40(%rbp), %r14
movq (%rcx), %rdx
addq %r12, %rdx
movq %r14, %rdi
movq %rbx, %rsi
movq %rcx, %rbx
movl %r15d, %ecx
callq 0x30284
movq %rbx, %rcx
movq %rax, %rbx
addq $0x8, %r12
cmpq %r12, %r13
jne 0x32896
movq -0x48(%rbp), %rax
movl -0x38(%rbp), %ecx
movl %ecx, 0x18(%rax)
movq -0x50(%rbp), %r14
movq %rax, (%r14)
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2d682(%rip), %rdi     # 0x5ff68
movl %eax, %esi
xorl %eax, %eax
callq 0x190bb
leaq 0x2d296(%rip), %rdi     # 0x5fb8c
callq 0x191a3
leaq 0x2d720(%rip), %rdi     # 0x60022
movl $0x8, %esi
xorl %eax, %eax
callq 0x190bb
leaq 0x2d670(%rip), %rdi     # 0x5ff85
callq 0x191a3
callq 0x13bec