LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/jech[P]shncpd/prefix.c
// Function: random_bits
void
random_bits(unsigned char *buf, int first, int len)
{
    int i;

    if(first % 8 != 0) {
        unsigned char mask = (0xFF >> (first % 8)) ^ 0xFF;
        buf[first / 8] &= mask;
        buf[first / 8] |= random() & (0xFF ^ mask);
    }

    for(i = (first + 7) / 8; i < (first + len) / 8; i++)
        buf[i] = random() % 0xFF;

    if((first + len) % 8 != 0) {
        unsigned char mask = 0xFF >> ((first + len) % 8);
        buf[(first + len) / 8] &= mask;
        buf[(first + len) / 8] |= random() & (0xFF ^ mask);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movl %esi, %r14d
movq %rdi, %rbx
pushq $0x8
popq %r12
movl %esi, %eax
cltd
idivl %r12d
leal (,%rax,8), %ecx
movl %esi, %r15d
subl %ecx, %r15d
je 0x8bee
movl $0xffffff00, %edx       # imm = 0xFFFFFF00
movl %r15d, %ecx
sarl %cl, %edx
movslq %eax, %r13
andb %dl, (%rbx,%r13)
callq 0x2240
movl $0xff, %edx
movl %r15d, %ecx
shrl %cl, %edx
andl %edx, %eax
orb %al, (%rbx,%r13)
leal 0x7(%r14), %eax
cltd
idivl %r12d
movl %eax, %ecx
addl %r14d, %ebp
movl %ebp, %eax
cltd
idivl %r12d
movl %edx, %ebp
movslq %ecx, %r15
movslq %eax, %r14
movl $0xff, %r12d
cmpq %r14, %r15
jge 0x8c27
callq 0x2240
cqto
idivq %r12
movb %dl, (%rbx,%r15)
incq %r15
jmp 0x8c0f
testl %ebp, %ebp
je 0x8c4c
movl $0xff, %eax
movl %ebp, %ecx
shrl %cl, %eax
andb %al, (%rbx,%r14)
callq 0x2240
movl $0xffffff00, %edx       # imm = 0xFFFFFF00
movl %ebp, %ecx
sarl %cl, %edx
andl %edx, %eax
orb %al, (%rbx,%r14)
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: random_prefix
int
random_prefix(struct prefix *res,
              int plen, int zero_bits, int tweak_v6,
              const struct prefix *in, const struct prefix_list *out)
{
    unsigned char pp[16];
    int i;
    struct prefix p;

    if(plen > 128)
        plen = 128;

    if(in->plen + zero_bits > plen)
        return 0;

    for(i = 0; i < 20; i++) {
        memset(pp, 0, 16);
        memcpy(pp, &in->p, 16);
        random_bits(pp, in->plen + zero_bits, (plen - (in->plen + zero_bits)));
        if(tweak_v6 && in->plen <= 68)
            pp[8] &= ~3;

        memcpy(&p.p, pp, 16);
        p.plen = plen;
        if(!prefix_list_overlap(&p, out, 0)) {
            *res = p;
            return 1;
        }
    }

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %ecx, %ebp
movl $0x80, %r14d
cmpl %r14d, %esi
cmovll %esi, %r14d
movzbl 0x10(%r8), %ecx
addl %edx, %ecx
xorl %eax, %eax
cmpl %r14d, %ecx
jg 0x8d0c
movq %r9, %rbx
movq %r8, %r15
movl %edx, %r12d
movq %rdi, 0x18(%rsp)
pushq $0x15
popq %r13
decl %r13d
je 0x8d0a
movups (%r15), %xmm0
movaps %xmm0, (%rsp)
movzbl 0x10(%r15), %esi
addl %r12d, %esi
movl %r14d, %edx
subl %esi, %edx
movq %rsp, %rdi
callq 0x8b9c
testl %ebp, %ebp
je 0x8cce
cmpb $0x44, 0x10(%r15)
ja 0x8cce
andb $-0x4, 0x8(%rsp)
movaps (%rsp), %xmm0
movaps %xmm0, 0x20(%rsp)
movb %r14b, 0x30(%rsp)
leaq 0x20(%rsp), %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x89b8
testl %eax, %eax
jne 0x8c9c
movups 0x2c(%rsp), %xmm0
movq 0x18(%rsp), %rax
movups %xmm0, 0xc(%rax)
movaps 0x20(%rsp), %xmm0
movups %xmm0, (%rax)
pushq $0x1
popq %rax
jmp 0x8d0c
xorl %eax, %eax
addq $0x48, %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: generate_random_v4
int
generate_random_v4(unsigned char *ip, const struct prefix_list *pl)
{
    int start, i, rc;
    struct prefix p;

    if(pl == NULL)
        return -1;

    start = random() % pl->numprefixes;

    for(i = 0; i < pl->numprefixes; i++) {
        int j = (start + i) % pl->numprefixes;
        if(prefix_v4(&pl->prefixes[j]) && pl->prefixes[j].plen <= 126) {
            rc = random_prefix(&p, 128, 0, 0, &pl->prefixes[j], NULL);
            if(rc >= 0) {
                memcpy(ip, (unsigned char*)&p.p + 12, 4);
                return 1;
            }
        }
    }
    return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
pushq $-0x1
popq %rbp
testq %rsi, %rsi
je 0x8dce
movq %rsi, %r14
movq %rdi, (%rsp)
callq 0x2240
movswl 0x8(%r14), %r13d
movslq %r13d, %rcx
cqto
idivq %rcx
movq %rdx, %r15
xorl %ebx, %ebx
testl %ecx, %ecx
cmovgl %r13d, %ebx
subl $0x1, %ebx
jb 0x8dce
movl %r15d, %eax
cltd
idivl %r13d
movslq %edx, %rax
imulq $0x1c, %rax, %r12
addq (%r14), %r12
movq %r12, %rdi
callq 0x8d1b
testl %eax, %eax
je 0x8da0
cmpb $0x7e, 0x10(%r12)
jbe 0x8da5
incl %r15d
jmp 0x8d76
leaq 0xc(%rsp), %r14
movq %r14, %rdi
movl $0x80, %esi
xorl %edx, %edx
xorl %ecx, %ecx
movq %r12, %r8
xorl %r9d, %r9d
callq 0x8c5b
movl 0xc(%r14), %eax
movq (%rsp), %rcx
movl %eax, (%rcx)
pushq $0x1
popq %rbp
movl %ebp, %eax
addq $0x28, %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: interface_v4
int
interface_v4(struct interface *interface, unsigned char *v4_return)
{
    int i;

    for(i = 0; i < interface->numassigned; i++) {
        struct in6_addr *a = &interface->assigned[i].assigned_address;
        if(IN6_IS_ADDR_V4MAPPED(a)) {
            memcpy(v4_return, (char*)a + 12, 4);
            return 1;
        }
    }
    return 0;
}

// Assembly:
movl 0x68(%rdi), %ecx
xorl %eax, %eax
testl %ecx, %ecx
cmovlel %eax, %ecx
imulq $0x70, %rcx, %rcx
xorl %edx, %edx
cmpq %rdx, %rcx
je 0x8e23
movq 0x60(%rdi), %r8
cmpl $0x0, 0x60(%r8,%rdx)
jne 0x8e13
cmpl $0x0, 0x64(%r8,%rdx)
jne 0x8e13
cmpl $0xffff0000, 0x68(%r8,%rdx) # imm = 0xFFFF0000
je 0x8e19
addq $0x70, %rdx
jmp 0x8def
movl 0x6c(%r8,%rdx), %eax
movl %eax, (%rsi)
pushq $0x1
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/jech[P]shncpd/prefix.c
// Function: all_assigned_prefixes
struct prefix_list *
all_assigned_prefixes()
{
    int i, j;
    struct prefix_list *pl = create_prefix_list(), *pl2;
    if(pl == NULL)
        return NULL;

    for(i = 0; i < numnodes; i++) {
        if(nodes[i].assigned == NULL)
            continue;
        for(j = 0; j < nodes[i].assigned->numprefixes; j++) {
            pl2 = prefix_list_cons_prefix(pl, &nodes[i].assigned->prefixes[j]);
            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
pushq %rax
callq 0x8619
testq %rax, %rax
je 0x8eb5
xorl %r14d, %r14d
leaq 0x8461(%rip), %r12      # 0x112a4
leaq 0x9a46(%rip), %rdx      # 0x12890
pushq $-0x1
popq %r13
movslq (%r12), %rcx
cmpq %rcx, %r14
jge 0x8eb7
imulq $0x70, %r14, %rcx
cmpq $0x0, 0x50(%rdx,%rcx)
je 0x8ea8
leaq (%rdx,%rcx), %rbp
addq $0x50, %rbp
xorl %esi, %esi
movq %rax, %rbx
movq (%rbp), %rax
movswq 0x8(%rax), %rcx
incq %r13
cmpq %rcx, %r13
jge 0x8e9a
leaq 0x1c(%rsi), %r15
addq (%rax), %rsi
movq %rbx, %rdi
callq 0x863f
movq %r15, %rsi
testq %rax, %rax
jne 0x8e6d
jmp 0x8ead
movq %rbx, %rax
leaq 0x99ec(%rip), %rdx      # 0x12890
pushq $-0x1
popq %r13
incq %r14
jmp 0x8e4e
movq %rbx, %rdi
callq 0x8624
xorl %eax, %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: all_delegated_prefixes
struct prefix_list *
all_delegated_prefixes()
{
    int i, j, k;
    struct prefix_list *pl = create_prefix_list(), *pl2;
    if(pl == NULL)
        return NULL;

    for(i = 0; i < numnodes; i++) {
        for(j = 0; j < nodes[i].numexts; j++) {
            if(nodes[i].exts[j]->delegated == NULL)
                continue;
            for(k = 0; k < nodes[i].exts[j]->delegated->numprefixes; k++) {
                struct prefix *p = &nodes[i].exts[j]->delegated->prefixes[k];
                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
pushq %rax
callq 0x8619
testq %rax, %rax
je 0x911c
xorl %esi, %esi
leaq 0x822a(%rip), %rcx      # 0x112a4
leaq 0x980f(%rip), %rdx      # 0x12890
pushq $-0x1
popq %r13
movslq (%rcx), %rcx
cmpq %rcx, %rsi
jge 0x911e
movq %rsi, (%rsp)
imulq $0x70, %rsi, %rbp
addq %rdx, %rbp
xorl %r12d, %r12d
movslq 0x68(%rbp), %rcx
cmpq %rcx, %r12
jge 0x90fa
movq 0x60(%rbp), %rcx
movq (%rcx,%r12,8), %rcx
cmpq $0x0, (%rcx)
je 0x90f5
movq %r13, %r14
xorl %esi, %esi
movq %rax, %rbx
movq 0x60(%rbp), %rax
movq (%rax,%r12,8), %rax
movq (%rax), %rax
movswq 0x8(%rax), %rcx
incq %r13
cmpq %rcx, %r13
jge 0x90ef
leaq 0x1c(%rsi), %r15
addq (%rax), %rsi
movq %rbx, %rdi
callq 0x863f
movq %r15, %rsi
testq %rax, %rax
jne 0x90bb
jmp 0x9114
movq %rbx, %rax
movq %r14, %r13
incq %r12
jmp 0x909f
movq (%rsp), %rsi
incq %rsi
leaq 0x819c(%rip), %rcx      # 0x112a4
leaq 0x9781(%rip), %rdx      # 0x12890
jmp 0x9085
movq %rbx, %rdi
callq 0x8624
xorl %eax, %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: all_node_addresses
struct prefix_list *
all_node_addresses()
{
    int i, j;
    struct prefix_list *pl = create_prefix_list(), *pl2;
    if(pl == NULL)
        return NULL;

    for(i = 0; i < numnodes; i++) {
        if(nodes[i].addresses == NULL || id_eq(nodes[i].id, myid))
            continue;
        for(j = 0; j < nodes[i].addresses->numprefixes; j++) {
            struct prefix *p = &nodes[i].addresses->prefixes[j];
            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
pushq %rax
callq 0x8619
testq %rax, %rax
je 0x91e3
movq %rax, %rbx
xorl %r12d, %r12d
leaq 0x8151(%rip), %r15      # 0x112a4
leaq 0x9736(%rip), %r13      # 0x12890
leaq 0x811f(%rip), %rbp      # 0x11280
movslq (%r15), %rax
cmpq %rax, %r12
jge 0x91e5
imulq $0x70, %r12, %r14
cmpq $0x0, 0x58(%r13,%r14)
je 0x91d6
addq %r13, %r14
leaq 0x8(%r14), %rdi
movq %rbp, %rsi
callq 0x8ac1
testl %eax, %eax
jne 0x91d6
pushq $-0x1
popq %r13
xorl %esi, %esi
movq %rbx, %r15
movq 0x58(%r14), %rax
movswq 0x8(%rax), %rcx
incq %r13
cmpq %rcx, %r13
jge 0x91be
leaq 0x1c(%rsi), %rbp
addq (%rax), %rsi
movq %r15, %rdi
callq 0x863f
movq %rax, %rbx
movq %rbp, %rsi
testq %rax, %rax
jne 0x918e
jmp 0x91db
movq %r15, %rbx
leaq 0x80dc(%rip), %r15      # 0x112a4
leaq 0x96c1(%rip), %r13      # 0x12890
leaq 0x80aa(%rip), %rbp      # 0x11280
incq %r12
jmp 0x9161
movq %r15, %rdi
callq 0x8624
xorl %ebx, %ebx
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: best_prefix
int
best_prefix(const struct prefix *delegated, int eid,
            const struct prefix *assigned,
            const struct prefix_list *link_assigned,
            struct prefix *best_return)
{
    struct prefix *best = NULL;
    int i;

    if(link_assigned) {
        for(i = 0; i < link_assigned->numprefixes; i++) {
            struct prefix *p = &link_assigned->prefixes[i];
            if(!prefix_within(p, delegated) && !prefix_within(delegated, p))
                continue;
            if(best && prefix_takes_precedence(best, p))
                continue;

            best = p;
        }
    }

    if(!best)
        return 0;

    if(assigned && prefix_takes_precedence(assigned, best))
        return 0;

    *best_return = *best;
    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
testq %rcx, %rcx
je 0x92b1
movq %rcx, %r12
movq %rdi, %r13
movq %rdx, 0x10(%rsp)
movq %r8, 0x8(%rsp)
movl 0x8(%rcx), %eax
xorl %ebx, %ebx
testw %ax, %ax
cmovlel %ebx, %eax
movzwl %ax, %eax
imulq $0x1c, %rax, %r14
xorl %r15d, %r15d
cmpq %rbx, %r14
je 0x927a
movq (%r12), %rbp
addq %rbx, %rbp
movq %rbp, %rdi
movq %r13, %rsi
callq 0x8869
testl %eax, %eax
jne 0x925d
movq %r13, %rdi
movq %rbp, %rsi
callq 0x8869
testl %eax, %eax
je 0x9274
testq %r15, %r15
je 0x9271
movq %r15, %rdi
movq %rbp, %rsi
callq 0x883f
testl %eax, %eax
jne 0x9274
movq %rbp, %r15
addq $0x1c, %rbx
jmp 0x9233
xorl %ebp, %ebp
testq %r15, %r15
je 0x92b3
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x9297
movq %r15, %rsi
callq 0x883f
testl %eax, %eax
jne 0x92b3
movups (%r15), %xmm0
movups 0xc(%r15), %xmm1
movq 0x8(%rsp), %rax
movups %xmm1, 0xc(%rax)
movups %xmm0, (%rax)
pushq $0x1
popq %rbp
jmp 0x92b3
xorl %ebp, %ebp
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_O2/jech[P]shncpd/prefix.c
// Function: route_externals
int
route_externals(struct external **ext, int numexternals, int add)
{
    int i, j, rc = 1;
    struct in6_addr def;
    struct in6_addr v4_def;
    memset(&def, 0, sizeof(def));
    memcpy(&v4_def, v4prefix, 16);
    for(i = 0; i < numexternals; i++) {
        for(j = 0; j < ext[i]->delegated->numprefixes; j++) {
            struct prefix *p = &ext[i]->delegated->prefixes[j];
            int rrc;
            if(prefix_v4(p)) {
                rrc = kernel_route(0, NULL, &v4_def, 96, NULL, 0, add);
                rrc = kernel_route(0, NULL, &p->p, p->plen, NULL, 0, add);
            } else {
                rrc = kernel_route(0, NULL, &def, 0, &p->p, p->plen, add);
                rrc = kernel_route(0, NULL, &p->p, p->plen, NULL, 0, add);
            }
            if(rrc < 0)
                rc = rrc;
        }
    }
    return rc;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movl %edx, %ebx
movq %rdi, %rbp
xorps %xmm0, %xmm0
leaq 0x40(%rsp), %rax
movaps %xmm0, (%rax)
movaps 0x39a9(%rip), %xmm0     # 0xccb0
leaq 0x30(%rsp), %rax
xorl %edx, %edx
testl %esi, %esi
cmovlel %edx, %esi
movq %rsi, 0x18(%rsp)
movaps %xmm0, (%rax)
pushq $0x1
popq %rsi
movq %rdi, 0x20(%rsp)
cmpq 0x18(%rsp), %rdx
je 0x93f9
pushq $0x10
popq %r14
xorl %r15d, %r15d
movq %rdx, 0x28(%rsp)
movq (%rbp,%rdx,8), %rax
movq (%rax), %rax
movswq 0x8(%rax), %rcx
cmpq %rcx, %r15
jge 0x93f1
movl %esi, 0x14(%rsp)
movq (%rax), %r13
leaq (%r14,%r13), %r12
addq $-0x10, %r12
movq %r12, %rdi
callq 0x8d1b
testl %eax, %eax
je 0x938a
movl %ebx, (%rsp)
xorl %edi, %edi
xorl %esi, %esi
leaq 0x30(%rsp), %rdx
pushq $0x60
popq %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0xa48f
addq %r14, %r13
jmp 0x93bd
movl %ebx, %ebp
imulq $0x1c, %r15, %rbx
addq %r13, %rbx
addq $0x10, %rbx
movzbl (%r13,%r14), %r9d
movl %ebp, (%rsp)
xorl %edi, %edi
xorl %esi, %esi
leaq 0x40(%rsp), %rdx
xorl %ecx, %ecx
movq %r12, %r8
callq 0xa48f
movq %rbx, %r13
movl %ebp, %ebx
movq 0x20(%rsp), %rbp
movzbl (%r13), %ecx
movl %ebx, (%rsp)
xorl %edi, %edi
xorl %esi, %esi
movq %r12, %rdx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0xa48f
testl %eax, %eax
movl 0x14(%rsp), %esi
cmovsl %eax, %esi
incq %r15
addq $0x1c, %r14
movq 0x28(%rsp), %rdx
jmp 0x933a
incq %rdx
jmp 0x9323
movl %esi, %eax
addq $0x58, %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: destroy_assigned_address
int
destroy_assigned_address(struct interface *interface,
                         struct assigned_prefix *ap)
{
    int rc = 0;

    if(IN6_IS_ADDR_UNSPECIFIED(&ap->assigned_address))
        return 0;

    debugf("Removing address ");
    debug_address(&ap->assigned_address);
    debugf(" from %s.\n", interface->ifname);

    assert(ap->assigned.plen > 0 && ap->applied);

    if(interface->ifindex > 0) {
        rc = kernel_address(interface->ifindex, interface->ifname,
                            &ap->assigned_address, ap->assigned.plen, 0);
        if(rc < 0)
            fprintf(stderr, "Couldn't remove address.\n");
    }

    return rc;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
cmpl $0x0, 0x60(%rsi)
jne 0x9433
cmpl $0x0, 0x64(%r14)
jne 0x9433
cmpl $0x0, 0x68(%r14)
jne 0x9433
cmpl $0x0, 0x6c(%r14)
je 0x949d
leaq 0x60(%r14), %r15
leaq 0x7e1a(%rip), %r12      # 0x11258
cmpl $0x2, (%r12)
jge 0x94ad
movq %r15, %rdi
callq 0x83dc
cmpl $0x2, (%r12)
jge 0x94c0
movzbl 0x2c(%r14), %ecx
testl %ecx, %ecx
je 0x94d9
cmpl $0x0, 0x3c(%r14)
je 0x94d9
movl 0x8(%rbx), %edi
testl %edi, %edi
jle 0x949d
movq (%rbx), %rsi
movq %r15, %rdx
xorl %r8d, %r8d
callq 0xa3bc
movl %eax, %ebx
testl %eax, %eax
jns 0x949f
movq 0x7b72(%rip), %rax      # 0x10ff8
movq (%rax), %rcx
leaq 0x3b5b(%rip), %rdi      # 0xcfeb
pushq $0x19
popq %rsi
pushq $0x1
popq %rdx
callq 0x2340
jmp 0x949f
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x3aaa(%rip), %rsi      # 0xcf5e
pushq $0x2
popq %rdi
xorl %eax, %eax
callq 0x23c0
jmp 0x9445
movq (%rbx), %rdx
leaq 0x3aa6(%rip), %rsi      # 0xcf70
pushq $0x2
popq %rdi
xorl %eax, %eax
callq 0x23c0
jmp 0x9454
leaq 0x3a9b(%rip), %rdi      # 0xcf7b
leaq 0x3a2c(%rip), %rsi      # 0xcf13
leaq 0x3ab2(%rip), %rcx      # 0xcfa0
movl $0x2e2, %edx            # imm = 0x2E2
callq 0x2150
// File: /workspace/github_c_makefile_star2_O2/jech[P]shncpd/prefix.c
// Function: destroy_assigned
int
destroy_assigned(struct interface *interface, struct assigned_prefix *ap)
{
    if(ap->applied) {
        destroy_assigned_address(interface, ap);

        debugf("Removing prefix ");
        debug_prefix(&ap->assigned);
        debugf(" from %s.\n", interface->ifname);

        assert(ap->assigned.plen > 0);
        if(interface->ifindex > 0)
            kernel_route(interface->ifindex, interface->ifname,
                         &ap->assigned.p, ap->assigned.plen, NULL, 0, 0);
        ap->applied = 0;
        ra_retract(&ap->assigned);
        schedule_ra(NULL, 1, 0);
    }
    ts_zero(&ap->apply_timer);
    publish_prefix(interface, ap, 0);
    memset(&ap->assigned, 0, sizeof(ap->assigned));
    return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
cmpl $0x0, 0x3c(%rsi)
je 0x9576
movq %rdi, %r14
movq %rbx, %rsi
callq 0x940a
leaq 0x7d3d(%rip), %r12      # 0x11258
cmpl $0x2, (%r12)
jge 0x9599
leaq 0x1c(%rbx), %r15
movq %r15, %rdi
callq 0x8448
cmpl $0x2, (%r12)
jge 0x95af
movzbl 0x2c(%rbx), %ecx
testl %ecx, %ecx
je 0x95c8
movl 0x8(%r14), %edi
testl %edi, %edi
jle 0x955e
movq (%r14), %rsi
andl $0x0, (%rsp)
movq %r15, %rdx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0xa48f
andl $0x0, 0x3c(%rbx)
movq %r15, %rdi
callq 0x67cd
pushq $0x1
popq %rsi
xorl %edi, %edi
xorl %edx, %edx
callq 0x6832
leaq 0x50(%rbx), %rdi
callq 0xa866
xorps %xmm0, %xmm0
movups %xmm0, 0x2c(%rbx)
movups %xmm0, 0x1c(%rbx)
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x3a65(%rip), %rsi      # 0xd005
pushq $0x2
popq %rdi
xorl %eax, %eax
callq 0x23c0
jmp 0x9522
movq (%r14), %rdx
leaq 0x39b7(%rip), %rsi      # 0xcf70
pushq $0x2
popq %rdi
xorl %eax, %eax
callq 0x23c0
jmp 0x9535
leaq 0x3a47(%rip), %rdi      # 0xd016
leaq 0x393d(%rip), %rsi      # 0xcf13
leaq 0x3a4f(%rip), %rcx      # 0xd02c
movl $0x2f8, %edx            # imm = 0x2F8
callq 0x2150
// File: /workspace/github_c_makefile_star2_O2/jech[P]shncpd/prefix.c
// Function: find_assigned
struct assigned_prefix *
find_assigned(struct interface *interface, const struct prefix *delegated,
              int create)
{
    struct assigned_prefix *new;
    int i;

    for(i = 0; i < interface->numassigned; i++) {
        if(prefix_eq(&interface->assigned[i].delegated, delegated))
            return &interface->assigned[i];
    }

    if(!create)
        return NULL;

    new = realloc(interface->assigned,
                  (interface->numassigned + 1) *
                  sizeof(struct assigned_prefix));
    if(new == NULL)
        return NULL;
    interface->assigned = new;

    memset(&interface->assigned[interface->numassigned], 0,
           sizeof(struct assigned_prefix));
    interface->assigned[interface->numassigned].delegated = *delegated;
    return &interface->assigned[interface->numassigned++];
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, 0xc(%rsp)
movq %rsi, %r14
movq %rdi, %rbx
movslq 0x68(%rdi), %rcx
xorl %r13d, %r13d
testl %ecx, %ecx
movl $0x0, %eax
movq %rcx, 0x10(%rsp)
cmovgl %ecx, %eax
imulq $0x70, %rax, %r12
pushq $0x70
popq %rbp
addq $-0x70, %rbp
movq %r12, %rax
addq %rbp, %rax
je 0x9645
movq 0x60(%rbx), %r15
leaq (%r15,%r13), %rdi
addq $0x70, %r13
movq %r14, %rsi
callq 0x87b6
testl %eax, %eax
je 0x961c
subq %rbp, %r15
jmp 0x96b4
cmpl $0x0, 0xc(%rsp)
je 0x96b1
movq 0x60(%rbx), %rdi
imulq $0x70, 0x10(%rsp), %rsi
addq $0x70, %rsi
callq 0x2290
testq %rax, %rax
je 0x96b1
movq %rax, 0x60(%rbx)
movslq 0x68(%rbx), %rcx
imulq $0x70, %rcx, %rdx
movq %rax, %r15
addq %rdx, %r15
xorps %xmm0, %xmm0
movups %xmm0, 0x5c(%rax,%rdx)
movups %xmm0, 0x4c(%rax,%rdx)
movups %xmm0, 0x3c(%rax,%rdx)
andl $0x0, 0x6c(%rax,%rdx)
movups %xmm0, 0x2c(%rax,%rdx)
movups %xmm0, 0x1c(%rax,%rdx)
movups (%r14), %xmm0
movups 0xc(%r14), %xmm1
movups %xmm0, (%rax,%rdx)
movups %xmm1, 0xc(%rax,%rdx)
leal 0x1(%rcx), %eax
movl %eax, 0x68(%rbx)
jmp 0x96b4
xorl %r15d, %r15d
movq %r15, %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/prefix.c
// Function: flush_assigned
void
flush_assigned(struct interface *interface, struct assigned_prefix *ap)
{
    int n = ap - interface->assigned;
    assert(n >= 0 && n < interface->numassigned);

    destroy_assigned(interface, ap);
    if(n < interface->numassigned - 1)
        interface->assigned[n] =
            interface->assigned[interface->numassigned - 1];
    interface->numassigned--;

    if(interface->numassigned == 0) {
        free(interface->assigned);
        interface->assigned = NULL;
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rax
subq 0x60(%rdi), %rax
pushq $0x70
popq %rcx
cqto
idivq %rcx
movq %rax, %r14
testl %r14d, %r14d
js 0x973e
movq %rdi, %rbx
cmpl %r14d, 0x68(%rdi)
jle 0x973e
movq %rbx, %rdi
callq 0x94f8
movl 0x68(%rbx), %ecx
leal -0x1(%rcx), %eax
cmpl %r14d, %eax
jle 0x9721
movq 0x60(%rbx), %rcx
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
imulq $0x70, %r14, %rdi
addq %rcx, %rdi
movl %eax, %eax
imulq $0x70, %rax, %rsi
addq %rcx, %rsi
pushq $0xe
popq %rcx
rep  movsq (%rsi), %es:(%rdi)
movl 0x68(%rbx), %ecx
decl %ecx
movl %ecx, 0x68(%rbx)
jne 0x9736
movq 0x60(%rbx), %rdi
callq 0x2040
andq $0x0, 0x60(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x392a(%rip), %rdi      # 0xd06f
leaq 0x37c7(%rip), %rsi      # 0xcf13
leaq 0x3941(%rip), %rcx      # 0xd094
movl $0x326, %edx            # imm = 0x326
callq 0x2150
// File: /workspace/github_c_makefile_star2_O2/jech[P]shncpd/prefix.c
// Function: prefix_assignment_cleanup
void
prefix_assignment_cleanup()
{
    int i;
    for(i = 0; i < numinterfaces; i++) {
        while(interfaces[i].numassigned > 0)
            flush_assigned(&interfaces[i], &interfaces[i].assigned[0]);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
xorl %r14d, %r14d
leaq 0x7339(%rip), %r15      # 0x112a0
leaq 0x7342(%rip), %r12      # 0x112b0
movslq (%r15), %rax
cmpq %rax, %r14
jge 0x9f99
imulq $0x98, %r14, %rbx
addq %r12, %rbx
cmpl $0x0, 0x68(%rbx)
jle 0x9f94
movq 0x60(%rbx), %rsi
movq %rbx, %rdi
callq 0x96c6
jmp 0x9f80
incq %r14
jmp 0x9f6e
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/jech[P]shncpd/local.c
// Function: set_config_var
static int
set_config_var(const char *name, const struct prefix_list *pl, int v4)
{
    char buf[(INET6_ADDRSTRLEN + 1) * 20];

    if(pl && pl->prefixes > 0) {
        int i;
        buf[0] = '\0';
        for(i = 0; i < pl->numprefixes; i++) {
            char a[INET6_ADDRSTRLEN];
            if(v4)
                inet_ntop(AF_INET, (char*)&pl->prefixes[i].p + 12,
                          a, sizeof(a));
            else
                inet_ntop(AF_INET6, &pl->prefixes[i].p, a, sizeof(a));
            if(i > 0)
                strncat(buf, " ", sizeof(buf) - strlen(a));
            strncat(buf, a, sizeof(buf) - strlen(a));
        }
        return setenv(name, buf, 1);
    }
    return 0;
}

// Assembly:
testq %rsi, %rsi
je 0xa259
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3f8, %rsp            # imm = 0x3F8
movq %rsi, %r14
cmpq $0x0, (%rsi)
je 0xa248
movl %edx, %ebp
movq %rdi, 0x8(%rsp)
leaq 0x40(%rsp), %r15
movb $0x0, (%r15)
xorl %r12d, %r12d
leaq 0x10(%rsp), %r13
xorl %ebx, %ebx
movswq 0x8(%r14), %rax
cmpq %rax, %rbx
jge 0xa236
movq (%r14), %rsi
testl %ebp, %ebp
je 0xa1dd
addq %r12, %rsi
addq $0xc, %rsi
pushq $0x2
jmp 0xa1e2
addq %r12, %rsi
pushq $0xa
popq %rdi
movq %r13, %rdx
pushq $0x2e
popq %rcx
callq 0x2030
testq %r12, %r12
je 0xa212
movq %r13, %rdi
callq 0x20e0
movl $0x3ac, %edx            # imm = 0x3AC
subq %rax, %rdx
movq %r15, %rdi
leaq 0x2a9f(%rip), %rsi      # 0xccac
callq 0x2180
movq %r13, %rdi
callq 0x20e0
movl $0x3ac, %edx            # imm = 0x3AC
subq %rax, %rdx
movq %r15, %rdi
movq %r13, %rsi
callq 0x2180
incq %rbx
addq $0x1c, %r12
jmp 0xa1c1
leaq 0x40(%rsp), %rsi
pushq $0x1
popq %rdx
movq 0x8(%rsp), %rdi
callq 0x20d0
addq $0x3f8, %rsp            # imm = 0x3F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/jech[P]shncpd/trickle.c
// Function: trickle_init
void
trickle_init(struct trickle_state *s, int I_min, int I_max, int k)
{
    memset(s, 0, sizeof(*s));
    s->I_min = I_min;
    s->I_max = I_max;
    s->k = k;

    s->I = I_min + (random() % (I_max - I_min));
    trickle_new_interval(s);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r14
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rdi)
andq $0x0, 0x28(%rdi)
movups %xmm0, 0x18(%rdi)
movl %esi, (%rdi)
movl %edx, 0x4(%rdi)
movl %ecx, 0x8(%rdi)
callq 0x2240
subl %ebp, %ebx
movslq %ebx, %rcx
cqto
idivq %rcx
addl %ebp, %edx
movl %edx, 0xc(%r14)
movq %r14, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0xa2a0
// File: /workspace/github_c_makefile_star2_O2/jech[P]shncpd/trickle.c
// Function: trickle_new_interval
void
trickle_new_interval(struct trickle_state *s)
{
    s->c = 0;
    trickle_new_t(s);
    s->I_start = now;
    s->triggered = 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
andl $0x0, 0x10(%rdi)
callq 0xa2c1
leaq 0x6fbc(%rip), %rax      # 0x11270
movups (%rax), %xmm0
movups %xmm0, 0x20(%rbx)
andl $0x0, 0x18(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/jech[P]shncpd/trickle.c
// Function: trickle_trigger
int
trickle_trigger(struct trickle_state *s)
{
    if(!s->triggered) {
        struct timespec tt;
        ts_add_msec(&tt, &s->I_start, s->t);
        if(ts_compare(&now, &tt) >= 0) {
            s->triggered = 1;
            return s->c < s->k;
        }
    } else {
        struct timespec tI;
        ts_add_msec(&tI, &s->I_start, s->I);
        if(ts_compare(&now, &tI) >= 0) {
            s->I = min(2 * s->I, s->I_max);
            trickle_new_interval(s);
        }
    }
    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x20(%rdi), %rsi
cmpl $0x0, 0x18(%rdi)
je 0xa360
movl 0xc(%rbx), %edx
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0xa7e7
leaq 0x6f36(%rip), %rdi      # 0x11270
movq %r14, %rsi
callq 0xa742
testl %eax, %eax
js 0xa397
movl 0x4(%rbx), %eax
movl 0xc(%rbx), %ecx
addl %ecx, %ecx
cmpl %eax, %ecx
cmovgel %eax, %ecx
movl %ecx, 0xc(%rbx)
movq %rbx, %rdi
callq 0xa2a0
jmp 0xa397
movl 0x14(%rbx), %edx
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0xa7e7
leaq 0x6ef9(%rip), %rdi      # 0x11270
movq %r14, %rsi
callq 0xa742
testl %eax, %eax
js 0xa397
movl $0x1, 0x18(%rbx)
movl 0x10(%rbx), %ecx
xorl %eax, %eax
cmpl 0x8(%rbx), %ecx
setl %al
jmp 0xa399
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/jech[P]shncpd/trickle.c
// Function: trickle_reset
void
trickle_reset(struct trickle_state *s, int consistent)
{
    if(consistent) {
        s->c++;
    } else if(s->I > s->I_min) {
        s->I = s->I_min;
        trickle_new_interval(s);
    }
}

// Assembly:
testl %esi, %esi
je 0xa3a9
incl 0x10(%rdi)
retq
movl (%rdi), %eax
cmpl %eax, 0xc(%rdi)
jle 0xa3b8
movl %eax, 0xc(%rdi)
jmp 0xa2a0
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/jech[P]shncpd/kernel.c
// Function: kernel_address
int
kernel_address(int ifindex, const char *ifname,
               const struct in6_addr *address, int plen,
               int add)
{
    char b[INET6_ADDRSTRLEN];
    char c[INET6_ADDRSTRLEN + 80];
    int rc;

    if(memcmp(address, v4prefix, 12) == 0) {
        inet_ntop(AF_INET, (char*)address + 12, b, sizeof(b));
        plen -= 96;
    } else {
        inet_ntop(AF_INET6, address, b, sizeof(b));
    }

    rc = snprintf(c, sizeof(c), "ip addr %s %s/%d dev %s",
                  add ? "add" : "del", b, plen, ifname);
    if(rc < 1 || rc >= sizeof(c)) {
        errno = ENOSPC;
        return -1;
    }

    rc = system(c);
    if(rc >= 0 && WIFEXITED(rc) && WEXITSTATUS(rc) == 0)
        return 1;

    return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xc8, %rsp
movl %r8d, %ebp
movl %ecx, %ebx
movq %rdx, %r15
movq %rsi, %r14
leaq 0x2ea5(%rip), %rsi      # 0xd280
pushq $0xc
popq %rdx
movq %r15, %rdi
callq 0x2270
testl %eax, %eax
je 0xa3ff
pushq $0xa
popq %rdi
leaq 0x10(%rsp), %rdx
pushq $0x2e
popq %rcx
movq %r15, %rsi
callq 0x2030
jmp 0xa419
addq $0xc, %r15
pushq $0x2
popq %rdi
leaq 0x10(%rsp), %rdx
pushq $0x2e
popq %rcx
movq %r15, %rsi
callq 0x2030
addl $-0x60, %ebx
testl %ebp, %ebp
leaq 0x2e8a(%rip), %rax      # 0xd2ac
leaq 0x2e7f(%rip), %rcx      # 0xd2a8
cmoveq %rax, %rcx
movq %r14, (%rsp)
leaq 0x2e58(%rip), %rdx      # 0xd290
xorl %ebp, %ebp
leaq 0x40(%rsp), %rdi
pushq $0x7e
popq %rsi
leaq 0x10(%rsp), %r8
movl %ebx, %r9d
xorl %eax, %eax
callq 0x2140
addl $-0x7e, %eax
cmpl $-0x7e, %eax
ja 0xa469
callq 0x2060
movl $0x1c, (%rax)
pushq $-0x1
popq %rbp
jmp 0xa47f
leaq 0x40(%rsp), %rdi
callq 0x2100
andl $0x8000ff7f, %eax       # imm = 0x8000FF7F
negl %eax
sbbl %ebp, %ebp
orl $0x1, %ebp
movl %ebp, %eax
addq $0xc8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jech[P]shncpd/kernel.c
// Function: kernel_router
int
kernel_router()
{
    char buf[100];
    int fd, rc;
    int router;

    fd = open("/proc/sys/net/ipv6/conf/all/forwarding", O_RDONLY);
    if(fd < 0)
        return -1;

    rc = read(fd, buf, 99);
    if(rc < 0) {
        close(fd);
        return -1;
    }
    close(fd);

    buf[rc] = '\0';

    router = atoi(buf);

    if(!router)
        return 0;

    rc = system("ip -6 route show | grep -q '^default '");
    return WIFEXITED(rc) && WEXITSTATUS(rc) == 1 ? 1 : 2;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x70, %rsp
leaq 0x2cbe(%rip), %rdi      # 0xd323
xorl %esi, %esi
xorl %eax, %eax
callq 0x22e0
pushq $-0x1
popq %rbx
testl %eax, %eax
js 0xa6cc
movl %eax, %ebp
movq %rsp, %rsi
pushq $0x63
popq %rdx
movl %eax, %edi
callq 0x21a0
movq %rax, %r14
movl %ebp, %edi
callq 0x2190
testl %r14d, %r14d
js 0xa6cc
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
movb $0x0, (%rsp,%r14)
movq %rsp, %rdi
callq 0x2320
testl %eax, %eax
je 0xa6ca
leaq 0x2c98(%rip), %rdi      # 0xd34a
callq 0x2100
andl $0xff7f, %eax           # imm = 0xFF7F
xorl %ebx, %ebx
cmpl $0x100, %eax            # imm = 0x100
setne %bl
incl %ebx
jmp 0xa6cc
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x70, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/jech[P]shncpd/util.c
// Function: read_random_bytes
int
read_random_bytes(void *buf, int len)
{
    int fd, rc;

    fd = open("/dev/urandom", O_RDONLY);
    if(fd < 0) {
        errno = ENOSYS;
        return -1;
    }

    rc = read(fd, buf, len);
    if(rc < len)
        rc = -1;

    close(fd);

    return rc;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %r14
leaq 0x2c86(%rip), %rdi      # 0xd371
xorl %esi, %esi
xorl %eax, %eax
callq 0x22e0
testl %eax, %eax
js 0xa71c
movl %eax, %ebx
movslq %ebp, %r15
movl %eax, %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x21a0
cmpl %r15d, %eax
pushq $-0x1
popq %rbp
cmovgel %eax, %ebp
movl %ebx, %edi
callq 0x2190
jmp 0xa72a
callq 0x2060
movl $0x26, (%rax)
pushq $-0x1
popq %rbp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/jech[P]shncpd/util.c
// Function: ts_compare
int
ts_compare(const struct timespec *s1, const struct timespec *s2)
{
    if(s1->tv_sec < s2->tv_sec)
        return -1;
    else if(s1->tv_sec > s2->tv_sec)
        return 1;
    else if(s1->tv_nsec < s2->tv_nsec)
        return -1;
    else if(s1->tv_nsec > s2->tv_nsec)
        return 1;
    else
        return 0;
}

// Assembly:
movq (%rsi), %rcx
pushq $-0x1
popq %rax
cmpq %rcx, (%rdi)
jge 0xa74e
retq
jle 0xa754
pushq $0x1
popq %rax
retq
movq 0x8(%rsi), %rcx
cmpq %rcx, 0x8(%rdi)
jl 0xa74d
setg %al
movzbl %al, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/jech[P]shncpd/util.c
// Function: ts_minus
void
ts_minus(struct timespec *d,
         const struct timespec *s1, const struct timespec *s2)
{
    if(s1->tv_nsec >= s2->tv_nsec) {
        d->tv_nsec = s1->tv_nsec - s2->tv_nsec;
        d->tv_sec = s1->tv_sec - s2->tv_sec;
    } else {
        d->tv_nsec = s1->tv_nsec + 1000000000 - s2->tv_nsec;
        d->tv_sec = s1->tv_sec - s2->tv_sec - 1;
    }
}

// Assembly:
movq 0x8(%rsi), %rax
movq 0x8(%rdx), %rcx
cmpq %rcx, %rax
jge 0xa7b7
addq $0x3b9aca00, %rax       # imm = 0x3B9ACA00
movq (%rdx), %r8
notq %r8
addq (%rsi), %r8
jmp 0xa7bd
movq (%rsi), %r8
subq (%rdx), %r8
subq %rcx, %rax
movq %rax, 0x8(%rdi)
movq %r8, (%rdi)
retq
// File: /workspace/github_c_makefile_star2_O2/jech[P]shncpd/util.c
// Function: format_32
const char *
format_32(const unsigned char *data)
{
    static char buf[4][16];
    static int i = 0;
    i = (i + 1) % 4;
    snprintf(buf[i], 16, "%02x:%02x:%02x:%02x",
             data[0], data[1], data[2], data[3]);
    return buf[i];
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movl 0xac68(%rip), %eax      # 0x154e0
incl %eax
andl $0x3, %eax
movl %eax, 0xac5d(%rip)      # 0x154e0
shll $0x4, %eax
leaq 0xac13(%rip), %rbx      # 0x154a0
addq %rbx, %rax
movzbl (%rdi), %ecx
movzbl 0x1(%rdi), %r8d
movzbl 0x2(%rdi), %r9d
movzbl 0x3(%rdi), %edx
movl %edx, (%rsp)
leaq 0x2ae7(%rip), %rdx      # 0xd392
pushq $0x10
popq %rsi
movq %rax, %rdi
xorl %eax, %eax
callq 0x2140
movl 0xac22(%rip), %eax      # 0x154e0
shlq $0x4, %rax
addq %rbx, %rax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/jech[P]shncpd/util.c
// Function: format_64
const char *
format_64(const unsigned char *data)
{
    static char buf[4][28];
    static int i = 0;
    i = (i + 1) % 4;
    snprintf(buf[i], 28, "%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x",
             data[0], data[1], data[2], data[3],
             data[4], data[5], data[6], data[7]);
    return buf[i];
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl 0xac87(%rip), %eax      # 0x15560
incl %eax
andl $0x3, %eax
movl %eax, 0xac7c(%rip)      # 0x15560
imulq $0x1c, %rax, %rax
leaq 0xac01(%rip), %rbx      # 0x154f0
addq %rbx, %rax
movzbl (%rdi), %ecx
movzbl 0x1(%rdi), %r8d
movzbl 0x2(%rdi), %r9d
movzbl 0x3(%rdi), %r10d
movzbl 0x4(%rdi), %r11d
movzbl 0x5(%rdi), %r14d
movzbl 0x6(%rdi), %r15d
movzbl 0x7(%rdi), %r12d
subq $0x8, %rsp
leaq 0x2a5b(%rip), %rdx      # 0xd37e
pushq $0x1c
popq %rsi
movq %rax, %rdi
xorl %eax, %eax
pushq %r12
pushq %r15
pushq %r14
pushq %r11
pushq %r10
callq 0x2140
addq $0x30, %rsp
movl 0xac1c(%rip), %eax      # 0x15560
imulq $0x1c, %rax, %rax
addq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/jech[P]shncpd/md5.c
// Function: md5_append
void
md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes)
{
    const md5_byte_t *p = data;
    int left = nbytes;
    int offset = (pms->count[0] >> 3) & 63;
    md5_word_t nbits = (md5_word_t)(nbytes << 3);

    if (nbytes <= 0)
	return;

    /* Update the message length. */
    pms->count[1] += nbytes >> 29;
    pms->count[0] += nbits;
    if (pms->count[0] < nbits)
	pms->count[1]++;

    /* Process an initial partial block. */
    if (offset) {
	int copy = (offset + nbytes > 64 ? 64 - offset : nbytes);

	memcpy(pms->buf + offset, p, copy);
	if (offset + copy < 64)
	    return;
	p += copy;
	left -= copy;
	md5_process(pms, pms->buf);
    }

    /* Process full blocks. */
    for (; left >= 64; p += 64, left -= 64)
	md5_process(pms, p);

    /* Process a final partial block. */
    if (left)
	memcpy(pms->buf, p, left);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
testl %edx, %edx
jle 0xaa60
movl %edx, %r15d
movq %rsi, %rbx
movq %rdi, %r14
movl (%rdi), %ecx
movl %ecx, %r13d
shrl $0x3, %r13d
andl $0x3f, %r13d
movl %edx, %eax
shrl $0x1d, %eax
addl 0x4(%rdi), %eax
leal (,%r15,8), %edx
movl %eax, 0x4(%rdi)
addl %ecx, %edx
movl %edx, (%rdi)
jae 0xa9db
incl %eax
movl %eax, 0x4(%r14)
testl %r13d, %r13d
je 0xaa22
leal (%r15,%r13), %eax
pushq $0x40
popq %r12
subl %r13d, %r12d
cmpl $0x41, %eax
cmovbl %r15d, %r12d
leaq (%r14,%r13), %rdi
addq $0x18, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x2220
movl %r12d, %eax
addl %r13d, %eax
cmpl $0x40, %eax
jb 0xaa60
leaq 0x18(%r14), %rsi
addq %r12, %rbx
subl %r12d, %r15d
movq %r14, %rdi
callq 0xaa6a
movslq %r15d, %r15
cmpl $0x40, %r15d
jl 0xaa40
movq %r14, %rdi
movq %rbx, %rsi
callq 0xaa6a
addq $0x40, %rbx
addq $-0x40, %r15
jmp 0xaa25
testl %r15d, %r15d
je 0xaa60
addq $0x18, %r14
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x2220
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/jech[P]shncpd/md5.c
// Function: md5_finish
void
md5_finish(md5_state_t *pms, md5_byte_t digest[16])
{
    static const md5_byte_t pad[64] = {
	0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
    };
    md5_byte_t data[8];
    int i;

    /* Save the length before padding. */
    for (i = 0; i < 8; ++i)
	data[i] = (md5_byte_t)(pms->count[i >> 2] >> ((i & 3) << 3));
    /* Pad to 56 bytes mod 64. */
    md5_append(pms, pad, ((55 - (pms->count[0] >> 3)) & 63) + 1);
    /* Append the length. */
    md5_append(pms, data, 8);
    for (i = 0; i < 16; ++i)
	digest[i] = (md5_byte_t)(pms->abcd[i >> 2] >> ((i & 3) << 3));
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
xorl %eax, %eax
xorl %edx, %edx
cmpq $0x8, %rdx
je 0xb1fb
movl %edx, %ecx
andl $-0x4, %ecx
movl (%r14,%rcx), %esi
movl %eax, %ecx
andb $0x18, %cl
shrl %cl, %esi
movb %sil, (%rsp,%rdx)
incq %rdx
addl $0x8, %eax
jmp 0xb1d9
movl (%r14), %eax
shrl $0x3, %eax
pushq $0x37
popq %rdx
subl %eax, %edx
andl $0x3f, %edx
incl %edx
leaq 0x21ae(%rip), %rsi      # 0xd3c0
movq %r14, %rdi
callq 0xa995
movq %rsp, %rsi
pushq $0x8
popq %rdx
movq %r14, %rdi
callq 0xa995
xorl %eax, %eax
xorl %edx, %edx
cmpq $0x10, %rdx
je 0xb24f
movl %edx, %ecx
andl $-0x4, %ecx
movl 0x8(%r14,%rcx), %esi
movl %eax, %ecx
andb $0x18, %cl
shrl %cl, %esi
movb %sil, (%rbx,%rdx)
incq %rdx
addl $0x8, %eax
jmp 0xb22c
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/sadistech[P]nesromtool2/./src/nrt_main.c
// Function: main
int main(int argc, char **argv, char **env) {
  if (argc == 1) {
    print_usage();
    exit(EXIT_SUCCESS);
  }

  char *appname = *(argv++); argc--;
  char *subcommand= *(argv++); argc--;

  if (subcommand[0] == '\0') {
    fprintf(stderr, "Please supply a subcommand.\n");
    print_usage();
    exit(EXIT_FAILURE);
  } else if (is_subcommand(subcommand, "help", "--help", "-h", NULL)) {
    print_usage();
  } else if (is_subcommand(subcommand, "info", NULL)) {
    subcommand_info(argc - 1, argv);
  } else if (is_subcommand(subcommand, "chr", NULL)) {
    subcommand_chr(argc - 1, argv);
  } else if (is_subcommand(subcommand, "prg", NULL)) {
    subcommand_prg(argc - 1, argv);
  } else if (is_subcommand(subcommand, "title", NULL)) {
    subcommand_title(argc - 1, argv);
  } else {
    fprintf(stderr, "Unknown subcommand: %s\n", subcommand);
    print_usage();
    exit(EXIT_FAILURE);
  }

  exit(EXIT_SUCCESS);

  return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
cmpl $0x1, %edi
jne 0x53b7
xorl %eax, %eax
callq 0x3486
xorl %edi, %edi
callq 0x2300
movq %rsi, %rbx
movq 0x8(%rsi), %r14
cmpb $0x0, (%r14)
jne 0x53ef
movq 0x5c2d(%rip), %rax      # 0xaff8
movq (%rax), %rcx
leaq 0x2493(%rip), %rdi      # 0x7868
pushq $0x1c
popq %rsi
pushq $0x1
popq %rdx
callq 0x2310
xorl %eax, %eax
callq 0x3486
pushq $0x1
popq %rdi
callq 0x2300
movl %edi, %ebp
leaq 0x10de(%rip), %rsi      # 0x64d6
leaq 0x10c3(%rip), %rdx      # 0x64c2
leaq 0x247f(%rip), %rcx      # 0x7885
movq %r14, %rdi
xorl %r8d, %r8d
xorl %eax, %eax
callq 0x3cd4
testb %al, %al
jne 0x53a9
addq $0x10, %rbx
leaq 0xeb6(%rip), %rsi       # 0x62d8
movq %r14, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0x3cd4
testb %al, %al
je 0x5444
addl $-0x3, %ebp
movl %ebp, %edi
movq %rbx, %rsi
callq 0x3e2d
jmp 0x53b0
leaq 0x12f7(%rip), %rsi      # 0x6742
movq %r14, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0x3cd4
testb %al, %al
je 0x546d
addl $-0x3, %ebp
movl %ebp, %edi
movq %rbx, %rsi
callq 0x4a69
jmp 0x53b0
leaq 0xf27(%rip), %rsi       # 0x639b
movq %r14, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0x3cd4
testb %al, %al
je 0x5496
addl $-0x3, %ebp
movl %ebp, %edi
movq %rbx, %rsi
callq 0x430b
jmp 0x53b0
leaq 0x1a9e(%rip), %rsi      # 0x6f3b
movq %r14, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0x3cd4
testb %al, %al
je 0x54bf
addl $-0x3, %ebp
movl %ebp, %edi
movq %rbx, %rsi
callq 0x5172
jmp 0x53b0
movq 0x5b32(%rip), %rax      # 0xaff8
movq (%rax), %rdi
leaq 0x23b8(%rip), %rsi      # 0x7888
movq %r14, %rdx
xorl %eax, %eax
callq 0x21e0
jmp 0x53e0
// File: /workspace/github_c_makefile_star2_O2/sushant8421[P]create_your_own_shell/run_searchstring.c
// Function: main
int main(int argc , char *argv[]){	
	int x , stat_loc;
	pid_t ch ;
	struct dirent *de;  // Pointer for directory entry 
  
    // opendir() returns a pointer of DIR type.  
    DIR *dr = opendir(argv[3]); 
  
    if (dr == NULL)  // opendir returns NULL if couldn't open directory 
    { 
        printf("Could not open current directory\n" ); 
        return 0; 
    }
    
    while ((de = readdir(dr)) != NULL) {
     	char *args[] = {"./searchstring" , argv[1] ,  de->d_name, argv[2], NULL};
    	if((ch = fork()) < 0){
    		printf("child is not created\n") ;
    	}
    	else if(ch > 0){
    		waitpid(ch, &stat_loc, WUNTRACED);
    	}
    	else{
    		if(x=execv("./searchstring", args)<0)
    			printf("execution error");
		}
	}
    		
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %rbx
movq 0x18(%rsi), %rdi
callq 0x1040
testq %rax, %rax
je 0x124a
movq %rax, %r14
leaq 0xe38(%rip), %r15       # 0x2004
leaq -0x2c(%rbp), %r13
pushq $0x2
popq %r12
movq %r14, %rdi
callq 0x1060
testq %rax, %rax
je 0x1256
movq %r15, -0x60(%rbp)
movq 0x8(%rbx), %rcx
movq %rcx, -0x58(%rbp)
addq $0x13, %rax
movq %rax, -0x50(%rbp)
movq 0x10(%rbx), %rax
movq %rax, -0x48(%rbp)
andq $0x0, -0x40(%rbp)
callq 0x1090
testl %eax, %eax
js 0x121c
je 0x122a
movl %eax, %edi
movq %r13, %rsi
movl %r12d, %edx
callq 0x1070
jmp 0x11d4
leaq 0xe00(%rip), %rdi       # 0x2023
callq 0x1030
jmp 0x11d4
movq %r15, %rdi
leaq -0x60(%rbp), %rsi
callq 0x1080
testl %eax, %eax
jns 0x11d4
leaq 0xdd2(%rip), %rdi       # 0x2013
xorl %eax, %eax
callq 0x1050
jmp 0x11d4
leaq 0xde7(%rip), %rdi       # 0x2038
callq 0x1030
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/WereCatf[P]Gonzales/fast-gpio.c
// Function: muxToString
char *muxToString(uint8_t port, uint8_t pin, uint8_t mux)
{
	char *returnStr=strUnknownMux;
	if(port < 1 || port > 6 || pin > 31) return strUnknownMux;
	if(mux==0) return strInputMux;
	if(mux==1) return strOutputMux;
	if(mux==5) return strUnknownMux; //Manual gives no definition for such mux
	mux-=2;
	if(mux==4) mux=3; //Skip the "missing" mux above
	uint8_t i, _pins, _port, _row;
	_port=1;
	i=0;
	while(_port != port){
		_pins=pinsWithMux[i];
		i+=_pins*2+1;
		_port++;
	}
	_pins=pinsWithMux[i];
	//printf("Debug: %d, %d\n", i, _pins);
	i++;
	while(_pins){
		if(pinsWithMux[i]==pin){
			_row=pinsWithMux[i+1];
			returnStr=muxNames[_row][mux];
			if(returnStr==NULL) returnStr=strUnknownMux;
			break;
		}
		i+=2;
		_pins--;
	}
	return returnStr;
}

// Assembly:
movq 0x3f99(%rip), %rax      # 0x7080
leal -0x7(%rdi), %ecx
cmpb $-0x6, %cl
setb %cl
cmpb $0x20, %sil
setae %r8b
orb %cl, %r8b
je 0x30fe
retq
cmpb $0x5, %dl
je 0x30fd
movzbl %dl, %ecx
cmpl $0x1, %ecx
je 0x3117
testl %ecx, %ecx
jne 0x311f
movq 0x3f72(%rip), %rax      # 0x7088
retq
movq 0x3f72(%rip), %rax      # 0x7090
retq
addb $-0x2, %dl
decb %dil
xorl %r9d, %r9d
leaq 0x48f1(%rip), %rcx      # 0x7a20
leal 0x1(%r9), %r8d
movzbl %r9b, %r9d
subb $0x1, %dil
jb 0x314c
movb (%r9,%rcx), %r9b
addb %r9b, %r9b
addb %r9b, %r8b
movl %r8d, %r9d
jmp 0x312f
cmpb $0x4, %dl
movzbl %dl, %edi
pushq $0x3
popq %rdx
cmovnel %edi, %edx
movb (%r9,%rcx), %dil
subb $0x1, %dil
jb 0x30fd
movzbl %r8b, %r9d
cmpb %sil, (%r9,%rcx)
je 0x3172
addb $0x2, %r8b
jmp 0x315c
movzbl 0x1(%r9,%rcx), %ecx
shll $0x5, %ecx
leaq 0x3f1e(%rip), %rsi      # 0x70a0
addq %rcx, %rsi
movzbl %dl, %ecx
movq (%rsi,%rcx,8), %rcx
testq %rcx, %rcx
cmovneq %rcx, %rax
retq
// File: /workspace/github_c_makefile_star2_O2/WereCatf[P]Gonzales/fast-gpio.c
// Function: initGpio
int initGpio()
{
	int fd = open("/dev/mem", O_RDWR|O_SYNC);
	if(fd < 0) return 1;
	// uint32_t addr = 0x01c20800 & ~(getpagesize() - 1);
	//Requires memmap to be on pagesize-boundary
	memmap=(uint8_t *)mmap(NULL, getpagesize()*2, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0x01c20000);
	if(memmap == NULL) return 1;
	close(fd);

	//Set memmap to point to PIO-registers
	memmap=memmap+0x800;
	return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
leaq 0x1cff(%rip), %rdi      # 0x4e9d
movl $0x101002, %esi         # imm = 0x101002
xorl %eax, %eax
callq 0x20a0
testl %eax, %eax
js 0x31f4
movl %eax, %ebx
callq 0x20c0
addl %eax, %eax
movslq %eax, %rsi
pushq $0x3
popq %rdx
pushq $0x1
popq %rbp
movl $0x1c20000, %r9d        # imm = 0x1C20000
xorl %edi, %edi
movl %ebp, %ecx
movl %ebx, %r8d
callq 0x2060
movq %rax, 0x48f7(%rip)      # 0x7ad0
testq %rax, %rax
je 0x31f7
movl %ebx, %edi
callq 0x2080
addq $0x800, 0x48e0(%rip) # imm = 0x800
xorl %ebp, %ebp
jmp 0x31f7
pushq $0x1
popq %rbp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/WereCatf[P]Gonzales/fast-gpio.c
// Function: readMux
int readMux(int port, int pin)
{
	volatile uint32_t *pioMem32, *configRegister;
	pioMem32=(uint32_t *)(memmap+port*0x24);
	configRegister=pioMem32+(pin >> 3);
	return *configRegister >> ((pin & 7) * 4) & 7;
}

// Assembly:
movslq %edi, %rax
imulq $0x24, %rax, %rax
addq 0x48c2(%rip), %rax      # 0x7ad0
leal (,%rsi,4), %ecx
movl %esi, %edx
sarl $0x3, %edx
movslq %edx, %rdx
movl (%rax,%rdx,4), %eax
shrl %cl, %eax
andl $0x7, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/WereCatf[P]Gonzales/fast-gpio.c
// Function: writeMux
void writeMux(int port, int pin, uint8_t mux)
{
	volatile uint32_t *pioMem32, *configRegister;
	uint32_t mask;

	pioMem32=(uint32_t *)(memmap+port*0x24);
	mux &= 7;
	configRegister=pioMem32+(pin >> 3);
	mask = ~(7 << ((pin & 7) * 4));
	*configRegister &= mask;
	*configRegister |= mux << ((pin & 7) * 4);
}

// Assembly:
movslq %edi, %rax
imulq $0x24, %rax, %rax
addq 0x489c(%rip), %rax      # 0x7ad0
leal (,%rsi,4), %ecx
sarl $0x3, %esi
movslq %esi, %rsi
pushq $0x7
popq %rdi
shll %cl, %edi
notl %edi
andl %edi, (%rax,%rsi,4)
andl $0x7, %edx
shll %cl, %edx
orl %edx, (%rax,%rsi,4)
retq