// File: 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
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movb %dl, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
andb $0x1, %al
movb %al, -0x11(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xc8(%rbp)
testb $0x1, 0x25d75(%rip)     # 0x4a7d1
jne 0x24a6c
movb $0x1, 0x25d6c(%rip)     # 0x4a7d1
movb $0x1, 0x25d66(%rip)     # 0x4a7d2
xorl %eax, %eax
movl %eax, %edi
callq 0x44a0
movq -0xc8(%rbp), %rdi
movq %rax, -0x20(%rbp)
addq $0x40, %rdi
leaq -0x10(%rbp), %rsi
callq 0x24d40
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movl 0x28(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x28(%rax)
testb $0x1, -0x11(%rbp)
jne 0x24b48
movq -0x28(%rbp), %rax
imull $0x190, 0x28(%rax), %eax # imm = 0x190
movl %eax, %eax
movq %rax, -0xd0(%rbp)
movq -0x28(%rbp), %rdi
addq $0x8, %rdi
callq 0x24e20
movq %rax, -0xd8(%rbp)
movq -0x28(%rbp), %rdi
addq $0x8, %rdi
callq 0x24e20
movq -0xd8(%rbp), %rcx
movq %rax, %rdx
movq -0xd0(%rbp), %rax
imulq %rdx, %rcx
cmpq %rcx, %rax
ja 0x24b48
movq -0x28(%rbp), %rax
movl 0x28(%rax), %eax
movq -0x28(%rbp), %rcx
imull 0x28(%rcx), %eax
imull $0x14, %eax, %eax
movl %eax, %eax
movq %rax, -0xe0(%rbp)
movq -0x28(%rbp), %rdi
addq $0x8, %rdi
callq 0x24e20
movq %rax, %rcx
movq -0xe0(%rbp), %rax
cmpq %rcx, %rax
jbe 0x24d28
movq -0x20(%rbp), %rax
movq -0x28(%rbp), %rcx
subq 0x20(%rcx), %rax
cmpq $0x5, %rax
jle 0x24d28
leaq -0x58(%rbp), %rdi
movq %rdi, -0xe8(%rbp)
callq 0x27850
movq -0xe8(%rbp), %rsi
movq -0x10(%rbp), %rdx
leaq 0x25a3e(%rip), %rdi     # 0x4a5a8
leaq 0x25c5f(%rip), %r8      # 0x4a7d0
movl $0x3e8, %ecx            # imm = 0x3E8
callq 0x27870
jmp 0x24b7d
movq -0xc8(%rbp), %rdi
addq $0x70, %rdi
xorl %esi, %esi
callq 0x27900
movq -0x28(%rbp), %rdi
addq $0x8, %rdi
callq 0x279c0
movq -0x28(%rbp), %rax
movl $0x0, (%rax)
movq -0x28(%rbp), %rax
movl $0x0, 0x4(%rax)
movq -0x28(%rbp), %rax
addq $0x8, %rax
movq %rax, -0xf0(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x27ae0
movq -0xf0(%rbp), %rdi
movq %rax, %rsi
callq 0x279e0
jmp 0x24bda
leaq -0x58(%rbp), %rdi
callq 0x27b00
movq %rax, -0x70(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x27b60
movq %rax, -0x78(%rbp)
leaq -0x70(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x27b30
testb $0x1, %al
jne 0x24c0a
jmp 0x24d08
leaq -0x70(%rbp), %rdi
callq 0x27b90
movq %rax, %rdi
leaq -0x7c(%rbp), %rsi
callq 0x13ee0
movb %al, -0xf1(%rbp)
jmp 0x24c27
movb -0xf1(%rbp), %al
testb $0x1, %al
jne 0x24c33
jmp 0x24c86
movl $0x4, -0xa0(%rbp)
movl -0x7c(%rbp), %eax
movl %eax, -0x9c(%rbp)
movq -0x28(%rbp), %rdi
addq $0x8, %rdi
leaq -0xa0(%rbp), %rsi
callq 0x27bc0
jmp 0x24c5c
movq -0x28(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0x24cef
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x27c70
jmp 0x24d31
leaq -0x70(%rbp), %rdi
callq 0x27b90
movq %rax, %rdi
leaq -0x8c(%rbp), %rsi
callq 0x13f30
movb %al, -0xf2(%rbp)
jmp 0x24ca6
movb -0xf2(%rbp), %al
testb $0x1, %al
jne 0x24cb2
jmp 0x24ced
movl $0x6, -0xb4(%rbp)
movups -0x8c(%rbp), %xmm0
movups %xmm0, -0xb0(%rbp)
movq -0x28(%rbp), %rdi
addq $0x8, %rdi
leaq -0xb4(%rbp), %rsi
callq 0x27bc0
jmp 0x24ce0
movq -0x28(%rbp), %rax
movl 0x4(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x4(%rax)
jmp 0x24cef
jmp 0x24cf1
leaq -0x70(%rbp), %rdi
xorl %esi, %esi
callq 0x27c30
movq %rax, -0xc0(%rbp)
jmp 0x24be7
movq -0x28(%rbp), %rax
movl $0x0, 0x28(%rax)
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x20(%rax)
leaq -0x58(%rbp), %rdi
callq 0x27c70
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
movq -0x60(%rbp), %rdi
callq 0x47f0
nopw (%rax,%rax)