// File: /workspace/github_c_makefile_star2_O2/jech[P]dht/dht.c
// Function: search_send_get_peers
static int
search_send_get_peers(struct search *sr, struct search_node *n)
{
    struct node *node;
    unsigned char tid[4];

    if(n == NULL) {
        int i;
        for(i = 0; i < sr->numnodes; i++) {
            if(sr->nodes[i].pinged < 3 && !sr->nodes[i].replied &&
               sr->nodes[i].request_time < now.tv_sec - DHT_SEARCH_RETRANSMIT)
                n = &sr->nodes[i];
        }
    }

    if(!n || n->pinged >= 3 || n->replied ||
       n->request_time >= now.tv_sec - DHT_SEARCH_RETRANSMIT)
        return 0;

    debugf("Sending get_peers.\n");
    make_tid(tid, "gp", sr->tid);
    send_get_peers((struct sockaddr*)&n->ss, n->sslen, tid, 4, sr->id, -1,
                   n->reply_time >= now.tv_sec - DHT_SEARCH_RETRANSMIT);
    n->pinged++;
    n->request_time = now.tv_sec;
    /* If the node happens to be in our main routing table, mark it
       as pinged. */
    node = find_node(n->id, n->ss.ss_family);
    if(node) pinged(node, NULL);
    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq %rsi, %rbx
movq %rdi, %r14
testq %rsi, %rsi
jne 0x6459
movl 0xce0(%r14), %esi
leaq 0x30(%r14), %rax
movq 0x7808(%rip), %rcx      # 0xdc10
addq $-0xa, %rcx
xorl %edx, %edx
testl %esi, %esi
cmovlel %edx, %esi
imulq $0xe8, %rsi, %rsi
xorl %ebx, %ebx
cmpq %rdx, %rsi
je 0x6450
cmpl $0x2, 0xe0(%r14,%rdx)
jg 0x6447
cmpl $0x0, 0x110(%r14,%rdx)
jne 0x6447
leaq (%rax,%rdx), %rdi
cmpq %rcx, 0xd0(%r14,%rdx)
cmovlq %rdi, %rbx
addq $0xe8, %rdx
jmp 0x641c
testq %rbx, %rbx
je 0x65e6
xorl %ebp, %ebp
cmpl $0x2, 0xb0(%rbx)
jg 0x65e8
cmpl $0x0, 0xe0(%rbx)
jne 0x65e8
movq 0x7794(%rip), %rax      # 0xdc10
addq $-0xa, %rax
cmpq %rax, 0xa0(%rbx)
jge 0x65e8
leaq 0x240c(%rip), %rdi      # 0x88a0
xorl %eax, %eax
callq 0x3324
movzwl (%r14), %r13d
movl 0x98(%rbx), %ebp
movq 0xa8(%rbx), %r15
movq 0x775d(%rip), %r12      # 0xdc10
movabsq $0x3a303264693a32, %rax # imm = 0x3A303264693A32
leaq 0x42(%rsp), %rdi
movq %rax, -0x3d(%rdi)
movabsq $0x693a3264613a3164, %rax # imm = 0x693A3264613A3164
movq %rax, -0x42(%rdi)
movl 0x7766(%rip), %eax      # 0xdc40
movl %eax, -0x26(%rdi)
movaps 0x774c(%rip), %xmm0     # 0xdc30
movups %xmm0, -0x36(%rdi)
movabsq $0x3a303268736168, %rax # imm = 0x3A303268736168
movq %rax, -0x1b(%rdi)
movabsq $0x685f6f666e693a39, %rax # imm = 0x685F6F666E693A39
movq %rax, -0x22(%rdi)
movups 0x10(%r14), %xmm0
movups %xmm0, -0x14(%rdi)
movl 0x20(%r14), %eax
movl %eax, -0x4(%rdi)
leaq 0x23b0(%rip), %rdx      # 0x88cb
pushq $0x4
popq %rcx
movl $0x1be, %esi            # imm = 0x1BE
xorl %eax, %eax
callq 0x2110
cmpl $0x1be, %eax            # imm = 0x1BE
ja 0x65a7
cmpl $0x1ba, %eax            # imm = 0x1BA
ja 0x65a7
leal 0x46(%rax), %r14d
movl %eax, %ecx
shll $0x10, %r13d
orl $0x7067, %r13d          # imm = 0x7067
movl %r13d, 0x42(%rsp,%rcx)
cmpb $0x1, 0x7727(%rip)      # 0xdc7c
jne 0x657c
cmpl $0x1b1, %eax            # imm = 0x1B1
ja 0x65a7
movl %r14d, %ecx
addl $0x4f, %eax
movb 0x770e(%rip), %dl       # 0xdc78
movb %dl, 0x8(%rsp,%rcx)
movq 0x76fb(%rip), %rdx      # 0xdc70
movq %rdx, (%rsp,%rcx)
movl %eax, %r14d
movl %r14d, %eax
leaq (%rsp,%rax), %rdi
movl $0x200, %esi            # imm = 0x200
subl %r14d, %esi
leaq 0x2136(%rip), %rdx      # 0x86c8
xorl %eax, %eax
callq 0x2110
testl %eax, %eax
js 0x65a7
addl %r14d, %eax
cmpl $0x200, %eax            # imm = 0x200
jbe 0x65fc
callq 0x2060
movl $0x1c, (%rax)
incl 0xb0(%rbx)
movq 0x7651(%rip), %rax      # 0xdc10
movq %rax, 0xa0(%rbx)
movzwl 0x18(%rbx), %esi
movq %rbx, %rdi
callq 0x3f70
pushq $0x1
popq %rbp
testq %rax, %rax
je 0x65e8
movq %rax, %rdi
xorl %esi, %esi
callq 0x74d5
jmp 0x65e8
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x18(%rbx), %rcx
addq $-0xa, %r12
xorl %edx, %edx
cmpq %r12, %r15
setge %dl
movl %eax, %esi
shll $0xb, %edx
movq %rsp, %rdi
movl %ebp, %r8d
callq 0x7516
jmp 0x65b2