// File: /workspace/github_c_makefile_star2_O0/janet-lang[P]janet/src/core/corelib.c
// Function: janet_core_env
JanetTable *janet_core_env(JanetTable *replacements) {
    /* Memoize core env, ignoring replacements the second time around. */
    if (NULL != janet_vm.core_env) {
        return janet_vm.core_env;
    }

    JanetTable *dict = janet_core_lookup_table(replacements);

    /* Unmarshal bytecode */
    Janet marsh_out = janet_unmarshal(
                          janet_core_image,
                          janet_core_image_size,
                          0,
                          dict,
                          NULL);

    /* Memoize */
    janet_gcroot(marsh_out);
    JanetTable *env = janet_unwrap_table(marsh_out);
    janet_vm.core_env = env;

    /* Invert image dict manually here. We can't do this in boot.janet as it
     * breaks deterministic builds */
    Janet lidv, midv;
    lidv = midv = janet_wrap_nil();
    janet_resolve(env, janet_csymbol("load-image-dict"), &lidv);
    janet_resolve(env, janet_csymbol("make-image-dict"), &midv);
    JanetTable *lid = janet_unwrap_table(lidv);
    JanetTable *mid = janet_unwrap_table(midv);
    for (int32_t i = 0; i < lid->capacity; i++) {
        const JanetKV *kv = lid->data + i;
        if (!janet_checktype(kv->key, JANET_NIL)) {
            janet_table_put(mid, kv->value, kv->key);
        }
    }

    return env;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x10(%rbp)
movq %fs:0x0, %rax
leaq -0x1ae0(%rax), %rcx
xorl %eax, %eax
cmpq 0x10(%rcx), %rax
je 0x2afea
movq %fs:0x0, %rax
leaq -0x1ae0(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x2b189
movq -0x10(%rbp), %rdi
callq 0x2b1a0
movq %rax, -0x18(%rbp)
movq 0xc27ba(%rip), %rdi     # 0xed7b8
movq 0xc27bb(%rip), %rsi     # 0xed7c0
movq -0x18(%rbp), %rcx
xorl %edx, %edx
xorl %eax, %eax
movl %eax, %r8d
callq 0x2b280
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0x2b360
movq -0x20(%rbp), %rdi
callq 0x1f9e0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x78(%rbp)
movq %fs:0x0, %rax
movq -0x78(%rbp), %rcx
leaq -0x1ae0(%rax), %rax
movq %rcx, 0x10(%rax)
movabsq $-0x77fffffffffff, %rdi # imm = 0xFFF8800000000001
callq 0x163e0
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x70(%rbp)
leaq 0xa6976(%rip), %rdi     # 0xd19fa
callq 0x19e00
movq -0x70(%rbp), %rdi
movq %rax, %rsi
leaq -0x30(%rbp), %rdx
callq 0x2b500
movq -0x28(%rbp), %rax
movq %rax, -0x68(%rbp)
leaq 0xa6962(%rip), %rdi     # 0xd1a0a
callq 0x19e00
movq -0x68(%rbp), %rdi
movq %rax, %rsi
leaq -0x38(%rbp), %rdx
callq 0x2b500
movq -0x30(%rbp), %rdi
callq 0x1f9e0
movq %rax, -0x48(%rbp)
movq -0x38(%rbp), %rdi
callq 0x1f9e0
movq %rax, -0x50(%rbp)
movl $0x0, -0x54(%rbp)
movl -0x54(%rbp), %eax
movq -0x48(%rbp), %rcx
cmpl 0x14(%rcx), %eax
jge 0x2b181
movq -0x48(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x54(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x60(%rbp)
xorl %eax, %eax
testb $0x1, %al
jne 0x2b10d
jmp 0x2b139
movq -0x60(%rbp), %rax
movsd (%rax), %xmm0
ucomisd %xmm0, %xmm0
setp %al
testb $0x1, %al
jne 0x2b122
jmp 0x2b171
movq -0x60(%rbp), %rax
movq (%rax), %rax
shrq $0x2f, %rax
andq $0xf, %rax
cmpq $0x0, %rax
je 0x2b171
jmp 0x2b159
movq -0x60(%rbp), %rcx
movabsq $-0x800000000000, %rax  # imm = 0xFFFF800000000000
andq (%rcx), %rax
movabsq $-0x7800000000000, %rcx # imm = 0xFFF8800000000000
cmpq %rcx, %rax
je 0x2b171
movq -0x50(%rbp), %rdi
movq -0x60(%rbp), %rcx
movq -0x60(%rbp), %rax
movq 0x8(%rcx), %rsi
movq (%rax), %rdx
callq 0x16120
jmp 0x2b173
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x2b0de
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)