// File: solaldunckel[P]webserv/srcs/Utils/File.cpp
// Function: File::parse_match()
void File::parse_match() {
  DIR *dir;
  struct dirent *ent;

  std::string path = path_.substr(0, path_.find_last_of("/"));
  if (!matches_.empty())
    matches_.clear();
  if ((dir = opendir(path.c_str()))) {
    while ((ent = readdir(dir))) {
      std::string name(ent->d_name);
      if (file_name_full_ != name && !name.find(file_name_)
        && name.find(mime_ext_) != std::string::npos) {
        matches_.push_back(ent->d_name);
      }
    }
    closedir(dir);
  } else {
    Log.print(DEBUG, "opendir : " + std::string(strerror(errno)) + " of " + path_, RED, true);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1b0, %rsp            # imm = 0x1B0
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x150(%rbp)
movq %rdi, %rax
addq $0x80, %rax
movq %rax, -0x158(%rbp)
addq $0x80, %rdi
leaq 0xb5db(%rip), %rsi      # 0x435a3
movq $-0x1, %rdx
callq 0x5500
movq -0x158(%rbp), %rsi
movq %rax, %rcx
leaq -0x38(%rbp), %rdi
xorl %eax, %eax
movl %eax, %edx
callq 0x55a0
movq -0x150(%rbp), %rdi
addq $0x68, %rdi
callq 0x13c40
testb $0x1, %al
jne 0x3800f
movq -0x150(%rbp), %rdi
addq $0x68, %rdi
callq 0x8f20
leaq -0x38(%rbp), %rdi
callq 0x51f0
movq %rax, %rdi
callq 0x5840
movq %rax, -0x160(%rbp)
jmp 0x38029
movq -0x160(%rbp), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, %rax
je 0x38211
jmp 0x38040
movq -0x10(%rbp), %rdi
callq 0x5860
movq %rax, -0x168(%rbp)
jmp 0x38052
movq -0x168(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
je 0x38201
movq -0x18(%rbp), %rax
addq $0x13, %rax
movq %rax, -0x178(%rbp)
leaq -0x69(%rbp), %rdi
movq %rdi, -0x170(%rbp)
callq 0x5960
movq -0x178(%rbp), %rsi
movq -0x170(%rbp), %rdx
leaq -0x68(%rbp), %rdi
callq 0x6be0
jmp 0x3809f
leaq -0x69(%rbp), %rdi
callq 0x55e0
movq -0x150(%rbp), %rdi
addq $0x28, %rdi
leaq -0x68(%rbp), %rsi
callq 0x29f20
testb $0x1, %al
jne 0x380c5
jmp 0x381f3
movq -0x150(%rbp), %rsi
addq $0x8, %rsi
leaq -0x68(%rbp), %rdi
xorl %eax, %eax
movl %eax, %edx
callq 0x5a90
cmpq $0x0, %rax
jne 0x381f3
movq -0x150(%rbp), %rsi
addq $0x48, %rsi
leaq -0x68(%rbp), %rdi
xorl %eax, %eax
movl %eax, %edx
callq 0x5a90
cmpq $-0x1, %rax
je 0x381f3
movq -0x150(%rbp), %rax
addq $0x68, %rax
movq %rax, -0x190(%rbp)
movq -0x18(%rbp), %rax
addq $0x13, %rax
movq %rax, -0x188(%rbp)
leaq -0x91(%rbp), %rdi
movq %rdi, -0x180(%rbp)
callq 0x5960
movq -0x188(%rbp), %rsi
movq -0x180(%rbp), %rdx
leaq -0x90(%rbp), %rdi
callq 0x6be0
jmp 0x38159
movq -0x190(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x91a0
jmp 0x3816e
leaq -0x90(%rbp), %rdi
callq 0x5aa8
leaq -0x91(%rbp), %rdi
callq 0x55e0
jmp 0x381f3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x38417
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x69(%rbp), %rdi
callq 0x55e0
jmp 0x38417
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x381d9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x5aa8
leaq -0x91(%rbp), %rdi
callq 0x55e0
leaq -0x68(%rbp), %rdi
callq 0x5aa8
jmp 0x38417
leaq -0x68(%rbp), %rdi
callq 0x5aa8
jmp 0x38040
movq -0x10(%rbp), %rdi
callq 0x58a0
jmp 0x3820c
jmp 0x38405
callq 0x5060
movl (%rax), %edi
callq 0x5170
movq %rax, -0x1a0(%rbp)
leaq -0x119(%rbp), %rdi
movq %rdi, -0x198(%rbp)
callq 0x5960
movq -0x1a0(%rbp), %rsi
movq -0x198(%rbp), %rdx
leaq -0x118(%rbp), %rdi
callq 0x6be0
jmp 0x38253
leaq 0xbca7(%rip), %rsi      # 0x43f01
leaq -0xf8(%rbp), %rdi
leaq -0x118(%rbp), %rdx
callq 0x107f0
jmp 0x3826f
leaq 0xbc28(%rip), %rdx      # 0x43e9e
leaq -0xd8(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
callq 0x6a80
jmp 0x3828b
movq -0x150(%rbp), %rdx
subq $-0x80, %rdx
leaq -0xb8(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x6a30
jmp 0x382ab
leaq -0x141(%rbp), %rdi
movq %rdi, -0x1a8(%rbp)
callq 0x5960
movq -0x1a8(%rbp), %rdx
leaq 0xad54(%rip), %rsi      # 0x43020
leaq -0x140(%rbp), %rdi
callq 0x6be0
jmp 0x382da
leaq 0x24317(%rip), %rdi     # 0x5c5f8
movl $0x2, %esi
leaq -0xb8(%rbp), %rdx
leaq -0x140(%rbp), %rcx
movl $0x1, %r8d
callq 0x3b240
jmp 0x38301
leaq -0x140(%rbp), %rdi
callq 0x5aa8
leaq -0x141(%rbp), %rdi
callq 0x55e0
leaq -0xb8(%rbp), %rdi
callq 0x5aa8
leaq -0xd8(%rbp), %rdi
callq 0x5aa8
leaq -0xf8(%rbp), %rdi
callq 0x5aa8
leaq -0x118(%rbp), %rdi
callq 0x5aa8
leaq -0x119(%rbp), %rdi
callq 0x55e0
jmp 0x38405
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x383f7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x383eb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x383df
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x383d3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x383bb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x140(%rbp), %rdi
callq 0x5aa8
leaq -0x141(%rbp), %rdi
callq 0x55e0
leaq -0xb8(%rbp), %rdi
callq 0x5aa8
leaq -0xd8(%rbp), %rdi
callq 0x5aa8
leaq -0xf8(%rbp), %rdi
callq 0x5aa8
leaq -0x118(%rbp), %rdi
callq 0x5aa8
leaq -0x119(%rbp), %rdi
callq 0x55e0
jmp 0x38417
leaq -0x38(%rbp), %rdi
callq 0x5aa8
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbp
retq
leaq -0x38(%rbp), %rdi
callq 0x5aa8
movq -0x40(%rbp), %rdi
callq 0x5950
nopl (%rax)