// File: /workspace/github_cpp_makefile_star2_O1/luisremis[P]SDFS/FileSystem.cpp
// Function: FileSystem::updateThread()
void FileSystem::updateThread(){
    myNode = membership.getMyNode();
    myself.ip_str = myNode.ip_str;
    myself.key = hashString( myself.ip_str );

    while(true){

        MemberUpdateMsg msg = membership.pullMsgFromFileSysQueue();
        
        if(msg.type == MSG_JOIN){
            // cout<<"recv join msg: "<<msg.node.ip_str<<endl;
            //if(msg.node.ip_str.compare(myNode.ip_str) != 0)
                detectJoin( msg.node );
            //else
                //myselfJoin( msg.node );
        }
        else if(msg.type == MSG_JOIN_FINISH){
            myJoinFinished( );
        }
        else if(msg.type == MSG_LEAVE || msg.type == MSG_FAIL ){
            // cout<<"recv leave msg: "<<msg.node.ip_str<<endl;
            if( msg.node.ip_str.compare(myNode.ip_str) != 0 )
                detectLeave( msg.node );
            else
                myselfLeave( msg.node );
        }
        //printVirtualRing();
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rdi, %rbx
movq 0x208(%rdi), %rsi
leaq -0x68(%rbp), %r15
movq %r15, %rdi
callq 0xa1e4
leaq 0x2c0(%rbx), %rdi
movq %rdi, -0x30(%rbp)
movq %r15, %rsi
callq 0x4410
movq 0x20(%r15), %rax
movq %rax, 0x2e0(%rbx)
movq (%r15), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0xb573
callq 0x4360
leaq 0x298(%rbx), %rdi
movq -0x30(%rbp), %rsi
callq 0x4210
leaq -0xf0(%rbp), %r14
movq %r14, -0x10(%r14)
movq 0x298(%rbx), %rsi
movq 0x2a0(%rbx), %rdx
addq %rsi, %rdx
leaq -0x100(%rbp), %r15
movq %r15, %rdi
callq 0x570a
movq (%r15), %rdi
movq 0x8(%r15), %rsi
movl $0xc70f6907, %edx       # imm = 0xC70F6907
callq 0x40c0
movl %eax, %ecx
imulq $0x10624dd3, %rcx, %rcx # imm = 0x10624DD3
shrq $0x26, %rcx
imull $0x3e8, %ecx, %ecx      # imm = 0x3E8
subl %ecx, %eax
movl %eax, 0x2b8(%rbx)
movq -0x100(%rbp), %rdi
cmpq %r14, %rdi
je 0xb5eb
callq 0x4360
leaq -0xd0(%rbp), %r14
leaq -0x50(%rbp), %r15
leaq -0x68(%rbp), %r12
leaq -0xe0(%rbp), %r13
movq 0x208(%rbx), %rsi
movq %r12, %rdi
callq 0xa0d0
movl -0x68(%rbp), %eax
cmpl $0x8, %eax
je 0xb662
cmpl $0x6, %eax
jne 0xb66f
movq %r14, -0xe0(%rbp)
movq -0x60(%rbp), %rsi
movq -0x58(%rbp), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0x570a
movq -0x40(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq %rbx, %rdi
movq %r13, %rsi
callq 0xf664
movq -0xe0(%rbp), %rdi
cmpq %r14, %rdi
jne 0xb724
jmp 0xb729
movq %rbx, %rdi
callq 0xef5c
jmp 0xb729
andl $-0x3, %eax
cmpl $0x5, %eax
jne 0xb729
leaq -0x60(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x4050
testl %eax, %eax
je 0xb6db
leaq -0xa8(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0x60(%rbp), %rsi
movq -0x58(%rbp), %rdx
addq %rsi, %rdx
leaq -0xb8(%rbp), %rdi
callq 0x570a
movq -0x40(%rbp), %rax
movq %rax, -0x98(%rbp)
movq %rbx, %rdi
leaq -0xb8(%rbp), %rsi
callq 0xf6e2
movq -0xb8(%rbp), %rdi
leaq -0xa8(%rbp), %rax
jmp 0xb71f
leaq -0x80(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x60(%rbp), %rsi
movq -0x58(%rbp), %rdx
addq %rsi, %rdx
leaq -0x90(%rbp), %rdi
callq 0x570a
movq -0x40(%rbp), %rax
movq %rax, -0x70(%rbp)
movq %rbx, %rdi
leaq -0x90(%rbp), %rsi
callq 0xfe72
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0xb729
callq 0x4360
movq -0x60(%rbp), %rdi
cmpq %r15, %rdi
je 0xb601
callq 0x4360
jmp 0xb601
movq %rax, %rbx
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
jmp 0xb761
movq %rax, %rbx
movq -0xb8(%rbp), %rdi
leaq -0xa8(%rbp), %rax
cmpq %rax, %rdi
jne 0xb777
jmp 0xb781
movq %rax, %rbx
movq -0xe0(%rbp), %rdi
cmpq %r14, %rdi
je 0xb781
callq 0x4360
jmp 0xb781
movq %rax, %rbx
movq -0x60(%rbp), %rdi
cmpq %r15, %rdi
je 0xb78f
callq 0x4360
movq %rbx, %rdi
callq 0x4630
movq %rax, %rdi
callq 0xa677
nop