// File: /workspace/github_cpp_makefile_star2_O2/tenup-coin[P]seeder/main.cpp
// Function: CDnsThread::cacheHit(unsigned long, bool)
void cacheHit(uint64_t requestedFlags, bool force = false) {
    static bool nets[NET_MAX] = {};
    if (!nets[NET_IPV4]) {
        nets[NET_IPV4] = true;
        nets[NET_IPV6] = true;
    }
    time_t now = time(NULL);
    FlagSpecificData& thisflag = perflag[requestedFlags];
    thisflag.cacheHits++;
    if (force || thisflag.cacheHits * 400 > (thisflag.cache.size()*thisflag.cache.size()) || (thisflag.cacheHits*thisflag.cacheHits * 20 > thisflag.cache.size() && (now - thisflag.cacheTime > 5))) {
      set<CNetAddr> ips;
      db.GetIPs(ips, requestedFlags, 1000, nets);
      dbQueries++;
      thisflag.cache.clear();
      thisflag.nIPv4 = 0;
      thisflag.nIPv6 = 0;
      thisflag.cache.reserve(ips.size());
      for (set<CNetAddr>::iterator it = ips.begin(); it != ips.end(); it++) {
        struct in_addr addr;
        struct in6_addr addr6;
        if ((*it).GetInAddr(&addr)) {
          addr_t a;
          a.v = 4;
          memcpy(&a.data.v4, &addr, 4);
          thisflag.cache.push_back(a);
          thisflag.nIPv4++;
        } else if ((*it).GetIn6Addr(&addr6)) {
          addr_t a;
          a.v = 6;
          memcpy(&a.data.v6, &addr6, 16);
          thisflag.cache.push_back(a);
          thisflag.nIPv6++;
        }
      }
      thisflag.cacheHits = 0;
      thisflag.cacheTime = now;
    }
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movl %edx, %ebx
movq %rdi, %r15
movq %rsi, 0x10(%rsp)
cmpb $0x0, 0xfe9a(%rip)      # 0x1d6e1
jne 0xd852
movw $0x101, 0xfe8f(%rip)    # imm = 0x101
xorl %edi, %edi
callq 0x33d0
movq %rax, %r12
leaq 0x40(%r15), %rdi
leaq 0x10(%rsp), %rsi
callq 0xd9f4
movq %rax, %r14
movl 0x28(%rax), %ecx
incl %ecx
movl %ecx, 0x28(%rax)
testb %bl, %bl
jne 0xd89f
imull $0x190, %ecx, %esi      # imm = 0x190
movq 0x10(%r14), %rax
subq 0x8(%r14), %rax
pushq $0x14
popq %rdi
cqto
idivq %rdi
movq %rax, %rdx
imulq %rax, %rdx
cmpq %rsi, %rdx
jae 0xd9bb
leaq 0x40(%rsp), %rbp
andl $0x0, (%rbp)
andq $0x0, 0x8(%rbp)
movq %rbp, 0x10(%rbp)
movq %rbp, 0x18(%rbp)
andq $0x0, 0x20(%rbp)
movq 0x10(%rsp), %rdx
leaq 0xfbf2(%rip), %rdi      # 0x1d4b8
leaq 0xfe13(%rip), %r8       # 0x1d6e0
leaq 0x38(%rsp), %rsi
movl $0x3e8, %ecx            # imm = 0x3E8
callq 0xe810
lock
incq 0x70(%r15)
movq %r14, %r15
addq $0x8, %r15
movq 0x8(%r14), %rax
cmpq %rax, 0x10(%r14)
je 0xd8f6
movq %rax, 0x10(%r14)
andq $0x0, (%r14)
movq 0x60(%rsp), %rsi
movq %r15, %rdi
callq 0xe862
movq %r12, 0x30(%rsp)
movq 0x50(%rsp), %r13
leaq 0xc(%rsp), %r12
cmpq %rbp, %r13
je 0xd994
leaq 0x20(%r13), %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x8744
testb %al, %al
je 0xd950
movl $0x4, 0x1c(%rsp)
movl 0xc(%rsp), %eax
movl %eax, 0x20(%rsp)
movq %r15, %rdi
leaq 0x1c(%rsp), %rsi
callq 0xe8fe
incl (%r14)
jmp 0xd987
movq %rbx, %rdi
leaq 0x68(%rsp), %rsi
callq 0x8766
testb %al, %al
je 0xd987
movl $0x6, 0x1c(%rsp)
movups 0x68(%rsp), %xmm0
leaq 0x20(%rsp), %rax
movups %xmm0, (%rax)
movq %r15, %rdi
leaq 0x1c(%rsp), %rsi
callq 0xe8fe
incl 0x4(%r14)
movq %r13, %rdi
callq 0x3460
movq %rax, %r13
jmp 0xd916
andl $0x0, 0x28(%r14)
movq 0x30(%rsp), %rax
movq %rax, 0x20(%r14)
leaq 0x38(%rsp), %rdi
callq 0xea7c
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
imull %ecx, %ecx
imull $0x14, %ecx, %ecx
cmpq %rcx, %rax
jae 0xd9ac
movq %r12, %rax
subq 0x20(%r14), %rax
cmpq $0x6, %rax
jge 0xd89f
jmp 0xd9ac
jmp 0xd9df
jmp 0xd9df
jmp 0xd9df
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0xea7c
movq %rbx, %rdi
callq 0x3690