// File: /workspace/github_cpp_makefile_star2_O1/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 0x37fb
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 0x337f
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 0xaa2(%rip), %rcx       # 0x3a8e
movq %r14, %rdi
movq %r15, %rsi
callq 0x3b6b
cmpq $0x281, %r12            # imm = 0x281
jl 0x3231
movl $0x28, %r12d
movq %r14, %rdi
leaq (%r14,%r12), %r13
movl 0x4(%r14,%r12), %eax
cmpl 0x4(%r14), %eax
jge 0x3066
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 0x3131
jne 0x3086
movl 0x8(%r14), %ecx
cmpl %ecx, 0x8(%r13)
setb %cl
jb 0x3082
jne 0x3086
movl 0x10(%r13), %ecx
cmpl 0x10(%r14), %ecx
setl %cl
testb %cl, %cl
jne 0x301c
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 0x30cb
movq %r13, %r9
jne 0x310e
cmpl 0x8(%rdi), %ecx
setb %r10b
jb 0x30c6
movq %r13, %r9
jne 0x310e
cmpl 0x10(%rdi), %esi
setl %r10b
movq %r13, %r9
jmp 0x3109
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 0x30cb
jne 0x310e
cmpl -0x20(%r9), %ecx
setb %r10b
jb 0x3109
jne 0x310e
cmpl -0x18(%r9), %esi
setl %r10b
testb %r10b, %r10b
jne 0x30cb
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 0x300d
leaq 0x280(%r14), %rax
cmpq %r15, %rax
movabsq $-0x3333333333333333, %r13 # imm = 0xCCCCCCCCCCCCCCCD
je 0x337f
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 0x31d5
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 0x31c9
jne 0x31cf
cmpl 0x4(%r9), %esi
setb %r10b
jb 0x31c4
jne 0x31cf
cmpl 0xc(%r9), %r8d
setl %r10b
testb %r10b, %r10b
je 0x31cf
addq $-0x28, %r9
jmp 0x318d
addq $0x24, %r9
jmp 0x31f8
movq %rax, %r9
jne 0x31f8
cmpl -0x20(%rax), %esi
setb %r10b
jb 0x31f0
movq %rax, %r9
jne 0x31f8
cmpl -0x18(%rax), %r8d
setl %r10b
movq %rax, %r9
testb %r10b, %r10b
jne 0x318a
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 0x3166
jmp 0x337f
leaq 0x28(%r14), %rax
cmpq %r15, %rax
je 0x337f
movq %r14, %rdi
movq %rax, %r12
movl 0x4(%rax), %eax
cmpl 0x4(%r14), %eax
jge 0x329c
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 0x336e
jne 0x32be
movl 0x8(%r14), %ecx
cmpl %ecx, 0x8(%r12)
setb %cl
jb 0x32ba
jne 0x32be
movl 0x10(%r12), %ecx
cmpl 0x10(%r14), %ecx
setl %cl
testb %cl, %cl
jne 0x324d
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 0x3308
movq %r12, %r9
jne 0x334b
cmpl 0x8(%rdi), %ecx
setb %r10b
jb 0x3303
movq %r12, %r9
jne 0x334b
cmpl 0x10(%rdi), %esi
setl %r10b
movq %r12, %r9
jmp 0x3346
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 0x3308
jne 0x334b
cmpl -0x20(%r9), %ecx
setb %r10b
jb 0x3346
jne 0x334b
cmpl -0x18(%r9), %esi
setl %r10b
testb %r10b, %r10b
jne 0x3308
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 0x3241
movq 0x28(%rbx), %r14
movq 0x30(%rbx), %r15
cmpq %r15, %r14
je 0x3748
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 0x6d9(%rip), %rcx       # 0x3a8e
movq %r14, %rdi
movq %r15, %rsi
callq 0x3b6b
cmpq $0x281, %r12            # imm = 0x281
jl 0x35fa
movl $0x28, %r12d
movq %r14, %rdi
leaq (%r14,%r12), %r13
movl 0x4(%r14,%r12), %eax
cmpl 0x4(%r14), %eax
jge 0x342f
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 0x34fa
jne 0x344f
movl 0x8(%r14), %ecx
cmpl %ecx, 0x8(%r13)
setb %cl
jb 0x344b
jne 0x344f
movl 0x10(%r13), %ecx
cmpl 0x10(%r14), %ecx
setl %cl
testb %cl, %cl
jne 0x33e5
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 0x3494
movq %r13, %r9
jne 0x34d7
cmpl 0x8(%rdi), %ecx
setb %r10b
jb 0x348f
movq %r13, %r9
jne 0x34d7
cmpl 0x10(%rdi), %esi
setl %r10b
movq %r13, %r9
jmp 0x34d2
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 0x3494
jne 0x34d7
cmpl -0x20(%r9), %ecx
setb %r10b
jb 0x34d2
jne 0x34d7
cmpl -0x18(%r9), %esi
setl %r10b
testb %r10b, %r10b
jne 0x3494
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 0x33d6
leaq 0x280(%r14), %rax
cmpq %r15, %rax
movabsq $-0x3333333333333333, %r13 # imm = 0xCCCCCCCCCCCCCCCD
je 0x3748
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 0x359e
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 0x3592
jne 0x3598
cmpl 0x4(%r9), %esi
setb %r10b
jb 0x358d
jne 0x3598
cmpl 0xc(%r9), %r8d
setl %r10b
testb %r10b, %r10b
je 0x3598
addq $-0x28, %r9
jmp 0x3556
addq $0x24, %r9
jmp 0x35c1
movq %rax, %r9
jne 0x35c1
cmpl -0x20(%rax), %esi
setb %r10b
jb 0x35b9
movq %rax, %r9
jne 0x35c1
cmpl -0x18(%rax), %r8d
setl %r10b
movq %rax, %r9
testb %r10b, %r10b
jne 0x3553
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 0x352f
jmp 0x3748
leaq 0x28(%r14), %rax
cmpq %r15, %rax
je 0x3748
movq %r14, %rdi
movq %rax, %r12
movl 0x4(%rax), %eax
cmpl 0x4(%r14), %eax
jge 0x3665
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 0x3737
jne 0x3687
movl 0x8(%r14), %ecx
cmpl %ecx, 0x8(%r12)
setb %cl
jb 0x3683
jne 0x3687
movl 0x10(%r12), %ecx
cmpl 0x10(%r14), %ecx
setl %cl
testb %cl, %cl
jne 0x3616
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 0x36d1
movq %r12, %r9
jne 0x3714
cmpl 0x8(%rdi), %ecx
setb %r10b
jb 0x36cc
movq %r12, %r9
jne 0x3714
cmpl 0x10(%rdi), %esi
setl %r10b
movq %r12, %r9
jmp 0x370f
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 0x36d1
jne 0x3714
cmpl -0x20(%r9), %ecx
setb %r10b
jb 0x370f
jne 0x3714
cmpl -0x18(%r9), %esi
setl %r10b
testb %r10b, %r10b
jne 0x36d1
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 0x360a
movq 0x40(%rbx), %rax
movq 0x48(%rbx), %rdx
movq %rdx, %r14
subq %rax, %r14
sarq $0x3, %r14
imulq %r13, %r14
xorl %ecx, %ecx
cmpq %rax, %rdx
setne %dl
je 0x3791
movl 0x8(%rbx), %esi
movb $0x1, %dl
cmpl 0x10(%rax), %esi
je 0x3791
movl $0x1, %edi
movl %edi, %ecx
movl %edi, %edi
cmpq %rdi, %r14
seta %dl
jbe 0x3791
leaq (%rdi,%rdi,4), %r8
leal 0x1(%rcx), %edi
cmpl 0x10(%rax,%r8,8), %esi
jne 0x3777
testb %dl, %dl
cmovnel %ecx, %r14d
movq 0x28(%rbx), %rcx
movq 0x30(%rbx), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
imulq %r13, %rdx
cmpq %r14, %rdx
jbe 0x37ed
movq 0x48(%rbx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
imulq %r13, %rdx
cmpq %r14, %rdx
jbe 0x37ed
movb $0x1, 0x10(%rbx)
leaq (%r14,%r14,4), %rax
movl 0x10(%rcx,%rax,8), %ecx
leaq -0x50(%rbp), %rdi
movq %rbx, %rsi
movl $0x6b, %edx
callq 0x5fa0
testq %r14, %r14
jne 0x37ed
movq %rbx, %rdi
callq 0x3ac8
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
movb $0x1, %al
retq