// File: /workspace/github_cpp_makefile_star2_O3/luisremis[P]SDFS/FileSystem.cpp
// Function: FileSystem::deleteFromFS(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void FileSystem::deleteFromFS(std::string remoteFile)
{
    // hashing function to find the machine/s where to store the file;
    
    int fileKey = hashString(remoteFile);
    int position = findPositionByKey(fileKey);

    // cout<<"delete " << fileKey << " from "<<position<<" "<<virtualRing[position].ip_str<<" "<<virtualRing[position].key<<endl;

    bool attempt = deleteFromNode( position, remoteFile );
    if( !attempt)
    {
        std::cout << "Problem removing at position " << position << std::endl;
    }
    
    attempt = deleteFromNode( position+1, remoteFile );
    //if(attempt)
        //return;
    
    attempt = deleteFromNode( position+2, remoteFile );
    //if(attempt)
        //return;


    //std::string destAddress = "localhost";
    //put(destAddress, localFile, remoteFile);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq -0xa0(%rbp), %r12
movq %r12, -0x10(%r12)
movq (%rsi), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq -0xb0(%rbp), %r15
movq %r15, %rdi
callq 0x56fa
movq (%r15), %rdi
movq 0x8(%r15), %rsi
movl $0xc70f6907, %edx       # imm = 0xC70F6907
callq 0x40c0
movq %rax, %r15
movl %r15d, %eax
imulq $0x10624dd3, %rax, %rax # imm = 0x10624DD3
shrq $0x26, %rax
imull $0x3e8, %eax, %eax      # imm = 0x3E8
subl %eax, %r15d
movq -0xb0(%rbp), %rdi
cmpq %r12, %rdi
je 0xd79d
callq 0x4360
movq %rbx, %rdi
movl %r15d, %esi
callq 0xba82
movl %eax, %r15d
leaq -0x80(%rbp), %r13
movq %r13, -0x10(%r13)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq -0x90(%rbp), %r12
movq %r12, %rdi
callq 0x56fa
movq %rbx, %rdi
movl %r15d, %esi
movq %r12, %rdx
callq 0xbfee
movl %eax, %r12d
movq -0x90(%rbp), %rdi
cmpq %r13, %rdi
je 0xd7ee
callq 0x4360
movq %rbx, -0x30(%rbp)
testb %r12b, %r12b
jne 0xd847
movq 0xb7c2(%rip), %r12      # 0x18fc0
leaq 0x6312(%rip), %rsi      # 0x13b17
movl $0x1d, %edx
movq %r12, %rdi
callq 0x43f0
movq %r12, %rdi
movl %r15d, %esi
callq 0x45f0
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x4380
movsbl %al, %esi
movq %r12, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x4260
leal 0x1(%r15), %r12d
leaq -0x60(%rbp), %rbx
movq %rbx, -0x10(%rbx)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq -0x70(%rbp), %r13
movq %r13, %rdi
callq 0x56fa
movq -0x30(%rbp), %rdi
movl %r12d, %esi
movq %r13, %rdx
callq 0xbfee
movq -0x70(%rbp), %rdi
cmpq %rbx, %rdi
je 0xd886
callq 0x4360
addl $0x2, %r15d
leaq -0x40(%rbp), %rbx
movq %rbx, -0x10(%rbx)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq -0x50(%rbp), %r14
movq %r14, %rdi
callq 0x56fa
movq -0x30(%rbp), %rdi
movl %r15d, %esi
movq %r14, %rdx
callq 0xbfee
movq -0x50(%rbp), %rdi
cmpq %rbx, %rdi
je 0xd8c5
callq 0x4360
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq -0x50(%rbp), %rdi
jmp 0xd8e7
movq %rax, %r14
movq -0x70(%rbp), %rdi
cmpq %rbx, %rdi
je 0xd8f1
callq 0x4360
movq %r14, %rdi
callq 0x4630
movq %rax, %r14
movq -0x90(%rbp), %rdi
cmpq %r13, %rdi
jne 0xd8ec
jmp 0xd8f1
movq %rax, %rdi
callq 0xa583