// File: /workspace/github_c_makefile_star2_O3/jech[P]shncpd/ra.c
// Function: router_advertisement
int
router_advertisement(int doread)
{
    int i, rc;

    if(doread) {
        rc = recv_rs();
        if(rc < 0 && errno != EAGAIN) {
            perror("recv(RA)");
        }
    }

    for(i = 0; i < numinterfaces; i++) {
        struct interface *interface = &interfaces[i];
        if(interface->ifindex <= 0)
            continue;

        if(ts_compare(&now, &interface->ra_timeout) >= 0) {
            int r = kernel_router();
            if(r > 0 || interface->retractions) {
                rc = send_multicast_ra(interface, r);
                if(rc < 0)
                    perror("send_ra");
            }
            schedule_ra(interface, 0, 1);
        }
    }
    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x6c8, %rsp            # imm = 0x6C8
testl %edi, %edi
je 0x7b3f
leaq 0xe0(%rsp), %rax
leaq 0x60(%rsp), %rcx
movq %rax, (%rcx)
movq $0x5dc, 0x8(%rcx)       # imm = 0x5DC
xorps %xmm0, %xmm0
leaq 0x28(%rsp), %rsi
movups %xmm0, 0x8(%rsi)
movups %xmm0, 0x18(%rsi)
movups %xmm0, 0x28(%rsi)
leaq 0xc(%rsp), %rax
movq %rax, (%rsi)
movl $0x1c, 0x8(%rsi)
movq %rcx, 0x10(%rsi)
movq $0x1, 0x18(%rsi)
leaq 0x70(%rsp), %rax
movq %rax, 0x20(%rsi)
movq $0x64, 0x28(%rsi)
movl 0xb760(%rip), %edi      # 0x131ec
xorl %edx, %edx
callq 0x2290
testl %eax, %eax
js 0x7b31
cmpl $0x1c, 0x30(%rsp)
jb 0x7b3f
cmpw $0xa, 0xc(%rsp)
jne 0x7b3f
movq 0x48(%rsp), %rcx
cmpq $0x10, 0x50(%rsp)
setb %dl
testq %rcx, %rcx
sete %sil
orb %dl, %sil
jne 0x7b3f
movl 0x8(%rcx), %edx
movl 0xc(%rcx), %esi
cmpl $0x29, %edx
jne 0x7ad2
cmpl $0x34, %esi
jne 0x7ad2
cmpl $0x8, %eax
jl 0x7b3f
cmpb $-0x1, 0x10(%rcx)
jne 0x7b3f
cmpb $-0x7b, 0xe0(%rsp)
jne 0x7b3f
cmpb $0x0, 0xe1(%rsp)
jne 0x7b3f
movl 0x24(%rsp), %edi
testl %edi, %edi
je 0x7b3f
callq 0x45ef
testq %rax, %rax
je 0x7b3f
movq %rax, %rbx
leaq 0xb741(%rip), %rax      # 0x13258
cmpl $0x2, (%rax)
jge 0x7c0b
movq %rbx, %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x74b8
jmp 0x7b3f
callq 0x2060
cmpl $0xb, (%rax)
jne 0x7bfa
leaq 0xb75a(%rip), %r13      # 0x132a0
cmpl $0x0, (%r13)
jle 0x7be3
leaq 0xb758(%rip), %rbx      # 0x132b0
leaq 0xb711(%rip), %r14      # 0x13270
leaq 0x61c3(%rip), %r15      # 0xdd29
xorl %ebp, %ebp
cmpl $0x0, 0x8(%rbx)
jle 0x7bc4
leaq 0x70(%rbx), %r12
movq %r14, %rdi
movq %r12, %rsi
callq 0xb464
testl %eax, %eax
js 0x7bc4
xorl %eax, %eax
callq 0xb36f
testl %eax, %eax
jg 0x7b96
cmpq $0x0, 0x90(%rbx)
je 0x7ba4
movq %rbx, %rdi
movl %eax, %esi
callq 0x7623
testl %eax, %eax
js 0x7bd9
movq %r12, %rdi
movq %r14, %rsi
movl $0x30570, %edx          # imm = 0x30570
callq 0xb514
movq %r12, %rdi
movq %r12, %rsi
movl $0x62250, %edx          # imm = 0x62250
callq 0xb5e5
incq %rbp
movslq (%r13), %rax
addq $0x98, %rbx
cmpq %rax, %rbp
jl 0x7b68
jmp 0x7be3
movq %r15, %rdi
callq 0x22e0
jmp 0x7ba4
movl $0x1, %eax
addq $0x6c8, %rsp            # imm = 0x6C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x611f(%rip), %rdi      # 0xdd20
callq 0x22e0
jmp 0x7b3f
movq (%rbx), %rdx
leaq 0x6135(%rip), %rsi      # 0xdd4a
movl $0x2, %edi
xorl %eax, %eax
callq 0x30a8
jmp 0x7b20
nop