// File: /workspace/github_c_makefile_star2_O1/msteveb[P]autosetup/./jimsh0.c
// Function: JimMakeChannel
static AioFile *JimMakeChannel(Jim_Interp *interp, int fd, Jim_Obj *filename,
    const char *hdlfmt, int family, int flags)
{
    AioFile *af;
    char buf[AIO_CMD_LEN];
    Jim_Obj *cmdname;

    snprintf(buf, sizeof(buf), hdlfmt, Jim_GetId(interp));
    cmdname = Jim_NewStringObj(interp, buf, -1);
    if (!filename) {
        filename = cmdname;
    }
    Jim_IncrRefCount(filename);


    af = Jim_Alloc(sizeof(*af));
    memset(af, 0, sizeof(*af));
    af->filename = filename;
    af->fd = fd;
    af->addr_family = family;
    af->fops = &stdio_fops;
    af->ssl = NULL;
    if (flags & AIO_WBUF_NONE) {
        af->wbuft = WBUF_OPT_NONE;
    }
    else {
#ifdef HAVE_ISATTY
        af->wbuft = isatty(af->fd) ? WBUF_OPT_LINE : WBUF_OPT_FULL;
#else
        af->wbuft = WBUF_OPT_FULL;
#endif
    }

#ifdef FD_CLOEXEC
    if ((flags & AIO_KEEPOPEN) == 0) {
        (void)fcntl(af->fd, F_SETFD, FD_CLOEXEC);
    }
#endif
    aio_set_nonblocking(af, !!(flags & AIO_NONBLOCK));

    af->flags |= flags;

    af->writebuf = Jim_NewStringObj(interp, NULL, 0);
    Jim_IncrRefCount(af->writebuf);
    af->wbuf_limit = AIO_DEFAULT_WBUF_LIMIT;
    af->rbuf_len = AIO_DEFAULT_RBUF_LEN;


    Jim_CreateCommand(interp, buf, JimAioSubCmdProc, af, JimAioDelProc);

    Jim_SetResult(interp, Jim_MakeGlobalNamespaceName(interp, cmdname));

    return af;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %r8d, -0x2c(%rbp)
movq %rdx, %r14
movl %esi, %r12d
movq %rdi, %rbx
movq 0x38(%rdi), %rax
incq %rax
movq %rax, 0x38(%rdi)
xorl %r13d, %r13d
leaq -0x60(%rbp), %r15
movl $0x20, %esi
movq %r15, %rdi
movq %rcx, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x61e0
movq %rbx, %rdi
movq %r15, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7516
testq %r14, %r14
movq %rax, -0x38(%rbp)
cmoveq %rax, %r14
incl 0x10(%r14)
movl $0x58, %esi
xorl %edi, %edi
callq *0x31160(%rip)          # 0x38288
movq %rax, %r15
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x40(%rax)
movq %r13, 0x50(%rax)
movq %r14, (%rax)
movl -0x2c(%rbp), %r14d
movl %r12d, 0x18(%rax)
movl $0x0, 0x1c(%rax)
leaq 0x2fb32(%rip), %rax     # 0x36c90
movq %rax, 0x28(%r15)
movq %r13, 0x20(%r15)
testb $0x8, %r14b
jne 0x717e
movl %r12d, %edi
callq 0x6110
xorl %r13d, %r13d
cmpl $0x1, %eax
adcl $0x1, %r13d
movl %r13d, 0x8(%r15)
testb $0x1, %r14b
jne 0x719d
movl 0x18(%r15), %edi
movl $0x2, %esi
movl $0x1, %edx
xorl %eax, %eax
callq 0x63f0
movq %r15, %rdi
xorl %esi, %esi
callq 0x14c5d
orl %r14d, 0xc(%r15)
movq %rbx, %rdi
callq 0xae58
leaq 0x310de(%rip), %rcx     # 0x38298
movq %rcx, (%rax)
movl $0x0, 0x14(%rax)
movq $0x0, 0x8(%rax)
movq %rax, 0x38(%r15)
incl 0x10(%rax)
movq $0x10000, 0x50(%r15)    # imm = 0x10000
movq $0x100, 0x48(%r15)      # imm = 0x100
leaq -0x60(%rbp), %rsi
movq %rbx, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7516
leaq -0x90e(%rip), %rdx      # 0x68ed
leaq 0xdd5e(%rip), %r8       # 0x14f60
movq %rbx, %rdi
movq %rax, %rsi
movq %r15, %rcx
callq 0xbe8d
movq -0x38(%rbp), %r14
incl 0x10(%r14)
movq (%rbx), %rsi
movl 0x10(%rsi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%rsi)
cmpl $0x1, %eax
jg 0x7231
movq %rbx, %rdi
callq 0x759a
movq %r14, (%rbx)
movq %r15, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq