// File: /workspace/github_c_makefile_star2_O3/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 0x7271
movq 0x8(%r14), %rsi
leaq 0x23797(%rip), %rdx     # 0x2a9ef
movq %rbx, %rdi
callq 0x73c6
xorl %r12d, %r12d
testl %eax, %eax
setne %r12b
movq %r12, %rax
incq %rax
jmp 0x7279
movl $0x1, %eax
xorl %r12d, %r12d
cmpl $0x2, %r15d
sete %cl
orb %r12b, %cl
je 0x7322
movq (%r14,%rax,8), %r14
movq (%r14), %rdi
testq %rdi, %rdi
jne 0x72a2
movq 0x8(%r14), %rax
movq %r14, %rdi
callq *0x18(%rax)
movq (%r14), %rdi
callq 0x6160
testq %rax, %rax
je 0x736e
movq %rax, %r15
movq %rbx, %rdi
callq 0xae38
movq %rax, %r14
leaq 0x2e0a3(%rip), %rax     # 0x35368
movq %rax, 0x8(%r14)
movq $0x0, (%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%r14)
movq %r15, %rdi
callq 0x6410
testq %rax, %rax
je 0x7341
cmpb $0x2e, 0x13(%rax)
jne 0x72fe
movzbl 0x14(%rax), %ecx
testl %ecx, %ecx
je 0x72d8
cmpl $0x2e, %ecx
jne 0x72fe
cmpb $0x0, 0x15(%rax)
je 0x72d8
addq $0x13, %rax
movq %rbx, %rdi
movq %rax, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7508
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x7683
jmp 0x72d8
leaq 0x236d2(%rip), %rcx     # 0x2a9fb
movl $0x1, %r15d
movq %rbx, %rdi
movl $0x1, %esi
movq %r14, %rdx
callq 0x7446
jmp 0x73ba
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 0x7366
movq %rbx, %rdi
callq 0x758c
movq %r14, (%rbx)
xorl %r15d, %r15d
jmp 0x73ba
xorl %r15d, %r15d
testb %r12b, %r12b
jne 0x73ba
callq 0x6080
movl (%rax), %edi
callq 0x64b0
movq %rbx, %rdi
movq %rax, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7508
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 0x73b1
movq %rbx, %rdi
callq 0x758c
movq %r14, (%rbx)
movl $0x1, %r15d
movl %r15d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq