// File: /workspace/github_c_makefile_star2_O0/janet-lang[P]janet/src/core/compile.c
// Function: lookup_missing
static int lookup_missing(
    JanetCompiler *c,
    const uint8_t *sym,
    JanetFunction *handler,
    JanetBinding *out) {
    int32_t minar = handler->def->min_arity;
    int32_t maxar = handler->def->max_arity;
    if (minar > 1 || maxar < 1) {
        janetc_error(c, janet_cstring("missing symbol lookup handler must take 1 argument"));
        return 0;
    }
    Janet args[1] = { janet_wrap_symbol(sym) };
    JanetFiber *fiberp = janet_fiber(handler, 64, 1, args);
    if (NULL == fiberp) {
        janetc_error(c, janet_cstring("failed to call missing symbol lookup handler"));
        return 0;
    }
    fiberp->env = c->env;
    int lock = janet_gclock();
    Janet tempOut;
    JanetSignal status = janet_continue(fiberp, janet_wrap_nil(), &tempOut);
    janet_gcunlock(lock);
    if (status != JANET_SIGNAL_OK) {
        janetc_error(c, janet_formatc("(lookup) %V", tempOut));
        return 0;
    }

    /* Convert return value as entry. */
    /* Alternative could use janet_resolve_ext(c->env, sym) to read result from environment. */
    *out = janet_binding_from_entry(tempOut);
    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movl 0x64(%rax), %eax
movl %eax, -0x2c(%rbp)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movl 0x68(%rax), %eax
movl %eax, -0x30(%rbp)
cmpl $0x1, -0x2c(%rbp)
jg 0x21133
cmpl $0x1, -0x30(%rbp)
jge 0x2115f
movq -0x10(%rbp), %rax
movq %rax, -0x80(%rbp)
leaq 0x6054d(%rip), %rdi     # 0x8168f
callq 0x64a70
movq -0x80(%rbp), %rdi
movq %rax, %rsi
callq 0x1ffb0
movl $0x0, -0x4(%rbp)
jmp 0x21298
movq -0x18(%rbp), %rdi
movabsq $-0x5800000000000, %rsi # imm = 0xFFFA800000000000
callq 0x7b550
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rdi
leaq -0x38(%rbp), %rcx
movl $0x40, %esi
movl $0x1, %edx
callq 0x36450
movq %rax, -0x40(%rbp)
xorl %eax, %eax
cmpq -0x40(%rbp), %rax
jne 0x211cb
movq -0x10(%rbp), %rax
movq %rax, -0x88(%rbp)
leaq 0x60517(%rip), %rdi     # 0x816c2
callq 0x64a70
movq -0x88(%rbp), %rdi
movq %rax, %rsi
callq 0x1ffb0
movl $0x0, -0x4(%rbp)
jmp 0x21298
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x28(%rax)
callq 0x3a810
movl %eax, -0x44(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x90(%rbp)
movabsq $-0x77fffffffffff, %rdi # imm = 0xFFF8800000000001
callq 0x7b460
movq -0x90(%rbp), %rdi
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rsi
leaq -0x50(%rbp), %rdx
callq 0x70a80
movl %eax, -0x54(%rbp)
movl -0x44(%rbp), %edi
callq 0x3a840
cmpl $0x0, -0x54(%rbp)
je 0x2125b
movq -0x10(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x50(%rbp), %rsi
leaq 0x604b3(%rip), %rdi     # 0x816ef
movb $0x0, %al
callq 0x5bdd0
movq -0x98(%rbp), %rdi
movq %rax, %rsi
callq 0x1ffb0
movl $0x0, -0x4(%rbp)
jmp 0x21298
movq -0x28(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0x50(%rbp), %rsi
leaq -0x78(%rbp), %rdi
callq 0x6c340
movq -0xa0(%rbp), %rax
movq -0x78(%rbp), %rcx
movq %rcx, (%rax)
movq -0x70(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x68(%rbp), %rcx
movq %rcx, 0x10(%rax)
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xa0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)