// File: /workspace/github_cpp_makefile_star2_O2/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 %rbx
subq $0x38, %rsp
movq %rsi, %r14
movq %rdi, %rbx
pushq $0x2
popq %rdi
movl %edi, %esi
xorl %edx, %edx
callq 0x30b0
movl %eax, 0x30(%rbx)
movq 0x6edf(%rip), %rdi      # 0xdfd0
leaq 0x2116(%rip), %rsi      # 0x920e
callq 0x3270
movq %rax, %rdi
callq 0x3160
movq %r14, %rdi
movq %rbx, %rsi
callq 0x785e
testq %rax, %rax
je 0x7181
movq %rax, %r15
movq 0x6eb1(%rip), %r14      # 0xdfd0
leaq 0x20fe(%rip), %rsi      # 0x9224
movq %r14, %rdi
callq 0x3270
movq %rax, %rdi
callq 0x3160
movl 0x30(%rbx), %edi
movq 0x28(%r15), %rsi
movq 0x30(%r15), %rdx
addq $0x20, %rbx
pushq $0x10
popq %r9
xorl %ecx, %ecx
movq %rbx, %r8
callq 0x3050
movq %rax, %rbx
leaq 0x20bd(%rip), %rsi      # 0x921a
movq %r14, %rdi
callq 0x3270
movq %rax, %rdi
movl %ebx, %esi
callq 0x3470
movq %rax, %rdi
addq $0x38, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x3160
movq 0x6e48(%rip), %rdi      # 0xdfd0
leaq 0x2092(%rip), %rsi      # 0x9221
callq 0x3270
movq %rax, %rdi
callq 0x3160
movq %rbx, %rdi
callq 0x7296
movq 0x48(%rbx), %rsi
cmpq 0x50(%rbx), %rsi
je 0x720d
leaq -0x48(%rbp), %r15
movq %r15, %rdi
callq 0x62f6
movl 0x30(%rbx), %edi
movq (%r15), %rsi
movq 0x8(%r15), %rdx
leaq 0x20(%rbx), %r8
pushq $0x10
popq %r9
xorl %ecx, %ecx
callq 0x3050
movq %rax, %r15
movq 0x6df3(%rip), %rdi      # 0xdfd0
leaq 0x2055(%rip), %rsi      # 0x9239
callq 0x3270
movq %rax, %rdi
movl %r15d, %esi
callq 0x3470
movq %rax, %rdi
callq 0x3160
leaq -0x48(%rbp), %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x77ac
jmp 0x7266
leaq 0x2019(%rip), %rsi      # 0x922d
leaq -0x48(%rbp), %rdi
leaq -0x19(%rbp), %rdx
callq 0x3110
movl 0x30(%rbx), %edi
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq $0x20, %rbx
pushq $0x10
popq %r9
xorl %ecx, %ecx
movq %rbx, %r8
callq 0x3050
movq %rax, %rbx
movq 0x6d88(%rip), %rdi      # 0xdfd0
leaq 0x1fcb(%rip), %rsi      # 0x921a
callq 0x3270
movq %rax, %rdi
movl %ebx, %esi
callq 0x3470
movq %rax, %rdi
callq 0x3160
leaq -0x48(%rbp), %rdi
callq 0x3140
addq $0x38, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x728d
jmp 0x7281
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x3140
movq %rbx, %rdi
callq 0x3480
nop