// File: /workspace/github_c_makefile_star2_O1/msteveb[P]autosetup/./jimsh0.c
// Function: Jim_ReaddirCmd
int Jim_ReaddirCmd(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
    const char *dirPath;
    DIR *dirPtr;
    struct dirent *entryPtr;
    int nocomplain = 0;

    if (argc == 3 && Jim_CompareStringImmediate(interp, argv[1], "-nocomplain")) {
        nocomplain = 1;
    }
    if (argc != 2 && !nocomplain) {
        Jim_WrongNumArgs(interp, 1, argv, "?-nocomplain? dirPath");
        return JIM_ERR;
    }

    dirPath = Jim_String(argv[1 + nocomplain]);

    dirPtr = opendir(dirPath);
    if (dirPtr == NULL) {
        if (nocomplain) {
            return JIM_OK;
        }
        Jim_SetResultString(interp, strerror(errno), -1);
        return JIM_ERR;
    }
    else {
        Jim_Obj *listObj = Jim_NewListObj(interp, NULL, 0);

        while ((entryPtr = readdir(dirPtr)) != NULL) {
            if (entryPtr->d_name[0] == '.') {
                if (entryPtr->d_name[1] == '\0') {
                    continue;
                }
                if ((entryPtr->d_name[1] == '.') && (entryPtr->d_name[2] == '\0'))
                    continue;
            }
            Jim_ListAppendElement(interp, listObj, Jim_NewStringObj(interp, entryPtr->d_name, -1));
        }
        closedir(dirPtr);

        Jim_SetResult(interp, listObj);

        return JIM_OK;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r14
movl %esi, %r15d
movq %rdi, %rbx
cmpl $0x3, %esi
jne 0x7283
movq 0x8(%r14), %rsi
leaq 0x247dd(%rip), %rdx     # 0x2ba47
movq %rbx, %rdi
callq 0x73d6
xorl %r12d, %r12d
testl %eax, %eax
setne %r12b
movq %r12, %rax
incq %rax
jmp 0x728b
movl $0x1, %eax
xorl %r12d, %r12d
cmpl $0x2, %r15d
sete %cl
orb %r12b, %cl
je 0x7332
movq (%r14,%rax,8), %r14
cmpq $0x0, (%r14)
jne 0x72af
movq 0x8(%r14), %rax
movq %r14, %rdi
callq *0x18(%rax)
movq (%r14), %rdi
callq 0x6160
testq %rax, %rax
je 0x737e
movq %rax, %r15
movq %rbx, %rdi
callq 0xae58
movq %rax, %r14
leaq 0x2f083(%rip), %rax     # 0x36358
movq %rax, 0x8(%r14)
movq $0x0, (%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%r14)
movq %r15, %rdi
callq 0x6410
testq %rax, %rax
je 0x7351
cmpb $0x2e, 0x13(%rax)
jne 0x730e
movzbl 0x14(%rax), %ecx
testl %ecx, %ecx
je 0x72e8
cmpl $0x2e, %ecx
jne 0x730e
cmpb $0x0, 0x15(%rax)
je 0x72e8
addq $0x13, %rax
movq %rbx, %rdi
movq %rax, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7516
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x7695
jmp 0x72e8
leaq 0x2471a(%rip), %rcx     # 0x2ba53
movl $0x1, %r15d
movq %rbx, %rdi
movl $0x1, %esi
movq %r14, %rdx
callq 0x7454
jmp 0x73ca
movq %r15, %rdi
callq 0x6280
incl 0x10(%r14)
movq (%rbx), %rsi
movl 0x10(%rsi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%rsi)
cmpl $0x1, %eax
jg 0x7376
movq %rbx, %rdi
callq 0x759a
movq %r14, (%rbx)
xorl %r15d, %r15d
jmp 0x73ca
xorl %r15d, %r15d
testb %r12b, %r12b
jne 0x73ca
callq 0x6080
movl (%rax), %edi
callq 0x64b0
movq %rbx, %rdi
movq %rax, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7516
movq %rax, %r14
incl 0x10(%rax)
movq (%rbx), %rsi
movl 0x10(%rsi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%rsi)
cmpl $0x1, %eax
jg 0x73c1
movq %rbx, %rdi
callq 0x759a
movq %r14, (%rbx)
movl $0x1, %r15d
movl %r15d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq