// File: /workspace/github_c_makefile_star2_O0/jech[P]dht/dht.c
// Function: dht_dump_tables
void
dht_dump_tables(FILE *f)
{
    int i;
    struct bucket *b;
    struct storage *st = storage;
    struct search *sr = searches;

    fprintf(f, "My id ");
    print_hex(f, myid, 20);
    fprintf(f, "\n");

    b = buckets;
    while(b) {
        dump_bucket(f, b);
        b = b->next;
    }

    fprintf(f, "\n");

    b = buckets6;
    while(b) {
        dump_bucket(f, b);
        b = b->next;
    }

    while(sr) {
        fprintf(f, "\nSearch%s id ", sr->af == AF_INET6 ? " (IPv6)" : "");
        print_hex(f, sr->id, 20);
        fprintf(f, " age %d%s\n", (int)(now.tv_sec - sr->step_time),
               sr->done ? " (done)" : "");
        for(i = 0; i < sr->numnodes; i++) {
            struct search_node *n = &sr->nodes[i];
            fprintf(f, "Node %d id ", i);
            print_hex(f, n->id, 20);
            fprintf(f, " bits %d age ", common_bits(sr->id, n->id));
            if(n->request_time)
                fprintf(f, "%d, ", (int)(now.tv_sec - n->request_time));
            fprintf(f, "%d", (int)(now.tv_sec - n->reply_time));
            if(n->pinged)
                fprintf(f, " (%d)", n->pinged);
            fprintf(f, "%s%s.\n",
                    find_node(n->id, sr->af) ? " (known)" : "",
                    n->replied ? " (replied)" : "");
        }
        sr = sr->next;
    }

    while(st) {
        fprintf(f, "\nStorage ");
        print_hex(f, st->id, 20);
        fprintf(f, " %d/%d nodes:", st->numpeers, st->maxpeers);
        for(i = 0; i < st->numpeers; i++) {
            char buf[100];
            if(st->peers[i].len == 4) {
                inet_ntop(AF_INET, st->peers[i].ip, buf, 100);
            } else if(st->peers[i].len == 16) {
                buf[0] = '[';
                inet_ntop(AF_INET6, st->peers[i].ip, buf + 1, 98);
                strcat(buf, "]");
            } else {
                strcpy(buf, "???");
            }
            fprintf(f, " %s:%u (%ld)",
                    buf, st->peers[i].port,
                    (long)(now.tv_sec - st->peers[i].time));
        }
        st = st->next;
    }

    fprintf(f, "\n\n");
    fflush(f);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x8(%rbp)
movq 0xc8aa(%rip), %rax      # 0x10c60
movq %rax, -0x20(%rbp)
movq 0xc847(%rip), %rax      # 0x10c08
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x7eae(%rip), %rsi      # 0xc27e
movb $0x0, %al
callq 0x21c0
movq -0x8(%rbp), %rdi
leaq 0xc84e(%rip), %rsi      # 0x10c30
movl $0x14, %edx
callq 0x4860
movq -0x8(%rbp), %rdi
leaq 0x7f26(%rip), %rsi      # 0xc31d
movb $0x0, %al
callq 0x21c0
movq 0xc84b(%rip), %rax      # 0x10c50
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x442e
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x48c0
movq -0x18(%rbp), %rax
movq 0xb8(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x4409
movq -0x8(%rbp), %rdi
leaq 0x7ee4(%rip), %rsi      # 0xc31d
movb $0x0, %al
callq 0x21c0
movq 0xc811(%rip), %rax      # 0x10c58
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x4470
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x48c0
movq -0x18(%rbp), %rax
movq 0xb8(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x444b
jmp 0x4472
cmpq $0x0, -0x28(%rbp)
je 0x469b
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movl 0x4(%rax), %ecx
leaq 0x7e8f(%rip), %rdx      # 0xc31e
leaq 0x7dfd(%rip), %rax      # 0xc293
cmpl $0xa, %ecx
cmoveq %rax, %rdx
leaq 0x7de1(%rip), %rsi      # 0xc285
movb $0x0, %al
callq 0x21c0
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
addq $0x10, %rsi
movl $0x14, %edx
callq 0x4860
movq -0x8(%rbp), %rdi
movq 0xc744(%rip), %rax      # 0x10c10
movq -0x28(%rbp), %rcx
subq 0x8(%rcx), %rax
movl %eax, %edx
movq -0x28(%rbp), %rax
movl 0x28(%rax), %esi
leaq 0x7e3a(%rip), %rcx      # 0xc31e
leaq 0x7dbb(%rip), %rax      # 0xc2a6
cmpl $0x0, %esi
cmovneq %rax, %rcx
leaq 0x7da2(%rip), %rsi      # 0xc29b
movb $0x0, %al
callq 0x21c0
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl 0xce0(%rcx), %eax
jge 0x4687
movq -0x28(%rbp), %rax
addq $0x30, %rax
movslq -0xc(%rbp), %rcx
imulq $0xe8, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %edx
leaq 0x7d6c(%rip), %rsi      # 0xc2ae
movb $0x0, %al
callq 0x21c0
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
movl $0x14, %edx
callq 0x4860
movq -0x8(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0x28(%rbp), %rdi
addq $0x10, %rdi
movq -0x30(%rbp), %rsi
callq 0x4c00
movq -0xa8(%rbp), %rdi
movl %eax, %edx
leaq 0x7d33(%rip), %rsi      # 0xc2ba
movb $0x0, %al
callq 0x21c0
movq -0x30(%rbp), %rax
cmpq $0x0, 0xa0(%rax)
je 0x45c2
movq -0x8(%rbp), %rdi
movq 0xc669(%rip), %rax      # 0x10c10
movq -0x30(%rbp), %rcx
subq 0xa0(%rcx), %rax
movl %eax, %edx
leaq 0x7d0d(%rip), %rsi      # 0xc2c8
movb $0x0, %al
callq 0x21c0
movq -0x8(%rbp), %rdi
movq 0xc643(%rip), %rax      # 0x10c10
movq -0x30(%rbp), %rcx
subq 0xa8(%rcx), %rax
movl %eax, %edx
leaq 0x7cec(%rip), %rsi      # 0xc2cd
movb $0x0, %al
callq 0x21c0
movq -0x30(%rbp), %rax
cmpl $0x0, 0xb0(%rax)
je 0x4611
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rax
movl 0xb0(%rax), %edx
leaq 0x7cc6(%rip), %rsi      # 0xc2d0
movb $0x0, %al
callq 0x21c0
movq -0x8(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rax
movl 0x4(%rax), %esi
callq 0x4cb0
movq -0xb0(%rbp), %rdi
movq %rax, %rcx
leaq 0x7ce1(%rip), %rdx      # 0xc31e
leaq 0x7c99(%rip), %rax      # 0xc2dd
cmpq $0x0, %rcx
cmovneq %rax, %rdx
movq -0x30(%rbp), %rax
movl 0xe0(%rax), %esi
leaq 0x7cc1(%rip), %rcx      # 0xc31e
leaq 0x7c82(%rip), %rax      # 0xc2e6
cmpl $0x0, %esi
cmovneq %rax, %rcx
leaq 0x7c64(%rip), %rsi      # 0xc2d6
movb $0x0, %al
callq 0x21c0
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x4507
movq -0x28(%rbp), %rax
movq 0xce8(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x4472
jmp 0x469d
cmpq $0x0, -0x20(%rbp)
je 0x4838
movq -0x8(%rbp), %rdi
leaq 0x7c3e(%rip), %rsi      # 0xc2f1
movb $0x0, %al
callq 0x21c0
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl $0x14, %edx
callq 0x4860
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x14(%rax), %edx
movq -0x20(%rbp), %rax
movl 0x18(%rax), %ecx
leaq 0x7c16(%rip), %rsi      # 0xc2fb
movb $0x0, %al
callq 0x21c0
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl 0x14(%rcx), %eax
jge 0x4827
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0xc(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movzwl 0x18(%rax), %eax
cmpl $0x4, %eax
jne 0x474e
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rsi
movslq -0xc(%rbp), %rax
shlq $0x5, %rax
addq %rax, %rsi
addq $0x8, %rsi
leaq -0xa0(%rbp), %rdx
movl $0x2, %edi
movl $0x64, %ecx
callq 0x2030
jmp 0x47cc
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0xc(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movzwl 0x18(%rax), %eax
cmpl $0x10, %eax
jne 0x47b7
movb $0x5b, -0xa0(%rbp)
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rsi
movslq -0xc(%rbp), %rax
shlq $0x5, %rax
addq %rax, %rsi
addq $0x8, %rsi
leaq -0xa0(%rbp), %rdx
addq $0x1, %rdx
movl $0xa, %edi
movl $0x62, %ecx
callq 0x2030
leaq -0xa0(%rbp), %rdi
leaq 0x7b59(%rip), %rsi      # 0xc309
callq 0x22f0
jmp 0x47ca
leaq -0xa0(%rbp), %rdi
leaq 0x7b46(%rip), %rsi      # 0xc30b
callq 0x20a0
jmp 0x47cc
movq -0x8(%rbp), %rdi
leaq -0xa0(%rbp), %rdx
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0xc(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movzwl 0x1a(%rax), %ecx
movq 0xc41b(%rip), %r8       # 0x10c10
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0xc(%rbp), %rsi
shlq $0x5, %rsi
addq %rsi, %rax
subq (%rax), %r8
leaq 0x7afd(%rip), %rsi      # 0xc30f
movb $0x0, %al
callq 0x21c0
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x46f3
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x469d
movq -0x8(%rbp), %rdi
leaq 0x7ad9(%rip), %rsi      # 0xc31c
movb $0x0, %al
callq 0x21c0
movq -0x8(%rbp), %rdi
callq 0x2240
addq $0xb0, %rsp
popq %rbp
retq
nopl (%rax)