// File: /workspace/github_cpp_makefile_star2_O1/Mirrvin[P]DragonsResurrectingInc/./specialists/TailSpecialist.cpp
// Function: TailSpecialist::handleFinishNeedTail(packet_t)
bool handleFinishNeedTail(packet_t packet) {
        if(!this->inTeam) {
            this->handlingNeedTail = false;
            std::sort(this->tailList.begin(), this->tailList.end(), comparePackets);
            std::sort(this->bodyList.begin(), this->bodyList.end(), comparePackets);
            unsigned int me = this->getSelfIndexFromTailList();
            bool haveMatchingBody = (this->bodyList.size() > me) && (me < this->tailList.size());
            if(haveMatchingBody) {
                // this->inTeam = true;
                // this->bodyRank = this->bodyList[me].status.MPI_SOURCE;
                this->headRank = this->bodyList[me].data;
                this->sendMessage(NEED_TAIL_POSITIVE, this->bodyList[me].status.MPI_SOURCE);
                if(me == 0) {
                    this->notifyBodiesWithNoTailsAssigned();
                }
                // this->sendMessage(AVENGERS_ASSEMBLED, this->rank);
                // this->sendMessage(AVENGERS_ASSEMBLED, this->headRank);
            }
        }
        return true;
    }

// Assembly:
cmpb $0x0, 0x10(%rdi)
jne 0x511e
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movb $0x0, 0x28(%rdi)
movq 0x30(%rdi), %r14
movq 0x38(%rdi), %r15
movabsq $-0x3333333333333333, %r13 # imm = 0xCCCCCCCCCCCCCCCD
cmpq %r15, %r14
je 0x4ce3
movq %r15, %r12
subq %r14, %r12
movq %r12, %rax
sarq $0x3, %rax
imulq %r13, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
leaq -0xec2(%rip), %rcx      # 0x3a8e
movq %r14, %rdi
movq %r15, %rsi
callq 0x3b6b
cmpq $0x281, %r12            # imm = 0x281
jl 0x4b95
movl $0x28, %r12d
movq %r14, %rdi
leaq (%r14,%r12), %r13
movl 0x4(%r14,%r12), %eax
cmpl 0x4(%r14), %eax
jge 0x49ca
movq 0x20(%r13), %rax
movq %rax, -0x30(%rbp)
movups (%r13), %xmm0
movups 0x10(%r13), %xmm1
movaps %xmm1, -0x40(%rbp)
movaps %xmm0, -0x50(%rbp)
subq %r12, %rdi
addq $0x50, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x21b0
movaps -0x50(%rbp), %xmm0
movaps -0x40(%rbp), %xmm1
movups %xmm0, (%r14)
movups %xmm1, 0x10(%r14)
movq -0x30(%rbp), %rax
movq %rax, 0x20(%r14)
jmp 0x4a95
jne 0x49ea
movl 0x8(%r14), %ecx
cmpl %ecx, 0x8(%r13)
setb %cl
jb 0x49e6
jne 0x49ea
movl 0x10(%r13), %ecx
cmpl 0x10(%r14), %ecx
setl %cl
testb %cl, %cl
jne 0x4980
movl (%r13), %r8d
movl 0x8(%r13), %ecx
movl 0xc(%r13), %edx
movl 0x10(%r13), %esi
movl 0x24(%r13), %r9d
movl %r9d, -0x40(%rbp)
movups 0x14(%r13), %xmm0
movaps %xmm0, -0x50(%rbp)
cmpl 0x4(%rdi), %eax
jl 0x4a2f
movq %r13, %r9
jne 0x4a72
cmpl 0x8(%rdi), %ecx
setb %r10b
jb 0x4a2a
movq %r13, %r9
jne 0x4a72
cmpl 0x10(%rdi), %esi
setl %r10b
movq %r13, %r9
jmp 0x4a6d
movq %rdi, %r9
movq 0x20(%rdi), %rdi
movq %rdi, 0x48(%r9)
movups 0x10(%r9), %xmm0
movups %xmm0, 0x38(%r9)
movups (%r9), %xmm0
movups %xmm0, 0x28(%r9)
leaq -0x28(%r9), %rdi
cmpl -0x24(%r9), %eax
jl 0x4a2f
jne 0x4a72
cmpl -0x20(%r9), %ecx
setb %r10b
jb 0x4a6d
jne 0x4a72
cmpl -0x18(%r9), %esi
setl %r10b
testb %r10b, %r10b
jne 0x4a2f
movl %r8d, (%r9)
movl %eax, 0x4(%r9)
movl %ecx, 0x8(%r9)
movl %edx, 0xc(%r9)
movl %esi, 0x10(%r9)
movaps -0x50(%rbp), %xmm0
movups %xmm0, 0x14(%r9)
movl -0x40(%rbp), %eax
movl %eax, 0x24(%r9)
addq $0x28, %r12
movq %r13, %rdi
cmpq $0x280, %r12            # imm = 0x280
jne 0x4971
leaq 0x280(%r14), %rax
cmpq %r15, %rax
movabsq $-0x3333333333333333, %r13 # imm = 0xCCCCCCCCCCCCCCCD
je 0x4ce3
addq $0x234, %r14            # imm = 0x234
movl (%rax), %ecx
movl 0x4(%rax), %edx
movl 0x8(%rax), %esi
movl 0xc(%rax), %edi
movl 0x10(%rax), %r8d
movl 0x24(%rax), %r9d
movl %r9d, -0x40(%rbp)
movups 0x14(%rax), %xmm0
movaps %xmm0, -0x50(%rbp)
cmpl -0x24(%rax), %edx
jge 0x4b39
movq %r14, %r9
movq 0x44(%r9), %r10
movq %r10, 0x6c(%r9)
movups 0x34(%r9), %xmm0
movups %xmm0, 0x5c(%r9)
movups 0x24(%r9), %xmm0
movups %xmm0, 0x4c(%r9)
cmpl (%r9), %edx
jl 0x4b2d
jne 0x4b33
cmpl 0x4(%r9), %esi
setb %r10b
jb 0x4b28
jne 0x4b33
cmpl 0xc(%r9), %r8d
setl %r10b
testb %r10b, %r10b
je 0x4b33
addq $-0x28, %r9
jmp 0x4af1
addq $0x24, %r9
jmp 0x4b5c
movq %rax, %r9
jne 0x4b5c
cmpl -0x20(%rax), %esi
setb %r10b
jb 0x4b54
movq %rax, %r9
jne 0x4b5c
cmpl -0x18(%rax), %r8d
setl %r10b
movq %rax, %r9
testb %r10b, %r10b
jne 0x4aee
movl %ecx, (%r9)
movl %edx, 0x4(%r9)
movl %esi, 0x8(%r9)
movl %edi, 0xc(%r9)
movl %r8d, 0x10(%r9)
movaps -0x50(%rbp), %xmm0
movups %xmm0, 0x14(%r9)
movl -0x40(%rbp), %ecx
movl %ecx, 0x24(%r9)
addq $0x28, %rax
addq $0x28, %r14
cmpq %r15, %rax
jne 0x4aca
jmp 0x4ce3
leaq 0x28(%r14), %rax
cmpq %r15, %rax
je 0x4ce3
movq %r14, %rdi
movq %rax, %r12
movl 0x4(%rax), %eax
cmpl 0x4(%r14), %eax
jge 0x4c00
movq 0x20(%r12), %rax
movq %rax, -0x30(%rbp)
movups (%r12), %xmm0
movups 0x10(%r12), %xmm1
movaps %xmm1, -0x40(%rbp)
movaps %xmm0, -0x50(%rbp)
movq %r12, %rdx
subq %r14, %rdx
subq %rdx, %rdi
addq $0x50, %rdi
movq %r14, %rsi
callq 0x21b0
movaps -0x50(%rbp), %xmm0
movaps -0x40(%rbp), %xmm1
movups %xmm0, (%r14)
movups %xmm1, 0x10(%r14)
movq -0x30(%rbp), %rax
movq %rax, 0x20(%r14)
jmp 0x4cd2
jne 0x4c22
movl 0x8(%r14), %ecx
cmpl %ecx, 0x8(%r12)
setb %cl
jb 0x4c1e
jne 0x4c22
movl 0x10(%r12), %ecx
cmpl 0x10(%r14), %ecx
setl %cl
testb %cl, %cl
jne 0x4bb1
movl (%r12), %r8d
movl 0x8(%r12), %ecx
movl 0xc(%r12), %edx
movl 0x10(%r12), %esi
movl 0x24(%r12), %r9d
movl %r9d, -0x40(%rbp)
movups 0x14(%r12), %xmm0
movaps %xmm0, -0x50(%rbp)
cmpl 0x4(%rdi), %eax
jl 0x4c6c
movq %r12, %r9
jne 0x4caf
cmpl 0x8(%rdi), %ecx
setb %r10b
jb 0x4c67
movq %r12, %r9
jne 0x4caf
cmpl 0x10(%rdi), %esi
setl %r10b
movq %r12, %r9
jmp 0x4caa
movq %rdi, %r9
movq 0x20(%rdi), %rdi
movq %rdi, 0x48(%r9)
movups 0x10(%r9), %xmm0
movups %xmm0, 0x38(%r9)
movups (%r9), %xmm0
movups %xmm0, 0x28(%r9)
leaq -0x28(%r9), %rdi
cmpl -0x24(%r9), %eax
jl 0x4c6c
jne 0x4caf
cmpl -0x20(%r9), %ecx
setb %r10b
jb 0x4caa
jne 0x4caf
cmpl -0x18(%r9), %esi
setl %r10b
testb %r10b, %r10b
jne 0x4c6c
movl %r8d, (%r9)
movl %eax, 0x4(%r9)
movl %ecx, 0x8(%r9)
movl %edx, 0xc(%r9)
movl %esi, 0x10(%r9)
movaps -0x50(%rbp), %xmm0
movups %xmm0, 0x14(%r9)
movl -0x40(%rbp), %eax
movl %eax, 0x24(%r9)
leaq 0x28(%r12), %rax
movq %r12, %rdi
cmpq %r15, %rax
jne 0x4ba5
movq 0x48(%rbx), %r14
movq 0x50(%rbx), %r15
cmpq %r15, %r14
je 0x50ac
movq %r15, %r12
subq %r14, %r12
movq %r12, %rax
sarq $0x3, %rax
imulq %r13, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
leaq -0x128b(%rip), %rcx     # 0x3a8e
movq %r14, %rdi
movq %r15, %rsi
callq 0x3b6b
cmpq $0x281, %r12            # imm = 0x281
jl 0x4f5e
movl $0x28, %r12d
movq %r14, %rdi
leaq (%r14,%r12), %r13
movl 0x4(%r14,%r12), %eax
cmpl 0x4(%r14), %eax
jge 0x4d93
movq 0x20(%r13), %rax
movq %rax, -0x30(%rbp)
movups (%r13), %xmm0
movups 0x10(%r13), %xmm1
movaps %xmm1, -0x40(%rbp)
movaps %xmm0, -0x50(%rbp)
subq %r12, %rdi
addq $0x50, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x21b0
movaps -0x50(%rbp), %xmm0
movaps -0x40(%rbp), %xmm1
movups %xmm0, (%r14)
movups %xmm1, 0x10(%r14)
movq -0x30(%rbp), %rax
movq %rax, 0x20(%r14)
jmp 0x4e5e
jne 0x4db3
movl 0x8(%r14), %ecx
cmpl %ecx, 0x8(%r13)
setb %cl
jb 0x4daf
jne 0x4db3
movl 0x10(%r13), %ecx
cmpl 0x10(%r14), %ecx
setl %cl
testb %cl, %cl
jne 0x4d49
movl (%r13), %r8d
movl 0x8(%r13), %ecx
movl 0xc(%r13), %edx
movl 0x10(%r13), %esi
movl 0x24(%r13), %r9d
movl %r9d, -0x40(%rbp)
movups 0x14(%r13), %xmm0
movaps %xmm0, -0x50(%rbp)
cmpl 0x4(%rdi), %eax
jl 0x4df8
movq %r13, %r9
jne 0x4e3b
cmpl 0x8(%rdi), %ecx
setb %r10b
jb 0x4df3
movq %r13, %r9
jne 0x4e3b
cmpl 0x10(%rdi), %esi
setl %r10b
movq %r13, %r9
jmp 0x4e36
movq %rdi, %r9
movq 0x20(%rdi), %rdi
movq %rdi, 0x48(%r9)
movups 0x10(%r9), %xmm0
movups %xmm0, 0x38(%r9)
movups (%r9), %xmm0
movups %xmm0, 0x28(%r9)
leaq -0x28(%r9), %rdi
cmpl -0x24(%r9), %eax
jl 0x4df8
jne 0x4e3b
cmpl -0x20(%r9), %ecx
setb %r10b
jb 0x4e36
jne 0x4e3b
cmpl -0x18(%r9), %esi
setl %r10b
testb %r10b, %r10b
jne 0x4df8
movl %r8d, (%r9)
movl %eax, 0x4(%r9)
movl %ecx, 0x8(%r9)
movl %edx, 0xc(%r9)
movl %esi, 0x10(%r9)
movaps -0x50(%rbp), %xmm0
movups %xmm0, 0x14(%r9)
movl -0x40(%rbp), %eax
movl %eax, 0x24(%r9)
addq $0x28, %r12
movq %r13, %rdi
cmpq $0x280, %r12            # imm = 0x280
jne 0x4d3a
leaq 0x280(%r14), %rax
cmpq %r15, %rax
movabsq $-0x3333333333333333, %r13 # imm = 0xCCCCCCCCCCCCCCCD
je 0x50ac
addq $0x234, %r14            # imm = 0x234
movl (%rax), %ecx
movl 0x4(%rax), %edx
movl 0x8(%rax), %esi
movl 0xc(%rax), %edi
movl 0x10(%rax), %r8d
movl 0x24(%rax), %r9d
movl %r9d, -0x40(%rbp)
movups 0x14(%rax), %xmm0
movaps %xmm0, -0x50(%rbp)
cmpl -0x24(%rax), %edx
jge 0x4f02
movq %r14, %r9
movq 0x44(%r9), %r10
movq %r10, 0x6c(%r9)
movups 0x34(%r9), %xmm0
movups %xmm0, 0x5c(%r9)
movups 0x24(%r9), %xmm0
movups %xmm0, 0x4c(%r9)
cmpl (%r9), %edx
jl 0x4ef6
jne 0x4efc
cmpl 0x4(%r9), %esi
setb %r10b
jb 0x4ef1
jne 0x4efc
cmpl 0xc(%r9), %r8d
setl %r10b
testb %r10b, %r10b
je 0x4efc
addq $-0x28, %r9
jmp 0x4eba
addq $0x24, %r9
jmp 0x4f25
movq %rax, %r9
jne 0x4f25
cmpl -0x20(%rax), %esi
setb %r10b
jb 0x4f1d
movq %rax, %r9
jne 0x4f25
cmpl -0x18(%rax), %r8d
setl %r10b
movq %rax, %r9
testb %r10b, %r10b
jne 0x4eb7
movl %ecx, (%r9)
movl %edx, 0x4(%r9)
movl %esi, 0x8(%r9)
movl %edi, 0xc(%r9)
movl %r8d, 0x10(%r9)
movaps -0x50(%rbp), %xmm0
movups %xmm0, 0x14(%r9)
movl -0x40(%rbp), %ecx
movl %ecx, 0x24(%r9)
addq $0x28, %rax
addq $0x28, %r14
cmpq %r15, %rax
jne 0x4e93
jmp 0x50ac
leaq 0x28(%r14), %rax
cmpq %r15, %rax
je 0x50ac
movq %r14, %rdi
movq %rax, %r12
movl 0x4(%rax), %eax
cmpl 0x4(%r14), %eax
jge 0x4fc9
movq 0x20(%r12), %rax
movq %rax, -0x30(%rbp)
movups (%r12), %xmm0
movups 0x10(%r12), %xmm1
movaps %xmm1, -0x40(%rbp)
movaps %xmm0, -0x50(%rbp)
movq %r12, %rdx
subq %r14, %rdx
subq %rdx, %rdi
addq $0x50, %rdi
movq %r14, %rsi
callq 0x21b0
movaps -0x50(%rbp), %xmm0
movaps -0x40(%rbp), %xmm1
movups %xmm0, (%r14)
movups %xmm1, 0x10(%r14)
movq -0x30(%rbp), %rax
movq %rax, 0x20(%r14)
jmp 0x509b
jne 0x4feb
movl 0x8(%r14), %ecx
cmpl %ecx, 0x8(%r12)
setb %cl
jb 0x4fe7
jne 0x4feb
movl 0x10(%r12), %ecx
cmpl 0x10(%r14), %ecx
setl %cl
testb %cl, %cl
jne 0x4f7a
movl (%r12), %r8d
movl 0x8(%r12), %ecx
movl 0xc(%r12), %edx
movl 0x10(%r12), %esi
movl 0x24(%r12), %r9d
movl %r9d, -0x40(%rbp)
movups 0x14(%r12), %xmm0
movaps %xmm0, -0x50(%rbp)
cmpl 0x4(%rdi), %eax
jl 0x5035
movq %r12, %r9
jne 0x5078
cmpl 0x8(%rdi), %ecx
setb %r10b
jb 0x5030
movq %r12, %r9
jne 0x5078
cmpl 0x10(%rdi), %esi
setl %r10b
movq %r12, %r9
jmp 0x5073
movq %rdi, %r9
movq 0x20(%rdi), %rdi
movq %rdi, 0x48(%r9)
movups 0x10(%r9), %xmm0
movups %xmm0, 0x38(%r9)
movups (%r9), %xmm0
movups %xmm0, 0x28(%r9)
leaq -0x28(%r9), %rdi
cmpl -0x24(%r9), %eax
jl 0x5035
jne 0x5078
cmpl -0x20(%r9), %ecx
setb %r10b
jb 0x5073
jne 0x5078
cmpl -0x18(%r9), %esi
setl %r10b
testb %r10b, %r10b
jne 0x5035
movl %r8d, (%r9)
movl %eax, 0x4(%r9)
movl %ecx, 0x8(%r9)
movl %edx, 0xc(%r9)
movl %esi, 0x10(%r9)
movaps -0x50(%rbp), %xmm0
movups %xmm0, 0x14(%r9)
movl -0x40(%rbp), %eax
movl %eax, 0x24(%r9)
leaq 0x28(%r12), %rax
movq %r12, %rdi
cmpq %r15, %rax
jne 0x4f6e
movq %rbx, %rdi
callq 0x53d8
movq 0x48(%rbx), %rcx
movq 0x50(%rbx), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
imulq %r13, %rdx
movl %eax, %r14d
cmpq %r14, %rdx
jbe 0x5110
movq 0x38(%rbx), %rax
subq 0x30(%rbx), %rax
sarq $0x3, %rax
imulq %r13, %rax
cmpq %r14, %rax
jbe 0x5110
leaq (%r14,%r14,4), %rax
movl (%rcx,%rax,8), %edx
movl %edx, 0x18(%rbx)
movl 0x10(%rcx,%rax,8), %ecx
leaq -0x50(%rbp), %rdi
movq %rbx, %rsi
movl $0x6f, %edx
callq 0x5fa0
testq %r14, %r14
jne 0x5110
movq %rbx, %rdi
callq 0x543a
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
movb $0x1, %al
retq
nop