// File: /workspace/github_c_makefile_star2_O3/stonezwr[P]SpiKL-IP/util.C
// Function: file_finder(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void file_finder(const std::string& path, std::vector<std::string>& filenames, const std::string& suffix){
    DIR *dir;
    struct dirent *ent; 
    struct stat st;

    dir = opendir(path.c_str());
    while((ent = readdir(dir)) != NULL){
        std::string file_name = ent->d_name;
        std::string full_file_name = path + "/" + file_name;
        if(file_name[0] == '.') continue;
    
        if(stat(full_file_name.c_str(), &st) == -1) continue;

        bool is_directory = (st.st_mode & S_IFDIR) != 0;

        if(is_directory)    file_finder(full_file_name, filenames, suffix);
    
        if(file_name.length() >= suffix.length() && file_name.substr(file_name.length() - suffix.length()) == suffix)
            filenames.push_back(file_name);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rdx, 0x8(%rsp)
movq %rsi, 0x50(%rsp)
movq %rdi, %r15
movq (%rdi), %rdi
callq 0x3460
movq %rax, %r12
movq %rax, %rdi
callq 0x3470
testq %rax, %rax
je 0x14c59
movq %rax, %r14
leaq 0x68(%rsp), %rbx
leaq 0x10(%rsp), %rbp
leaq 0x13(%r14), %r13
leaq 0x40(%rsp), %rax
movq %rax, 0x30(%rsp)
movq %r13, %rdi
callq 0x3150
leaq (%r14,%rax), %rdx
addq $0x13, %rdx
leaq 0x30(%rsp), %rdi
movq %r13, %rsi
callq 0xaf16
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
movq %rbp, %rdi
callq 0xb50c
movq %rbp, %rdi
leaq 0x2877(%rip), %rsi      # 0x1733c
callq 0x35f0
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
movq %rbp, %rdi
callq 0x3110
movq %rbx, 0x58(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x14aff
movq %rdx, 0x58(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x68(%rsp)
jmp 0x14b05
movups (%rcx), %xmm0
movups %xmm0, (%rbx)
movq 0x8(%rax), %rdx
movq %rdx, 0x60(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x14b39
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x32f0
movq 0x30(%rsp), %rax
cmpb $0x2e, (%rax)
je 0x14c12
movq 0x58(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0x3280
cmpl $-0x1, %eax
je 0x14c12
testb $0x40, 0x91(%rsp)
je 0x14b7d
leaq 0x58(%rsp), %rdi
movq 0x50(%rsp), %rsi
movq 0x8(%rsp), %rdx
callq 0x14a2d
movq 0x38(%rsp), %rdx
movq 0x8(%rsp), %rax
subq 0x8(%rax), %rdx
jb 0x14c12
movq %rbp, %rdi
leaq 0x30(%rsp), %rsi
movq $-0x1, %rcx
callq 0x3310
movq 0x18(%rsp), %rdx
movq 0x8(%rsp), %rax
cmpq 0x8(%rax), %rdx
jne 0x14bd7
movq 0x10(%rsp), %r14
testq %rdx, %rdx
je 0x14be1
movq 0x8(%rsp), %rax
movq (%rax), %rsi
movq %r14, %rdi
callq 0x3300
testl %eax, %eax
sete %r13b
jmp 0x14be4
movq 0x10(%rsp), %r14
xorl %r13d, %r13d
jmp 0x14be4
movb $0x1, %r13b
leaq 0x20(%rsp), %rax
cmpq %rax, %r14
je 0x14bfe
movq 0x20(%rsp), %rsi
incq %rsi
movq %r14, %rdi
callq 0x32f0
testb %r13b, %r13b
je 0x14c12
movq 0x50(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x113aa
movq 0x58(%rsp), %rdi
cmpq %rbx, %rdi
je 0x14c29
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x32f0
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x14c45
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x32f0
movq %r12, %rdi
callq 0x3470
movq %rax, %r14
testq %rax, %rax
jne 0x14a74
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x14c6d
movq %rax, %r14
movq 0x58(%rsp), %rdi
cmpq %rbx, %rdi
je 0x14ca7
movq 0x68(%rsp), %rsi
jmp 0x14c9f
movq %rax, %r14
jmp 0x14ca7
jmp 0x14c88
movq %rax, %r14
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x14ca7
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x32f0
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x14cc3
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x32f0
movq %r14, %rdi
callq 0x3570