// File: /workspace/github_cpp_makefile_star2_O3/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 0x4f3c
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 0x4b52
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 -0xe5a(%rip), %rcx      # 0x39b6
movq %r14, %rdi
movq %r15, %rsi
callq 0x3a7b
cmpq $0x281, %r12            # imm = 0x281
jl 0x4a22
movl $0x28, %r12d
movq %r14, %rdi
leaq (%r14,%r12), %r13
movl 0x4(%r14,%r12), %eax
cmpl 0x4(%r14), %eax
jge 0x488a
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 0x4938
movl 0x8(%r13), %ecx
jne 0x48a2
cmpl 0x8(%r14), %ecx
jb 0x4840
jne 0x48a2
movl 0x10(%r13), %edx
cmpl 0x10(%r14), %edx
jl 0x4840
movl (%r13), %r8d
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
jge 0x48fe
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 0x48c4
jne 0x4915
cmpl -0x20(%r9), %ecx
jb 0x48c4
jne 0x4915
cmpl -0x18(%r9), %esi
jl 0x48c4
jmp 0x4915
movq %r13, %r9
jne 0x4915
cmpl 0x8(%rdi), %ecx
jb 0x48c4
movq %r13, %r9
jne 0x4915
movq %r13, %r9
cmpl 0x10(%rdi), %esi
jl 0x48c4
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 0x4831
leaq 0x280(%r14), %rax
cmpq %r15, %rax
movabsq $-0x3333333333333333, %r13 # imm = 0xCCCCCCCCCCCCCCCD
je 0x4b52
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 0x49d1
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 0x49c5
jne 0x49cb
cmpl 0x4(%r9), %esi
jb 0x49c5
jne 0x49cb
cmpl 0xc(%r9), %r8d
jge 0x49cb
addq $-0x28, %r9
jmp 0x4994
addq $0x24, %r9
jmp 0x49e9
movq %rax, %r9
jne 0x49e9
cmpl -0x20(%rax), %esi
jb 0x4991
movq %rax, %r9
jne 0x49e9
movq %rax, %r9
cmpl -0x18(%rax), %r8d
jl 0x4991
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 0x496d
jmp 0x4b52
leaq 0x28(%r14), %rax
cmpq %r15, %rax
je 0x4b52
movq %r14, %rdi
movq %rax, %r12
movl 0x4(%rax), %eax
cmpl 0x4(%r14), %eax
jge 0x4a8d
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 0x4b41
movl 0x8(%r12), %ecx
jne 0x4aa7
cmpl 0x8(%r14), %ecx
jb 0x4a3e
jne 0x4aa7
movl 0x10(%r12), %edx
cmpl 0x10(%r14), %edx
jl 0x4a3e
movl (%r12), %r8d
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
jge 0x4b07
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 0x4acd
jne 0x4b1e
cmpl -0x20(%r9), %ecx
jb 0x4acd
jne 0x4b1e
cmpl -0x18(%r9), %esi
jl 0x4acd
jmp 0x4b1e
movq %r12, %r9
jne 0x4b1e
cmpl 0x8(%rdi), %ecx
jb 0x4acd
movq %r12, %r9
jne 0x4b1e
movq %r12, %r9
cmpl 0x10(%rdi), %esi
jl 0x4acd
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 0x4a32
movq 0x48(%rbx), %r14
movq 0x50(%rbx), %r15
cmpq %r15, %r14
je 0x4eca
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 -0x11d2(%rip), %rcx     # 0x39b6
movq %r14, %rdi
movq %r15, %rsi
callq 0x3a7b
cmpq $0x281, %r12            # imm = 0x281
jl 0x4d9a
movl $0x28, %r12d
movq %r14, %rdi
leaq (%r14,%r12), %r13
movl 0x4(%r14,%r12), %eax
cmpl 0x4(%r14), %eax
jge 0x4c02
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 0x4cb0
movl 0x8(%r13), %ecx
jne 0x4c1a
cmpl 0x8(%r14), %ecx
jb 0x4bb8
jne 0x4c1a
movl 0x10(%r13), %edx
cmpl 0x10(%r14), %edx
jl 0x4bb8
movl (%r13), %r8d
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
jge 0x4c76
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 0x4c3c
jne 0x4c8d
cmpl -0x20(%r9), %ecx
jb 0x4c3c
jne 0x4c8d
cmpl -0x18(%r9), %esi
jl 0x4c3c
jmp 0x4c8d
movq %r13, %r9
jne 0x4c8d
cmpl 0x8(%rdi), %ecx
jb 0x4c3c
movq %r13, %r9
jne 0x4c8d
movq %r13, %r9
cmpl 0x10(%rdi), %esi
jl 0x4c3c
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 0x4ba9
leaq 0x280(%r14), %rax
cmpq %r15, %rax
movabsq $-0x3333333333333333, %r13 # imm = 0xCCCCCCCCCCCCCCCD
je 0x4eca
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 0x4d49
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 0x4d3d
jne 0x4d43
cmpl 0x4(%r9), %esi
jb 0x4d3d
jne 0x4d43
cmpl 0xc(%r9), %r8d
jge 0x4d43
addq $-0x28, %r9
jmp 0x4d0c
addq $0x24, %r9
jmp 0x4d61
movq %rax, %r9
jne 0x4d61
cmpl -0x20(%rax), %esi
jb 0x4d09
movq %rax, %r9
jne 0x4d61
movq %rax, %r9
cmpl -0x18(%rax), %r8d
jl 0x4d09
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 0x4ce5
jmp 0x4eca
leaq 0x28(%r14), %rax
cmpq %r15, %rax
je 0x4eca
movq %r14, %rdi
movq %rax, %r12
movl 0x4(%rax), %eax
cmpl 0x4(%r14), %eax
jge 0x4e05
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 0x4eb9
movl 0x8(%r12), %ecx
jne 0x4e1f
cmpl 0x8(%r14), %ecx
jb 0x4db6
jne 0x4e1f
movl 0x10(%r12), %edx
cmpl 0x10(%r14), %edx
jl 0x4db6
movl (%r12), %r8d
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
jge 0x4e7f
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 0x4e45
jne 0x4e96
cmpl -0x20(%r9), %ecx
jb 0x4e45
jne 0x4e96
cmpl -0x18(%r9), %esi
jl 0x4e45
jmp 0x4e96
movq %r12, %r9
jne 0x4e96
cmpl 0x8(%rdi), %ecx
jb 0x4e45
movq %r12, %r9
jne 0x4e96
movq %r12, %r9
cmpl 0x10(%rdi), %esi
jl 0x4e45
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 0x4daa
movq %rbx, %rdi
callq 0x51c8
movq 0x48(%rbx), %rcx
movq 0x50(%rbx), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
imulq %r13, %rdx
movl %eax, %r14d
cmpq %r14, %rdx
jbe 0x4f2e
movq 0x38(%rbx), %rax
subq 0x30(%rbx), %rax
sarq $0x3, %rax
imulq %r13, %rax
cmpq %r14, %rax
jbe 0x4f2e
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 0x5d68
testq %r14, %r14
jne 0x4f2e
movq %rbx, %rdi
callq 0x5216
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
movb $0x1, %al
retq
nop