LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/jech[P]shncpd/state.c
// Function: flush_neighbour
void
flush_neighbour(struct neighbour *neigh)
{
    int i = neigh - neighs;

    assert(i >= 0 && i < numneighs);

    if(i < numneighs - 1)
        neighs[i] = neighs[numneighs - 1];
    MEM_UNDEFINED(neighs + numneighs - 1, sizeof(struct neighbour));

    numneighs--;
    republish(1, 1);
}

// Assembly:
leaq 0xf3c8(%rip), %rax      # 0x13e90
subq %rax, %rdi
shrq $0x6, %rdi
testl %edi, %edi
js 0x4b2e
movl 0xe7cf(%rip), %ecx      # 0x132a8
cmpl %edi, %ecx
jle 0x4b2e
decl %ecx
cmpl %edi, %ecx
jle 0x4b19
andl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
shlq $0x6, %rdi
movl %ecx, %edx
shlq $0x6, %rdx
movaps (%rdx,%rax), %xmm0
movaps 0x10(%rdx,%rax), %xmm1
movaps 0x20(%rdx,%rax), %xmm2
movaps 0x30(%rdx,%rax), %xmm3
movaps %xmm3, 0x30(%rdi,%rax)
movaps %xmm2, 0x20(%rdi,%rax)
movaps %xmm1, 0x10(%rdi,%rax)
movaps %xmm0, (%rdi,%rax)
movl %ecx, 0xe789(%rip)      # 0x132a8
movl $0x1, %edi
movl $0x1, %esi
jmp 0x492a
pushq %rax
leaq 0x89a0(%rip), %rdi      # 0xd4d6
leaq 0x89b1(%rip), %rsi      # 0xd4ee
leaq 0x89b2(%rip), %rcx      # 0xd4f6
movl $0x80, %edx
callq 0x2150
// File: /workspace/github_c_makefile_star2_O1/jech[P]shncpd/state.c
// Function: find_node
struct node *
find_node(const unsigned char *id, int create)
{
    int p = 0;

    if(numnodes > 0) {
        int m, g = numnodes - 1, c;

        do {
            m = (p + g) / 2;
            c = memcmp(id, nodes[m].id, 4);
            if(c == 0)
                return &nodes[m];
            else if(c < 0)
                g = m - 1;
            else
                p = m + 1;
        } while(p <= g);
    }

    if(!create || numnodes >= MAXNODES)
        return NULL;

    if(p < numnodes)
        memmove(nodes + p + 1, nodes + p,
                (numnodes - p) * sizeof(struct node));
    memset(&nodes[p], 0, sizeof(struct node));
    memcpy(nodes[p].id, id, 4);
    numnodes++;

    return &nodes[p];
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0xe744(%rip), %r14d     # 0x132a4
leaq 0xfd29(%rip), %r15      # 0x14890
testl %r14d, %r14d
jle 0x4bbd
leal -0x1(%r14), %edx
xorl %eax, %eax
movl (%rbx), %ecx
bswapl %ecx
leal (%rdx,%rax), %r9d
shrl %r9d
imulq $0x70, %r9, %rdi
movl 0x8(%rdi,%r15), %r10d
bswapl %r10d
xorl %r8d, %r8d
cmpl %r10d, %ecx
seta %r8b
sbbl $0x0, %r8d
je 0x4bad
js 0x4ba3
incl %r9d
movl %r9d, %eax
jmp 0x4ba9
decl %r9d
movl %r9d, %edx
cmpl %edx, %eax
jle 0x4b76
testl %r8d, %r8d
jne 0x4bbf
addq %rdi, %r15
movq %r15, %rax
jmp 0x4c3e
xorl %eax, %eax
testl %esi, %esi
sete %cl
cmpl $0x64, %r14d
setge %dl
orb %cl, %dl
je 0x4bd3
xorl %eax, %eax
jmp 0x4c3e
movl %r14d, %ecx
movl %eax, %r12d
subl %eax, %ecx
jle 0x4bf9
imulq $0x70, %r12, %rax
leaq (%r15,%rax), %rsi
leaq (%rax,%r15), %rdi
addq $0x70, %rdi
movslq %ecx, %rax
imulq $0x70, %rax, %rdx
callq 0x22b0
imulq $0x70, %r12, %rcx
leaq (%r15,%rcx), %rax
xorps %xmm0, %xmm0
movaps %xmm0, 0x60(%rcx,%r15)
movaps %xmm0, 0x50(%rcx,%r15)
movaps %xmm0, 0x40(%rcx,%r15)
movaps %xmm0, 0x30(%rcx,%r15)
movaps %xmm0, 0x20(%rcx,%r15)
movaps %xmm0, 0x10(%rcx,%r15)
movaps %xmm0, (%rcx,%r15)
movl (%rbx), %edx
movl %edx, 0x8(%rcx,%r15)
incl %r14d
movl %r14d, 0xe666(%rip)     # 0x132a4
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jech[P]shncpd/state.c
// Function: flush_node
void
flush_node(struct node *node)
{
    int i = node - nodes;
    int j;

    assert(i >= 0 && i < numnodes);

    free(node->neighs);
    free(node->data);
    destroy_prefix_list(node->assigned);
    destroy_prefix_list(node->addresses);
    for(j = 0; j < node->numexts; j++)
        destroy_external(node->exts[j]);
    free(node->exts);

    if(i < numnodes - 1)
        memmove(nodes + i, nodes + i + 1,
                (numnodes - i - 1) * sizeof(struct node));
    MEM_UNDEFINED(nodes + numnodes - 1, sizeof(struct node));

    numnodes--;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
leaq 0xfc37(%rip), %r14      # 0x14890
movq %rdi, %rax
subq %r14, %rax
sarq $0x4, %rax
movabsq $0x6db6db6db6db6db7, %r15 # imm = 0x6DB6DB6DB6DB6DB7
imulq %rax, %r15
testl %r15d, %r15d
js 0x4d23
cmpl %r15d, 0xe623(%rip)     # 0x132a4
jle 0x4d23
movq %rdi, %rbx
movq 0x40(%rdi), %rdi
callq 0x2040
movq 0x10(%rbx), %rdi
callq 0x2040
movq 0x50(%rbx), %rdi
callq 0x97c3
movq 0x58(%rbx), %rdi
callq 0x97c3
cmpl $0x0, 0x68(%rbx)
jle 0x4cd0
xorl %r12d, %r12d
movq 0x60(%rbx), %rax
movq (%rax,%r12,8), %rdi
callq 0x4d42
incq %r12
movslq 0x68(%rbx), %rax
cmpq %rax, %r12
jl 0x4cb7
movq 0x60(%rbx), %rdi
callq 0x2040
movl 0xe5c5(%rip), %eax      # 0x132a4
leal -0x1(%rax), %ebx
cmpl %r15d, %ebx
jle 0x4d11
movl %r15d, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
imulq $0x70, %rcx, %rcx
leaq (%r14,%rcx), %rdi
leaq (%rcx,%r14), %rsi
addq $0x70, %rsi
notl %r15d
addl %r15d, %eax
cltq
imulq $0x70, %rax, %rdx
callq 0x22b0
movl %ebx, 0xe58d(%rip)      # 0x132a4
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x87f5(%rip), %rdi      # 0xd51f
leaq 0x87bd(%rip), %rsi      # 0xd4ee
leaq 0x87fe(%rip), %rcx      # 0xd536
movl $0xb3, %edx
callq 0x2150
// File: /workspace/github_c_makefile_star2_O1/jech[P]shncpd/state.c
// Function: node_hash
void
node_hash(unsigned char *h, const unsigned char *data, int len)
{
    md5_state_t ms;
    unsigned char digest[16];
    md5_init(&ms);
    md5_append(&ms, data, len);
    md5_finish(&ms, digest);
    memcpy(h, digest, 8);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x10(%rsp), %r12
movq %r12, %rdi
callq 0xbd50
movq %r12, %rdi
movq %r14, %rsi
movl %ebx, %edx
callq 0xbd69
movq %rsp, %rbx
movq %r12, %rdi
movq %rbx, %rsi
callq 0xc7c7
movq (%rbx), %rax
movq %rax, (%r15)
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jech[P]shncpd/state.c
// Function: network_hash
int
network_hash(unsigned char *h)
{
    md5_state_t ms;
    unsigned char digest[16];
    int i;

    /* This relies on the node table being sorted. */

    md5_init(&ms);
    for(i = 0; i < numnodes; i++) {
        unsigned char s[4];
        DO_HTONL(s, nodes[i].seqno);
        md5_append(&ms, s, 4);
        md5_append(&ms, nodes[i].datahash, 8);
    }
    md5_finish(&ms, digest);
    memcpy(h, digest, 8);
    return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x70, %rsp
movq %rdi, %rbx
leaq 0x18(%rsp), %rdi
callq 0xbd50
cmpl $0x0, 0xe264(%rip)      # 0x132a4
jle 0x5090
leaq 0xf863(%rip), %r14      # 0x148ac
xorl %r13d, %r13d
leaq 0x18(%rsp), %r15
movq %rsp, %r12
movl 0x8(%r14), %eax
bswapl %eax
movl %eax, (%rsp)
movq %r15, %rdi
movq %r12, %rsi
movl $0x4, %edx
callq 0xbd69
movq %r15, %rdi
movq %r14, %rsi
movl $0x8, %edx
callq 0xbd69
incq %r13
movslq 0xe21d(%rip), %rax      # 0x132a4
addq $0x70, %r14
cmpq %rax, %r13
jl 0x5054
leaq 0x18(%rsp), %rdi
movq %rsp, %r14
movq %r14, %rsi
callq 0xc7c7
movq (%r14), %rax
movq %rax, (%rbx)
movl $0x1, %eax
addq $0x70, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jech[P]shncpd/state.c
// Function: all_dhcp_data
struct prefix_list *
all_dhcp_data(int ntp, int v4, int v6)
{
    int i, j, k;
    struct prefix_list *pl = create_prefix_list(), *pl2;

    for(i = 0; i < numnodes; i++) {
        for(j = 0; j < nodes[i].numexts; j++) {
            struct prefix_list *data =
                ntp ? nodes[i].exts[j]->ntp : nodes[i].exts[j]->dns;
            if(data == NULL)
                continue;
            for(k = 0; k < nodes[i].exts[j]->dns->numprefixes; k++) {
                struct prefix *p = &data->prefixes[k];
                if((!v4 && prefix_v4(p)) || (!v6 && !prefix_v4(p)))
                    continue;
                pl2 = prefix_list_cons_prefix(pl, p);
                if(pl2 == NULL) {
                    destroy_prefix_list(pl);
                    return NULL;
                }
                pl = pl2;
            }
        }
    }
    return pl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edx, 0x8(%rsp)
movl %esi, 0xc(%rsp)
movl %edi, %r15d
callq 0x97b4
cmpl $0x0, 0xe1c6(%rip)      # 0x132a4
jle 0x5241
xorl %ecx, %ecx
testl %r15d, %r15d
setne %cl
leaq 0x8(,%rcx,8), %rcx
xorl %edx, %edx
leaq 0xf793(%rip), %rsi      # 0x14890
movq %rcx, 0x10(%rsp)
movq %rax, (%rsp)
movq %rdx, 0x18(%rsp)
imulq $0x70, %rdx, %rbx
cmpl $0x0, 0x68(%rbx,%rsi)
jle 0x521a
addq %rsi, %rbx
xorl %r12d, %r12d
movq 0x60(%rbx), %rax
movq (%rax,%r12,8), %rax
movq (%rax,%rcx), %rax
movq %rax, 0x20(%rsp)
testq %rax, %rax
je 0x51f3
movq 0x60(%rbx), %rax
movq (%rax,%r12,8), %rax
movq 0x8(%rax), %rax
xorl %edx, %edx
cmpw $0x0, 0x8(%rax)
jle 0x5201
xorl %ebp, %ebp
xorl %r14d, %r14d
movq 0x20(%rsp), %rax
movq (%rax), %r15
addq %rbp, %r15
cmpl $0x0, 0xc(%rsp)
je 0x5199
cmpl $0x0, 0x8(%rsp)
jne 0x517d
movq %r15, %rdi
callq 0x9ef3
testl %eax, %eax
je 0x51bb
movq (%rsp), %r13
movq %r13, %rdi
movq %r15, %rsi
callq 0x97de
testq %rax, %rax
je 0x51ac
xorl %ecx, %ecx
movq %rax, (%rsp)
jmp 0x51c0
movq %r15, %rdi
callq 0x9ef3
movl $0xa, %ecx
testl %eax, %eax
jne 0x51c0
jmp 0x516a
movq %r13, %rdi
callq 0x97c3
movl $0x1, %ecx
jmp 0x51c0
movl $0xa, %ecx
cmpl $0xa, %ecx
je 0x51c9
testl %ecx, %ecx
jne 0x51fa
incq %r14
movq 0x60(%rbx), %rax
movq (%rax,%r12,8), %rax
movq 0x8(%rax), %rax
movswq 0x8(%rax), %rax
addq $0x1c, %rbp
cmpq %rax, %r14
jl 0x5158
movq 0x10(%rsp), %rcx
xorl %edx, %edx
jmp 0x5201
movl $0x7, %edx
jmp 0x5201
movl %ecx, %edx
movq 0x10(%rsp), %rcx
cmpl $0x7, %edx
je 0x520a
testl %edx, %edx
jne 0x523f
incq %r12
movslq 0x68(%rbx), %rax
cmpq %rax, %r12
jl 0x5120
movq 0x18(%rsp), %rdx
incq %rdx
movslq 0xe07b(%rip), %rax      # 0x132a4
cmpq %rax, %rdx
movq (%rsp), %rax
leaq 0xf659(%rip), %rsi      # 0x14890
jl 0x5102
jmp 0x5241
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jech[P]shncpd/send.c
// Function: flushbuf
int
flushbuf()
{
    struct sockaddr_in6 tob, *to;
    int rc;

    if(!buffered)
        return 0;

    if(buffered_interface) {
        memset(&tob, 0, sizeof(tob));
        tob.sin6_family = AF_INET6;
        memcpy(&tob.sin6_addr, &protocol_group, 16);
        tob.sin6_port = htons(protocol_port);
        tob.sin6_scope_id = buffered_interface->ifindex;
        to = &tob;
    } else {
        to = &buffered_sin6;
    }

    rc = sendto(protocol_socket, sendbuf, buffered, 0,
                (struct sockaddr*)to, sizeof(struct sockaddr_in6));

    if(rc < 0) {
        int saved_errno = errno;
        perror("sendto");
        errno = saved_errno;
    }

    buffered_interface = NULL;
    buffered = 0;
    MEM_UNDEFINED(sendbuf, SENDBUF_SIZE);
    MEM_UNDEFINED(&buffered_sin6, sizeof(buffered_sin6));

    return rc;
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movslq 0x121f4(%rip), %rdx     # 0x17450
testq %rdx, %rdx
je 0x52ad
movq 0x121f0(%rip), %rax     # 0x17458
testq %rax, %rax
je 0x52b1
xorps %xmm0, %xmm0
movq %rsp, %r8
movaps %xmm0, (%r8)
movups %xmm0, 0xc(%r8)
movw $0xa, (%r8)
leaq 0xdfd7(%rip), %rcx      # 0x13260
movups (%rcx), %xmm0
leaq 0xdf4d(%rip), %rcx      # 0x131e0
movzwl (%rcx), %ecx
rolw $0x8, %cx
movups %xmm0, 0x8(%r8)
movw %cx, 0x2(%r8)
movl 0x8(%rax), %eax
movl %eax, 0x18(%r8)
jmp 0x52b8
xorl %ebx, %ebx
jmp 0x52f1
leaq 0x121a8(%rip), %r8      # 0x17460
leaq 0xdfc5(%rip), %rax      # 0x13284
movl (%rax), %edi
movq 0x121b8(%rip), %rsi     # 0x17480
xorl %ecx, %ecx
movl $0x1c, %r9d
callq 0x2170
movq %rax, %rbx
testl %ebx, %ebx
js 0x52f9
movq $0x0, 0x12171(%rip) # 0x17458
movl $0x0, 0x1215f(%rip)     # 0x17450
movl %ebx, %eax
addq $0x20, %rsp
popq %rbx
retq
callq 0x2607
jmp 0x52dc
// File: /workspace/github_c_makefile_star2_O1/jech[P]shncpd/send.c
// Function: buffer_network_state
int
buffer_network_state(const struct sockaddr_in6 *sin6,
                     struct interface *interface)
{
    unsigned char h[8];
    int rc;
    rc = network_hash(h);
    if(rc < 0)
        return -1;
    debugf("-> NETWORK-STATE %s%s\n",
           format_64(h), interface ? " (multicast)" : "");
    buffer_tlv(4, h, 8, sin6, interface);
    return 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsp, %rdi
callq 0x501f
testl %eax, %eax
js 0x5561
leaq 0xdd1b(%rip), %rax      # 0x13258
cmpl $0x2, (%rax)
jge 0x556e
movq %rsp, %rsi
movl $0x4, %edi
movl $0x8, %edx
movq %r14, %rcx
movq %rbx, %r8
callq 0x5300
movl $0x1, %eax
jmp 0x5566
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x2629
jmp 0x5542
// File: /workspace/github_c_makefile_star2_O1/jech[P]shncpd/send.c
// Function: buffer_node_state
int
buffer_node_state(struct node *node, int full,
                  const struct sockaddr_in6 *sin6, struct interface *interface)
{
    int buflen = full ? 20 + node->datalen : 20;
    unsigned char buf[buflen];
    int i = 0;
    long long orig_delay =
        (now.tv_sec - node->orig_time.tv_sec) * 1000LL +
        ((long long)now.tv_nsec - node->orig_time.tv_nsec + 999999) / 1000000;

    BYTES(node->id, 4);
    LONG(node->seqno);
    LONG((unsigned)orig_delay);
    BYTES(node->datahash, 8);
    if(full) {
        BYTES(node->data, node->datalen);
    }
    assert(i == buflen);
    debugf("-> NODE-STATE %s%s\n",
           format_32(node->id),
           full && interface ? " (full, multicast)" :
           full ? " (full)" :
           interface ? " (multicast)" : "");
    return buffer_tlv(5, buf, buflen, sin6, interface);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %rbx
movq %rdx, %r13
movl %esi, %r9d
movq %rdi, %r12
movl $0x14, %ecx
movl $0x14, %r15d
testl %esi, %esi
je 0x55b0
movl 0x18(%r12), %r15d
addl $0x14, %r15d
movl %r15d, %esi
movq %rsp, %rdi
addq $0xf, %rsi
andq $-0x10, %rsi
movq %rdi, %r14
subq %rsi, %r14
movq %r14, %rsp
leaq 0xdca2(%rip), %rax      # 0x13270
movl (%rax), %edx
subl 0x28(%r12), %edx
imull $0x3e8, %edx, %r8d      # imm = 0x3E8
movq 0x8(%rax), %rax
subq 0x30(%r12), %rax
addq $0xf423f, %rax          # imm = 0xF423F
movabsq $0x431bde82d7b634db, %rdx # imm = 0x431BDE82D7B634DB
imulq %rdx
movq %rdx, %rax
shrq $0x3f, %rax
shrq $0x12, %rdx
addl %eax, %edx
addl %r8d, %edx
negq %rsi
movl 0x8(%r12), %eax
movl %eax, (%r14)
movl 0x24(%r12), %eax
bswapl %eax
movl %eax, 0x4(%r14)
bswapl %edx
movl %edx, 0x8(%r14)
movq 0x1c(%r12), %rax
movq %rax, 0xc(%rdi,%rsi)
testl %r9d, %r9d
je 0x5662
leaq 0x14(%r14), %rdi
movq 0x10(%r12), %rsi
movq %r13, -0x38(%rbp)
movq %rbx, -0x30(%rbp)
movl 0x18(%r12), %ebx
movq %rbx, %rdx
movl %r9d, %r13d
callq 0x2210
movl %r13d, %r9d
leal 0x14(%rbx), %ecx
movq -0x30(%rbp), %rbx
movq -0x38(%rbp), %r13
cmpl %r15d, %ecx
jne 0x56b1
leaq 0xdbea(%rip), %rax      # 0x13258
cmpl $0x2, (%rax)
jge 0x5698
movl $0x5, %edi
movq %r14, %rsi
movl %r15d, %edx
movq %r13, %rcx
movq %rbx, %r8
callq 0x5300
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
addq $0x8, %r12
xorl %edx, %edx
testl %r9d, %r9d
sete %dl
movq %r12, %rdi
movq %rbx, %rsi
callq 0x265d
jmp 0x5673
leaq 0x803b(%rip), %rdi      # 0xd6f3
leaq 0x8040(%rip), %rsi      # 0xd6ff
leaq 0x8040(%rip), %rcx      # 0xd706
movl $0xb1, %edx
callq 0x2150
// File: /workspace/github_c_makefile_star2_O1/jech[P]shncpd/ra.c
// Function: ra_retract
void
ra_retract(const struct prefix *prefix)
{
    int i;
    for(i = 0; i < numinterfaces; i++) {
        if(interfaces[i].ifindex > 0) {
            struct prefix_list *pl =
                prefix_list_cons_prefix(interfaces[i].retractions, prefix);
            if(pl)
                interfaces[i].retractions = pl;
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
leaq 0xbad5(%rip), %r14      # 0x132a0
cmpl $0x0, (%r14)
jle 0x7813
movq %rdi, %rbx
movl $0x90, %r15d
addq 0xb7ff(%rip), %r15      # 0x12fe0
xorl %r12d, %r12d
cmpl $0x0, -0x88(%r15)
jle 0x7801
movq (%r15), %rdi
movq %rbx, %rsi
callq 0x97de
testq %rax, %rax
je 0x7801
movq %rax, (%r15)
incq %r12
movslq (%r14), %rax
addq $0x98, %r15
cmpq %rax, %r12
jl 0x77e4
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jech[P]shncpd/ra.c
// Function: schedule_ra
void
schedule_ra(struct interface *interface, int soon, int override)
{
    int a, b;

    if(interface == NULL) {
        int i;
        for(i = 0; i < numinterfaces; i++) {
            if(interfaces[i].ifindex > 0)
                schedule_ra(&interfaces[i], soon, override);
        }
        return;
    }

    if(soon) {
        a = 0;
        b = MAX_RA_DELAY_TIME;
    } else {
        a = MIN_RTR_ADV_INTERVAL;
        b = MAX_RTR_ADV_INTERVAL;
    }

    if(!override && interface->ra_timeout.tv_sec > 0 &&
       ts_minus_msec(&interface->ra_timeout, &now) < b)
        return;

    ts_add_msec(&interface->ra_timeout, &now, a);
    ts_add_random(&interface->ra_timeout, &interface->ra_timeout, b - a);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movl %esi, %ebx
testq %rdi, %rdi
je 0x7895
movq %rdi, %r14
xorl %eax, %eax
testl %ebx, %ebx
movl $0x30570, %r12d         # imm = 0x30570
cmovnel %eax, %r12d
movl $0x927c0, %r13d         # imm = 0x927C0
movl $0x1f4, %r15d           # imm = 0x1F4
cmovnel %r15d, %r13d
testl %ebp, %ebp
je 0x78d3
addq $0x70, %r14
leaq 0xba0d(%rip), %rsi      # 0x13270
movq %r14, %rdi
movl %r12d, %edx
callq 0xbae6
testl %ebx, %ebx
movl $0x62250, %eax          # imm = 0x62250
cmovel %eax, %r15d
movq %r14, %rdi
movq %r14, %rsi
movl %r15d, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xbbb3
leaq 0xba04(%rip), %r15      # 0x132a0
cmpl $0x0, (%r15)
jle 0x78f7
leaq 0xba07(%rip), %r14      # 0x132b0
xorl %r12d, %r12d
cmpl $0x0, 0x8(%r14)
jle 0x78bf
movq %r14, %rdi
movl %ebx, %esi
movl %ebp, %edx
callq 0x781f
incq %r12
movslq (%r15), %rax
addq $0x98, %r14
cmpq %rax, %r12
jl 0x78ac
jmp 0x78f7
cmpq $0x0, 0x70(%r14)
jle 0x7858
leaq 0x70(%r14), %rdi
leaq 0xb987(%rip), %rsi      # 0x13270
callq 0xbab7
cmpl %r13d, %eax
jge 0x7858
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jech[P]shncpd/ra.c
// Function: ra_setup
int
ra_setup()
{
    int rc;
    rc = setup_ra_socket();
    if(rc < 0) {
        perror("setup_ra_socket");
        return rc;
    }
    schedule_ra(NULL, 1, 1);
    return 1;
}

// Assembly:
pushq %rbx
callq 0x75d4
testl %eax, %eax
js 0x792a
movl $0x1, %ebx
xorl %edi, %edi
movl $0x1, %esi
movl $0x1, %edx
callq 0x781f
movl %ebx, %eax
popq %rbx
retq
movl %eax, %ebx
leaq 0x63ed(%rip), %rdi      # 0xdd20
callq 0x22e0
jmp 0x7926
// File: /workspace/github_c_makefile_star2_O1/jech[P]shncpd/ra.c
// Function: ra_cleanup
void
ra_cleanup()
{
    if(ra_socket >= 0) {
        if(is_a_router()) {
            debugf("Retracting RA.\n");
            send_multicast_ra(NULL, -1);
        }
        close(ra_socket);
    }
    ra_socket = -1;
}

// Assembly:
cmpl $0x0, 0xb8ab(%rip)      # 0x131ec
js 0x7974
pushq %rax
callq 0x3539
testl %eax, %eax
je 0x7965
leaq 0xb904(%rip), %rax      # 0x13258
cmpl $0x2, (%rax)
jge 0x797f
xorl %edi, %edi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x7986
movl 0xb881(%rip), %edi      # 0x131ec
callq 0x2190
addq $0x8, %rsp
movl $0xffffffff, 0xb86e(%rip) # imm = 0xFFFFFFFF
retq
callq 0x2de1
jmp 0x7959
// File: /workspace/github_c_makefile_star2_O1/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 0x7efb
leaq 0xe0(%rsp), %rax
leaq 0x60(%rsp), %rcx
movq %rax, (%rcx)
movq $0x5dc, 0x8(%rcx)       # imm = 0x5DC
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rsi
movaps %xmm0, (%rsi)
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, 0x20(%rsi)
movq $0x0, 0x30(%rsi)
leaq 0x4(%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 0xb33c(%rip), %edi      # 0x131ec
xorl %edx, %edx
callq 0x2290
movq %rax, %rbx
testl %ebx, %ebx
js 0x7eed
cmpl $0x1c, 0x28(%rsp)
jb 0x7ee9
cmpw $0xa, 0x4(%rsp)
jne 0x7ee9
movq 0x40(%rsp), %rax
cmpq $0x10, 0x48(%rsp)
setb %cl
testq %rax, %rax
sete %dl
orb %cl, %dl
je 0x7fb6
testl %ebx, %ebx
jns 0x7efb
callq 0x2060
cmpl $0xb, (%rax)
jne 0x8022
leaq 0xb39e(%rip), %r13      # 0x132a0
cmpl $0x0, (%r13)
jle 0x7f9f
leaq 0xb39c(%rip), %rbx      # 0x132b0
leaq 0xb355(%rip), %r14      # 0x13270
leaq 0x5e27(%rip), %r15      # 0xdd49
xorl %ebp, %ebp
cmpl $0x0, 0x8(%rbx)
jle 0x7f80
leaq 0x70(%rbx), %r12
movq %r14, %rdi
movq %r12, %rsi
callq 0xba38
testl %eax, %eax
js 0x7f80
xorl %eax, %eax
callq 0xb943
testl %eax, %eax
jg 0x7f52
cmpq $0x0, 0x90(%rbx)
je 0x7f60
movq %rbx, %rdi
movl %eax, %esi
callq 0x7986
testl %eax, %eax
js 0x7f95
movq %r12, %rdi
movq %r14, %rsi
movl $0x30570, %edx          # imm = 0x30570
callq 0xbae6
movq %r12, %rdi
movq %r12, %rsi
movl $0x62250, %edx          # imm = 0x62250
callq 0xbbb3
incq %rbp
movslq (%r13), %rax
addq $0x98, %rbx
cmpq %rax, %rbp
jl 0x7f24
jmp 0x7f9f
movq %r15, %rdi
callq 0x22e0
jmp 0x7f60
movl $0x1, %eax
addq $0x6c8, %rsp            # imm = 0x6C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x8, %ebx
jl 0x7ee9
cmpb $-0x1, 0x10(%rax)
jne 0x7ee9
cmpb $-0x7b, 0xe0(%rsp)
jne 0x7ee9
cmpb $0x0, 0xe1(%rsp)
jne 0x7ee9
movl 0x1c(%rsp), %edi
testl %edi, %edi
je 0x7ee9
callq 0x476f
testq %rax, %rax
je 0x7ee9
movq %rax, %r14
leaq 0xb24f(%rip), %rax      # 0x13258
cmpl $0x2, (%rax)
jge 0x8033
movq %r14, %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x781f
jmp 0x7ee9
leaq 0x5d17(%rip), %rdi      # 0xdd40
callq 0x22e0
jmp 0x7efb
movq (%r14), %rdx
leaq 0x5d2d(%rip), %rsi      # 0xdd6a
movl $0x2, %edi
xorl %eax, %eax
callq 0x319e
jmp 0x800e
nop
// File: /workspace/github_c_makefile_star2_O1/jech[P]shncpd/dhcpv4.c
// Function: flush_lease
void
flush_lease(struct lease *lease)
{
    int i = lease - leases;

    assert(i >= 0 && i < numleases);

    if(i < numleases - 1)
        leases[i] = leases[numleases - 1];
    MEM_UNDEFINED(leases + numleases - 1, sizeof(struct lease));
    numleases--;
}

// Assembly:
movq 0xf435(%rip), %rax      # 0x17488
subq %rax, %rdi
sarq $0x4, %rdi
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rdi, %rdx
testl %edx, %edx
js 0x80b7
movl 0xf41e(%rip), %ecx      # 0x17490
cmpl %edx, %ecx
jle 0x80b7
decl %ecx
cmpl %edx, %ecx
jle 0x80b0
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
leaq (%rdx,%rdx,2), %rdx
shlq $0x4, %rdx
movl %ecx, %esi
leaq (%rsi,%rsi,2), %rsi
shlq $0x4, %rsi
movups (%rax,%rsi), %xmm0
movups 0x10(%rax,%rsi), %xmm1
movups 0x20(%rax,%rsi), %xmm2
movups %xmm2, 0x20(%rax,%rdx)
movups %xmm1, 0x10(%rax,%rdx)
movups %xmm0, (%rax,%rdx)
movl %ecx, 0xf3da(%rip)      # 0x17490
retq
pushq %rax
leaq 0x5d01(%rip), %rdi      # 0xddc0
leaq 0x5d12(%rip), %rsi      # 0xddd8
leaq 0x5d14(%rip), %rcx      # 0xdde1
movl $0x47, %edx
callq 0x2150
// File: /workspace/github_c_makefile_star2_O1/jech[P]shncpd/dhcpv4.c
// Function: find_lease
struct lease *
find_lease(const unsigned char *ip, int create)
{
    int i;
    for(i = 0; i < numleases; i++)
        if(memcmp(leases[i].ip, ip, 4) == 0)
            return &leases[i];

    if(create) {
        if(numleases >= maxleases) {
            struct lease *nl =
                realloc(leases, (numleases * 2 + 2) * sizeof(struct lease));
            if(nl) {
                leases = nl;
                maxleases = numleases * 2 + 2;
            }
        }
        memset(&leases[numleases], 0, sizeof(struct lease));
        memcpy(leases[numleases].ip, ip, 4);
        return &leases[numleases++];
    }

    return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movslq 0xf3aa(%rip), %r14      # 0x17490
testq %r14, %r14
jle 0x8104
movq 0xf396(%rip), %rax      # 0x17488
movq %r14, %rcx
movl (%rax), %edx
cmpl (%rbx), %edx
je 0x817a
addq $0x30, %rax
decq %rcx
jne 0x80f5
testl %esi, %esi
je 0x8178
cmpl 0xf385(%rip), %r14d     # 0x17494
jl 0x8143
movq 0xf370(%rip), %rdi      # 0x17488
leaq 0x2(,%r14,2), %r15
movq %r15, %rax
shlq $0x4, %rax
leaq (%rax,%rax,2), %rsi
callq 0x2280
testq %rax, %rax
je 0x8143
movq %rax, 0xf34c(%rip)      # 0x17488
movl %r15d, 0xf351(%rip)     # 0x17494
movq 0xf33e(%rip), %rcx      # 0x17488
leaq (%r14,%r14,2), %rdx
shlq $0x4, %rdx
leaq (%rcx,%rdx), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rcx,%rdx)
movups %xmm0, 0x10(%rcx,%rdx)
movups %xmm0, (%rcx,%rdx)
movl (%rbx), %esi
movl %esi, (%rcx,%rdx)
leal 0x1(%r14), %ecx
movl %ecx, 0xf31a(%rip)      # 0x17490
jmp 0x817a
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jech[P]shncpd/dhcpv4.c
// Function: interface_dhcpv4
int
interface_dhcpv4(struct interface *interface)
{
    int i, prio;

    if(interface->type == INTERFACE_MESH)
        return 0;

    prio = interface_dhcpv4_prio(interface);
    if(prio == 0)
        return 0;

    for(i = 0; i < numneighs; i++) {
        if(neighs[i].interface == interface) {
            struct node *node = find_node(neighs[i].id, 0);
            unsigned char capa[2];
            capa[0] = 0;
            capa[1] = interface_dhcpv4_prio(interface) & 0x0F;
            if(node == NULL)
                continue;
            if((node->capabilities[1] & 0x0F) > prio) {
                return 0;
            } else if((node->capabilities[1] & 0x0F) == prio) {
                if(memcmp(node->capabilities, capa, 2) > 0) {
                    return 0;
                } else if(memcmp(node->capabilities, capa, 2) == 0) {
                    if(memcmp(node->id, myid, 4) > 0)
                        return 0;
                }
            }
        }
    }
    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
xorl %ebx, %ebx
cmpl $0x3, 0xc(%rdi)
je 0x82c3
movq %rdi, %r14
leaq 0xb021(%rip), %rax      # 0x131e8
cmpl $0x0, (%rax)
je 0x81e1
callq 0x3539
testl %eax, %eax
je 0x81e1
movl $0x4, 0x4(%rsp)
xorl %eax, %eax
jmp 0x81eb
movl $0x0, 0x4(%rsp)
movb $0x1, %al
testb %al, %al
jne 0x82c3
leaq 0xb0ae(%rip), %r13      # 0x132a8
movl $0x1, %ebx
cmpl $0x0, (%r13)
jle 0x82c3
leaq 0xbc7f(%rip), %r15      # 0x13e90
addq $0x8, %r15
xorl %ebp, %ebp
cmpq %r14, -0x8(%r15)
jne 0x82af
movq %r15, %rdi
xorl %esi, %esi
callq 0x4b4e
movq %rax, %r12
movb $0x0, 0x2(%rsp)
leaq 0xafae(%rip), %rax      # 0x131e8
cmpl $0x0, (%rax)
je 0x824a
callq 0x3539
movb $0x4, %cl
testl %eax, %eax
jne 0x824c
xorl %ecx, %ecx
movb %cl, 0x3(%rsp)
testq %r12, %r12
je 0x82a6
movzbl 0x39(%r12), %ecx
andl $0xf, %ecx
movl $0x1, %eax
cmpl %ecx, 0x4(%rsp)
jb 0x82ab
jne 0x82a2
movzwl 0x38(%r12), %ecx
movzwl 0x2(%rsp), %edx
rolw $0x8, %cx
rolw $0x8, %dx
movzwl %cx, %ecx
movzwl %dx, %edx
subl %edx, %ecx
testl %ecx, %ecx
jg 0x82ab
jne 0x82a2
movl 0x8(%r12), %ecx
leaq 0xafe8(%rip), %rdx      # 0x13280
movl (%rdx), %edx
bswapl %ecx
bswapl %edx
cmpl %edx, %ecx
ja 0x82ab
xorl %eax, %eax
jmp 0x82ab
movl $0x4, %eax
testb $0x3, %al
jne 0x82d4
incq %rbp
movslq (%r13), %rax
addq $0x40, %r15
cmpq %rax, %rbp
jl 0x8217
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %ebx, %ebx
jmp 0x82c3
// File: /workspace/github_c_makefile_star2_O1/jech[P]shncpd/dhcpv4.c
// Function: setup_dhcpv4_socket
int
setup_dhcpv4_socket()
{
    int s, rc, one = 1;
    struct sockaddr_in sin;

    if(dhcpv4_socket >= 0) {
        close(dhcpv4_socket);
        dhcpv4_socket = -1;
    }

    s = socket(PF_INET, SOCK_DGRAM, 0);
    if(s < 0)
        return -1;

    rc = setsockopt(s, SOL_SOCKET, SO_BROADCAST, &one, sizeof(one));
    if(rc < 0)
        goto fail;

    rc = setsockopt(s, IPPROTO_IP, IP_PKTINFO, &one, sizeof(one));
    if(rc < 0)
        goto fail;

    rc = fcntl(s, F_GETFD, 0);
    if(rc < 0)
        goto fail;

    rc = fcntl(s, F_SETFD, rc | FD_CLOEXEC);
    if(rc < 0)
        goto fail;

    rc = fcntl(s, F_GETFL, 0);
    if(rc < 0)
        goto fail;

    rc = fcntl(s, F_SETFL, (rc | O_NONBLOCK));
    if(rc < 0)
        goto fail;

    memset(&sin, 0, sizeof(sin));
    sin.sin_family = AF_INET;
    sin.sin_port = htons(67);

    rc = bind(s, (struct sockaddr*)&sin, sizeof(sin));
    if(rc < 0)
        goto fail;

    dhcpv4_socket = s;
    return s;

fail:
    return -1;
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x28, %rsp
movl $0x1, 0xc(%rsp)
movl 0xaf04(%rip), %edi      # 0x131f0
testl %edi, %edi
js 0x82ff
callq 0x2190
movl $0xffffffff, 0xaef1(%rip) # imm = 0xFFFFFFFF
movl $0x2, %edi
movl $0x2, %esi
xorl %edx, %edx
callq 0x2390
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl %eax, %eax
js 0x83e5
movl %eax, %ebp
leaq 0xc(%rsp), %rcx
movl %eax, %edi
movl $0x1, %esi
movl $0x6, %edx
movl $0x4, %r8d
callq 0x20a0
testl %eax, %eax
js 0x83e5
leaq 0xc(%rsp), %rcx
movl %ebp, %edi
xorl %esi, %esi
movl $0x8, %edx
movl $0x4, %r8d
callq 0x20a0
testl %eax, %eax
js 0x83e5
movl %ebp, %edi
movl $0x1, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x20b0
testl %eax, %eax
js 0x83e5
orl $0x1, %eax
movl %ebp, %edi
movl $0x2, %esi
movl %eax, %edx
xorl %eax, %eax
callq 0x20b0
testl %eax, %eax
js 0x83e5
movl %ebp, %edi
movl $0x3, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x20b0
testl %eax, %eax
js 0x83e5
orl $0x800, %eax            # imm = 0x800
movl %ebp, %edi
movl $0x4, %esi
movl %eax, %edx
xorl %eax, %eax
callq 0x20b0
testl %eax, %eax
js 0x83e5
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rsi
movaps %xmm0, (%rsi)
movl $0x43000002, (%rsi)     # imm = 0x43000002
movl %ebp, %edi
movl $0x10, %edx
callq 0x22a0
testl %eax, %eax
js 0x83e5
movl %ebp, 0xae0d(%rip)      # 0x131f0
movl %ebp, %ebx
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jech[P]shncpd/dhcpv4.c
// Function: find_matching_lease
static struct lease *
find_matching_lease(const unsigned char *cid, int cidlen,
                    const unsigned char *chaddr, struct prefix_list *pl)
{
    int i;

    for(i = 0; i < numleases; i++) {
        if(lease_match(cid, cidlen, chaddr, &leases[i]) &&
           (pl == NULL || prefix_list_within_v4(leases[i].ip, pl)))
            return &leases[i];
    }

    return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, (%rsp)
cmpl $0x0, 0xe5a3(%rip)      # 0x17490
jle 0x8f42
movq %rcx, %r14
movl %esi, %ebp
movq %rdi, %r12
xorl %ebx, %ebx
xorl %r15d, %r15d
movq 0xe585(%rip), %r13      # 0x17488
addq %rbx, %r13
movq %r12, %rdi
movl %ebp, %esi
movq (%rsp), %rdx
movq %r13, %rcx
callq 0x8f5f
testl %eax, %eax
je 0x8f2f
testq %r14, %r14
je 0x8f46
movq %r13, %rdi
movq %r14, %rsi
callq 0x9b0e
testl %eax, %eax
jne 0x8f46
incq %r15
movslq 0xe557(%rip), %rax      # 0x17490
addq $0x30, %rbx
cmpq %rax, %r15
jl 0x8efc
xorl %ebx, %ebx
jmp 0x8f4d
addq 0xe53b(%rip), %rbx      # 0x17488
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jech[P]shncpd/dhcpv4.c
// Function: lease_match
static int
lease_match(const unsigned char *cid, int cidlen,
            const unsigned char *chaddr, const struct lease *lease)
{
    if(cidlen > 0 || lease->cidlen > 0)
        return lease->cidlen == cidlen && memcmp(lease->cid, cid, cidlen) == 0;
    else
        return memcmp(chaddr, lease->chaddr, 16) == 0;
}

// Assembly:
movq %rdi, %rax
testl %esi, %esi
jg 0x8f6c
cmpl $0x0, 0x20(%rcx)
jle 0x8f90
cmpl %esi, 0x20(%rcx)
jne 0x8f8c
pushq %rax
movq 0x18(%rcx), %rdi
movslq %esi, %rdx
movq %rax, %rsi
callq 0x2260
testl %eax, %eax
sete %al
addq $0x8, %rsp
jmp 0x8fa9
xorl %eax, %eax
jmp 0x8fa9
movdqu (%rdx), %xmm0
movdqu 0x8(%rcx), %xmm1
pcmpeqb %xmm0, %xmm1
pmovmskb %xmm1, %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
sete %al
movzbl %al, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/jech[P]shncpd/dhcpv4.c
// Function: generate_v4
static int
generate_v4(unsigned char *ip_return, unsigned char *mask_return,
            const struct prefix_list *pl)
{
    int i, j, rc;

    for(i = 0; i < 2; i++) {
        for(j = 0; j < 20; j++) {
            unsigned char ip[4];
            struct lease *lease;
            rc = generate_random_v4(ip, pl);
            if(rc < 0)
                return -1;
            lease = find_lease(ip, 0);
            if(!lease || (i > 0 && lease->end < now.tv_sec)) {
                int plen;
                unsigned char mask[4];
                unsigned int addr;
                plen = compute_netmask(mask, ip, pl);
                if(plen < 0 || plen > 30)
                    continue;
                /* Check that we are not in the first quarter. */
                DO_NTOHL(addr, ip);
                if((addr & (3 << (30 - plen))) == 0)
                    continue;
                memcpy(ip_return, ip, 4);
                memcpy(mask_return, mask, 4);
                return 1;
            }
        }
    }
    return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movq %rsi, 0x10(%rsp)
movq %rdi, 0x8(%rsp)
xorl %r14d, %r14d
leaq 0x4(%rsp), %r12
movq %rsp, %r13
movl $0x14, %r15d
movq %r12, %rdi
movq %rbx, %rsi
callq 0x9f14
testl %eax, %eax
js 0x9058
movq %r12, %rdi
xorl %esi, %esi
callq 0x80d7
testq %rax, %rax
je 0x900f
xorl %edx, %edx
cmpl $0x1, %r14d
jne 0x9062
movq 0x28(%rax), %rax
leaq 0xa266(%rip), %rcx      # 0x13270
cmpq (%rcx), %rax
jge 0x9062
movq %r13, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x909a
movl $0x7, %edx
cmpl $0x1e, %eax
ja 0x9062
movl 0x4(%rsp), %esi
movl %esi, %edi
bswapl %edi
movb $0x1e, %cl
subb %al, %cl
shrl %cl, %edi
testb $0x3, %dil
je 0x9062
movq 0x8(%rsp), %rax
movl %esi, (%rax)
movl (%rsp), %eax
movq 0x10(%rsp), %rcx
movl %eax, (%rcx)
movl $0x1, %edx
movl $0x1, %ebp
jmp 0x9062
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl $0x1, %edx
cmpl $0x7, %edx
je 0x906b
testl %edx, %edx
jne 0x9089
decl %r15d
jne 0x8fd9
leal 0x1(%r14), %eax
testl %r14d, %r14d
movl %eax, %r14d
je 0x8fd3
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jech[P]shncpd/dhcpv4.c
// Function: compute_netmask
static int
compute_netmask(unsigned char *mask,
                const unsigned char *ip, const struct prefix_list *pl)
{
    int i;
    unsigned int m;

    if(pl == NULL)
        return -1;

    for(i = 0; i < pl->numprefixes; i++) {
        if(prefix_within_v4(ip, &pl->prefixes[i])) {
            int plen;
            assert(pl->prefixes[i].plen >= 96);
            plen = pl->prefixes[i].plen - 96;
            m = 0xFFFFFFFFu << (32 - plen);
            DO_HTONL(mask, m);
            return plen;
        }
    }
    return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %rdx, %rdx
je 0x9108
movq %rdx, %r15
cmpw $0x0, 0x8(%rdx)
jle 0x9108
movq %rsi, %r12
movq %rdi, %r14
xorl %r13d, %r13d
xorl %ebp, %ebp
movq (%r15), %rsi
addq %r13, %rsi
movq %r12, %rdi
callq 0x9a70
testl %eax, %eax
jne 0x90e9
incq %rbp
movswq 0x8(%r15), %rax
addq $0x1c, %r13
cmpq %rax, %rbp
jl 0x90c4
jmp 0x9108
movq (%r15), %rax
movzbl 0x10(%rax,%r13), %ecx
cmpl $0x5f, %ecx
jbe 0x9119
leal -0x60(%rcx), %ebx
negb %cl
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
shll %cl, %eax
bswapl %eax
movl %eax, (%r14)
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4d89(%rip), %rdi      # 0xdea9
leaq 0x4cb1(%rip), %rsi      # 0xddd8
leaq 0x4d96(%rip), %rcx      # 0xdec4
movl $0x229, %edx            # imm = 0x229
callq 0x2150
// File: /workspace/github_c_makefile_star2_O1/jech[P]shncpd/prefix.c
// Function: format_address
char *
format_address(const struct in6_addr *a, char *buf, int buflen)
{
    char *ptr;

    if(IN6_IS_ADDR_V4MAPPED(a))
        ptr = (char*)inet_ntop(AF_INET, (char*)a + 12, buf, buflen);
    else
        ptr = (char*)inet_ntop(AF_INET6, a, buf, buflen);

    if(ptr == NULL)
        snprintf(buf, buflen, "%s", strerror(errno));
    buf[buflen - 1] = '\0';
    return ptr;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %rsi
cmpl $0x0, (%rdi)
jne 0x942a
cmpl $0x0, 0x4(%rsi)
jne 0x942a
cmpl $0xffff0000, 0x8(%rsi)  # imm = 0xFFFF0000
jne 0x942a
addq $0xc, %rsi
movl $0x2, %edi
jmp 0x942f
movl $0xa, %edi
movq %rbx, %rdx
movl %ebp, %ecx
callq 0x2030
movq %rax, %r14
movslq %ebp, %r15
testq %rax, %rax
jne 0x9467
callq 0x2060
movl (%rax), %edi
callq 0x2350
leaq 0x49c2(%rip), %rdx      # 0xde19
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rcx
xorl %eax, %eax
callq 0x2140
movb $0x0, -0x1(%rbx,%r15)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jech[P]shncpd/prefix.c
// Function: format_prefix_raw
char *
format_prefix_raw(const struct in6_addr *a, int plen, char *buf, int buflen)
{
    char *ptr;
    int len;
    int v4 = plen > 96 && IN6_IS_ADDR_V4MAPPED(a);

    if(v4)
        ptr = (char*)inet_ntop(AF_INET, (char*)a + 12,
                               buf, buflen);
    else
        ptr = (char*)inet_ntop(AF_INET6, a, buf, buflen);

    if(ptr == NULL)
        snprintf(buf, buflen, "%s", strerror(errno));
    buf[buflen - 1] = '\0';

    len = strlen(buf);
    snprintf(buf + len, buflen - len, "/%d", v4 ? plen - 96 : plen);
    buf[buflen - 1] = '\0';

    return ptr;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebp
movq %rdx, %rbx
movl %esi, %r14d
movq %rdi, %rsi
cmpl $0x61, %r14d
jl 0x94a6
cmpl $0x0, (%rsi)
jne 0x94a6
cmpl $0x0, 0x4(%rsi)
je 0x9545
xorl %eax, %eax
movl %eax, 0x4(%rsp)
testb %al, %al
je 0x94bb
addq $0xc, %rsi
movl $0x2, %edi
jmp 0x94c0
movl $0xa, %edi
movq %rbx, %rdx
movl %ebp, %ecx
callq 0x2030
movq %rax, %r15
movslq %ebp, %r12
testq %rax, %rax
jne 0x94f8
callq 0x2060
movl (%rax), %edi
callq 0x2350
leaq 0x4931(%rip), %rdx      # 0xde19
movq %rbx, %rdi
movq %r12, %rsi
movq %rax, %rcx
xorl %eax, %eax
callq 0x2140
xorl %r13d, %r13d
movb %r13b, -0x1(%rbx,%r12)
movq %rbx, %rdi
callq 0x20e0
cltq
leaq (%rbx,%rax), %rdi
subl %eax, %ebp
movslq %ebp, %rsi
leal -0x60(%r14), %ecx
cmpb $0x0, 0x4(%rsp)
cmovel %r14d, %ecx
leaq 0x4a1a(%rip), %rdx      # 0xdf41
xorl %eax, %eax
callq 0x2140
movb %r13b, -0x1(%rbx,%r12)
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0xffff0000, 0x8(%rsi)  # imm = 0xFFFF0000
sete %al
jmp 0x94a8
// File: /workspace/github_c_makefile_star2_O1/jech[P]shncpd/prefix.c
// Function: debug_prefix_list
void
debug_prefix_list(const struct prefix_list *pl)
{
    int i;

    if(debug_level < 2 || !pl)
        return;

    for(i = 0; i < pl->numprefixes; i++) {
        debug_prefix(&pl->prefixes[i]);
        if(i < pl->numprefixes - 1)
            debugf(" ");
    }
}

// Assembly:
testq %rdi, %rdi
je 0x9681
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
leaq 0x9c30(%rip), %r14      # 0x13258
cmpl $0x2, (%r14)
jl 0x9676
movq %rdi, %rbx
cmpw $0x0, 0x8(%rdi)
jle 0x9676
xorl %r15d, %r15d
xorl %r12d, %r12d
movq (%rbx), %rdi
addq %r15, %rdi
callq 0x95d6
movswq 0x8(%rbx), %rax
decq %rax
cmpq %rax, %r12
jge 0x965c
cmpl $0x2, (%r14)
jge 0x966f
incq %r12
movswq 0x8(%rbx), %rax
addq $0x1c, %r15
cmpq %rax, %r12
jl 0x963e
jmp 0x9676
callq 0x2fbb
jmp 0x965c
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jech[P]shncpd/prefix.c
// Function: parse_prefix
int
parse_prefix(const char *string, struct prefix *p)
{
    char buf[INET6_ADDRSTRLEN];
    int rc, plen;
    char *slash;
    struct in_addr ina;
    struct in6_addr ina6;

    memset(p, 0, sizeof(struct prefix));

    if(strcmp(string, "default") == 0) {
        return 1;
    }

    strncpy(buf, string, INET6_ADDRSTRLEN);
    buf[INET6_ADDRSTRLEN - 1] = '\0';

    slash = strchr(buf, '/');
    if(slash == NULL) {
        plen = -1;
    } else {
        char *end;
        plen = strtol(slash + 1, &end, 0);
        if(*end != '\0' || plen < 0 || plen > 128)
            return -1;
        *slash = '\0';
    }

    rc = inet_pton(AF_INET, buf, &ina);
    if(rc > 0) {
        memcpy(&p->p, v4prefix, 12);
        memcpy((char*)&p->p + 12, &ina, 4);
        p->plen = plen < 0 ? 128 : plen + 96;
    } else {
        rc = inet_pton(AF_INET6, buf, &ina6);
        if(rc < 1)
            return -1;
        memcpy(&p->p, &ina6, 16);
        p->plen = plen < 0 ? 128 : plen;
    }
    return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x50, %rsp
movq %rsi, %r14
movq %rdi, %r15
xorps %xmm0, %xmm0
movups %xmm0, 0xc(%rsi)
movups %xmm0, (%rsi)
leaq 0x489f(%rip), %rsi      # 0xdf45
callq 0x21c0
movl $0x1, %ebx
testl %eax, %eax
je 0x97a4
leaq 0x20(%rsp), %r12
movl $0x2e, %edx
movq %r12, %rdi
movq %r15, %rsi
callq 0x2080
movb $0x0, 0x2d(%r12)
movq %r12, %rdi
movl $0x2f, %esi
callq 0x2120
testq %rax, %rax
je 0x971f
movq %rax, %r12
leaq 0x1(%rax), %rdi
leaq 0x10(%rsp), %r13
movq %r13, %rsi
xorl %edx, %edx
callq 0x2200
movq %rax, %r15
movq (%r13), %rax
cmpb $0x0, (%rax)
jne 0x979f
cmpl $0x80, %r15d
ja 0x979f
movb $0x0, (%r12)
jmp 0x9725
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
leaq 0x20(%rsp), %rsi
leaq 0xc(%rsp), %rdx
movl $0x2, %edi
callq 0x2220
testl %eax, %eax
jle 0x976c
movl $0xffff0000, 0x8(%r14)  # imm = 0xFFFF0000
movq $0x0, (%r14)
movl 0xc(%rsp), %eax
movl %eax, 0xc(%r14)
leal 0x60(%r15), %eax
testl %r15d, %r15d
movzbl %al, %eax
movl $0x80, %ecx
cmovnsl %eax, %ecx
movb %cl, 0x10(%r14)
jmp 0x97a4
leaq 0x20(%rsp), %rsi
leaq 0x10(%rsp), %rdx
movl $0xa, %edi
callq 0x2220
testl %eax, %eax
jle 0x979f
movups 0x10(%rsp), %xmm0
movups %xmm0, (%r14)
testl %r15d, %r15d
movl $0x80, %eax
cmovnsl %r15d, %eax
movb %al, 0x10(%r14)
jmp 0x97a4
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jech[P]shncpd/prefix.c
// Function: prefix_list_cons_prefix
struct prefix_list *
prefix_list_cons_prefix(struct prefix_list *pl, const struct prefix *p)
{
    if(pl == NULL)
        pl = create_prefix_list();
    if(pl == NULL)
        return NULL;
    if(pl->numprefixes >= pl->maxprefixes) {
        struct prefix *n =
            realloc(pl->prefixes,
                    (pl->maxprefixes * 2 + 2) * sizeof(struct prefix));
        if(n == NULL)
            return NULL;
        pl->prefixes = n;
        pl->maxprefixes = pl->maxprefixes * 2 + 2;
    }
    pl->prefixes[pl->numprefixes++] = *p;
    return pl;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
testq %rdi, %rdi
jne 0x97ff
movl $0x1, %edi
movl $0x10, %esi
callq 0x21b0
movq %rax, %rbx
testq %rbx, %rbx
je 0x9864
movswq 0xa(%rbx), %rax
cmpw %ax, 0x8(%rbx)
jl 0x9836
movq (%rbx), %rdi
imulq $0x38, %rax, %rsi
addq $0x38, %rsi
callq 0x2280
testq %rax, %rax
je 0x9864
movq %rax, (%rbx)
movzwl 0xa(%rbx), %eax
leal 0x2(,%rax,2), %eax
movw %ax, 0xa(%rbx)
movq (%rbx), %rax
movswq 0x8(%rbx), %rcx
leal 0x1(%rcx), %edx
movw %dx, 0x8(%rbx)
leaq (%rcx,%rcx,8), %rdx
leaq (%rdx,%rdx,2), %rdx
addq %rcx, %rdx
movups (%r14), %xmm0
movups 0xc(%r14), %xmm1
movups %xmm1, 0xc(%rax,%rdx)
movups %xmm0, (%rax,%rdx)
jmp 0x9866
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/jech[P]shncpd/prefix.c
// Function: prefix_list_cons
struct prefix_list *
prefix_list_cons(struct prefix_list *pl,
                 const struct in6_addr *a, int plen,
                 const unsigned char *id, unsigned int eid, int prio)
{
    struct prefix p;

    p.p = *a;
    p.plen = plen;
    if(id)
        memcpy(p.id, id, 4);
    else
        memset(p.id, 0, 4);
    p.eid = eid;
    p.prio = prio;
    return prefix_list_cons_prefix(pl, &p);
}

// Assembly:
subq $0x28, %rsp
movups (%rsi), %xmm0
movaps %xmm0, (%rsp)
movb %dl, 0x10(%rsp)
testq %rcx, %rcx
je 0x9889
movl (%rcx), %eax
jmp 0x988b
xorl %eax, %eax
movq %rsp, %rsi
movl %eax, 0x14(%rsi)
movl %r8d, 0x18(%rsi)
movw %r9w, 0x12(%rsi)
callq 0x97de
addq $0x28, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/jech[P]shncpd/prefix.c
// Function: prefix_list_remove
struct prefix_list *
prefix_list_remove(struct prefix_list *pl, int i)
{
    assert(i >= 0 && i < pl->numprefixes);
    memmove(pl->prefixes + i, pl->prefixes + i + 1,
            sizeof(struct prefix) * (pl->numprefixes - i - 1));
    pl->numprefixes--;
    MEM_UNDEFINED(pl->prefixes + pl->numprefixes,
                  sizeof(struct prefix));
    return pl;
}

// Assembly:
pushq %rbx
testl %esi, %esi
js 0x98f2
movq %rdi, %rbx
movswl 0x8(%rdi), %ecx
cmpl %esi, %ecx
jle 0x98f2
movq (%rbx), %rax
movl %esi, %edx
leaq (%rdx,%rdx,8), %rdi
leaq (%rdi,%rdi,2), %r8
addq %rdx, %r8
leaq (%rax,%r8), %rdi
addq %r8, %rax
addq $0x1c, %rax
notl %esi
addl %esi, %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx,8), %rdx
leaq (%rdx,%rdx,2), %rdx
addq %rcx, %rdx
movq %rax, %rsi
callq 0x22b0
decw 0x8(%rbx)
movq %rbx, %rax
popq %rbx
retq
leaq 0x4654(%rip), %rdi      # 0xdf4d
leaq 0x466b(%rip), %rsi      # 0xdf6b
leaq 0x466d(%rip), %rcx      # 0xdf74
movl $0xe3, %edx
callq 0x2150
// File: /workspace/github_c_makefile_star2_O1/jech[P]shncpd/prefix.c
// Function: prefix_list_append
struct prefix_list*
prefix_list_append(struct prefix_list *p1, struct prefix_list *p2)
{
    int i;

    if(p1 == NULL)
        return p2;

    for(i = 0; i < p2->numprefixes; i++) {
        struct prefix_list *pl = prefix_list_cons_prefix(p1, &p2->prefixes[i]);
        if(pl == NULL)
            return NULL;
    }
    destroy_prefix_list(p2);
    return p1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
testq %rdi, %rdi
je 0x9960
movq %rdi, %rbx
cmpw $0x0, 0x8(%r14)
jle 0x9956
xorl %r15d, %r15d
xorl %r12d, %r12d
movq (%r14), %rsi
addq %r15, %rsi
movq %rbx, %rdi
callq 0x97de
testq %rax, %rax
je 0x9965
incq %r12
movswq 0x8(%r14), %rax
addq $0x1c, %r15
cmpq %rax, %r12
jl 0x9932
movq %r14, %rdi
callq 0x97c3
jmp 0x9967
movq %r14, %rbx
jmp 0x9967
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/jech[P]shncpd/prefix.c
// Function: prefix_list_member
int
prefix_list_member(const struct prefix *p, const struct prefix_list *pl)
{
    int i;
    if(pl == NULL)
        return 0;

    for(i = 0; i < pl->numprefixes; i++) {
        struct prefix *q = &pl->prefixes[i];
        if(prefix_eq(p, q))
            return 1;
    }
    return 0;
}

// Assembly:
xorl %eax, %eax
testq %rsi, %rsi
je 0x99dd
movswq 0x8(%rsi), %rcx
testq %rcx, %rcx
jle 0x99dd
movq (%rsi), %rdx
movb 0x10(%rdi), %sil
cmpb 0x10(%rdx), %sil
jne 0x99d4
movdqu (%rdi), %xmm0
movdqu (%rdx), %xmm1
pcmpeqb %xmm0, %xmm1
pmovmskb %xmm1, %r8d
cmpl $0xffff, %r8d           # imm = 0xFFFF
je 0x99de
addq $0x1c, %rdx
decq %rcx
jne 0x99b4
retq
movl $0x1, %eax
retq