// File: /workspace/github_cpp_makefile_star2_O3/jianxinzhou[P]Smart/./src/MyTask.cpp
// Function: MyTask::excute(MyCache&)
void MyTask::excute(MyCache& cache) // cache_通过工作线程传入
{
    peerfd_ = socket(AF_INET, SOCK_DGRAM, 0);
    std::cout << "Task excute" << std::endl ;
    std::unordered_map<std::string, std::string>::iterator iter;
    iter =  cache.isMapped(queryWord_);
	if(iter != cache.hashmap_.end())
	{
        std::cout << " cached "  << std::endl;
        int iret = sendto(peerfd_, (iter -> second).c_str(), 
                  (iter -> second).size(), 0, 
                  (struct sockaddr*)&addr_, sizeof(addr_));
        std::cout <<"send: " << iret << std::endl ;
    }
    else 
	{
		std::cout << " no cached " << std::endl ;
        get_result();
        //std::cout << inet_ntoa(m_addr.sin_addr) << std::endl ;
        if(result_.empty())
        {
            std::string res = "no anwser !" ;
            int iret = sendto(peerfd_, res.c_str(), 
                       res.size(), 0, 
                       (struct sockaddr*)&addr_, sizeof(addr_));
            std::cout <<"send: " << iret << std::endl;
        }
        else 
        {
            MyResult res = result_.top();
            int iret = sendto(peerfd_, res.word_.c_str(), 
                              res.word_.size(), 0, 
                              (struct sockaddr*)&addr_, sizeof(addr_));
            std::cout <<"send:" << iret << std::endl ;
            cache.map_to_cache(queryWord_, res.word_);
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movl $0x2, %edi
movl $0x2, %esi
xorl %edx, %edx
callq 0x30b0
movl %eax, 0x30(%rbx)
movq 0x5a86(%rip), %r15      # 0xcfd0
leaq 0x1d03(%rip), %rsi      # 0x9254
movl $0xb, %edx
movq %r15, %rdi
callq 0x3310
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x3290
movsbl %al, %esi
movq %r15, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31d0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x7f3a
testq %rax, %rax
je 0x7651
movq %rax, %r12
leaq 0x1cc7(%rip), %rsi      # 0x926a
movl $0x8, %edx
movq %r15, %rdi
callq 0x3310
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x3290
movsbl %al, %esi
movq %r15, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31d0
movl 0x30(%rbx), %edi
movq 0x28(%r12), %rsi
movq 0x30(%r12), %rdx
addq $0x20, %rbx
xorl %ecx, %ecx
movq %rbx, %r8
movl $0x10, %r9d
callq 0x3060
movq %rax, %rbx
leaq 0x1c5e(%rip), %rsi      # 0x9260
movl $0x6, %edx
movq %r15, %rdi
callq 0x3310
movq %r15, %rdi
movl %ebx, %esi
callq 0x34a0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3290
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3040
movq %rax, %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x31d0
leaq 0x1c0f(%rip), %rsi      # 0x9267
movl $0xb, %edx
movq %r15, %rdi
callq 0x3310
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x3290
movsbl %al, %esi
movq %r15, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31d0
movq %rbx, %rdi
callq 0x7834
movq 0x48(%rbx), %r13
cmpq 0x50(%rbx), %r13
je 0x7765
leaq -0x40(%rbp), %r12
movq %r12, -0x10(%r12)
movq (%r13), %rsi
movq 0x8(%r13), %rdx
addq %rsi, %rdx
leaq -0x50(%rbp), %r15
movq %r15, %rdi
callq 0x4cea
movq 0x20(%r13), %rax
movq %rax, 0x20(%r15)
movl 0x30(%rbx), %edi
movq (%r15), %rsi
movq 0x8(%r15), %rdx
leaq 0x20(%rbx), %r8
xorl %ecx, %ecx
movl $0x10, %r9d
callq 0x3060
movq %rax, %r15
movq 0x58e1(%rip), %rdi      # 0xcfd0
leaq 0x1b89(%rip), %rsi      # 0x927f
movl $0x5, %edx
callq 0x3310
movq 0x58c9(%rip), %rdi      # 0xcfd0
movl %r15d, %esi
callq 0x34a0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x3290
movsbl %al, %esi
movq %r15, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31d0
leaq -0x50(%rbp), %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x7ef4
movq -0x50(%rbp), %rdi
cmpq %r12, %rdi
je 0x7756
callq 0x3280
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq -0x40(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x1aff(%rip), %rsi      # 0x9273
leaq 0x1b03(%rip), %rdx      # 0x927e
leaq -0x50(%rbp), %rdi
callq 0x4984
movl 0x30(%rbx), %edi
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
addq $0x20, %rbx
xorl %ecx, %ecx
movq %rbx, %r8
movl $0x10, %r9d
callq 0x3060
movq %rax, %rbx
movq 0x5823(%rip), %rdi      # 0xcfd0
leaq 0x1aac(%rip), %rsi      # 0x9260
movl $0x6, %edx
callq 0x3310
movq 0x580b(%rip), %rdi      # 0xcfd0
movl %ebx, %esi
callq 0x34a0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3290
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31d0
movq -0x50(%rbp), %rdi
cmpq %r14, %rdi
jne 0x7751
jmp 0x7756
movq %rax, %rbx
jmp 0x782c
movq %rax, %rbx
movq -0x50(%rbp), %rdi
cmpq %r14, %rdi
jne 0x7827
jmp 0x782c
movq %rax, %rbx
movq -0x50(%rbp), %rdi
cmpq %r12, %rdi
je 0x782c
callq 0x3280
movq %rbx, %rdi
callq 0x34b0