// File: /workspace/github_cpp_makefile_star2_O2/solaldunckel[P]webserv/srcs/Utils/File.cpp
// Function: File::parseExtensionsNegociation()
void File::parseExtensionsNegociation() {
  std::string file = path_.substr(path_.find_last_of("/") + 1);

  if (file.empty())
    return;

  file_name_full_ = file;

  file_name_ = file.substr(0, file.find("."));
  file.erase(0, file.find("."));
  if (file.find_last_of(".") != std::string::npos) {
    int last = file.find_last_of(".");
    mime_ext_ = file.substr(last);
    while (!g_mimes.getType(mime_ext_).compare("application/octet-stream")) {
      int last2 = last;
      if ((file.find_last_of(".", last - 1) != std::string::npos)) {
        last = file.find_last_of(".", last - 1);
        mime_ext_ = file.substr(last, last2 - last) ;
      }
      else
        break ;
      if (last <= 0)
        break ;
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
leaq 0x80(%rdi), %r14
leaq 0x5e7b(%rip), %rsi      # 0x1c57e
pushq $-0x1
popq %r15
movq %r14, %rdi
movq %r15, %rdx
callq 0x4430
leaq 0x1(%rax), %rdx
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rcx
callq 0x44a0
cmpq $0x0, 0x8(%r12)
je 0x168c7
leaq 0x28(%rbx), %rdi
leaq 0x8(%rsp), %rsi
callq 0x4240
leaq 0x621c(%rip), %rsi      # 0x1c966
leaq 0x8(%rsp), %r14
movq %r14, %rdi
xorl %edx, %edx
callq 0x4870
leaq 0x28(%rsp), %rdi
movq %r14, %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0x44a0
leaq 0x8(%rbx), %rdi
leaq 0x28(%rsp), %r14
movq %r14, %rsi
callq 0x4560
movq %r14, %rdi
callq 0x4898
leaq 0x61db(%rip), %rsi      # 0x1c966
leaq 0x8(%rsp), %r14
movq %r14, %rdi
xorl %edx, %edx
callq 0x4870
movq %r14, %rdi
xorl %esi, %esi
movq %rax, %rdx
callq 0x40a0
leaq 0x61b8(%rip), %rsi      # 0x1c966
leaq 0x8(%rsp), %rdi
pushq $-0x1
popq %rdx
callq 0x4430
cmpq $-0x1, %rax
je 0x168c7
leaq 0x619a(%rip), %rsi      # 0x1c966
leaq 0x8(%rsp), %r14
pushq $-0x1
popq %r15
movq %r14, %rdi
movq %r15, %rdx
callq 0x4430
movq %rax, %r13
movslq %r13d, %rdx
leaq 0x28(%rsp), %rdi
movq %r14, %rsi
movq %r15, %rcx
callq 0x44a0
addq $0x48, %rbx
leaq 0x28(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4560
movq %r14, %rdi
callq 0x4898
leaq 0x48(%rsp), %r12
leaq 0x8(%rsp), %rbp
movq %r12, %rdi
movq %rbx, %rsi
callq 0x45e0
movq %r14, %rdi
leaq 0x14d37(%rip), %rsi     # 0x2b568
movq %r12, %rdx
callq 0x1ab78
movq %r14, %rdi
leaq 0x66a1(%rip), %rsi      # 0x1cee4
callq 0x4100
movl %eax, %r15d
movq %r14, %rdi
callq 0x4898
movq %r12, %rdi
callq 0x4898
testl %r15d, %r15d
jne 0x168c7
leal -0x1(%r13), %eax
movslq %eax, %r15
movq %rbp, %rdi
leaq 0x60f5(%rip), %rsi      # 0x1c966
movq %r15, %rdx
callq 0x4430
cmpq $-0x1, %rax
je 0x168c7
movq %rbp, %rdi
leaq 0x60dd(%rip), %rsi      # 0x1c966
movq %r15, %rdx
callq 0x4430
movq %rax, %r15
movslq %r15d, %rdx
subl %edx, %r13d
movslq %r13d, %rcx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x44a0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4560
movq %r14, %rdi
callq 0x4898
movl %r15d, %r13d
testl %r15d, %r15d
jg 0x1681c
leaq 0x8(%rsp), %rdi
callq 0x4898
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x168f7
jmp 0x168f7
jmp 0x168f7
jmp 0x168f7
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x4898
jmp 0x168fa
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x4898
movq %rbx, %rdi
callq 0x4750