// File: /workspace/github_c_makefile_star2_O2/janet-lang[P]janet/src/core/io.c
// Function: cfun_io_print_impl_x
static Janet cfun_io_print_impl_x(int32_t argc, Janet *argv, int newline,
                                  FILE *dflt_file, int32_t offset, Janet x) {
    FILE *f;
    switch (janet_type(x)) {
        default:
            janet_panicf("cannot print to %v", x);
        case JANET_BUFFER: {
            /* Special case buffer */
            JanetBuffer *buf = janet_unwrap_buffer(x);
            for (int32_t i = offset; i < argc; ++i) {
                janet_to_string_b(buf, argv[i]);
            }
            if (newline)
                janet_buffer_push_u8(buf, '\n');
            return janet_wrap_nil();
        }
        case JANET_FUNCTION: {
            /* Special case function */
            JanetFunction *fun = janet_unwrap_function(x);
            JanetBuffer *buf = janet_buffer(0);
            for (int32_t i = offset; i < argc; ++i) {
                janet_to_string_b(buf, argv[i]);
            }
            if (newline)
                janet_buffer_push_u8(buf, '\n');
            Janet args[1] = { janet_wrap_buffer(buf) };
            janet_call(fun, 1, args);
            return janet_wrap_nil();
        }
        case JANET_NIL:
            f = dflt_file;
            if (f == NULL) janet_panic("cannot print to nil");
            break;
        case JANET_ABSTRACT: {
            void *abstract = janet_unwrap_abstract(x);
            if (janet_abstract_type(abstract) != &janet_file_type)
                return janet_wrap_nil();
            JanetFile *iofile = abstract;
            io_assert_writeable(iofile);
            f = iofile->file;
            break;
        }
    }
    for (int32_t i = offset; i < argc; ++i) {
        int32_t len;
        const uint8_t *vstr;
        if (janet_checktype(argv[i], JANET_BUFFER)) {
            JanetBuffer *b = janet_unwrap_buffer(argv[i]);
            vstr = b->data;
            len = b->count;
        } else {
            vstr = janet_to_string(argv[i]);
            len = janet_string_length(vstr);
        }
        if (len) {
            if (1 != fwrite(vstr, len, 1, f)) {
                if (f == dflt_file) {
                    janet_panicf("cannot print %d bytes", len);
                } else {
                    janet_panicf("cannot print %d bytes to %v", len, x);
                }
            }
        }
    }
    if (newline)
        putc('\n', f);
    return janet_wrap_nil();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, %r15
movl %r8d, %ebx
movq %rcx, -0x38(%rbp)
movl %edx, %r13d
movq %rsi, %r14
movq %r9, %xmm0
movq %r9, %rcx
shrq $0x2f, %rcx
andl $0xf, %ecx
xorl %eax, %eax
ucomisd %xmm0, %xmm0
movl %edi, %r12d
cmovpl %ecx, %eax
cmpl $0x1, %eax
je 0x2c0af
cmpl $0xb, %eax
je 0x2c144
cmpl $0xc, %eax
je 0x2c027
movl %r13d, -0x2c(%rbp)
cmpl $0xe, %eax
jne 0x2c1c4
movq %r15, %rdi
callq 0x4b1f1
movq %rax, %r13
movq -0x10(%rax), %rax
cmpq 0x53f84(%rip), %rax     # 0x7ff90
jne 0x2c17b
movq %r15, -0x40(%rbp)
movq %r13, %rdi
callq 0x2bc4c
movq (%r13), %r13
jmp 0x2c0c7
movq %r15, %rdi
movl %r13d, %r15d
callq 0x4b1f1
movq %rax, -0x38(%rbp)
xorl %edi, %edi
callq 0x15f78
movq %rax, %r13
movslq %ebx, %rbx
movslq %r12d, %r12
cmpq %r12, %rbx
jge 0x2c05c
movq (%r14,%rbx,8), %rsi
movq %r13, %rdi
callq 0x3b300
incq %rbx
jmp 0x2c046
testl %r15d, %r15d
je 0x2c06c
pushq $0xa
popq %rsi
movq %r13, %rdi
callq 0x161be
movabsq $-0x2800000000000, %rsi # imm = 0xFFFD800000000000
movq %r13, %rdi
callq 0x4b3ab
leaq -0x48(%rbp), %rdx
movq %rax, (%rdx)
pushq $0x1
popq %rsi
movq -0x38(%rbp), %rdi
callq 0x47bff
movabsq $-0x77fffffffffff, %rdi # imm = 0xFFF8800000000001
callq 0x4b313
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r15, -0x40(%rbp)
movl %r13d, -0x2c(%rbp)
movq -0x38(%rbp), %rax
movq %rax, %r13
testq %rax, %rax
je 0x2c1d5
movslq %ebx, %rbx
movslq %r12d, %r15
cmpq %r15, %rbx
jge 0x2c131
movq (%r14,%rbx,8), %rdi
movq %rdi, %rax
movabsq $-0x800000000000, %rcx  # imm = 0xFFFF800000000000
andq %rcx, %rax
movabsq $-0x2800000000000, %rcx # imm = 0xFFFD800000000000
cmpq %rcx, %rax
jne 0x2c104
callq 0x4b1f1
movq 0x18(%rax), %rdi
addq $0x10, %rax
jmp 0x2c110
callq 0x3b7f1
movq %rax, %rdi
addq $-0x8, %rax
movslq (%rax), %r12
testq %r12, %r12
je 0x2c12c
movq %r12, %rsi
pushq $0x1
popq %rdx
movq %r13, %rcx
callq 0x12a80
cmpq $0x1, %rax
jne 0x2c198
incq %rbx
jmp 0x2c0cd
cmpl $0x0, -0x2c(%rbp)
je 0x2c17b
pushq $0xa
popq %rdi
movq %r13, %rsi
callq 0x125b0
jmp 0x2c17b
movq %r15, %rdi
callq 0x4b1f1
movq %rax, %r15
movslq %ebx, %rbx
movslq %r12d, %r12
cmpq %r12, %rbx
jge 0x2c16b
movq (%r14,%rbx,8), %rsi
movq %r15, %rdi
callq 0x3b300
incq %rbx
jmp 0x2c155
testl %r13d, %r13d
je 0x2c17b
pushq $0xa
popq %rsi
movq %r15, %rdi
callq 0x161be
movabsq $-0x77fffffffffff, %rdi # imm = 0xFFF8800000000001
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4b313
cmpq -0x38(%rbp), %r13
jne 0x2c1af
leaq 0x2e525(%rip), %rdi     # 0x5a6ca
movl %r12d, %esi
xorl %eax, %eax
callq 0x176c9
leaq 0x2e52a(%rip), %rdi     # 0x5a6e0
movl %r12d, %esi
movq -0x40(%rbp), %rdx
xorl %eax, %eax
callq 0x176c9
leaq 0x2e4d8(%rip), %rdi     # 0x5a6a3
movq %r15, %rsi
xorl %eax, %eax
callq 0x176c9
leaq 0x2e4da(%rip), %rdi     # 0x5a6b6
callq 0x177b1