// File: /workspace/github_cpp_makefile_star2_O1/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 $0x78, %rsp
movq %rdi, 0x8(%rsp)
leaq 0x80(%rdi), %r14
leaq 0x8d3f(%rip), %rsi      # 0x25594
movl $0x1, %ecx
movq %r14, %rdi
movq $-0x1, %rdx
callq 0x4860
leaq 0x1(%rax), %rdx
leaq 0x30(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movq $-0x1, %rcx
callq 0x4480
cmpq $0x0, 0x8(%r15)
je 0x1cae2
movq 0x8(%rsp), %rax
leaq 0x28(%rax), %rdi
leaq 0x30(%rsp), %rsi
callq 0x4230
leaq 0x911e(%rip), %rsi      # 0x259c7
leaq 0x30(%rsp), %r14
movl $0x1, %ecx
movq %r14, %rdi
xorl %edx, %edx
callq 0x4770
leaq 0x10(%rsp), %rdi
movq %r14, %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0x4480
movq 0x8(%rsp), %rax
leaq 0x8(%rax), %rdi
leaq 0x10(%rsp), %r14
movq %r14, %rsi
callq 0x4560
movq (%r14), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x1c8ff
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x4460
leaq 0x90c1(%rip), %rsi      # 0x259c7
leaq 0x30(%rsp), %r14
movl $0x1, %ecx
movq %r14, %rdi
xorl %edx, %edx
callq 0x4770
movq %r14, %rdi
xorl %esi, %esi
movq %rax, %rdx
callq 0x40b0
leaq 0x9099(%rip), %rsi      # 0x259c7
leaq 0x30(%rsp), %rdi
movl $0x1, %ecx
movq $-0x1, %rdx
callq 0x4860
cmpq $-0x1, %rax
je 0x1cae2
leaq 0x9072(%rip), %rsi      # 0x259c7
leaq 0x30(%rsp), %r14
movl $0x1, %ecx
movq %r14, %rdi
movq $-0x1, %rdx
callq 0x4860
movq %rax, %r13
movslq %r13d, %rdx
leaq 0x10(%rsp), %rdi
movq %r14, %rsi
movq $-0x1, %rcx
callq 0x4480
movq 0x8(%rsp), %rax
leaq 0x48(%rax), %rdi
leaq 0x10(%rsp), %r14
movq %rdi, 0x70(%rsp)
movq %r14, %rsi
callq 0x4560
movq (%r14), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x1c9bd
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x4460
leaq 0x50(%rsp), %r14
leaq 0x10(%rsp), %rbp
leaq 0x60(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x8(%rsp), %rax
movq 0x48(%rax), %rsi
movq 0x50(%rax), %rdx
addq %rsi, %rdx
movq %r14, %rdi
callq 0x6bac
movq %rbp, %rdi
leaq 0x15b65(%rip), %rsi     # 0x32558
movq %r14, %rdx
callq 0x237e0
movq %rbp, %rdi
leaq 0x952f(%rip), %rsi      # 0x25f34
callq 0x40f0
movl %eax, %r15d
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x1ca29
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x4460
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x1ca45
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x4460
testl %r15d, %r15d
jne 0x1cae2
leal -0x1(%r13), %eax
movslq %eax, %r15
movl $0x1, %ecx
leaq 0x30(%rsp), %rbx
movq %rbx, %rdi
leaq 0x8f5e(%rip), %r12      # 0x259c7
movq %r12, %rsi
movq %r15, %rdx
callq 0x4860
cmpq $-0x1, %rax
je 0x1cad8
movl $0x1, %ecx
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x4860
movq %rax, %r15
movslq %r15d, %rdx
subl %edx, %r13d
movslq %r13d, %rcx
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x4480
movq 0x70(%rsp), %rdi
movq %rbp, %rsi
callq 0x4560
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x1cacd
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x4460
testl %r15d, %r15d
setg %al
movl %r15d, %r13d
jmp 0x1cada
xorl %eax, %eax
testb %al, %al
jne 0x1c9c7
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1cafd
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x4460
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1cb35
jmp 0x1cb35
jmp 0x1cb35
jmp 0x1cb35
movq %rax, %rbx
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x1cb38
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x4460
jmp 0x1cb38
movq %rax, %rbx
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1cb53
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x4460
movq %rbx, %rdi
callq 0x4780
nop