// File: /workspace/github_cpp_makefile_star2_O3/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 0x553f
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 -0xf79(%rip), %rcx      # 0x4387
movq %r14, %rdi
movq %r15, %rsi
callq 0x3a7b
cmpq $0x281, %rbx            # imm = 0x281
jl 0x5475
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 0x537c
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 0x53d3
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 0x53bd
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 0x539a
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 0x5329
addq $0x280, %r14            # imm = 0x280
cmpq %r15, %r14
movq -0x58(%rbp), %r12
movabsq $-0x3333333333333333, %r13 # imm = 0xCCCCCCCCCCCCCCCD
je 0x553f
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 0x5451
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 0x542e
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 0x5409
jmp 0x553f
leaq 0x28(%r14), %rax
cmpq %r15, %rax
je 0x553f
movq %r14, %rdi
movq %rax, %rbx
movl 0x8(%rax), %eax
cmpl 0x8(%r14), %eax
jae 0x54d8
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 0x552f
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 0x5519
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 0x54f6
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 0x5485
movq 0x68(%r12), %rdx
movq 0x60(%r12), %rcx
movq %rdx, %rax
subq %rcx, %rax
sarq $0x3, %rax
imulq %r13, %rax
cmpq %rcx, %rdx
je 0x5574
movl 0x8(%r12), %esi
xorl %edx, %edx
leaq (%rdx,%rdx,4), %rdi
cmpl %esi, 0x10(%rcx,%rdi,8)
je 0x5576
incl %edx
cmpq %rdx, %rax
ja 0x5563
movl %eax, %edx
testl %edx, %edx
jne 0x5617
cmpl $0x0, 0x24(%r12)
jle 0x5617
callq 0x58c2
movl 0x8(%r12), %edx
leaq 0x1d46(%rip), %rdi      # 0x72e1
movl %eax, %esi
xorl %eax, %eax
callq 0x2030
movl 0x24(%r12), %eax
testl %eax, %eax
jle 0x55b4
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 0x5f92
movq 0x60(%r12), %rdi
movq 0x68(%r12), %rdx
leaq 0x28(%rdi), %rsi
cmpq %rdx, %rsi
je 0x55f2
subq %rsi, %rdx
callq 0x21b0
movq 0x68(%r12), %rdx
addq $-0x28, %rdx
movq %rdx, 0x68(%r12)
movb $0x1, 0x2a(%r12)
movl 0x1c(%r12), %ecx
leaq -0x50(%rbp), %rdi
movq %r12, %rsi
movl $0x75, %edx
callq 0x5d68
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq