// File: /workspace/github_c_makefile_star2_O1/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 $0x28, %rsp
movq %rsi, -0x30(%rbp)
cmpq %rsi, 0xf0(%rdi)
jbe 0x32e1b
movq %rdx, %r14
movq %rdi, %r15
cmpb $-0x25, (%rsi)
jne 0x32cb7
incq %rsi
leaq -0x30(%rbp), %rax
movq %rsi, (%rax)
movq %r15, %rdi
movq %rax, %rsi
callq 0x30618
testl %eax, %eax
js 0x32e27
movq 0xd8(%r15), %rcx
testq %rcx, %rcx
je 0x32df9
movl -0x4(%rcx), %edx
jmp 0x32dfb
movl %ecx, %r12d
movl $0x20, %esi
movl $0xb, %edi
callq 0x2bb18
movq %rax, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movq 0xd8(%r15), %rdi
testq %rdi, %rdi
je 0x32ce9
movl -0x4(%rdi), %eax
incl %eax
cmpl -0x8(%rdi), %eax
jl 0x32cff
movl $0x1, %esi
movl $0x8, %edx
callq 0x4c0b4
movq %rax, 0xd8(%r15)
movq 0xd8(%r15), %rax
movslq -0x4(%rax), %rcx
leal 0x1(%rcx), %edx
movl %edx, -0x4(%rax)
movq %rbx, -0x38(%rbp)
movq %rbx, (%rax,%rcx,8)
leaq -0x30(%rbp), %r13
movq %r15, %rdi
movq %r13, %rsi
callq 0x320ce
movl %eax, %ebx
movq %r15, %rdi
movq %r13, %rsi
callq 0x320ce
testl %ebx, %ebx
movl %eax, -0x3c(%rbp)
je 0x32d82
movq -0x30(%rbp), %rsi
leaq -0x50(%rbp), %r13
movq %r15, %rdi
movq %r13, %rdx
movl %r12d, %ecx
callq 0x30822
movq %rax, -0x30(%rbp)
movq (%r13), %rdx
movq %rdx, %rax
shrq $0x2f, %rax
cmpl $0x1fff3, %eax          # imm = 0x1FFF3
jne 0x32e37
movq %rdx, %rdi
callq 0x4f838
movq -0x38(%rbp), %rcx
movq %rax, 0x10(%rcx)
negl %ebx
movl %ebx, 0x1c(%rcx)
jmp 0x32df1
testl %eax, %eax
je 0x32e4a
movq %r14, -0x48(%rbp)
movq -0x38(%rbp), %r14
movq %r14, %rbx
addq $0x10, %rbx
movl %eax, %r13d
leaq (,%r13,8), %rdi
callq 0x12770
movq %rax, (%rbx)
testq %rax, %rax
je 0x32e56
movl $0x0, 0x1c(%r14)
movq -0x30(%rbp), %rax
shlq $0x3, %r13
xorl %r14d, %r14d
movq (%rbx), %rdx
addq %r14, %rdx
movq %r15, %rdi
movq %rax, %rsi
movl %r12d, %ecx
callq 0x30822
addq $0x8, %r14
cmpq %r14, %r13
jne 0x32dc8
movq %rax, -0x30(%rbp)
movq -0x48(%rbp), %r14
movq -0x38(%rbp), %rcx
movl -0x3c(%rbp), %eax
movl %eax, 0x18(%rcx)
jmp 0x32e05
xorl %edx, %edx
cmpl %edx, %eax
jge 0x32e27
movl %eax, %eax
movq (%rcx,%rax,8), %rcx
movq %rcx, (%r14)
movq -0x30(%rbp), %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2dd6a(%rip), %rdi     # 0x60b8c
callq 0x19263
leaq 0x2e13a(%rip), %rdi     # 0x60f68
movl %eax, %esi
xorl %eax, %eax
callq 0x1917b
leaq 0x2e1e4(%rip), %rdi     # 0x61022
movl $0x8, %esi
xorl %eax, %eax
callq 0x1917b
leaq 0x2e134(%rip), %rdi     # 0x60f85
callq 0x19263
callq 0x13bfc