// File: /workspace/github_c_makefile_star2_O3/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
je 0x69be
xorl %ebp, %ebp
cmpl $0x2, 0xb0(%rbx)
jg 0x6a21
cmpl $0x0, 0xe0(%rbx)
jne 0x6a21
movq 0x73c4(%rip), %rax      # 0xdc10
addq $-0xa, %rax
cmpq %rax, 0xa0(%rbx)
jge 0x6a21
leaq 0x303c(%rip), %rdi      # 0x98a0
xorl %eax, %eax
callq 0x362c
movzwl (%r14), %r13d
movl 0x98(%rbx), %ebp
movq 0xa8(%rbx), %r15
movq 0x738d(%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 0x7396(%rip), %eax      # 0xdc40
movl %eax, -0x26(%rdi)
movaps 0x737c(%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 0x2fe0(%rip), %rdx      # 0x98cb
movl $0x1be, %esi            # imm = 0x1BE
movl $0x4, %ecx
xorl %eax, %eax
callq 0x2110
cmpl $0x1be, %eax            # imm = 0x1BE
ja 0x697d
cmpl $0x1ba, %eax            # imm = 0x1BA
ja 0x697d
leal 0x46(%rax), %r14d
movl %eax, %ecx
shll $0x10, %r13d
orl $0x7067, %r13d          # imm = 0x7067
movl %r13d, 0x42(%rsp,%rcx)
cmpb $0x1, 0x7355(%rip)      # 0xdc7c
jne 0x694e
cmpl $0x1b1, %eax            # imm = 0x1B1
ja 0x697d
movl %r14d, %ecx
addl $0x4f, %eax
movb 0x733c(%rip), %dl       # 0xdc78
movb %dl, 0x8(%rsp,%rcx)
movq 0x7329(%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 0x2d64(%rip), %rdx      # 0x96c8
xorl %eax, %eax
callq 0x2110
testl %eax, %eax
js 0x697d
addl %r14d, %eax
cmpl $0x200, %eax            # imm = 0x200
jbe 0x6a35
callq 0x2060
movl $0x1c, (%rax)
incl 0xb0(%rbx)
movq 0x727b(%rip), %rax      # 0xdc10
movq %rax, 0xa0(%rbx)
movzwl 0x18(%rbx), %esi
movq %rbx, %rdi
callq 0x42f4
movl $0x1, %ebp
testq %rax, %rax
je 0x6a21
movq %rax, %rdi
xorl %esi, %esi
callq 0x8002
jmp 0x6a21
movslq 0xce0(%r14), %rdx
testq %rdx, %rdx
jle 0x6a1f
leaq 0x30(%r14), %rax
movq 0x723b(%rip), %rcx      # 0xdc10
addq $-0xa, %rcx
imulq $0xe8, %rdx, %rdx
xorl %esi, %esi
xorl %ebx, %ebx
cmpl $0x2, 0xe0(%r14,%rsi)
jg 0x6a0a
cmpl $0x0, 0x110(%r14,%rsi)
jne 0x6a0a
leaq (%rax,%rsi), %rdi
cmpq %rcx, 0xd0(%r14,%rsi)
cmovlq %rdi, %rbx
addq $0xe8, %rsi
cmpq %rsi, %rdx
jne 0x69e4
testq %rbx, %rbx
jne 0x6829
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 0x8043
jmp 0x6988