// File: /workspace/github_cpp_makefile_star2_O1/Mirrvin[P]DragonsResurrectingInc/./specialists/TailSpecialist.cpp
// Function: TailSpecialist::tryToAcceptOrder()
void tryToAcceptOrder() {
        std::sort(this->orderPriority.begin(), this->orderPriority.end(), comparePacketsLamport);
        unsigned int me = this->getIndexFromOrderPriority(this->rank);
        if(me == 0 && this->availableOrders > 0) { 
            printf("%u: Got the order , rank: %d\n",Monitor::getLamport(), this->rank);
            if(this->availableOrders > 0) 
                this->availableOrders -= 1;
            this->gettingResurrectionOrder = false;
            this->resurrecting = true;
            this->broadcastMessage(FREE_ORDER_PRIORITY, TAIL);
            this->orderPriority.erase(
                this->orderPriority.begin() + me);
            this->beginDragonResurrection();
        }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %r12
movq 0x60(%rdi), %r14
movq 0x68(%rdi), %r15
movabsq $-0x3333333333333333, %r13 # imm = 0xCCCCCCCCCCCCCCCD
cmpq %r15, %r14
je 0x576f
movq %r15, %rbx
subq %r14, %rbx
movq %rbx, %rax
sarq $0x3, %rax
imulq %r13, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
leaq -0x1068(%rip), %rcx     # 0x44c8
movq %r14, %rdi
movq %r15, %rsi
callq 0x3b6b
cmpq $0x281, %rbx            # imm = 0x281
jl 0x56a5
movq %r12, -0x58(%rbp)
leaq 0x28(%r14), %r13
movl $0x28, %r12d
movq %r14, %rdi
leaq (%r14,%r12), %rbx
movl 0x8(%r14,%r12), %eax
cmpl 0x8(%r14), %eax
jae 0x55ac
movq 0x20(%rbx), %rax
movq %rax, -0x30(%rbp)
movups (%rbx), %xmm0
movups 0x10(%rbx), %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 0x5603
movq (%rbx), %rcx
movups 0x18(%rbx), %xmm0
movups %xmm0, -0x44(%rbp)
movups 0xc(%rbx), %xmm0
movaps %xmm0, -0x50(%rbp)
movq %rbx, %rdx
cmpl 0x8(%rdi), %eax
jae 0x55ed
movq %r13, %rsi
leaq -0x28(%rsi), %rdx
movq -0x8(%rsi), %rdi
movq %rdi, 0x20(%rsi)
movups -0x28(%rsi), %xmm0
movups -0x18(%rsi), %xmm1
movups %xmm1, 0x10(%rsi)
movups %xmm0, (%rsi)
cmpl -0x48(%rsi), %eax
movq %rdx, %rsi
jb 0x55ca
movq %rcx, (%rdx)
movl %eax, 0x8(%rdx)
movaps -0x50(%rbp), %xmm0
movups %xmm0, 0xc(%rdx)
movups -0x44(%rbp), %xmm0
movups %xmm0, 0x18(%rdx)
addq $0x28, %r12
addq $0x28, %r13
movq %rbx, %rdi
cmpq $0x280, %r12            # imm = 0x280
jne 0x5559
addq $0x280, %r14            # imm = 0x280
cmpq %r15, %r14
movq -0x58(%rbp), %r12
movabsq $-0x3333333333333333, %r13 # imm = 0xCCCCCCCCCCCCCCCD
je 0x576f
movq (%r14), %rax
movl 0x8(%r14), %ecx
movups 0x18(%r14), %xmm0
movups %xmm0, -0x44(%rbp)
movups 0xc(%r14), %xmm0
movaps %xmm0, -0x50(%rbp)
movq %r14, %rdx
cmpl -0x20(%r14), %ecx
jae 0x5681
movq %r14, %rsi
leaq -0x28(%rsi), %rdx
movq -0x8(%rsi), %rdi
movq %rdi, 0x20(%rsi)
movups -0x28(%rsi), %xmm0
movups -0x18(%rsi), %xmm1
movups %xmm1, 0x10(%rsi)
movups %xmm0, (%rsi)
cmpl -0x48(%rsi), %ecx
movq %rdx, %rsi
jb 0x565e
movq %rax, (%rdx)
movl %ecx, 0x8(%rdx)
movaps -0x50(%rbp), %xmm0
movups %xmm0, 0xc(%rdx)
movups -0x44(%rbp), %xmm0
movups %xmm0, 0x18(%rdx)
addq $0x28, %r14
cmpq %r15, %r14
jne 0x5639
jmp 0x576f
leaq 0x28(%r14), %rax
cmpq %r15, %rax
je 0x576f
movq %r14, %rdi
movq %rax, %rbx
movl 0x8(%rax), %eax
cmpl 0x8(%r14), %eax
jae 0x5708
movq 0x20(%rbx), %rax
movq %rax, -0x30(%rbp)
movups (%rbx), %xmm0
movups 0x10(%rbx), %xmm1
movaps %xmm1, -0x40(%rbp)
movaps %xmm0, -0x50(%rbp)
movq %rbx, %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 0x575f
movq (%rbx), %rcx
movups 0x18(%rbx), %xmm0
movups %xmm0, -0x44(%rbp)
movups 0xc(%rbx), %xmm0
movaps %xmm0, -0x50(%rbp)
movq %rbx, %rdx
cmpl 0x8(%rdi), %eax
jae 0x5749
movq %rbx, %rsi
leaq -0x28(%rsi), %rdx
movq -0x8(%rsi), %rdi
movq %rdi, 0x20(%rsi)
movups -0x28(%rsi), %xmm0
movups -0x18(%rsi), %xmm1
movups %xmm1, 0x10(%rsi)
movups %xmm0, (%rsi)
cmpl -0x48(%rsi), %eax
movq %rdx, %rsi
jb 0x5726
movq %rcx, (%rdx)
movl %eax, 0x8(%rdx)
movaps -0x50(%rbp), %xmm0
movups %xmm0, 0xc(%rdx)
movups -0x44(%rbp), %xmm0
movups %xmm0, 0x18(%rdx)
leaq 0x28(%rbx), %rax
movq %rbx, %rdi
cmpq %r15, %rax
jne 0x56b5
movq 0x68(%r12), %rsi
movq 0x60(%r12), %rdx
movq %rsi, %rax
subq %rdx, %rax
sarq $0x3, %rax
imulq %r13, %rax
xorl %ecx, %ecx
cmpq %rdx, %rsi
setne %sil
je 0x57c0
movl 0x8(%r12), %edi
cmpl %edi, 0x10(%rdx)
je 0x57c0
movl $0x1, %r8d
movl %r8d, %ecx
movl %r8d, %r8d
cmpq %r8, %rax
seta %sil
jbe 0x57c0
leaq (%r8,%r8,4), %r9
leal 0x1(%rcx), %r8d
cmpl %edi, 0x10(%rdx,%r9,8)
jne 0x57a2
testb %sil, %sil
cmovnel %ecx, %eax
testl %eax, %eax
jne 0x585f
cmpl $0x0, 0x24(%r12)
jle 0x585f
callq 0x5b08
movl 0x8(%r12), %edx
leaq 0x1af6(%rip), %rdi      # 0x72e1
movl %eax, %esi
xorl %eax, %eax
callq 0x2030
movl 0x24(%r12), %eax
testl %eax, %eax
jle 0x5804
decl %eax
movl %eax, 0x24(%r12)
movw $0x100, 0x29(%r12)      # imm = 0x100
leaq -0x50(%rbp), %rdi
movq %r12, %rsi
movl $0x74, %edx
movl $0x3, %ecx
callq 0x61ca
movq 0x60(%r12), %rdi
movq 0x68(%r12), %rdx
leaq 0x28(%rdi), %rsi
cmpq %rdx, %rsi
je 0x583d
subq %rsi, %rdx
callq 0x21b0
addq $-0x28, 0x68(%r12)
movb $0x1, 0x2a(%r12)
movl 0x1c(%r12), %ecx
leaq -0x50(%rbp), %rdi
movq %r12, %rsi
movl $0x75, %edx
callq 0x5fa0
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq