// File: /workspace/github_c_makefile_star2_O3/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
movl %r8d, %ebx
movl %edx, %r13d
movq %rsi, %r12
movq %r9, %xmm0
movq %r9, %rdx
shrq $0x2f, %rdx
andl $0xf, %edx
xorl %eax, %eax
ucomisd %xmm0, %xmm0
movl %edi, %r14d
cmovpl %edx, %eax
cmpl $0xb, %eax
jg 0x2e73d
cmpl $0x1, %eax
je 0x2e78a
cmpl $0xb, %eax
jne 0x2e90e
movq %r9, %rdi
callq 0x4ebc4
movq %rax, %r15
subl %ebx, %r14d
jle 0x2e722
movslq %ebx, %rax
leaq (%r12,%rax,8), %rbx
xorl %r12d, %r12d
movq (%rbx,%r12,8), %rsi
movq %r15, %rdi
callq 0x3e828
incq %r12
cmpl %r12d, %r14d
jne 0x2e70e
testl %r13d, %r13d
je 0x2e82f
movq %r15, %rdi
movl $0xa, %esi
callq 0x17947
jmp 0x2e82f
cmpl $0xc, %eax
je 0x2e84c
movq %rcx, -0x38(%rbp)
cmpl $0xe, %eax
jne 0x2e90e
movq %r12, %r15
movq %r9, %rdi
movq %r9, -0x40(%rbp)
callq 0x4ebc4
movq %rax, %r12
movq -0x10(%rax), %rax
cmpq 0x56820(%rip), %rax     # 0x84f90
jne 0x2e82f
movl %r13d, -0x2c(%rbp)
movl 0x8(%r12), %edi
callq 0x2e2e5
movq (%r12), %r12
jmp 0x2e7a5
movq %r12, %r15
movq %r9, -0x40(%rbp)
movl %r13d, -0x2c(%rbp)
movq %rcx, %r12
movq %rcx, -0x38(%rbp)
testq %rcx, %rcx
je 0x2e91f
subl %ebx, %r14d
jle 0x2e81c
movslq %ebx, %rax
leaq (%r15,%rax,8), %r15
xorl %r13d, %r13d
movq (%r15,%r13,8), %rdi
movq %rdi, %rax
movabsq $-0x800000000000, %rcx  # imm = 0xFFFF800000000000
andq %rcx, %rax
movabsq $-0x2800000000000, %rcx # imm = 0xFFFD800000000000
cmpq %rcx, %rax
jne 0x2e7e6
callq 0x4ebc4
movq 0x18(%rax), %rdi
addq $0x10, %rax
jmp 0x2e7f2
callq 0x3ed51
movq %rax, %rdi
addq $-0x8, %rax
movslq (%rax), %rbx
testq %rbx, %rbx
je 0x2e814
movl $0x1, %edx
movq %rbx, %rsi
movq %r12, %rcx
callq 0x12a80
cmpq $0x1, %rax
jne 0x2e8e4
incq %r13
cmpl %r13d, %r14d
jne 0x2e7b4
cmpl $0x0, -0x2c(%rbp)
je 0x2e82f
movl $0xa, %edi
movq %r12, %rsi
callq 0x125b0
movabsq $-0x77fffffffffff, %rdi # imm = 0xFFF8800000000001
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4ece6
movq %r12, %r15
movl %r13d, -0x2c(%rbp)
movq %r9, %rdi
callq 0x4ebc4
movq %rax, -0x38(%rbp)
xorl %edi, %edi
callq 0x176f7
movq %rax, %r12
subl %ebx, %r14d
jle 0x2e88c
movslq %ebx, %rax
leaq (%r15,%rax,8), %rbx
xorl %r13d, %r13d
movq (%rbx,%r13,8), %rsi
movq %r12, %rdi
callq 0x3e828
incq %r13
cmpl %r13d, %r14d
jne 0x2e878
cmpl $0x0, -0x2c(%rbp)
je 0x2e89f
movq %r12, %rdi
movl $0xa, %esi
callq 0x17947
movabsq $-0x2800000000000, %rsi # imm = 0xFFFD800000000000
movq %r12, %rdi
callq 0x4ed7e
leaq -0x48(%rbp), %rdx
movq %rax, (%rdx)
movq -0x38(%rbp), %rdi
movl $0x1, %esi
callq 0x4b70a
movabsq $-0x77fffffffffff, %rdi # imm = 0xFFF8800000000001
callq 0x4ece6
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpq -0x38(%rbp), %r12
jne 0x2e8fa
leaq 0x2fdd9(%rip), %rdi     # 0x5e6ca
movl %ebx, %esi
xorl %eax, %eax
callq 0x190bb
leaq 0x2fddf(%rip), %rdi     # 0x5e6e0
movl %ebx, %esi
movq -0x40(%rbp), %rdx
xorl %eax, %eax
callq 0x190bb
leaq 0x2fd8e(%rip), %rdi     # 0x5e6a3
movq %r9, %rsi
xorl %eax, %eax
callq 0x190bb
leaq 0x2fd90(%rip), %rdi     # 0x5e6b6
callq 0x191a3