// File: /workspace/github_cpp_makefile_star2_O3/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 0x8cb5(%rip), %rsi      # 0x25594
movl $0x1, %ecx
movq %r14, %rdi
movq $-0x1, %rdx
callq 0x4870
leaq 0x1(%rax), %rdx
leaq 0x20(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movq $-0x1, %rcx
callq 0x4490
cmpq $0x0, 0x8(%r15)
je 0x1cb44
leaq 0x28(%rbx), %rdi
leaq 0x20(%rsp), %rsi
callq 0x4230
leaq 0x9099(%rip), %rsi      # 0x259c7
leaq 0x20(%rsp), %r14
movl $0x1, %ecx
movq %r14, %rdi
xorl %edx, %edx
callq 0x4780
movq %rsp, %rdi
movq %r14, %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0x4490
leaq 0x8(%rbx), %rdi
movq %rsp, %r14
movq %r14, %rsi
callq 0x4570
movq (%r14), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x1c97b
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x4470
leaq 0x9045(%rip), %rsi      # 0x259c7
leaq 0x20(%rsp), %r14
movl $0x1, %ecx
movq %r14, %rdi
xorl %edx, %edx
callq 0x4780
movq %r14, %rdi
xorl %esi, %esi
movq %rax, %rdx
callq 0x40b0
leaq 0x901d(%rip), %rsi      # 0x259c7
leaq 0x20(%rsp), %rdi
movl $0x1, %ecx
movq $-0x1, %rdx
callq 0x4870
cmpq $-0x1, %rax
je 0x1cb44
leaq 0x8ff6(%rip), %rsi      # 0x259c7
leaq 0x20(%rsp), %r14
movl $0x1, %ecx
movq %r14, %rdi
movq $-0x1, %rdx
callq 0x4870
movq %rax, %r13
movslq %r13d, %rdx
movq %rsp, %rdi
movq %r14, %rsi
movq $-0x1, %rcx
callq 0x4490
leaq 0x48(%rbx), %rdi
movq %rsp, %r14
movq %rdi, 0x60(%rsp)
movq %r14, %rsi
callq 0x4570
movq (%r14), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x1ca30
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x4470
leaq 0x40(%rsp), %r12
movq %rsp, %rbp
leaq 0x20(%rsp), %r14
leaq 0x50(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x48(%rbx), %rsi
movq 0x50(%rbx), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0x6c2a
movq %rbp, %rdi
leaq 0x15b04(%rip), %rsi     # 0x32568
movq %r12, %rdx
callq 0x23764
movq %rbp, %rdi
leaq 0x94be(%rip), %rsi      # 0x25f34
callq 0x40f0
movl %eax, %r15d
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x1ca99
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x1cab5
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x4470
testl %r15d, %r15d
jne 0x1cb44
leal -0x1(%r13), %eax
movslq %eax, %r15
movl $0x1, %ecx
movq %r14, %rdi
leaq 0x8ef3(%rip), %rsi      # 0x259c7
movq %r15, %rdx
callq 0x4870
cmpq $-0x1, %rax
je 0x1cb44
movl $0x1, %ecx
movq %r14, %rdi
leaq 0x8ed6(%rip), %rsi      # 0x259c7
movq %r15, %rdx
callq 0x4870
movq %rax, %r15
movslq %r15d, %rdx
subl %edx, %r13d
movslq %r13d, %rcx
movq %rbp, %rdi
movq %r14, %rsi
callq 0x4490
movq 0x60(%rsp), %rdi
movq %rbp, %rsi
callq 0x4570
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x1cb38
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x4470
movl %r15d, %r13d
testl %r15d, %r15d
jg 0x1ca3d
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1cb5f
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x4470
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1cb97
jmp 0x1cb97
jmp 0x1cb97
jmp 0x1cb97
movq %rax, %rbx
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x1cb9a
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x4470
jmp 0x1cb9a
movq %rax, %rbx
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1cbb5
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x4470
movq %rbx, %rdi
callq 0x4790
nop