// File: /workspace/github_c_makefile_star2_O1/jech[P]dht/dht.c
// Function: dump_bucket
static void
dump_bucket(FILE *f, struct bucket *b)
{
    struct node *n = b->nodes;
    fprintf(f, "Bucket ");
    print_hex(f, b->first, 20);
    fprintf(f, " count %d/%d age %d%s%s:\n",
            b->count, b->max_count, (int)(now.tv_sec - b->time),
            in_bucket(myid, b) ? " (mine)" : "",
            b->cached.ss_family ? " (cached)" : "");
    while(n) {
        char buf[512];
        unsigned short port;
        fprintf(f, "    Node ");
        print_hex(f, n->id, 20);
        if(n->ss.ss_family == AF_INET) {
            struct sockaddr_in *sin = (struct sockaddr_in*)&n->ss;
            inet_ntop(AF_INET, &sin->sin_addr, buf, 512);
            port = ntohs(sin->sin_port);
        } else if(n->ss.ss_family == AF_INET6) {
            struct sockaddr_in6 *sin6 = (struct sockaddr_in6*)&n->ss;
            inet_ntop(AF_INET6, &sin6->sin6_addr, buf, 512);
            port = ntohs(sin6->sin6_port);
        } else {
            snprintf(buf, 512, "unknown(%d)", n->ss.ss_family);
            port = 0;
        }

        if(n->ss.ss_family == AF_INET6)
            fprintf(f, " [%s]:%d ", buf, port);
        else
            fprintf(f, " %s:%d ", buf, port);
        if(n->time != n->reply_time)
            fprintf(f, "age %ld, %ld",
                    (long)(now.tv_sec - n->time),
                    (long)(now.tv_sec - n->reply_time));
        else
            fprintf(f, "age %ld", (long)(now.tv_sec - n->time));
        if(n->pinged)
            fprintf(f, " (%d)", n->pinged);
        if(node_good(n))
            fprintf(f, " (good)");
        fprintf(f, "\n");
        n = n->next;
    }

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x218, %rsp            # imm = 0x218
movq %rsi, %r14
movq %rdi, %rbx
movq 0x28(%rsi), %r13
leaq 0x5614(%rip), %rdi      # 0x972c
movl $0x7, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2300
movl $0x4, %r12d
leaq 0x55f0(%rip), %r15      # 0x9727
movzbl (%r14,%r12), %edx
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x21c0
incq %r12
cmpq $0x18, %r12
jne 0x4137
movl 0x18(%r14), %ebp
movl 0x1c(%r14), %r15d
movl 0x9aaf(%rip), %r12d     # 0xdc10
subl 0x20(%r14), %r12d
movq %r14, %rdi
callq 0x7e61
testl %eax, %eax
leaq 0x51b2(%rip), %rax      # 0x9328
leaq 0x55d1(%rip), %r9       # 0x974e
cmoveq %rax, %r9
cmpw $0x0, 0x30(%r14)
leaq 0x55c8(%rip), %rcx      # 0x9756
cmoveq %rax, %rcx
movq %rcx, (%rsp)
leaq 0x5597(%rip), %rsi      # 0x9734
movq %rbx, %rdi
movl %ebp, %edx
movl %r15d, %ecx
movl %r12d, %r8d
xorl %eax, %eax
callq 0x21c0
testq %r13, %r13
je 0x4342
leaq 0x5568(%rip), %r15      # 0x9727
leaq 0x10(%rsp), %r12
leaq 0x55b5(%rip), %r14      # 0x9780
movl $0x9, %esi
movl $0x1, %edx
leaq 0x5584(%rip), %rdi      # 0x9760
movq %rbx, %rcx
callq 0x2300
xorl %ebp, %ebp
movzbl (%r13,%rbp), %edx
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x21c0
incq %rbp
cmpq $0x14, %rbp
jne 0x41e6
movzwl 0x18(%r13), %ecx
cmpl $0xa, %ecx
je 0x421c
cmpl $0x2, %ecx
jne 0x423d
leaq 0x1c(%r13), %rsi
movl $0x2, %edi
jmp 0x4225
leaq 0x20(%r13), %rsi
movl $0xa, %edi
movq %r12, %rdx
movl $0x200, %ecx            # imm = 0x200
callq 0x2030
movzwl 0x1a(%r13), %ebp
rolw $0x8, %bp
jmp 0x4255
xorl %ebp, %ebp
movl $0x200, %esi            # imm = 0x200
movq %r12, %rdi
leaq 0x551c(%rip), %rdx      # 0x976a
xorl %eax, %eax
callq 0x2110
cmpw $0xa, 0x18(%r13)
movzwl %bp, %ecx
movq %r14, %rsi
leaq 0x550e(%rip), %rax      # 0x9776
cmoveq %rax, %rsi
movq %rbx, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x21c0
movq 0xa0(%r13), %rsi
movq 0xa8(%r13), %rax
movq 0x9982(%rip), %rcx      # 0xdc10
movq %rcx, %rdx
subq %rsi, %rdx
cmpq %rax, %rsi
jne 0x42ac
movq %rbx, %rdi
leaq 0x54f2(%rip), %rsi      # 0x9795
xorl %eax, %eax
callq 0x21c0
jmp 0x42c0
subq %rax, %rcx
movq %rbx, %rdi
leaq 0x54cf(%rip), %rsi      # 0x9788
xorl %eax, %eax
callq 0x21c0
movl 0xb8(%r13), %edx
testl %edx, %edx
je 0x42dc
movq %rbx, %rdi
leaq 0x500b(%rip), %rsi      # 0x92e0
xorl %eax, %eax
callq 0x21c0
cmpl $0x2, 0xb8(%r13)
jg 0x4325
movq 0x9923(%rip), %rax      # 0xdc10
leaq -0x1c20(%rax), %rcx
cmpq %rcx, 0xa8(%r13)
jl 0x4325
addq $-0x384, %rax           # imm = 0xFC7C
cmpq %rax, 0xa0(%r13)
jl 0x4325
movl $0x7, %esi
movl $0x1, %edx
leaq 0x5480(%rip), %rdi      # 0x979d
movq %rbx, %rcx
callq 0x2300
movl $0xa, %edi
movq %rbx, %rsi
callq 0x2170
movq 0xc0(%r13), %r13
testq %r13, %r13
jne 0x41cb
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq