// File: /workspace/github_c_makefile_star2_O0/janet-lang[P]janet/src/core/marsh.c
// Function: marshal_one_abstract
static void marshal_one_abstract(MarshalState *st, Janet x, int flags) {
    void *abstract = janet_unwrap_abstract(x);
#ifdef JANET_EV
    /* Threaded abstract types get passed through as pointers in the unsafe mode */
    if ((flags & JANET_MARSHAL_UNSAFE) &&
            (JANET_MEMORY_THREADED_ABSTRACT == (janet_abstract_head(abstract)->gc.flags & JANET_MEM_TYPEBITS))) {

        /* Increment refcount before sending message. This prevents a "death in transit" problem
         * where a message is garbage collected while in transit between two threads - i.e., the sending threads
         * loses the reference and runs a garbage collection before the receiving thread gets the message. */
        janet_abstract_incref(abstract);
        pushbyte(st, LB_THREADED_ABSTRACT);
        pushbytes(st, (uint8_t *) &abstract, sizeof(abstract));
        MARK_SEEN();
        return;
    }
#endif
    const JanetAbstractType *at = janet_abstract_type(abstract);
    if (at->marshal) {
        pushbyte(st, LB_ABSTRACT);
        marshal_one(st, janet_csymbolv(at->name), flags + 1);
        JanetMarshalContext context = {st, NULL, flags + 1, NULL, at};
        at->marshal(abstract, &context);
    } else {
        janet_panicf("cannot marshal %p", x);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rsi, -0x8(%rbp)
movq %rdi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rdi
callq 0x7b260
movq %rax, -0x20(%rbp)
movl -0x14(%rbp), %eax
andl $0x20000, %eax          # imm = 0x20000
cmpl $0x0, %eax
je 0x43b4a
movq -0x20(%rbp), %rax
movl -0x20(%rax), %ecx
andl $0xff, %ecx
movl $0xd, %eax
cmpl %ecx, %eax
jne 0x43b4a
movq -0x20(%rbp), %rdi
callq 0x13120
movq -0x10(%rbp), %rdi
movl $0xe0, %esi
callq 0x40750
movq -0x10(%rbp), %rdi
leaq -0x20(%rbp), %rsi
movl $0x8, %edx
callq 0x407d0
movq -0x10(%rbp), %rax
cmpl $0x0, 0x54(%rax)
je 0x43b43
movq -0x10(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x68(%rbp)
movq -0x10(%rbp), %rcx
movl 0x50(%rcx), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, 0x50(%rcx)
cvtsi2sd %eax, %xmm0
callq 0x7b820
movq -0x68(%rbp), %rdi
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x697e0
jmp 0x43b45
jmp 0x43bff
movq -0x20(%rbp), %rax
movq -0x10(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpq $0x0, 0x28(%rax)
je 0x43bed
movq -0x10(%rbp), %rdi
movl $0xd9, %esi
callq 0x40750
movq -0x10(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rdi
callq 0x68d90
movq %rax, %rdi
movabsq $-0x5800000000000, %rsi # imm = 0xFFFA800000000000
callq 0x7b550
movq -0x70(%rbp), %rdi
movq %rax, -0x38(%rbp)
movl -0x14(%rbp), %edx
addl $0x1, %edx
movq -0x38(%rbp), %rsi
callq 0x40840
movq -0x10(%rbp), %rax
movq %rax, -0x60(%rbp)
movq $0x0, -0x58(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
movq $0x0, -0x48(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x20(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq *%rax
jmp 0x43bff
movq -0x8(%rbp), %rsi
leaq 0x490c4(%rip), %rdi     # 0x8ccbc
movb $0x0, %al
callq 0x1ac40
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)