// File: /workspace/github_cpp_makefile_star2_O2/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 $0x30, %rsp
movl 0x24(%rbp), %r14d
leal -0x65(%r14), %ecx
cmpl $0x15, %ecx
ja 0x2c13
movq %rdi, %rbx
leaq 0x10(%rbp), %rax
leaq 0x24a6(%rip), %rdx      # 0x502c
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movq %rbx, %rdi
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x4e4a
movl 0x20(%rbx), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x20(%rbx)
cmpl $0x1, %eax
jle 0x2c80
jmp 0x2ceb
movl 0x1c(%rbx), %ecx
leaq -0x40(%rbp), %rdi
pushq $0x76
jmp 0x2ce2
movq %rbx, %rdi
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x2f6a
movq %rbx, %rdi
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x2f02
movl 0x10(%rax), %eax
movl %eax, 0x18(%rbx)
movl 0x8(%rbx), %ecx
leaq -0x40(%rbp), %rdi
pushq $0x68
popq %rdx
movq %rbx, %rsi
callq 0x4b00
movb $0x0, 0x24(%rbx)
jmp 0x2ceb
movb $0x0, 0x10(%rbx)
andq $0x0, 0x18(%rbx)
jmp 0x2ceb
callq 0x45d2
leaq 0x25dd(%rip), %rdi      # 0x51fc
movl %eax, %esi
movl %r14d, %edx
xorl %eax, %eax
callq 0x2030
jmp 0x2ceb
movq %rbx, %rdi
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x2d48
andl $0x0, 0x18(%rbx)
movb $0x0, 0x24(%rbx)
leaq -0x40(%rbp), %rdi
pushq $0x68
popq %rdx
pushq $0x1
popq %rcx
movq %rbx, %rsi
callq 0x4d0e
jmp 0x2ceb
movq %rbx, %rdi
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x2eca
movl 0x10(%rax), %esi
movq %rbx, %rdi
callq 0x3bd2
cmpb $0x1, 0x25(%rbx)
jne 0x2ceb
movq %rbx, %rdi
callq 0x3ace
jmp 0x2ceb
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 0x2ceb
addq $0x40, %rbx
leaq -0x40(%rbp), %rsi
movq %rbx, %rdi
callq 0x2fe0
jmp 0x2ceb
movq %rbx, %rdi
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x2e1c
movq %rbx, %rdi
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x2fa6
movl 0x8(%rbx), %ecx
leaq -0x40(%rbp), %rdi
pushq $0x68
popq %rdx
movq %rbx, %rsi
callq 0x4b00
movb $0x1, %al
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq