// File: /workspace/github_c_makefile_star2_O0/msteveb[P]autosetup/./jimsh0.c
// Function: aio_cmd_buffering
static int aio_cmd_buffering(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
    AioFile *af = Jim_CmdPrivData(interp);
    Jim_Obj *resultObj;

    static const char * const options[] = {
        "none",
        "line",
        "full",
        NULL
    };

    if (argc) {
        if (Jim_GetEnum(interp, argv[0], options, &af->wbuft, NULL, JIM_ERRMSG) != JIM_OK) {
            return JIM_ERR;
        }

        if (af->wbuft == WBUF_OPT_FULL && argc == 2) {
            long l;
            if (Jim_GetLong(interp, argv[1], &l) != JIM_OK || l <= 0) {
                return JIM_ERR;
            }
            af->wbuf_limit = l;
        }

        if (af->wbuft == WBUF_OPT_NONE) {
            if (aio_flush(interp, af) != JIM_OK) {
                return JIM_ERR;
            }
        }

    }

    resultObj = Jim_NewListObj(interp, NULL, 0);
    Jim_ListAppendElement(interp, resultObj, Jim_NewStringObj(interp, options[af->wbuft], -1));
    if (af->wbuft == WBUF_OPT_FULL) {
        Jim_ListAppendElement(interp, resultObj, Jim_NewIntObj(interp, af->wbuf_limit));
    }
    Jim_SetResult(interp, resultObj);

    return JIM_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x1b8(%rax), %rax
movq %rax, -0x28(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x1826c
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movq (%rax), %rsi
movq -0x28(%rbp), %rcx
addq $0x8, %rcx
leaq 0x2eaaa(%rip), %rdx     # 0x46c80
xorl %eax, %eax
movl %eax, %r8d
movl $0x1, %r9d
callq 0x8590
cmpl $0x0, %eax
je 0x181f7
movl $0x1, -0x4(%rbp)
jmp 0x18349
movq -0x28(%rbp), %rax
cmpl $0x2, 0x8(%rax)
jne 0x18240
cmpl $0x2, -0x14(%rbp)
jne 0x18240
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rsi
leaq -0x38(%rbp), %rdx
callq 0xf4d0
cmpl $0x0, %eax
jne 0x18228
cmpq $0x0, -0x38(%rbp)
jg 0x18234
movl $0x1, -0x4(%rbp)
jmp 0x18349
movq -0x38(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x50(%rax)
movq -0x28(%rbp), %rax
cmpl $0x0, 0x8(%rax)
jne 0x1826a
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x18a70
cmpl $0x0, %eax
je 0x18268
movl $0x1, -0x4(%rbp)
jmp 0x18349
jmp 0x1826a
jmp 0x1826c
movq -0x10(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x7b50
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rax
movslq 0x8(%rax), %rcx
leaq 0x2e9de(%rip), %rax     # 0x46c80
movq (%rax,%rcx,8), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7990
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rsi
movq %rax, %rdx
callq 0x7bd0
movq -0x28(%rbp), %rax
cmpl $0x2, 0x8(%rax)
jne 0x182fb
movq -0x10(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rax
movq 0x50(%rax), %rsi
callq 0x8d60
movq -0x60(%rbp), %rdi
movq -0x58(%rbp), %rsi
movq %rax, %rdx
callq 0x7bd0
jmp 0x182fd
movq -0x30(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movl 0x10(%rcx), %eax
addl $-0x1, %eax
movl %eax, 0x10(%rcx)
cmpl $0x0, %eax
jg 0x18337
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x7a10
movq -0x40(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)