// File: /workspace/github_cpp_makefile_star2_O1/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 0x5a9e(%rip), %r15      # 0xcfd0
leaq 0x1d1b(%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 0x7639
movq %rax, %r12
leaq 0x1cdf(%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 0x1c76(%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 0x1c27(%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 0x781c
movq 0x48(%rbx), %r13
cmpq 0x50(%rbx), %r13
je 0x774d
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 0x4ce6
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 0x58f9(%rip), %rdi      # 0xcfd0
leaq 0x1ba1(%rip), %rsi      # 0x927f
movl $0x5, %edx
callq 0x3310
movq 0x58e1(%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 0x773e
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 0x1b17(%rip), %rsi      # 0x9273
leaq 0x1b1b(%rip), %rdx      # 0x927e
leaq -0x50(%rbp), %rdi
callq 0x497a
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 0x583b(%rip), %rdi      # 0xcfd0
leaq 0x1ac4(%rip), %rsi      # 0x9260
movl $0x6, %edx
callq 0x3310
movq 0x5823(%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 0x7739
jmp 0x773e
movq %rax, %rbx
jmp 0x7814
movq %rax, %rbx
movq -0x50(%rbp), %rdi
cmpq %r14, %rdi
jne 0x780f
jmp 0x7814
movq %rax, %rbx
movq -0x50(%rbp), %rdi
cmpq %r12, %rdi
je 0x7814
callq 0x3280
movq %rbx, %rdi
callq 0x34b0