// File: /workspace/github_cpp_makefile_star2_O1/devanshdalal[P]cloud-computing-concepts-part-2/MP1Node.cpp
// Function: MP1Node::AddNode(int)
void MP1Node::AddNode(int node)
{
    if (m_.find(node) != m_.end())
        return;
    m_.insert(node);
    memberNode->memberList.emplace_back(node, 0);
    if (node == this_node_)
    {
        memberNode->inGroup = 1;
    }
    Address a(std::to_string(node) + ":0");
#ifdef DEBUGLOG
    log->logNodeAdd(&memberNode->addr, &a);
#endif
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdi, %rbx
movl %esi, 0xc(%rsp)
movslq %esi, %rax
movq 0x30(%rdi), %rdi
movq 0x38(%rbx), %r8
xorl %r10d, %r10d
xorl %edx, %edx
divq %r8
movq (%rdi,%rdx,8), %rax
testq %rax, %rax
je 0x3e60
movq (%rax), %r9
movq %rax, %r10
cmpl %esi, 0x8(%r9)
je 0x3e60
movq %rdx, %rcx
movq %r9, %r11
movq (%r9), %r9
testq %r9, %r9
je 0x3e5d
movslq 0x8(%r9), %rdi
movq %rdi, %rax
xorl %edx, %edx
divq %r8
movl $0x0, %r10d
cmpq %rcx, %rdx
jne 0x3e60
movq %r11, %r10
cmpl %esi, %edi
jne 0x3e32
jmp 0x3e60
xorl %r10d, %r10d
testq %r10, %r10
je 0x3e6f
cmpq $0x0, (%r10)
jne 0x3ff5
leaq 0x30(%rbx), %rdi
leaq 0x18(%rsp), %r14
movq %rdi, (%r14)
leaq 0xc(%rsp), %r15
movq %r15, %rsi
movq %r14, %rdx
callq 0x5dc6
movq 0x20(%rbx), %rdi
addq $0x28, %rdi
movl $0x0, (%r14)
leaq 0x18(%rsp), %rdx
movq %r15, %rsi
callq 0x579e
movl (%r15), %r13d
cmpl 0xa4(%rbx), %r13d
jne 0x3ebb
movq 0x20(%rbx), %rax
movb $0x1, 0xf(%rax)
movl %r13d, %ebp
negl %ebp
cmovsl %r13d, %ebp
movl $0x1, %r14d
cmpl $0xa, %ebp
jb 0x3f18
movl $0x4, %r14d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x3f0f
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x3f15
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x3f18
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r14d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x3edc
addl $-0x3, %r14d
jmp 0x3f18
addl $-0x2, %r14d
jmp 0x3f18
decl %r14d
shrl $0x1f, %r13d
movl %r13d, %esi
addl %r14d, %esi
leaq 0x28(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x18(%rsp), %r15
movq %r15, %rdi
movl $0x2d, %edx
callq 0x32f0
movq (%r15), %rdi
addq %r13, %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0x5d13
leaq 0x140f3(%rip), %rsi     # 0x18048
movq %r15, %rdi
callq 0x34a0
leaq 0x48(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x3f84
movq %rdx, 0x38(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x48(%rsp)
jmp 0x3f8b
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
leaq 0x38(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x12(%rsp), %rdi
callq 0x57dc
movq 0x38(%rsp), %rdi
cmpq %r14, %rdi
je 0x3fc8
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x18(%rsp), %rdi
cmpq %r12, %rdi
je 0x3fdf
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x10(%rbx), %rdi
movq 0x20(%rbx), %rsi
addq $0x8, %rsi
leaq 0x12(%rsp), %rdx
callq 0xc48c
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x38(%rsp), %rdi
cmpq %r14, %rdi
je 0x4023
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x3280
jmp 0x4023
movq %rax, %rbx
movq 0x18(%rsp), %rdi
cmpq %r12, %rdi
je 0x403a
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x3280
movq %rbx, %rdi
callq 0x3470