// File: /workspace/github_c_makefile_star2_O1/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 $0x128, %rsp            # imm = 0x128
movq %rdx, (%rsp)
movq %rsi, 0x28(%rsp)
movq %rdi, %r15
movq (%rdi), %rdi
callq 0x3460
movq %rax, 0x70(%rsp)
movq %rax, %rdi
callq 0x3470
testq %rax, %rax
je 0x14f8a
movq %rax, %r14
leaq 0x18(%rsp), %r12
leaq 0x60(%rsp), %r13
leaq 0x30(%rsp), %rbp
leaq 0x13(%r14), %rbx
movq %r12, 0x8(%rsp)
movq %rbx, %rdi
callq 0x3150
leaq (%r14,%rax), %rdx
addq $0x13, %rdx
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0xb190
leaq 0x40(%rsp), %rax
movq %rax, 0x30(%rsp)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
movq %rbp, %rdi
callq 0xb78c
movq %rbp, %rdi
leaq 0x253e(%rip), %rsi      # 0x1731c
callq 0x35f0
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %rbp, %rdi
callq 0x3110
movq %r13, 0x50(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x14e18
movq %rdx, 0x50(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x60(%rsp)
jmp 0x14e20
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
movq %rdx, 0x58(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x14e54
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x32f0
movq 0x8(%rsp), %rax
cmpb $0x2e, (%rax)
je 0x14f3c
movq 0x50(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0x3280
cmpl $-0x1, %eax
je 0x14f3c
testb $0x40, 0xb1(%rsp)
je 0x14e9a
leaq 0x50(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq (%rsp), %rdx
callq 0x14d45
movq 0x10(%rsp), %rbx
movq (%rsp), %rax
movq 0x8(%rax), %r14
movq %rbx, %rdx
subq %r14, %rdx
jb 0x14ef9
leaq 0x78(%rsp), %rdi
leaq 0x8(%rsp), %rsi
movq $-0x1, %rcx
callq 0x3310
movq 0x80(%rsp), %rdx
movq (%rsp), %rax
cmpq 0x8(%rax), %rdx
jne 0x14ef9
testq %rdx, %rdx
je 0x14f82
movq (%rsp), %rax
movq (%rax), %rsi
movq 0x78(%rsp), %rdi
callq 0x3300
testl %eax, %eax
sete %r12b
jmp 0x14efc
xorl %r12d, %r12d
cmpq %r14, %rbx
jb 0x14f23
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x14f23
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x32f0
testb %r12b, %r12b
leaq 0x18(%rsp), %r12
je 0x14f3c
movq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x116ce
movq 0x50(%rsp), %rdi
cmpq %r13, %rdi
je 0x14f53
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x32f0
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x14f6a
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x32f0
movq 0x70(%rsp), %rdi
callq 0x3470
movq %rax, %r14
testq %rax, %rax
jne 0x14d92
jmp 0x14f8a
movb $0x1, %r12b
jmp 0x14efc
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x14f9e
movq %rax, %rbx
movq 0x50(%rsp), %rdi
cmpq %r13, %rdi
je 0x14fd8
movq 0x60(%rsp), %rsi
jmp 0x14fd0
movq %rax, %rbx
jmp 0x14fd8
jmp 0x14fb9
movq %rax, %rbx
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x14fd8
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x32f0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x14ff4
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x32f0
movq %rbx, %rdi
callq 0x3570