// File: /workspace/github_cpp_makefile_star2_O3/Mirrvin[P]DragonsResurrectingInc/./specialists/BodySpecialist.cpp
// Function: BodySpecialist::handleFinishNeedBody(packet_t)
bool handleFinishNeedBody(packet_t packet) {    
        if(this->headRank == 0) {
            this->handlingNeedBody = false;
            std::sort(this->bodyList.begin(), this->bodyList.end(), comparePackets);
            std::sort(this->headList.begin(), this->headList.end(), comparePackets);
            unsigned int me = this->getSelfIndexFromBodyList();
            bool haveMatchingHead = (this->headList.size() > me) && (me < this->bodyList.size());
            if(haveMatchingHead) {               
                this->inTeam = true;
                this->sendMessage(NEED_BODY_POSITIVE, this->headList[me].status.MPI_SOURCE);
                
                if(me == 0) {
                    this->notifyHeadsWithNoBodiesAssigned();
                }
            }
        }
        return true;
    }

// Assembly:
cmpl $0x0, 0x18(%rdi)
jne 0x3723
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movb $0x0, 0x24(%rdi)
movq 0x40(%rdi), %r14
movq 0x48(%rdi), %r15
movabsq $-0x3333333333333333, %r13 # imm = 0xCCCCCCCCCCCCCCCD
cmpq %r15, %r14
je 0x3320
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 0x9d8(%rip), %rcx       # 0x39b6
movq %r14, %rdi
movq %r15, %rsi
callq 0x3a7b
cmpq $0x281, %r12            # imm = 0x281
jl 0x31f0
movl $0x28, %r12d
movq %r14, %rdi
leaq (%r14,%r12), %r13
movl 0x4(%r14,%r12), %eax
cmpl 0x4(%r14), %eax
jge 0x3058
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 0x3106
movl 0x8(%r13), %ecx
jne 0x3070
cmpl 0x8(%r14), %ecx
jb 0x300e
jne 0x3070
movl 0x10(%r13), %edx
cmpl 0x10(%r14), %edx
jl 0x300e
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 0x30cc
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 0x3092
jne 0x30e3
cmpl -0x20(%r9), %ecx
jb 0x3092
jne 0x30e3
cmpl -0x18(%r9), %esi
jl 0x3092
jmp 0x30e3
movq %r13, %r9
jne 0x30e3
cmpl 0x8(%rdi), %ecx
jb 0x3092
movq %r13, %r9
jne 0x30e3
movq %r13, %r9
cmpl 0x10(%rdi), %esi
jl 0x3092
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 0x2fff
leaq 0x280(%r14), %rax
cmpq %r15, %rax
movabsq $-0x3333333333333333, %r13 # imm = 0xCCCCCCCCCCCCCCCD
je 0x3320
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 0x319f
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 0x3193
jne 0x3199
cmpl 0x4(%r9), %esi
jb 0x3193
jne 0x3199
cmpl 0xc(%r9), %r8d
jge 0x3199
addq $-0x28, %r9
jmp 0x3162
addq $0x24, %r9
jmp 0x31b7
movq %rax, %r9
jne 0x31b7
cmpl -0x20(%rax), %esi
jb 0x315f
movq %rax, %r9
jne 0x31b7
movq %rax, %r9
cmpl -0x18(%rax), %r8d
jl 0x315f
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 0x313b
jmp 0x3320
leaq 0x28(%r14), %rax
cmpq %r15, %rax
je 0x3320
movq %r14, %rdi
movq %rax, %r12
movl 0x4(%rax), %eax
cmpl 0x4(%r14), %eax
jge 0x325b
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 0x330f
movl 0x8(%r12), %ecx
jne 0x3275
cmpl 0x8(%r14), %ecx
jb 0x320c
jne 0x3275
movl 0x10(%r12), %edx
cmpl 0x10(%r14), %edx
jl 0x320c
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 0x32d5
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 0x329b
jne 0x32ec
cmpl -0x20(%r9), %ecx
jb 0x329b
jne 0x32ec
cmpl -0x18(%r9), %esi
jl 0x329b
jmp 0x32ec
movq %r12, %r9
jne 0x32ec
cmpl 0x8(%rdi), %ecx
jb 0x329b
movq %r12, %r9
jne 0x32ec
movq %r12, %r9
cmpl 0x10(%rdi), %esi
jl 0x329b
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 0x3200
movq 0x28(%rbx), %r14
movq 0x30(%rbx), %r15
cmpq %r15, %r14
je 0x3698
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 0x660(%rip), %rcx       # 0x39b6
movq %r14, %rdi
movq %r15, %rsi
callq 0x3a7b
cmpq $0x281, %r12            # imm = 0x281
jl 0x3568
movl $0x28, %r12d
movq %r14, %rdi
leaq (%r14,%r12), %r13
movl 0x4(%r14,%r12), %eax
cmpl 0x4(%r14), %eax
jge 0x33d0
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 0x347e
movl 0x8(%r13), %ecx
jne 0x33e8
cmpl 0x8(%r14), %ecx
jb 0x3386
jne 0x33e8
movl 0x10(%r13), %edx
cmpl 0x10(%r14), %edx
jl 0x3386
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 0x3444
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 0x340a
jne 0x345b
cmpl -0x20(%r9), %ecx
jb 0x340a
jne 0x345b
cmpl -0x18(%r9), %esi
jl 0x340a
jmp 0x345b
movq %r13, %r9
jne 0x345b
cmpl 0x8(%rdi), %ecx
jb 0x340a
movq %r13, %r9
jne 0x345b
movq %r13, %r9
cmpl 0x10(%rdi), %esi
jl 0x340a
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 0x3377
leaq 0x280(%r14), %rax
cmpq %r15, %rax
movabsq $-0x3333333333333333, %r13 # imm = 0xCCCCCCCCCCCCCCCD
je 0x3698
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 0x3517
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 0x350b
jne 0x3511
cmpl 0x4(%r9), %esi
jb 0x350b
jne 0x3511
cmpl 0xc(%r9), %r8d
jge 0x3511
addq $-0x28, %r9
jmp 0x34da
addq $0x24, %r9
jmp 0x352f
movq %rax, %r9
jne 0x352f
cmpl -0x20(%rax), %esi
jb 0x34d7
movq %rax, %r9
jne 0x352f
movq %rax, %r9
cmpl -0x18(%rax), %r8d
jl 0x34d7
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 0x34b3
jmp 0x3698
leaq 0x28(%r14), %rax
cmpq %r15, %rax
je 0x3698
movq %r14, %rdi
movq %rax, %r12
movl 0x4(%rax), %eax
cmpl 0x4(%r14), %eax
jge 0x35d3
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 0x3687
movl 0x8(%r12), %ecx
jne 0x35ed
cmpl 0x8(%r14), %ecx
jb 0x3584
jne 0x35ed
movl 0x10(%r12), %edx
cmpl 0x10(%r14), %edx
jl 0x3584
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 0x364d
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 0x3613
jne 0x3664
cmpl -0x20(%r9), %ecx
jb 0x3613
jne 0x3664
cmpl -0x18(%r9), %esi
jl 0x3613
jmp 0x3664
movq %r12, %r9
jne 0x3664
cmpl 0x8(%rdi), %ecx
jb 0x3613
movq %r12, %r9
jne 0x3664
movq %r12, %r9
cmpl 0x10(%rdi), %esi
jl 0x3613
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 0x3578
movq 0x40(%rbx), %rdx
movq 0x48(%rbx), %rcx
movq %rcx, %rax
subq %rdx, %rax
sarq $0x3, %rax
imulq %r13, %rax
cmpq %rdx, %rcx
je 0x36c9
movl 0x8(%rbx), %esi
xorl %ecx, %ecx
leaq (%rcx,%rcx,4), %rdi
cmpl 0x10(%rdx,%rdi,8), %esi
je 0x36cb
incl %ecx
cmpq %rcx, %rax
ja 0x36b8
movl %eax, %ecx
movq 0x28(%rbx), %rdx
movq 0x30(%rbx), %rsi
subq %rdx, %rsi
sarq $0x3, %rsi
imulq %r13, %rsi
movl %ecx, %r14d
cmpq %r14, %rsi
jbe 0x3715
cmpq %r14, %rax
jbe 0x3715
movb $0x1, 0x10(%rbx)
leaq (%r14,%r14,4), %rax
movl 0x10(%rdx,%rax,8), %ecx
leaq -0x50(%rbp), %rdi
movq %rbx, %rsi
movl $0x6b, %edx
callq 0x5d68
testq %r14, %r14
jne 0x3715
movq %rbx, %rdi
callq 0x39e4
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
movb $0x1, %al
retq