// File: /workspace/github_cpp_makefile_star2_O2/luisremis[P]SDFS/FileSystem.cpp
// Function: FileSystem::myJoinFinished()
bool FileSystem::myJoinFinished( ){
    
    virtualRingLock.lock();

    int minKey, maxKey;
    bool success;

    VirtualNode target = nNodeLater(3, myPosition);
    if(target != myself ){
        minKey = nNodeBefore(1, myPosition).key;
        maxKey = nNodeBefore(0, myPosition).key;
        success = pullFileFromRange(  target.ip_str, minKey, maxKey, true);
        // cout<<success<<" pull key from "<<minKey<<" to "<<maxKey<<" from "<<target.ip_str<<" "<<target.key<<endl;
        logFile<<success<<" myJoinFinished pull key from "<<minKey<<" to "<<maxKey<<" from "<<target.ip_str<<" "<<target.key<<endl;
    }
    
    target = nNodeLater(2, myPosition);
    if(target != myself ){
        minKey = nNodeBefore(2, myPosition).key;
        maxKey = nNodeBefore(1, myPosition).key;
        success = pullFileFromRange(  target.ip_str, minKey, maxKey, true);
        // cout<<success<<" pull key from "<<minKey<<" to "<<maxKey<<" from "<<target.ip_str<<" "<<target.key<<endl;
        logFile<<success<<" myJoinFinished pull key from "<<minKey<<" to "<<maxKey<<" from "<<target.ip_str<<" "<<target.key<<endl;
    }

    target = nNodeLater(1, myPosition);
    if(target != myself ){
        minKey = nNodeBefore(3, myPosition).key;
        maxKey = nNodeBefore(2, myPosition).key;
        success = pullFileFromRange(  target.ip_str, minKey, maxKey, true);
        // cout<<success<<" pull key from "<<minKey<<" to "<<maxKey<<" from "<<target.ip_str<<" "<<target.key<<endl;
        logFile<<success<<" myJoinFinished pull key from "<<minKey<<" to "<<maxKey<<" from "<<target.ip_str<<" "<<target.key<<endl;
    }

    virtualRingLock.unlock();

    return success;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rdi, %r14
leaq 0x268(%rdi), %rbx
movq %rbx, %rdi
callq 0x8608
movl 0x290(%r14), %ecx
leaq -0x78(%rbp), %r15
pushq $0x3
popq %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0xc24a
movl 0x20(%r15), %eax
cmpl 0x2b8(%r14), %eax
je 0xbf56
movl 0x290(%r14), %ecx
leaq -0x50(%rbp), %rdi
pushq $0x1
popq %rdx
movq %r14, %rsi
callq 0xc2a4
leaq -0x50(%rbp), %rdi
movl 0x20(%rdi), %r13d
callq 0x41b0
movl 0x290(%r14), %ecx
leaq -0x50(%rbp), %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0xc2a4
leaq -0x50(%rbp), %rdi
movl 0x20(%rdi), %r12d
callq 0x41b0
leaq -0xd8(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x4450
leaq -0xd8(%rbp), %rsi
pushq $0x1
popq %r8
movq %r14, %rdi
movl %r13d, %edx
movl %r12d, %ecx
callq 0xb8ea
movl %eax, %r15d
leaq -0xd8(%rbp), %rdi
callq 0x41b0
movzbl %r15b, %esi
movq %r14, %rdi
callq 0x4560
leaq 0x3e00(%rip), %rsi      # 0xfcec
movq %rax, %rdi
callq 0x4370
movq %rax, %rdi
movl %r13d, %esi
callq 0x45a0
leaq 0x3886(%rip), %rsi      # 0xf78c
movq %rax, %rdi
callq 0x4370
movq %rax, %rdi
movl %r12d, %esi
callq 0x45a0
leaq 0x3de4(%rip), %rsi      # 0xfd04
movq %rax, %rdi
callq 0x4370
leaq -0x78(%rbp), %rsi
movq %rax, %rdi
callq 0x4300
leaq 0x33e7(%rip), %rsi      # 0xf322
movq %rax, %rdi
callq 0x4370
movl -0x58(%rbp), %esi
movq %rax, %rdi
callq 0x45a0
movq %rax, %rdi
callq 0x41d0
movl 0x290(%r14), %ecx
leaq -0x50(%rbp), %rdi
pushq $0x2
popq %rdx
movq %r14, %rsi
callq 0xc24a
leaq -0x78(%rbp), %r12
leaq -0x50(%rbp), %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0xcb62
movq %r13, %rdi
callq 0x41b0
movl 0x20(%r12), %eax
cmpl 0x2b8(%r14), %eax
je 0xc094
movl 0x290(%r14), %ecx
leaq -0x50(%rbp), %rdi
pushq $0x2
popq %rdx
movq %r14, %rsi
callq 0xc2a4
leaq -0x50(%rbp), %rdi
movl 0x20(%rdi), %r13d
callq 0x41b0
movl 0x290(%r14), %ecx
leaq -0x50(%rbp), %rdi
pushq $0x1
popq %rdx
movq %r14, %rsi
callq 0xc2a4
leaq -0x50(%rbp), %rdi
movl 0x20(%rdi), %r12d
callq 0x41b0
leaq -0xb8(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x4450
leaq -0xb8(%rbp), %rsi
pushq $0x1
popq %r8
movq %r14, %rdi
movl %r13d, %edx
movl %r12d, %ecx
callq 0xb8ea
movl %eax, %r15d
leaq -0xb8(%rbp), %rdi
callq 0x41b0
movzbl %r15b, %esi
movq %r14, %rdi
callq 0x4560
leaq 0x3cc2(%rip), %rsi      # 0xfcec
movq %rax, %rdi
callq 0x4370
movq %rax, %rdi
movl %r13d, %esi
callq 0x45a0
leaq 0x3748(%rip), %rsi      # 0xf78c
movq %rax, %rdi
callq 0x4370
movq %rax, %rdi
movl %r12d, %esi
callq 0x45a0
leaq 0x3ca6(%rip), %rsi      # 0xfd04
movq %rax, %rdi
callq 0x4370
leaq -0x78(%rbp), %rsi
movq %rax, %rdi
callq 0x4300
leaq 0x32a9(%rip), %rsi      # 0xf322
movq %rax, %rdi
callq 0x4370
movl -0x58(%rbp), %esi
movq %rax, %rdi
callq 0x45a0
movq %rax, %rdi
callq 0x41d0
movl 0x290(%r14), %ecx
leaq -0x50(%rbp), %rdi
pushq $0x1
popq %rdx
movq %r14, %rsi
callq 0xc24a
leaq -0x78(%rbp), %r12
leaq -0x50(%rbp), %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0xcb62
movq %r13, %rdi
callq 0x41b0
movl 0x20(%r12), %eax
cmpl 0x2b8(%r14), %eax
je 0xc1d2
movl 0x290(%r14), %ecx
leaq -0x50(%rbp), %rdi
pushq $0x3
popq %rdx
movq %r14, %rsi
callq 0xc2a4
leaq -0x50(%rbp), %rdi
movl 0x20(%rdi), %r13d
callq 0x41b0
movl 0x290(%r14), %ecx
leaq -0x50(%rbp), %rdi
pushq $0x2
popq %rdx
movq %r14, %rsi
callq 0xc2a4
leaq -0x50(%rbp), %rdi
movl 0x20(%rdi), %r12d
callq 0x41b0
leaq -0x98(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x4450
leaq -0x98(%rbp), %rsi
pushq $0x1
popq %r8
movq %r14, %rdi
movl %r13d, %edx
movl %r12d, %ecx
callq 0xb8ea
movl %eax, %r15d
leaq -0x98(%rbp), %rdi
callq 0x41b0
movzbl %r15b, %esi
movq %r14, %rdi
callq 0x4560
leaq 0x3b84(%rip), %rsi      # 0xfcec
movq %rax, %rdi
callq 0x4370
movq %rax, %rdi
movl %r13d, %esi
callq 0x45a0
leaq 0x360a(%rip), %rsi      # 0xf78c
movq %rax, %rdi
callq 0x4370
movq %rax, %rdi
movl %r12d, %esi
callq 0x45a0
leaq 0x3b68(%rip), %rsi      # 0xfd04
movq %rax, %rdi
callq 0x4370
leaq -0x78(%rbp), %rsi
movq %rax, %rdi
callq 0x4300
leaq 0x316b(%rip), %rsi      # 0xf322
movq %rax, %rdi
callq 0x4370
movl -0x58(%rbp), %esi
movq %rax, %rdi
callq 0x45a0
movq %rax, %rdi
callq 0x41d0
movq %rbx, %rdi
callq 0x4290
leaq -0x78(%rbp), %rdi
callq 0x41b0
andb $0x1, %r15b
movl %r15d, %eax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x98(%rbp), %rdi
jmp 0xc226
jmp 0xc235
jmp 0xc235
movq %rax, %rbx
leaq -0xb8(%rbp), %rdi
jmp 0xc226
jmp 0xc235
jmp 0xc235
movq %rax, %rbx
leaq -0xd8(%rbp), %rdi
callq 0x41b0
jmp 0xc238
jmp 0xc235
jmp 0xc235
jmp 0xc235
jmp 0xc235
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
callq 0x41b0
movq %rbx, %rdi
callq 0x45d0
nop