// File: /workspace/github_cpp_makefile_star2_O2/sunpihai-up[P]MulThreadsWordsCounter/WordsCounter-v3.cpp
// Function: getFiles(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void getFiles(string path)
{
    struct stat fSta;
    stat(path.c_str(), &fSta);
    if (S_ISDIR(fSta.st_mode))
    {
        DIR *pDir = opendir(path.c_str());
        struct dirent *ptr = NULL;
        // Access the files in this directory in turn
        while ((ptr = readdir(pDir)) != 0)
        {
            // Recursively enter subfolders
            // ! Must judge whether the file name starts with '.'
            if (ptr->d_type == DT_DIR && ptr->d_name[0] != '.')
            {
                getFiles(path + "/" + ptr->d_name);
                continue;
            }

            string fName = ptr->d_name;
            // Only fetch files of TXT type
            if (fName.find(".txt") != string::npos)
            {
                pathQueue.push(path + "/" + ptr->d_name);
            }
        }
        closedir(pDir);
    }
    else if (S_ISREG(fSta.st_mode) && path.find(".txt") != string::npos)
    {
        // The path is a TXT file
        pathQueue.push(path);
    }
    else
    {
        puts("Invalid path or no TXT file under the path!\n");
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movq %rdi, -0x30(%rbp)
movq (%rdi), %rdi
leaq -0x148(%rbp), %r14
movq %r14, %rsi
callq 0x21c0
movl $0xf000, %eax           # imm = 0xF000
andl 0x18(%r14), %eax
movl %eax, %ecx
negw %cx
jo 0x2726
cmpl $0x4000, %eax           # imm = 0x4000
jne 0x275f
movq -0x30(%rbp), %rax
movq (%rax), %rdi
callq 0x22b0
movq %rax, %r14
leaq -0x98(%rbp), %r12
leaq -0x78(%rbp), %r15
movq %rax, -0x38(%rbp)
movq %r14, %rdi
callq 0x22d0
testq %rax, %rax
je 0x277c
movq %rax, %r13
cmpb $0x4, 0x12(%rax)
jne 0x2654
cmpb $0x2e, 0x13(%r13)
jne 0x26cf
addq $0x13, %r13
movq %r12, %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x20e0
movq %r12, %rdi
leaq 0x29f4(%rip), %rsi      # 0x5064
xorl %edx, %edx
callq 0x23a0
cmpq $-0x1, %rax
je 0x26c2
leaq -0x58(%rbp), %rbx
movq %rbx, %rdi
movq -0x30(%rbp), %rsi
leaq 0x29d3(%rip), %rdx      # 0x5062
callq 0x314d
movq %r15, %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x3124
leaq 0x5bdf(%rip), %rdi      # 0x8288
movq %r15, %rsi
callq 0x36ce
movq %r15, %rdi
callq 0x23b8
leaq -0x58(%rbp), %rdi
callq 0x23b8
movq %r12, %rdi
callq 0x23b8
jmp 0x2633
addq $0x13, %r13
movq %r12, %rdi
movq -0x30(%rbp), %rsi
leaq 0x2981(%rip), %rdx      # 0x5062
callq 0x314d
leaq -0xb8(%rbp), %rbx
movq %rbx, %rdi
movq %r12, %r15
movq %r12, %rsi
movq %r13, %rdx
callq 0x3124
movq %rbx, %rdi
callq 0x25cc
movq %rbx, %rdi
callq 0x23b8
movq %r15, %r12
movq %r15, %rdi
callq 0x23b8
movq -0x38(%rbp), %r14
leaq -0x78(%rbp), %r15
jmp 0x2633
leaq 0x2937(%rip), %rsi      # 0x5064
movq -0x30(%rbp), %rdi
xorl %edx, %edx
callq 0x23a0
cmpq $-0x1, %rax
je 0x275f
leaq 0x5b43(%rip), %rdi      # 0x8288
movq -0x30(%rbp), %rsi
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x392e
leaq 0x2903(%rip), %rdi      # 0x5069
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x22f0
movq %r14, %rdi
callq 0x2300
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0xb8(%rbp), %rdi
jmp 0x27be
jmp 0x27a9
movq %rax, %rbx
jmp 0x27ba
movq %rax, %rbx
jmp 0x27c3
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
callq 0x23b8
leaq -0x58(%rbp), %rdi
callq 0x23b8
leaq -0x98(%rbp), %rdi
callq 0x23b8
jmp 0x27d4
movq %rax, %rbx
movq %rbx, %rdi
callq 0x2360