// File: /workspace/github_c_makefile_star2_O0/jech[P]shncpd/prefix.c
// Function: address_assignment_1
int
address_assignment_1(struct interface *interface,
                     struct assigned_prefix *ap,
                     struct prefix_list *addresses)
{
    int have_assigned = ap->assigned.plen > 0;
    int have_address = !IN6_IS_ADDR_UNSPECIFIED(&ap->assigned_address);
    struct prefix p = {.p = ap->assigned_address, .plen = 128};
    int rc;
    int republish = 0;

    if(have_address && (!have_assigned ||
                        !prefix_within(&p, &ap->assigned) ||
                        prefix_list_overlap(&p, addresses, 0))) {
        destroy_assigned_address(interface, ap);
        memset(&ap->assigned_address, 0, 16);
        have_address = 0;
        republish = 1;
    }

    if(have_address || !have_assigned)
        return republish;

    rc = random_prefix(&p, 128, min(2, 128 - ap->assigned.plen), 0,
                       &ap->assigned, addresses);
    if(rc <= 0) {
        fprintf(stderr, "Couldn't generate random address.\n");
        return republish;
    }

    debugf("Adding address ");
    debug_address(&p.p);
    debugf(" to interface %s.\n", interface->ifname);
    rc = kernel_address(interface->ifindex, interface->ifname,
                        &p.p, ap->assigned.plen, 1);
    if(rc >= 0) {
        ap->assigned_address = p.p;
        republish = 1;
    } else {
        perror("Couldn't assign address");
    }

    return republish;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x18(%rbp), %rax
movzbl 0x2c(%rax), %eax
cmpl $0x0, %eax
setg %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x24(%rbp)
movq -0x18(%rbp), %rax
addq $0x60, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rcx
xorl %eax, %eax
cmpl $0x0, (%rcx)
movb %al, -0x59(%rbp)
jne 0xe490
movq -0x30(%rbp), %rcx
xorl %eax, %eax
cmpl $0x0, 0x4(%rcx)
movb %al, -0x59(%rbp)
jne 0xe490
movq -0x30(%rbp), %rcx
xorl %eax, %eax
cmpl $0x0, 0x8(%rcx)
movb %al, -0x59(%rbp)
jne 0xe490
movq -0x30(%rbp), %rax
cmpl $0x0, 0xc(%rax)
sete %al
movb %al, -0x59(%rbp)
movb -0x59(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq 0x60(%rax), %rcx
movq %rcx, -0x50(%rbp)
movq 0x68(%rax), %rax
movq %rax, -0x48(%rbp)
movb $-0x80, -0x40(%rbp)
movw $0x0, -0x3e(%rbp)
leaq -0x50(%rbp), %rdi
addq $0x14, %rdi
xorl %esi, %esi
movl $0x4, %edx
callq 0x2170
movl $0x0, -0x38(%rbp)
movl $0x0, -0x58(%rbp)
cmpl $0x0, -0x28(%rbp)
je 0xe551
cmpl $0x0, -0x24(%rbp)
je 0xe522
movq -0x18(%rbp), %rsi
addq $0x1c, %rsi
leaq -0x50(%rbp), %rdi
callq 0xc730
cmpl $0x0, %eax
je 0xe522
movq -0x20(%rbp), %rsi
leaq -0x50(%rbp), %rdi
xorl %edx, %edx
callq 0xc9e0
cmpl $0x0, %eax
je 0xe551
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xdb20
movq -0x18(%rbp), %rdi
addq $0x60, %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x2170
movl $0x0, -0x28(%rbp)
movl $0x1, -0x58(%rbp)
cmpl $0x0, -0x28(%rbp)
jne 0xe55d
cmpl $0x0, -0x24(%rbp)
jne 0xe568
movl -0x58(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0xe67c
movq -0x18(%rbp), %rax
movzbl 0x2c(%rax), %eax
movl $0x80, %esi
subl %eax, %esi
movl $0x2, %edi
callq 0xcb70
movl %eax, %edx
movq -0x18(%rbp), %r8
addq $0x1c, %r8
movq -0x20(%rbp), %r9
leaq -0x50(%rbp), %rdi
movl $0x80, %esi
xorl %ecx, %ecx
callq 0xcea0
movl %eax, -0x54(%rbp)
cmpl $0x0, -0x54(%rbp)
jg 0xe5cb
movq 0x7a49(%rip), %rax      # 0x15ff8
movq (%rax), %rdi
leaq 0x4cd1(%rip), %rsi      # 0x1328a
movb $0x0, %al
callq 0x21f0
movl -0x58(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0xe67c
jmp 0xe5cd
leaq 0x7c94(%rip), %rax      # 0x16268
cmpl $0x2, (%rax)
jl 0xe5ec
movl $0x2, %edi
leaq 0x4cc8(%rip), %rsi      # 0x132ad
movb $0x0, %al
callq 0xfda0
jmp 0xe5ee
leaq -0x50(%rbp), %rdi
callq 0xbf70
leaq 0x7c6a(%rip), %rax      # 0x16268
cmpl $0x2, (%rax)
jl 0xe61d
movq -0x10(%rbp), %rax
movq (%rax), %rdx
movl $0x2, %edi
leaq 0x4ca7(%rip), %rsi      # 0x132bd
movb $0x0, %al
callq 0xfda0
jmp 0xe61f
movq -0x10(%rbp), %rax
movl 0x8(%rax), %edi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
leaq -0x50(%rbp), %rdx
movq -0x18(%rbp), %rax
movzbl 0x2c(%rax), %ecx
movl $0x1, %r8d
callq 0xf350
movl %eax, -0x54(%rbp)
cmpl $0x0, -0x54(%rbp)
jl 0xe66a
movq -0x18(%rbp), %rax
movq -0x50(%rbp), %rcx
movq %rcx, 0x60(%rax)
movq -0x48(%rbp), %rcx
movq %rcx, 0x68(%rax)
movl $0x1, -0x58(%rbp)
jmp 0xe676
leaq 0x4c5f(%rip), %rdi      # 0x132d0
callq 0x2300
movl -0x58(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)