// File: /workspace/github_c_makefile_star2_O1/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 0x68d7
movslq 0xce0(%r14), %rdx
testq %rdx, %rdx
jle 0x68d5
leaq 0x30(%r14), %rax
movq 0x737e(%rip), %rcx      # 0xdc10
addq $-0xa, %rcx
imulq $0xe8, %rdx, %rdx
xorl %esi, %esi
xorl %ebx, %ebx
cmpl $0x2, 0xe0(%r14,%rsi)
jg 0x68c7
cmpl $0x0, 0x110(%r14,%rsi)
jne 0x68c7
leaq (%rax,%rsi), %rdi
cmpq %rcx, 0xd0(%r14,%rsi)
cmovlq %rdi, %rbx
addq $0xe8, %rsi
cmpq %rsi, %rdx
jne 0x68a1
jmp 0x68d7
xorl %ebx, %ebx
xorl %ebp, %ebp
testq %rbx, %rbx
je 0x6a6f
cmpl $0x2, 0xb0(%rbx)
jg 0x6a6f
cmpl $0x0, 0xe0(%rbx)
jne 0x6a6f
movq 0x730d(%rip), %rax      # 0xdc10
addq $-0xa, %rax
cmpq %rax, 0xa0(%rbx)
jge 0x6a6f
leaq 0x2f95(%rip), %rdi      # 0x98b0
xorl %eax, %eax
callq 0x366b
movzwl (%r14), %r13d
movl 0x98(%rbx), %ebp
movq 0xa8(%rbx), %r15
movq 0x72d6(%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 0x72df(%rip), %eax      # 0xdc40
movl %eax, -0x26(%rdi)
movaps 0x72c5(%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 0x2f39(%rip), %rdx      # 0x98db
movl $0x1be, %esi            # imm = 0x1BE
movl $0x4, %ecx
xorl %eax, %eax
callq 0x2110
cmpl $0x1be, %eax            # imm = 0x1BE
ja 0x6a30
cmpl $0x1ba, %eax            # imm = 0x1BA
jg 0x6a30
leal 0x46(%rax), %r14d
movl %eax, %ecx
shll $0x10, %r13d
orl $0x7067, %r13d          # imm = 0x7067
movl %r13d, 0x42(%rsp,%rcx)
cmpb $0x1, 0x729e(%rip)      # 0xdc7c
jne 0x6a05
cmpl $0x1b1, %eax            # imm = 0x1B1
ja 0x6a30
movl %r14d, %ecx
addl $0x4f, %eax
movb 0x7285(%rip), %dl       # 0xdc78
movb %dl, 0x8(%rsp,%rcx)
movq 0x7272(%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 0x2cbd(%rip), %rdx      # 0x96d8
xorl %eax, %eax
callq 0x2110
testl %eax, %eax
js 0x6a30
addl %r14d, %eax
cmpl $0x200, %eax            # imm = 0x200
jle 0x6a83
callq 0x2060
movl $0x1c, (%rax)
incl 0xb0(%rbx)
movq 0x71c8(%rip), %rax      # 0xdc10
movq %rax, 0xa0(%rbx)
movzwl 0x18(%rbx), %esi
movq %rbx, %rdi
callq 0x4354
movl $0x1, %ebp
testq %rax, %rax
je 0x6a6f
movq %rax, %rdi
xorl %esi, %esi
callq 0x8017
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 0x8058
jmp 0x6a3b