// File: /workspace/github_cpp_makefile_star2_O3/Mirrvin[P]DragonsResurrectingInc/./specialists/BodySpecialist.cpp
// Function: BodySpecialist::handle(packet_t)
bool handle(packet_t packet) {        
        bool success = true;
        switch(packet.status.MPI_TAG){
            case NEED_BODY:
                success = this->handleNeedBody(packet); break;
            case NEED_BODY_ACK:
                success = this->handleNeedBodyAck(packet); break;
            case FINISH_NEED_BODY:
                success = this->handleFinishNeedBody(packet); break;
            case NEED_TAIL_POSITIVE:
                success = this->handleNeedTailPositive(packet); break;
            case NEED_TAIL_NEGATIVE:
                success = this->handleNeedTailNegative(packet); break;
            case AVENGERS_ASSEMBLE:
                success = this->handleAvengersAssemble(packet); break;
            case NEED_DESK_REQUEST:
                success = this->handleNeedDeskRequest(packet); break;
            case NEED_DESK_REPLY:
                success = this->handleNeedDeskReply(packet); break;
            case FREE_DESK:
                success = this->handleFreeDesk(packet); break;
            case DO_PAPERWORK:
                success = this->handleDoPaperwork(packet); break;
            case DONE_PAPERWORK:
                success = this->handleDonePaperwork(packet); break;
            case RESURRECTION_FINISHED:
                success = this->handleResurrectionFinished(packet); break;
            case NEED_BODY_POSITIVE:
                success = this->handleNeedBodyPositive(packet); break;
            case NEED_BODY_NEGATIVE:
                success = this->handleNeedBodyNegative(packet); break;
            case END:
                success = this->handleEnd(packet); break;
            default: 
                printf("%u: No handler for tag %d in BodySpecialist\n",Monitor::getLamport(), packet.status.MPI_TAG); break;                
        }
        return success;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x80, %rsp
movl 0x24(%rbp), %r14d
leal -0x65(%r14), %ecx
cmpl $0x15, %ecx
ja 0x2d40
movq %rdi, %rbx
leaq 0x10(%rbp), %rax
leaq 0x43cf(%rip), %rdx      # 0x702c
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movq %rbx, %rdi
addq $0x80, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x6100
movl 0x20(%rbx), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x20(%rbx)
cmpl $0x1, %eax
jle 0x2dbe
jmp 0x2e46
movl 0x1c(%rbx), %ecx
leaq -0x40(%rbp), %rdi
movq %rbx, %rsi
movl $0x76, %edx
jmp 0x2e41
movq %rbx, %rdi
addq $0x80, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x3762
cmpb $0x1, 0x10(%rbx)
jne 0x2e46
leaq -0x40(%rbp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x5df6
movl 0x18(%rbx), %eax
movl %eax, (%r14)
movq 0x20(%r14), %rax
movq %rax, 0x20(%rsp)
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
leaq -0x68(%rbp), %rdi
movq %rbx, %rsi
movl $0x67, %edx
movl $0x3, %ecx
callq 0x6002
jmp 0x2e46
movl 0x10(%rax), %eax
movl %eax, 0x18(%rbx)
movl 0x8(%rbx), %ecx
leaq -0x40(%rbp), %rdi
movq %rbx, %rsi
movl $0x68, %edx
callq 0x5d68
movb $0x0, 0x24(%rbx)
jmp 0x2e46
movb $0x0, 0x10(%rbx)
movq $0x0, 0x18(%rbx)
jmp 0x2e46
callq 0x58c2
leaq 0x44b0(%rip), %rdi      # 0x71fc
movl %eax, %esi
movl %r14d, %edx
xorl %eax, %eax
callq 0x2030
jmp 0x2e46
movq %rbx, %rdi
addq $0x80, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x2e66
movl $0x0, 0x18(%rbx)
movb $0x0, 0x24(%rbx)
leaq -0x40(%rbp), %rdi
movq %rbx, %rsi
movl $0x68, %edx
movl $0x1, %ecx
callq 0x5f92
jmp 0x2e46
movq %rbx, %rdi
addq $0x80, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x3726
movl 0x10(%rax), %esi
movq %rbx, %rdi
callq 0x4396
cmpb $0x1, 0x25(%rbx)
jne 0x2e46
movq %rbx, %rdi
callq 0x4020
jmp 0x2e46
movq 0x20(%rax), %rcx
movq %rcx, -0x20(%rbp)
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movaps %xmm1, -0x30(%rbp)
movaps %xmm0, -0x40(%rbp)
cmpb $0x0, 0x10(%rbx)
jne 0x2e46
movq 0x48(%rbx), %rsi
cmpq 0x50(%rbx), %rsi
je 0x2e54
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movq 0x20(%rax), %rax
movq %rax, 0x20(%rsi)
movups %xmm1, 0x10(%rsi)
movups %xmm0, (%rsi)
addq $0x28, 0x48(%rbx)
jmp 0x2e46
movq %rbx, %rdi
addq $0x80, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x2f7c
movq %rbx, %rdi
addq $0x80, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x37ca
movl 0x8(%rbx), %ecx
leaq -0x40(%rbp), %rdi
movq %rbx, %rsi
movl $0x68, %edx
callq 0x5d68
movb $0x1, %al
addq $0x80, %rsp
popq %rbx
popq %r14
popq %rbp
retq
addq $0x40, %rbx
leaq -0x40(%rbp), %rdx
movq %rbx, %rdi
callq 0x3834
jmp 0x2e46