// File: /workspace/github_c_makefile_star2_O2/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, %r12d
movq %rdx, %r14
movl %esi, -0x2c(%rbp)
movq %rdi, %rbx
movq 0x38(%rdi), %rax
incq %rax
movq %rax, 0x38(%rdi)
xorl %r13d, %r13d
leaq -0x60(%rbp), %r15
pushq $0x20
popq %rsi
movq %r15, %rdi
movq %rcx, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x61e0
pushq $-0x1
popq %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x7363
testq %r14, %r14
movq %rax, -0x38(%rbp)
cmoveq %rax, %r14
incl 0x10(%r14)
pushq $0x58
popq %rsi
xorl %edi, %edi
callq *0x2c2aa(%rip)          # 0x33288
movl -0x2c(%rbp), %edi
movq %rax, %r15
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rax)
movups %xmm0, 0x28(%rax)
movups %xmm0, 0x8(%rax)
movups %xmm0, 0x38(%rax)
movups %xmm0, 0x48(%rax)
movq %r14, (%rax)
movl %edi, 0x18(%rax)
leaq 0x2ac88(%rip), %rax     # 0x31c90
movq %rax, 0x28(%r15)
testb $0x8, %r12b
jne 0x7021
callq 0x6110
xorl %r13d, %r13d
cmpl $0x1, %eax
adcl $0x1, %r13d
movl %r13d, 0x8(%r15)
testb $0x1, %r12b
jne 0x703c
movl 0x18(%r15), %edi
pushq $0x2
popq %rsi
pushq $0x1
popq %rdx
xorl %eax, %eax
callq 0x63f0
movq %r15, %rdi
xorl %esi, %esi
callq 0x12e9b
orl %r12d, 0xc(%r15)
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x7363
movq %rax, 0x38(%r15)
incl 0x10(%rax)
movq $0x10000, 0x50(%r15)    # imm = 0x10000
movq $0x100, 0x48(%r15)      # imm = 0x100
leaq -0x80d(%rip), %rdx      # 0x6867
leaq 0xc0e0(%rip), %r8       # 0x1315b
leaq -0x60(%rbp), %rsi
movq %rbx, %rdi
movq %r15, %rcx
callq 0x6bac
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 0x70ab
movq %rbx, %rdi
callq 0x73bf
movq %r14, (%rbx)
movq %r15, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq