// File: /workspace/github_cpp_makefile_star2_O3/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 0xa0f2
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 0xb43b
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 0x56fa
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 0xb4b3
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 0x9fe2
movl -0x68(%rbp), %eax
cmpl $0x8, %eax
je 0xb52a
cmpl $0x6, %eax
jne 0xb537
movq %r14, -0xe0(%rbp)
movq -0x60(%rbp), %rsi
movq -0x58(%rbp), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0x56fa
movq -0x40(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq %rbx, %rdi
movq %r13, %rsi
callq 0xf530
movq -0xe0(%rbp), %rdi
cmpq %r14, %rdi
jne 0xb5ec
jmp 0xb5f1
movq %rbx, %rdi
callq 0xee10
jmp 0xb5f1
andl $-0x3, %eax
cmpl $0x5, %eax
jne 0xb5f1
leaq -0x60(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x4050
testl %eax, %eax
je 0xb5a3
leaq -0xa8(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0x60(%rbp), %rsi
movq -0x58(%rbp), %rdx
addq %rsi, %rdx
leaq -0xb8(%rbp), %rdi
callq 0x56fa
movq -0x40(%rbp), %rax
movq %rax, -0x98(%rbp)
movq %rbx, %rdi
leaq -0xb8(%rbp), %rsi
callq 0xf5ae
movq -0xb8(%rbp), %rdi
leaq -0xa8(%rbp), %rax
jmp 0xb5e7
leaq -0x80(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x60(%rbp), %rsi
movq -0x58(%rbp), %rdx
addq %rsi, %rdx
leaq -0x90(%rbp), %rdi
callq 0x56fa
movq -0x40(%rbp), %rax
movq %rax, -0x70(%rbp)
movq %rbx, %rdi
leaq -0x90(%rbp), %rsi
callq 0xfd34
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0xb5f1
callq 0x4360
movq -0x60(%rbp), %rdi
cmpq %r15, %rdi
je 0xb4c9
callq 0x4360
jmp 0xb4c9
movq %rax, %rbx
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
jmp 0xb629
movq %rax, %rbx
movq -0xb8(%rbp), %rdi
leaq -0xa8(%rbp), %rax
cmpq %rax, %rdi
jne 0xb63f
jmp 0xb649
movq %rax, %rbx
movq -0xe0(%rbp), %rdi
cmpq %r14, %rdi
je 0xb649
callq 0x4360
jmp 0xb649
movq %rax, %rbx
movq -0x60(%rbp), %rdi
cmpq %r15, %rdi
je 0xb657
callq 0x4360
movq %rbx, %rdi
callq 0x4630
movq %rax, %rdi
callq 0xa583
nop