// File: OpenFodder[P]SOS_Unpacker/stdafx.cpp
// Function: local_DirectoryList(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
std::vector<std::string> local_DirectoryList(const std::string& pPath, const std::string& pExtension) {
    struct dirent		**directFiles;
    std::vector<std::string>		  results;

    // Build the file path

    std::string finalPath;

    finalPath += pPath;
    finalPath += "/";

    findType = pExtension;

    transform(findType.begin(), findType.end(), findType.begin(), ::toupper);

    int count = scandir(finalPath.c_str(), (dirent***)&directFiles, file_select, 0);

    for (int i = 0; i < count; ++i) {

        results.push_back(std::string(directFiles[i]->d_name));
    }

    transform(findType.begin(), findType.end(), findType.begin(), ::tolower);

    count = scandir(finalPath.c_str(), (dirent***)&directFiles, file_select, 0);

    for (int i = 0; i < count; ++i) {

        results.push_back(std::string(directFiles[i]->d_name));
    }

    return results;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x160, %rsp            # imm = 0x160
movq %rdi, -0x110(%rbp)
movq %rdi, %rax
movq %rax, -0x108(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movb $0x0, -0x21(%rbp)
callq 0x1b390
leaq -0x48(%rbp), %rdi
movq %rdi, -0x100(%rbp)
callq 0x4340
movq -0x100(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x42d0
jmp 0x1d5d3
leaq 0xe40(%rip), %rsi       # 0x1e41a
leaq -0x48(%rbp), %rdi
callq 0x4210
jmp 0x1d5e5
movq -0x18(%rbp), %rsi
leaq 0xc0c0(%rip), %rdi      # 0x296b0
callq 0x4050
jmp 0x1d5f7
leaq 0xc0b2(%rip), %rdi      # 0x296b0
movq %rdi, -0x120(%rbp)
callq 0x41c0
movq -0x120(%rbp), %rdi
movq %rax, -0x60(%rbp)
callq 0x4150
movq -0x120(%rbp), %rdi
movq %rax, -0x68(%rbp)
callq 0x41c0
movq %rax, -0x70(%rbp)
movq -0x60(%rbp), %rdi
movq -0x68(%rbp), %rsi
movq -0x70(%rbp), %rdx
movq 0x999f(%rip), %rcx      # 0x26fe0
callq 0x1da00
movq %rax, -0x118(%rbp)
jmp 0x1d64f
movq -0x118(%rbp), %rax
movq %rax, -0x78(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x40e0
movq %rax, %rdi
leaq -0x21d(%rip), %rdx      # 0x1d450
xorl %eax, %eax
movl %eax, %ecx
leaq -0x20(%rbp), %rsi
callq 0x4070
movl %eax, -0x124(%rbp)
jmp 0x1d682
movl -0x124(%rbp), %eax
movl %eax, -0x7c(%rbp)
movl $0x0, -0x80(%rbp)
movl -0x80(%rbp), %eax
cmpl -0x7c(%rbp), %eax
jge 0x1d767
movq -0x20(%rbp), %rax
movslq -0x80(%rbp), %rcx
movq (%rax,%rcx,8), %rax
addq $0x13, %rax
movq %rax, -0x138(%rbp)
leaq -0xa1(%rbp), %rdi
movq %rdi, -0x130(%rbp)
callq 0x4430
movq -0x138(%rbp), %rsi
movq -0x130(%rbp), %rdx
leaq -0xa0(%rbp), %rdi
callq 0x4320
jmp 0x1d6e4
movq -0x110(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x1da80
jmp 0x1d6f9
leaq -0xa0(%rbp), %rdi
callq 0x4488
leaq -0xa1(%rbp), %rdi
callq 0x4260
movl -0x80(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x80(%rbp)
jmp 0x1d692
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x1d8fc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x1d756
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x4488
leaq -0xa1(%rbp), %rdi
callq 0x4260
jmp 0x1d8fc
leaq 0xbf42(%rip), %rdi      # 0x296b0
movq %rdi, -0x148(%rbp)
callq 0x41c0
movq -0x148(%rbp), %rdi
movq %rax, -0xb0(%rbp)
callq 0x4150
movq -0x148(%rbp), %rdi
movq %rax, -0xb8(%rbp)
callq 0x41c0
movq %rax, -0xc0(%rbp)
movq -0xb0(%rbp), %rdi
movq -0xb8(%rbp), %rsi
movq -0xc0(%rbp), %rdx
movq 0x9805(%rip), %rcx      # 0x26fc8
callq 0x1da00
movq %rax, -0x140(%rbp)
jmp 0x1d7d1
movq -0x140(%rbp), %rax
movq %rax, -0xc8(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x40e0
movq %rax, %rdi
leaq -0x3a2(%rip), %rdx      # 0x1d450
xorl %eax, %eax
movl %eax, %ecx
leaq -0x20(%rbp), %rsi
callq 0x4070
movl %eax, -0x14c(%rbp)
jmp 0x1d807
movl -0x14c(%rbp), %eax
movl %eax, -0x7c(%rbp)
movl $0x0, -0xcc(%rbp)
movl -0xcc(%rbp), %eax
cmpl -0x7c(%rbp), %eax
jge 0x1d8e7
movq -0x20(%rbp), %rax
movslq -0xcc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
addq $0x13, %rax
movq %rax, -0x160(%rbp)
leaq -0xf1(%rbp), %rdi
movq %rdi, -0x158(%rbp)
callq 0x4430
movq -0x160(%rbp), %rsi
movq -0x158(%rbp), %rdx
leaq -0xf0(%rbp), %rdi
callq 0x4320
jmp 0x1d872
movq -0x110(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
callq 0x1da80
jmp 0x1d887
leaq -0xf0(%rbp), %rdi
callq 0x4488
leaq -0xf1(%rbp), %rdi
callq 0x4260
movl -0xcc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xcc(%rbp)
jmp 0x1d81a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x1d8d9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0x4488
leaq -0xf1(%rbp), %rdi
callq 0x4260
jmp 0x1d8fc
movb $0x1, -0x21(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x4488
testb $0x1, -0x21(%rbp)
jne 0x1d91f
jmp 0x1d913
leaq -0x48(%rbp), %rdi
callq 0x4488
movq -0x110(%rbp), %rdi
callq 0x1b550
jmp 0x1d92f
movq -0x110(%rbp), %rdi
callq 0x1b550
movq -0x108(%rbp), %rax
addq $0x160, %rsp            # imm = 0x160
popq %rbp
retq
movq -0x50(%rbp), %rdi
callq 0x4420
nopl (%rax,%rax)