LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/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 0xa97c
movq %r12, %rdi
movq %r14, %rsi
movl %ebx, %edx
callq 0xa995
movq %rsp, %rbx
movq %r12, %rdi
movq %rbx, %rsi
callq 0xb1cb
movq (%rbx), %rax
movq %rax, (%r15)
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdi, 0x8(%rsp)
leaq 0x20(%rsp), %r14
movq %r14, %rdi
callq 0xa97c
leaq 0xe62c(%rip), %r15      # 0x128ac
xorl %ebx, %ebx
leaq 0x10(%rsp), %r12
pushq $0x4
popq %rbp
pushq $0x8
popq %r13
movslq 0xd00f(%rip), %rax      # 0x112a4
cmpq %rax, %rbx
jge 0x42c8
movl 0x8(%r15), %eax
bswapl %eax
movl %eax, 0x10(%rsp)
movq %r14, %rdi
movq %r12, %rsi
movl %ebp, %edx
callq 0xa995
movq %r14, %rdi
movq %r15, %rsi
movl %r13d, %edx
callq 0xa995
incq %rbx
addq $0x70, %r15
jmp 0x428e
leaq 0x20(%rsp), %rdi
leaq 0x10(%rsp), %r14
movq %r14, %rsi
callq 0xb1cb
movq (%r14), %rax
movq 0x8(%rsp), %rcx
movq %rax, (%rcx)
pushq $0x1
popq %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x8619
movq %rax, %r14
xorl %eax, %eax
testl %r15d, %r15d
setne %al
leaq 0x8(,%rax,8), %rdx
xorl %ecx, %ecx
leaq 0xe55f(%rip), %rsi      # 0x12890
movq %rdx, 0x18(%rsp)
movslq 0xcf67(%rip), %rax      # 0x112a4
cmpq %rax, %rcx
jge 0x4413
movq %rcx, 0x10(%rsp)
imulq $0x70, %rcx, %r12
addq %rsi, %r12
xorl %ebx, %ebx
movslq 0x68(%r12), %rax
cmpq %rax, %rbx
jge 0x43f4
movq 0x60(%r12), %rcx
movq (%rcx,%rbx,8), %rax
movq (%rax,%rdx), %rax
movq %rax, 0x20(%rsp)
testq %rax, %rax
je 0x43ec
xorl %ebp, %ebp
xorl %r13d, %r13d
movq (%rcx,%rbx,8), %rax
movq 0x8(%rax), %rax
movswq 0x8(%rax), %rax
cmpq %rax, %r13
jge 0x43e7
movq 0x20(%rsp), %rax
movq (%rax), %r15
addq %rbp, %r15
cmpl $0x0, 0xc(%rsp)
je 0x43c7
cmpl $0x0, 0x8(%rsp)
jne 0x43b5
movq %r15, %rdi
callq 0x8d1b
testl %eax, %eax
je 0x43d3
movq %r14, %rdi
movq %r15, %rsi
callq 0x863f
testq %rax, %rax
jne 0x43d6
jmp 0x4408
movq %r15, %rdi
callq 0x8d1b
testl %eax, %eax
je 0x43a2
movq %r14, %rax
incq %r13
movq 0x60(%r12), %rcx
addq $0x1c, %rbp
movq %rax, %r14
jmp 0x437e
movq 0x18(%rsp), %rdx
incq %rbx
jmp 0x4354
movq 0x10(%rsp), %rcx
incq %rcx
leaq 0xe48d(%rip), %rsi      # 0x12890
jmp 0x4336
movq %r14, %rdi
callq 0x8624
xorl %r14d, %r14d
movq %r14, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movslq 0x11019(%rip), %rdx     # 0x15450
testq %rdx, %rdx
je 0x4483
movq 0x11015(%rip), %rax     # 0x15458
testq %rax, %rax
je 0x4487
leaq 0x4(%rsp), %r8
andl $0x0, 0x4(%r8)
movw $0xa, (%r8)
leaq 0xce01(%rip), %rcx      # 0x11260
movups (%rcx), %xmm0
leaq 0xcd7f(%rip), %rcx      # 0x111e8
movzwl (%rcx), %ecx
rolw $0x8, %cx
movups %xmm0, 0x8(%r8)
movw %cx, 0x2(%r8)
movl 0x8(%rax), %eax
movl %eax, 0x18(%r8)
jmp 0x448e
xorl %ebx, %ebx
jmp 0x44bf
leaq 0x10fd2(%rip), %r8      # 0x15460
leaq 0xcdef(%rip), %rax      # 0x11284
movl (%rax), %edi
movq 0x10fe2(%rip), %rsi     # 0x15480
pushq $0x1c
popq %r9
xorl %ecx, %ecx
callq 0x2170
movq %rax, %rbx
testl %ebx, %ebx
js 0x44ca
andq $0x0, 0x10fa0(%rip)     # 0x15458
andl $0x0, 0x10f91(%rip)     # 0x15450
movl %ebx, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
callq 0x2060
movq %rax, %r14
movl (%rax), %ebp
leaq 0x81c5(%rip), %rdi      # 0xc6a0
callq 0x22f0
movl %ebp, (%r14)
jmp 0x44b0
// File: /workspace/github_c_makefile_star2_O2/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 0x4259
testl %eax, %eax
js 0x4703
leaq 0xcb72(%rip), %rax      # 0x11258
cmpl $0x2, (%rax)
jge 0x470e
pushq $0x4
popq %rdi
movq %rsp, %rsi
pushq $0x8
popq %rdx
movq %r14, %rcx
movq %rbx, %r8
callq 0x44e5
pushq $0x1
jmp 0x4705
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rsp, %rdi
callq 0xa8cb
testq %rbx, %rbx
leaq 0x81ca(%rip), %rdx      # 0xc8ea
leaq 0x7fbf(%rip), %rcx      # 0xc6e6
cmoveq %rdx, %rcx
leaq 0x7f9d(%rip), %rsi      # 0xc6cf
pushq $0x2
popq %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x23c0
jmp 0x46eb
// File: /workspace/github_c_makefile_star2_O2/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, %r12
movl %esi, %r10d
movq %rdi, %r14
pushq $0x14
popq %rcx
movl %ecx, %r15d
testl %esi, %esi
je 0x4770
movl 0x18(%r14), %r15d
addl $0x14, %r15d
movl %r15d, %esi
movq %rsp, %rdi
addq $0xf, %rsi
andq $-0x10, %rsi
movq %rdi, %r13
subq %rsi, %r13
movq %r13, %rsp
leaq 0xcae2(%rip), %rax      # 0x11270
movl (%rax), %edx
subl 0x28(%r14), %edx
imull $0x3e8, %edx, %r8d      # imm = 0x3E8
movq 0x8(%rax), %rax
subq 0x30(%r14), %rax
addq $0xf423f, %rax          # imm = 0xF423F
movl $0xf4240, %r9d          # imm = 0xF4240
cqto
idivq %r9
addl %r8d, %eax
negq %rsi
movl 0x8(%r14), %edx
movl %edx, (%r13)
movl 0x24(%r14), %edx
bswapl %edx
movl %edx, 0x4(%r13)
bswapl %eax
movl %eax, 0x8(%r13)
movq 0x1c(%r14), %rax
movq %rax, 0xc(%rdi,%rsi)
testl %r10d, %r10d
je 0x480d
leaq 0x14(%r13), %rdi
movq 0x10(%r14), %rsi
movq %r12, -0x38(%rbp)
movq %rbx, -0x30(%rbp)
movl 0x18(%r14), %ebx
movq %rbx, %rdx
movl %r10d, %r12d
callq 0x2220
movl %r12d, %r10d
leal 0x14(%rbx), %ecx
movq -0x30(%rbp), %rbx
movq -0x38(%rbp), %r12
cmpl %r15d, %ecx
jne 0x4898
leaq 0xca3b(%rip), %rax      # 0x11258
cmpl $0x2, (%rax)
jge 0x4845
pushq $0x5
popq %rdi
movq %r13, %rsi
movl %r15d, %edx
movq %r12, %rcx
movq %rbx, %r8
callq 0x44e5
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
addq $0x8, %r14
movq %r14, %rdi
movl %r10d, %r14d
callq 0xa86d
testq %rbx, %rbx
leaq 0x808c(%rip), %rcx      # 0xc8ea
leaq 0x7e81(%rip), %rdx      # 0xc6e6
cmoveq %rcx, %rdx
leaq 0x7f18(%rip), %rsi      # 0xc788
leaq 0x7efe(%rip), %rcx      # 0xc775
cmoveq %rsi, %rcx
testl %r14d, %r14d
cmoveq %rdx, %rcx
leaq 0x7ed8(%rip), %rsi      # 0xc761
pushq $0x2
popq %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x23c0
jmp 0x4822
leaq 0x7e54(%rip), %rdi      # 0xc6f3
leaq 0x7e59(%rip), %rsi      # 0xc6ff
leaq 0x7e59(%rip), %rcx      # 0xc706
movl $0xb1, %edx
callq 0x2150
// File: /workspace/github_c_makefile_star2_O2/jech[P]shncpd/receive.c
// Function: parse_pref
static void
parse_pref(struct in6_addr *a, const unsigned char *p, int plen)
{
    unsigned char b[16];
    memset(b, 0, 16);
    memcpy(b, p, plen / 8);
    if(plen % 8 != 0)
        b[plen / 8] = (p[plen / 8] & ((0xFF << (8 - (plen % 8))) & 0xFF));
    memcpy(a, b, 16);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movq %rsp, %rdi
movaps %xmm0, (%rdi)
movl %edx, %r15d
shrl $0x3, %r15d
movq %r15, %rdx
callq 0x2220
andl $0x7, %ebp
je 0x6226
movb $0x8, %cl
subb %bpl, %cl
movl $0xff, %eax
shll %cl, %eax
andb (%r14,%r15), %al
movb %al, (%rsp,%r15)
movaps (%rsp), %xmm0
movups %xmm0, (%rbx)
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
movl $0x90, %r14d
addq 0xa7fe(%rip), %r14      # 0x10fe0
movq %rdi, %rbx
leaq 0xaab4(%rip), %r15      # 0x112a0
movl (%r15), %ecx
xorl %r12d, %r12d
movslq %ecx, %rax
cmpq %rax, %r12
jge 0x6826
cmpl $0x0, -0x88(%r14)
jle 0x681a
movq (%r14), %rdi
movq %rbx, %rsi
callq 0x863f
movl (%r15), %ecx
testq %rax, %rax
je 0x681a
movq %rax, (%r14)
incq %r12
addq $0x98, %r14
jmp 0x67f2
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x68a8
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 0x68e6
addq $0x70, %r14
leaq 0xa9fa(%rip), %rsi      # 0x11270
movq %r14, %rdi
movl %r12d, %edx
callq 0xa7e7
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 0xa826
leaq 0xa9f1(%rip), %r15      # 0x112a0
movl (%r15), %eax
leaq 0xa9f7(%rip), %r14      # 0x112b0
xorl %r12d, %r12d
movslq %eax, %rcx
cmpq %rcx, %r12
jge 0x690a
cmpl $0x0, 0x8(%r14)
jle 0x68da
movq %r14, %rdi
movl %ebx, %esi
movl %ebp, %edx
callq 0x6832
movl (%r15), %eax
incq %r12
addq $0x98, %r14
jmp 0x68bc
cmpq $0x0, 0x70(%r14)
jle 0x686b
leaq 0x70(%r14), %rdi
leaq 0xa974(%rip), %rsi      # 0x11270
callq 0xa7c8
cmpl %r13d, %eax
jge 0x686b
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x6610
testl %eax, %eax
js 0x6935
pushq $0x1
popq %rbx
xorl %edi, %edi
movl %ebx, %esi
movl %ebx, %edx
callq 0x6832
movl %ebx, %eax
popq %rbx
retq
movl %eax, %ebx
leaq 0x63a2(%rip), %rdi      # 0xcce0
callq 0x22f0
jmp 0x6931
// File: /workspace/github_c_makefile_star2_O2/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, 0xa8a8(%rip)      # 0x111f4
js 0x697d
pushq %rax
callq 0x272a
testl %eax, %eax
je 0x696e
leaq 0xa8f9(%rip), %rax      # 0x11258
cmpl $0x2, (%rax)
jge 0x6985
pushq $-0x1
popq %rsi
xorl %edi, %edi
callq 0x6998
movl 0xa880(%rip), %edi      # 0x111f4
callq 0x2190
addq $0x8, %rsp
orl $-0x1, 0xa870(%rip)     # 0x111f4
retq
leaq 0x6364(%rip), %rsi      # 0xccf0
pushq $0x2
popq %rdi
xorl %eax, %eax
callq 0x23c0
jmp 0x6964
// File: /workspace/github_c_makefile_star2_O2/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 0x6e9f
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 0xa3f2(%rip), %edi      # 0x111f4
xorl %edx, %edx
callq 0x22a0
testl %eax, %eax
js 0x6e91
cmpl $0x1c, 0x30(%rsp)
jb 0x6e9f
cmpw $0xa, 0xc(%rsp)
jne 0x6e9f
movq 0x48(%rsp), %rcx
cmpq $0x10, 0x50(%rsp)
setb %dl
testq %rcx, %rcx
sete %sil
orb %dl, %sil
jne 0x6e9f
cmpl $0x8, %eax
jb 0x6e9f
cmpb $-0x1, 0x10(%rcx)
jne 0x6e9f
cmpb $-0x7b, 0xe0(%rsp)
jne 0x6e9f
cmpb $0x0, 0xe1(%rsp)
jne 0x6e9f
movl 0x24(%rsp), %edi
testl %edi, %edi
je 0x6e9f
callq 0x38f4
testq %rax, %rax
je 0x6e9f
movq %rax, %rbx
leaq 0xa3df(%rip), %rax      # 0x11258
cmpl $0x2, (%rax)
jge 0x6f4b
pushq $0x1
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x6832
jmp 0x6e9f
callq 0x2060
cmpl $0xb, (%rax)
jne 0x6f3a
leaq 0xa40a(%rip), %rbx      # 0x112b0
leaq 0xa3f3(%rip), %r12      # 0x112a0
leaq 0xa3bc(%rip), %r14      # 0x11270
leaq 0x5e4e(%rip), %r15      # 0xcd09
pushq $0x1
popq %rbp
xorl %r13d, %r13d
movslq (%r12), %rax
cmpq %rax, %r13
jge 0x6f25
cmpl $0x0, 0x8(%rbx)
jle 0x6f0f
leaq 0x70(%rbx), %rsi
movq %r14, %rdi
callq 0xa742
testl %eax, %eax
js 0x6f0f
xorl %eax, %eax
callq 0xa656
testl %eax, %eax
jg 0x6ef5
cmpq $0x0, 0x90(%rbx)
je 0x6f03
movq %rbx, %rdi
movl %eax, %esi
callq 0x6998
testl %eax, %eax
js 0x6f1b
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %edx
callq 0x6832
incq %r13
addq $0x98, %rbx
jmp 0x6ec1
movq %r15, %rdi
callq 0x22f0
jmp 0x6f03
pushq $0x1
popq %rax
addq $0x6c8, %rsp            # imm = 0x6C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5dbf(%rip), %rdi      # 0xcd00
callq 0x22f0
jmp 0x6e9f
movq (%rbx), %rdx
leaq 0x5dd5(%rip), %rsi      # 0xcd2a
pushq $0x2
popq %rdi
xorl %eax, %eax
callq 0x23c0
jmp 0x6e82
// File: /workspace/github_c_makefile_star2_O2/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 %rdi, %rax
movq 0xe51a(%rip), %rcx      # 0x15488
subq %rcx, %rax
pushq $0x30
popq %rsi
cqto
idivq %rsi
testl %eax, %eax
js 0x6fbf
movl 0xe50d(%rip), %edx      # 0x15490
cmpl %eax, %edx
jle 0x6fbf
decl %edx
cmpl %eax, %edx
jbe 0x6fb8
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
imulq $0x30, %rax, %rax
movl %edx, %esi
imulq $0x30, %rsi, %rsi
movups (%rcx,%rsi), %xmm0
movups 0x10(%rcx,%rsi), %xmm1
movups 0x20(%rcx,%rsi), %xmm2
movups %xmm2, 0x20(%rcx,%rax)
movups %xmm1, 0x10(%rcx,%rax)
movups %xmm0, (%rcx,%rax)
movl %edx, 0xe4d2(%rip)      # 0x15490
retq
pushq %rax
leaq 0x5da1(%rip), %rdi      # 0xcd68
leaq 0x5db2(%rip), %rsi      # 0xcd80
leaq 0x5db4(%rip), %rcx      # 0xcd89
pushq $0x47
popq %rdx
callq 0x2150
// File: /workspace/github_c_makefile_star2_O2/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 %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movslq 0xe4a1(%rip), %r15      # 0x15490
movq 0xe492(%rip), %r14      # 0x15488
xorl %ecx, %ecx
testl %r15d, %r15d
cmovgl %r15d, %ecx
incq %rcx
movq %r14, %rax
decq %rcx
je 0x701a
movl (%rax), %edx
addq $0x30, %rax
cmpl (%rbx), %edx
jne 0x7005
addq $-0x30, %rax
jmp 0x7081
testl %esi, %esi
je 0x707f
cmpl 0xe46f(%rip), %r15d     # 0x15494
jl 0x7051
leaq 0x2(,%r15,2), %r12
imulq $0x30, %r12, %rsi
movq %r14, %rdi
callq 0x2290
testq %rax, %rax
je 0x7051
movq %rax, 0xe441(%rip)      # 0x15488
movl %r12d, 0xe446(%rip)     # 0x15494
movq %rax, %r14
imulq $0x30, %r15, %rcx
leaq (%r14,%rcx), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%r14,%rcx)
movups %xmm0, 0x10(%r14,%rcx)
movups %xmm0, (%r14,%rcx)
movl (%rbx), %edx
movl %edx, (%r14,%rcx)
leal 0x1(%r15), %ecx
movl %ecx, 0xe413(%rip)      # 0x15490
jmp 0x7081
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x7177
movq %rdi, %r14
callq 0x708d
testl %eax, %eax
je 0x7177
movl %eax, %ebp
leaq 0xadb1(%rip), %r15      # 0x11e90
addq $0x8, %r15
leaq 0xa1be(%rip), %rax      # 0x112a8
movl (%rax), %ebx
xorl %r13d, %r13d
movslq %ebx, %rax
cmpq %rax, %r13
jge 0x7174
cmpq %r14, -0x8(%r15)
je 0x7106
incq %r13
addq $0x40, %r15
jmp 0x70ef
movq %r15, %rdi
xorl %esi, %esi
callq 0x3d24
movq %rax, %r12
movb $0x0, 0x6(%rsp)
callq 0x708d
movb %al, 0x7(%rsp)
leaq 0xa180(%rip), %rax      # 0x112a8
movl (%rax), %ebx
testq %r12, %r12
je 0x70fd
leaq 0x38(%r12), %rdi
movzbl 0x39(%r12), %eax
andl $0xf, %eax
cmpl %eax, %ebp
jb 0x7170
jne 0x70fd
leaq 0x6(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x21b0
testl %eax, %eax
jg 0x7170
jne 0x70fd
addq $0x8, %r12
movq %r12, %rdi
leaq 0xa11c(%rip), %rsi      # 0x11280
pushq $0x4
popq %rdx
callq 0x21b0
testl %eax, %eax
jle 0x70fd
xorl %ebx, %ebx
jmp 0x7177
pushq $0x1
popq %rbx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 $0x18, %rsp
movl $0x1, 0x4(%rsp)
movl 0xa05c(%rip), %edi      # 0x111f8
testl %edi, %edi
js 0x71ac
callq 0x2190
orl $-0x1, 0xa04c(%rip)     # 0x111f8
pushq $0x2
popq %rdi
movl %edi, %esi
xorl %edx, %edx
callq 0x23a0
pushq $-0x1
popq %rbx
testl %eax, %eax
js 0x7276
movl %eax, %ebp
pushq $0x1
popq %rsi
pushq $0x6
popq %rdx
leaq 0x4(%rsp), %rcx
pushq $0x4
popq %r8
movl %eax, %edi
callq 0x20a0
testl %eax, %eax
js 0x7276
pushq $0x8
popq %rdx
leaq 0x4(%rsp), %rcx
pushq $0x4
popq %r8
movl %ebp, %edi
xorl %esi, %esi
callq 0x20a0
testl %eax, %eax
js 0x7276
pushq $0x1
popq %rsi
movl %ebp, %edi
xorl %edx, %edx
xorl %eax, %eax
callq 0x20b0
testl %eax, %eax
js 0x7276
orl $0x1, %eax
pushq $0x2
popq %rsi
movl %ebp, %edi
movl %eax, %edx
xorl %eax, %eax
callq 0x20b0
testl %eax, %eax
js 0x7276
pushq $0x3
popq %rsi
movl %ebp, %edi
xorl %edx, %edx
xorl %eax, %eax
callq 0x20b0
testl %eax, %eax
js 0x7276
orl $0x800, %eax            # imm = 0x800
pushq $0x4
popq %rsi
movl %ebp, %edi
movl %eax, %edx
xorl %eax, %eax
callq 0x20b0
testl %eax, %eax
js 0x7276
leaq 0x8(%rsp), %rsi
andl $0x0, 0xc(%rsi)
andq $0x0, 0x4(%rsi)
movl $0x43000002, (%rsi)     # imm = 0x43000002
pushq $0x10
popq %rdx
movl %ebp, %edi
callq 0x22b0
testl %eax, %eax
js 0x7276
movl %ebp, 0x9f84(%rip)      # 0x111f8
movl %ebp, %ebx
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
subq $0x18, %rsp
movq %rcx, %rbx
movq %rdx, 0x10(%rsp)
movl %esi, 0x4(%rsp)
movq %rdi, 0x8(%rsp)
movl 0xd631(%rip), %r15d     # 0x15490
xorl %r14d, %r14d
xorl %ebp, %ebp
movslq %r15d, %rax
cmpq %rax, %rbp
jge 0x7eb5
movq 0xd615(%rip), %r12      # 0x15488
leaq (%r12,%r14), %r13
movq 0x8(%rsp), %rdi
movl 0x4(%rsp), %esi
movq 0x10(%rsp), %rdx
movq %r13, %rcx
callq 0x7ed6
testl %eax, %eax
je 0x7eac
testq %rbx, %rbx
je 0x7ec1
movq %r13, %rdi
movq %rbx, %rsi
callq 0x8985
testl %eax, %eax
jne 0x7eba
movl 0xd5e4(%rip), %r15d     # 0x15490
incq %rbp
addq $0x30, %r14
jmp 0x7e64
xorl %r12d, %r12d
jmp 0x7ec4
movq 0xd5c7(%rip), %r12      # 0x15488
addq %r14, %r12
movq %r12, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
setg %r8b
movl 0x20(%rcx), %edi
testl %edi, %edi
setg %r9b
orb %r8b, %r9b
cmpb $0x1, %r9b
jne 0x7f10
cmpl %esi, %edi
jne 0x7f2b
pushq %rax
movq 0x18(%rcx), %rdi
movslq %esi, %rdx
movq %rax, %rsi
callq 0x2270
testl %eax, %eax
sete %al
addq $0x8, %rsp
jmp 0x7f2d
movdqu 0x8(%rcx), %xmm0
movdqu (%rdx), %xmm1
pcmpeqb %xmm0, %xmm1
pmovmskb %xmm1, %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
sete %al
jmp 0x7f2d
xorl %eax, %eax
movzbl %al, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq $-0x1
popq %rbx
testq %rdx, %rdx
je 0x7f92
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r14
pushq $-0x1
popq %r13
xorl %esi, %esi
movswq 0x8(%r15), %rax
incq %r13
cmpq %rax, %r13
jge 0x7f92
leaq 0x1c(%rsi), %rbp
addq (%r15), %rsi
movq %r12, %rdi
callq 0x88d1
movq %rbp, %rsi
testl %eax, %eax
je 0x7f53
movq (%r15), %rax
movzbl -0xc(%rax,%rbp), %ecx
cmpl $0x5f, %ecx
jbe 0x7fa3
leal -0x60(%rcx), %ebx
negb %cl
pushq $-0x1
popq %rax
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 0x4ea7(%rip), %rdi      # 0xce51
leaq 0x4dcf(%rip), %rsi      # 0xcd80
leaq 0x4eb4(%rip), %rcx      # 0xce6c
movl $0x229, %edx            # imm = 0x229
callq 0x2150
// File: /workspace/github_c_makefile_star2_O2/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 0x82a3
cmpl $0x0, 0x4(%rsi)
jne 0x82a3
cmpl $0xffff0000, 0x8(%rsi)  # imm = 0xFFFF0000
jne 0x82a3
addq $0xc, %rsi
pushq $0x2
jmp 0x82a5
pushq $0xa
popq %rdi
movq %rbx, %rdx
movl %ebp, %ecx
callq 0x2030
movq %rax, %r14
movslq %ebp, %r15
testq %rax, %rax
jne 0x82de
callq 0x2060
movl (%rax), %edi
callq 0x2360
leaq 0x4af3(%rip), %rdx      # 0xcdc1
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_O2/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 0x833e
cmpl $0x0, (%rsi)
jne 0x833e
cmpl $0x0, 0x4(%rsi)
jne 0x833e
cmpl $0xffff0000, 0x8(%rsi)  # imm = 0xFFFF0000
jne 0x833e
addq $0xc, %rsi
pushq $0x2
popq %rdi
movq %rbx, %rdx
movl %ebp, %ecx
callq 0x2030
movq %rax, %r15
movb $0x1, %al
movl %eax, 0x4(%rsp)
jmp 0x8356
pushq $0xa
popq %rdi
movq %rbx, %rdx
movl %ebp, %ecx
callq 0x2030
movq %rax, %r15
movl $0x0, 0x4(%rsp)
movslq %ebp, %r12
testq %r15, %r15
jne 0x8381
callq 0x2060
movl (%rax), %edi
callq 0x2360
leaq 0x4a50(%rip), %rdx      # 0xcdc1
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 0x4b39(%rip), %rdx      # 0xcee9
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
// File: /workspace/github_c_makefile_star2_O2/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 0x84fb
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x8dc3(%rip), %r15      # 0x11258
cmpl $0x2, (%r15)
jl 0x84ed
movq %rdi, %rbx
leaq 0x4807(%rip), %r14      # 0xccac
pushq $0x2
popq %rbp
xorl %r12d, %r12d
xorl %r13d, %r13d
movswq 0x8(%rbx), %rax
cmpq %rax, %r13
jge 0x84ed
movq (%rbx), %rdi
addq %r12, %rdi
callq 0x8448
movswq 0x8(%rbx), %rax
decq %rax
cmpq %rax, %r13
jge 0x84d6
cmpl $0x2, (%r15)
jge 0x84df
incq %r13
addq $0x1c, %r12
jmp 0x84ae
movl %ebp, %edi
movq %r14, %rsi
xorl %eax, %eax
callq 0x23c0
jmp 0x84d6
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x49cd(%rip), %rsi      # 0xceed
callq 0x21d0
pushq $0x1
popq %rbx
testl %eax, %eax
je 0x8609
leaq 0x20(%rsp), %r12
pushq $0x2e
popq %rdx
movq %r12, %rdi
movq %r15, %rsi
callq 0x2080
movb $0x0, 0x2d(%r12)
pushq $0x2f
popq %rsi
movq %r12, %rdi
callq 0x2120
testq %rax, %rax
je 0x858f
movq %rax, %r12
leaq 0x1(%rax), %rdi
leaq 0x10(%rsp), %r13
movq %r13, %rsi
xorl %edx, %edx
callq 0x2210
movq %rax, %r15
movq (%r13), %rax
cmpb $0x0, (%rax)
jne 0x8606
cmpl $0x80, %r15d
ja 0x8606
movb $0x0, (%r12)
jmp 0x8593
pushq $-0x1
popq %r15
pushq $0x2
popq %rdi
leaq 0x20(%rsp), %rsi
leaq 0xc(%rsp), %rdx
callq 0x2230
testl %eax, %eax
jle 0x85d5
movl $0xffff0000, 0x8(%r14)  # imm = 0xFFFF0000
andq $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 0x8609
pushq $0xa
popq %rdi
leaq 0x20(%rsp), %rsi
leaq 0x10(%rsp), %rdx
callq 0x2230
testl %eax, %eax
jle 0x8606
movups 0x10(%rsp), %xmm0
movups %xmm0, (%r14)
testl %r15d, %r15d
movl $0x80, %eax
cmovnsl %r15d, %eax
movb %al, 0x10(%r14)
jmp 0x8609
pushq $-0x1
popq %rbx
movl %ebx, %eax
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x865b
callq 0x8619
movq %rax, %rbx
testq %rax, %rax
je 0x86ba
movzwl 0x8(%rbx), %ecx
movswq 0xa(%rbx), %rdx
movq (%rbx), %rax
cmpw %dx, %cx
jl 0x8697
imulq $0x38, %rdx, %rsi
addq $0x38, %rsi
movq %rax, %rdi
callq 0x2290
testq %rax, %rax
je 0x86ba
movq %rax, (%rbx)
movzwl 0xa(%rbx), %ecx
leal 0x2(,%rcx,2), %ecx
movw %cx, 0xa(%rbx)
movzwl 0x8(%rbx), %ecx
leal 0x1(%rcx), %edx
movw %dx, 0x8(%rbx)
movswq %cx, %rcx
imulq $0x1c, %rcx, %rcx
movups (%r14), %xmm0
movups 0xc(%r14), %xmm1
movups %xmm1, 0xc(%rax,%rcx)
movups %xmm0, (%rax,%rcx)
jmp 0x86bc
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x86df
movl (%rcx), %eax
jmp 0x86e1
xorl %eax, %eax
movq %rsp, %rsi
movl %eax, 0x14(%rsi)
movl %r8d, 0x18(%rsi)
movw %r9w, 0x12(%rsi)
callq 0x863f
addq $0x28, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x873a
movq %rdi, %rbx
movswl 0x8(%rdi), %ecx
cmpl %esi, %ecx
jle 0x873a
movq (%rbx), %rax
movl %esi, %edx
imulq $0x1c, %rdx, %rdx
leaq (%rax,%rdx), %rdi
addq %rdx, %rax
addq $0x1c, %rax
notl %esi
addl %esi, %ecx
movslq %ecx, %rcx
imulq $0x1c, %rcx, %rdx
movq %rax, %rsi
callq 0x22c0
decw 0x8(%rbx)
movq %rbx, %rax
popq %rbx
retq
leaq 0x47b4(%rip), %rdi      # 0xcef5
leaq 0x47cb(%rip), %rsi      # 0xcf13
leaq 0x47cd(%rip), %rcx      # 0xcf1c
movl $0xe3, %edx
callq 0x2150
// File: /workspace/github_c_makefile_star2_O2/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 0x879a
movq %rdi, %rbx
pushq $-0x1
popq %r15
xorl %esi, %esi
movswq 0x8(%r14), %rax
incq %r15
cmpq %rax, %r15
jge 0x879f
leaq 0x1c(%rsi), %r12
addq (%r14), %rsi
movq %rbx, %rdi
callq 0x863f
movq %r12, %rsi
testq %rax, %rax
jne 0x8772
xorl %ebx, %ebx
jmp 0x87a7
movq %r14, %rbx
jmp 0x87a7
movq %r14, %rdi
callq 0x8624
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rsi, %rsi
je 0x882c
movq %rsi, %r14
movq %rdi, %r15
movl 0x8(%rsi), %eax
xorl %ebx, %ebx
testw %ax, %ax
cmovlel %ebx, %eax
movzwl %ax, %eax
imulq $0x1c, %rax, %r12
addq $0x1c, %r12
pushq $0x1
popq %rbp
xorl %esi, %esi
leaq 0x1c(%rsi), %r13
cmpq %r13, %r12
je 0x882e
addq (%r14), %rsi
movq %r15, %rdi
callq 0x87b6
movq %r13, %rsi
testl %eax, %eax
je 0x880d
movl %ebp, %ebx
jmp 0x882e
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jech[P]shncpd/prefix.c
// Function: prefix_within
int
prefix_within(const struct prefix *p, const struct prefix *q)
{
    unsigned char pp[16], qq[16];

    if(p->plen < q->plen)
        return 0;

    memcpy(pp, &p->p, 16);
    memcpy(qq, &q->p, 16);

    if(memcmp(pp, qq, q->plen / 8) != 0)
        return 0;

    if(q->plen % 8 == 0) {
        return 1;
    } else {
        int i = q->plen / 8 + 1;
        unsigned char mask = (0xFF << (q->plen % 8)) & 0xFF;
        if((pp[i] & mask) == (qq[i] & mask)) {
            return 1;
        }
    }

    return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movzbl 0x10(%rsi), %ebx
xorl %ebp, %ebp
cmpb %bl, 0x10(%rdi)
jb 0x88c6
movups (%rdi), %xmm0
leaq 0x10(%rsp), %rdi
movaps %xmm0, (%rdi)
movups (%rsi), %xmm0
movq %rsp, %rsi
movaps %xmm0, (%rsi)
movl %ebx, %r14d
shrl $0x3, %r14d
movq %r14, %rdx
callq 0x2270
testl %eax, %eax
jne 0x88c6
andl $0x7, %ebx
je 0x88c3
movb 0x1(%rsp,%r14), %al
xorb 0x11(%rsp,%r14), %al
movzbl %al, %eax
movl %ebx, %ecx
shrl %cl, %eax
xorl %ebp, %ebp
testl %eax, %eax
sete %bpl
jmp 0x88c6
pushq $0x1
popq %rbp
movl %ebp, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jech[P]shncpd/prefix.c
// Function: prefix_within_v4
int
prefix_within_v4(const unsigned char *p4, const struct prefix *q)
{
    struct prefix p;
    memset(&p, 0, sizeof(p));
    memcpy(&p.p, v4prefix, 12);
    memcpy((char*)&p.p + 12, p4, 4);
    p.plen = 128;

    return prefix_within(&p, q);
}

// Assembly:
subq $0x28, %rsp
leaq 0x8(%rsp), %rax
andl $0x0, 0x18(%rax)
andq $0x0, 0x10(%rax)
andq $0x0, (%rax)
movl $0xffff0000, 0x8(%rax)  # imm = 0xFFFF0000
movl (%rdi), %ecx
movl %ecx, 0xc(%rax)
movb $-0x80, 0x10(%rax)
movq %rax, %rdi
callq 0x8869
addq $0x28, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/jech[P]shncpd/prefix.c
// Function: prefix_list_within
int
prefix_list_within(const struct prefix *p, const struct prefix_list *pl)
{
    int i;

    if(pl == NULL)
        return 0;

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

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rsi, %rsi
je 0x8972
movq %rsi, %r14
movq %rdi, %r15
movl 0x8(%rsi), %eax
xorl %ebx, %ebx
testw %ax, %ax
cmovlel %ebx, %eax
movzwl %ax, %eax
imulq $0x1c, %rax, %r12
addq $0x1c, %r12
pushq $0x1
popq %rbp
xorl %esi, %esi
leaq 0x1c(%rsi), %r13
cmpq %r13, %r12
je 0x8974
addq (%r14), %rsi
movq %r15, %rdi
callq 0x8869
movq %r13, %rsi
testl %eax, %eax
je 0x8953
movl %ebp, %ebx
jmp 0x8974
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jech[P]shncpd/prefix.c
// Function: prefix_list_overlap
int
prefix_list_overlap(const struct prefix *p, const struct prefix_list *pl,
                    int respect_precedence)
{
    unsigned char pp[16];
    int i;

    memcpy(pp, &p->p, 16);

    if(pl == NULL)
        return 0;

    for(i = 0; i < pl->numprefixes; i++) {
        struct prefix *q = &pl->prefixes[i];
        int plen = min(p->plen, q->plen);
        unsigned char qq[16];

        if(respect_precedence &&
           ((id_eq(p->id, q->id) && p->eid == q->eid) ||
            prefix_takes_precedence(p, q)))
            continue;

        memcpy(qq, &q->p, 16);

        if(memcmp(pp, qq, plen / 8) != 0)
            continue;

        if(plen % 8 == 0) {
            return 1;
        } else {
            int i = plen / 8 + 1;
            unsigned char mask = (0xFF << (plen % 8)) & 0xFF;
            if((pp[i] & mask) == (qq[i] & mask)) {
                return 1;
            }
        }
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %edx, 0xc(%rsp)
movups (%rdi), %xmm0
movaps %xmm0, 0x30(%rsp)
testq %rsi, %rsi
je 0x8aab
movq %rdi, %r12
movl 0x8(%rsi), %eax
leaq 0x14(%rdi), %rcx
movq %rcx, 0x10(%rsp)
xorl %ecx, %ecx
testw %ax, %ax
cmovlel %ecx, %eax
movzwl %ax, %eax
imulq $0x1c, %rax, %rax
movq %rax, 0x18(%rsp)
xorl %ebx, %ebx
cmpq %rbx, 0x18(%rsp)
je 0x8aab
movq %rsi, %r13
movq (%rsi), %r15
leaq (%r15,%rbx), %r14
movl 0x10(%r12), %eax
movl 0x10(%r15,%rbx), %ebp
cmpb %bpl, %al
cmovbl %eax, %ebp
cmpl $0x0, 0xc(%rsp)
je 0x8a5d
leaq (%r15,%rbx), %rsi
addq $0x14, %rsi
movq 0x10(%rsp), %rdi
callq 0x8ac1
testl %eax, %eax
je 0x8a4e
movl 0x18(%r12), %eax
cmpl 0x18(%r15,%rbx), %eax
je 0x8a9f
movq %r12, %rdi
movq %r14, %rsi
callq 0x883f
testl %eax, %eax
jne 0x8a9f
movups (%r14), %xmm0
movaps %xmm0, 0x20(%rsp)
movzbl %bpl, %r14d
shrl $0x3, %r14d
leaq 0x30(%rsp), %rdi
leaq 0x20(%rsp), %rsi
movq %r14, %rdx
callq 0x2270
testl %eax, %eax
jne 0x8a9f
andb $0x7, %bpl
je 0x8abc
movb 0x21(%rsp,%r14), %al
xorb 0x31(%rsp,%r14), %al
movzbl %al, %eax
movl %ebp, %ecx
shrl %cl, %eax
testl %eax, %eax
je 0x8abc
addq $0x1c, %rbx
movq %r13, %rsi
jmp 0x8a00
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x1
popq %rax
jmp 0x8aad
// File: /workspace/github_c_makefile_star2_O2/jech[P]shncpd/prefix.c
// Function: filter_included
struct prefix_list *
filter_included(struct prefix_list *pl)
{
    int i, j;

    i = 0;
 again:
    while(i < pl->numprefixes) {
        for(j = 0; j < pl->numprefixes; j++) {
            if(i != j && prefix_within(&pl->prefixes[i], &pl->prefixes[j])) {
                pl = prefix_list_remove(pl, i);
                goto again;
            }
        }
        i++;
    }
    return pl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
movswq 0x8(%rbx), %rcx
testw %cx, %cx
movl $0x0, %eax
cmovgl %ecx, %eax
movslq %r14d, %r14
movzwl %ax, %eax
imulq $0x1c, %rax, %r12
movq %rcx, (%rsp)
cmpq %rcx, %r14
jge 0x8b46
movl %r14d, %eax
imulq $0x1c, %rax, %r13
imulq $0x1c, %r14, %rbp
xorl %r15d, %r15d
cmpq %r15, %r12
je 0x8b30
cmpq %r15, %r13
je 0x8b2a
movq (%rbx), %rsi
leaq (%rsi,%rbp), %rdi
addq %r15, %rsi
callq 0x8869
testl %eax, %eax
jne 0x8b39
addq $0x1c, %r15
jmp 0x8b0d
incq %r14
movq (%rsp), %rcx
jmp 0x8afa
movq %rbx, %rdi
movl %r14d, %esi
callq 0x86fa
jmp 0x8adc
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_O2/jech[P]shncpd/prefix.c
// Function: prefix_valid
int
prefix_valid(const struct prefix *p,
             const struct prefix_list *pl1, const struct prefix_list *pl2)
{
    if(pl1 && prefix_list_overlap(p, pl1, 1))
        return 0;
    if(pl2 && prefix_list_overlap(p, pl2, 1))
        return 0;
    return 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, %r14
testq %rsi, %rsi
je 0x8b76
pushq $0x1
popq %rdx
movq %r14, %rdi
callq 0x89b8
testl %eax, %eax
jne 0x8b8d
testq %rbx, %rbx
je 0x8b91
pushq $0x1
popq %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x89b8
testl %eax, %eax
je 0x8b91
xorl %eax, %eax
jmp 0x8b94
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq