// File: /workspace/github_c_makefile_star2_O1/jech[P]shncpd/dhcpv4.c
// Function: dhcpv4_receive
int
dhcpv4_receive()
{
    int i, rc, buflen;
    const char broadcast_addr[4] = {255, 255, 255, 255};
    struct sockaddr_in from, to;
    int dontroute = 1;
    int bufsiz = 1500;
    unsigned char buf[bufsiz];
    unsigned char myaddr[4];
    struct dhcpv4_request req;
    struct interface *interface;
    struct prefix_list *pl = NULL, *dns = NULL;
    int ifindex = -1;
    unsigned char netmask[4];
    struct iovec iov[1];
    struct msghdr msg;
    int cmsglen = 100;
    char cmsgbuf[cmsglen];
    struct cmsghdr *cmsg = (struct cmsghdr*)cmsgbuf;

    iov[0].iov_base = buf;
    iov[0].iov_len = bufsiz;
    memset(&msg, 0, sizeof(msg));
    msg.msg_name = &from;
    msg.msg_namelen = sizeof(from);
    msg.msg_iov = iov;
    msg.msg_iovlen = 1;
    msg.msg_control = cmsg;
    msg.msg_controllen = cmsglen;

    rc = recvmsg(dhcpv4_socket, &msg, 0);

    if(rc < 0)
        return -1;

    if(from.sin_family != AF_INET || msg.msg_namelen < sizeof(from))
        return -1;

    buflen = rc;

    cmsg = CMSG_FIRSTHDR(&msg);
    while(cmsg != NULL) {
        if ((cmsg->cmsg_level == IPPROTO_IP) &&
            (cmsg->cmsg_type == IP_PKTINFO)) {
            struct in_pktinfo *info = (struct in_pktinfo*)CMSG_DATA(cmsg);
            ifindex = info->ipi_ifindex;
            break;
        }
        cmsg = CMSG_NXTHDR(&msg, cmsg);
    }

    interface = ifindex > 0 ? find_interface(ifindex) : NULL;

    if(interface == NULL)
        return -1;

    rc = interface_v4(interface, myaddr);
    if(rc <= 0) {
        return -1;
    }

    for(i = 0; i < interface->numassigned; i++) {
        struct assigned_prefix *ap = &interface->assigned[i];
        struct prefix_list *ppl;

        if(!ap->applied || !prefix_v4(&ap->assigned))
            continue;

        ppl = prefix_list_cons_prefix(pl, &ap->assigned);
        if(ppl != NULL)
            pl = ppl;
    }

    memset(&req, 0, sizeof(req));
    rc = dhcpv4_parse(buf, buflen, &req);
    if(rc < 0)
        return -1;

    debugf("   DHCPv4 (type %d) on %s", req.type, interface->ifname);

    if(user_class_match(req.uc, req.uclen, "HOMENET") ||
       (memcmp(req.sid, zeroes, 4) != 0 && memcmp(req.sid, myaddr, 4) != 0)) {
        debugf(" (ignored)\n");
        goto done;
    }

    debugf("\n");

    memset(&to, 0, sizeof(to));
    to.sin_family = AF_INET;
    if(memcmp(req.giaddr, zeroes, 4) != 0) {
        memcpy(&to.sin_addr, req.giaddr, 4);
        dontroute = 0;
    } else if(!req.broadcast && memcmp(req.ciaddr, zeroes, 4) != 0) {
        memcpy(&to.sin_addr, req.ciaddr, 4);
    } else {
        memcpy(&to.sin_addr, broadcast_addr, 4);
    }
    to.sin_port = htons(68);

    if(!interface_dhcpv4(interface))
        goto nak;

    dns = all_dhcp_data(0, 1, 0);

    switch(req.type) {
    case 1:                     /* DHCPDISCOVER */
    case 3: {                   /* DHCPREQUEST */
        struct lease *lease = NULL;
        unsigned char cip[4];
        int have_cip;
        time_t lease_end;

        if(req.type == 1)
            memcpy(cip, req.ip, 4);
        else if(memcmp(req.ciaddr, zeroes, 4) != 0)
            memcpy(cip, req.ciaddr, 4);
        else
            memcpy(cip, req.ip, 4);

        have_cip = memcmp(cip, zeroes, 4) != 0;

        if(req.type == 3 && !have_cip)
            goto nak;

        if(req.type == 1) {
            lease = find_matching_lease(req.cid, req.cidlen, req.chaddr, pl);
            if(lease && !prefix_list_within_v4(lease->ip, pl))
                lease = NULL;
        }

        if(lease == NULL && have_cip) {
            if(prefix_list_within_v4(cip, pl)) {
                lease = find_lease(cip, req.type == 1);
                if(lease && !lease_expired(lease) &&
                   !lease_match(req.cid, req.cidlen, req.chaddr, lease)) {
                    lease = NULL;
                }
            } else {
                lease = NULL;
            }
        }

        if(lease == NULL) {
            if(req.type == 3)
                goto nak;
            rc = generate_v4(cip, netmask, pl);
            if(rc < 0)
                goto nak;
            lease = find_lease(cip, 1);
        } else {
            rc = compute_netmask(netmask, lease->ip, pl);
            if(rc < 0)
                goto nak;
        }

        if(lease == NULL)
            goto nak;

        memcpy(lease->chaddr, req.chaddr, 16);
        lease->ifindex = ifindex;
        lease_end = req.type == 1 ? now.tv_sec : now.tv_sec + LEASE_TIME + 10;
        if(lease->end < lease_end) {
            lease->end = lease_end;
        }
        free(lease->cid);
        lease->cidlen = req.cidlen;
        lease->cid = req.cid;
        req.cid = NULL;

        rc = dhcpv4_send(dhcpv4_socket, &to, dontroute,
                         req.type == 1 ? 2 : 5, req.xid, req.chaddr, myaddr,
                         lease->ip, ifindex, netmask, dns, LEASE_TIME);
        if(rc < 0)
            perror("dhcpv4_send");
        break;
    }
    case 4: {                   /* DHCPDECLINE */
        struct lease *lease = find_lease(req.ip, 0);
        fprintf(stderr, "Received DHCPDECLINE");
        if(lease && lease->end >= now.tv_sec) {
            fprintf(stderr, " (already assigned).\n");
        } else if(lease && lease->end >= now.tv_sec - LEASE_TIME) {
            fprintf(stderr, " (marking as used).\n");
            free(lease->cid);
            lease->cid = NULL;
            lease->cidlen = 0;
            req.cid = NULL;
            memset(lease->chaddr, 0, 16);
            lease->end = now.tv_sec + LEASE_TIME;
        } else {
            fprintf(stderr, " (ignored).\n");
        }
        break;
    }
    case 7: {                   /* DHCPRELEASE */
        struct lease *lease =
            find_matching_lease(req.cid, req.cidlen, req.chaddr, NULL);
        if(lease)
            lease->end = now.tv_sec;
        break;
    }
    case 8: {                   /* DHCPINFORM */
        rc = dhcpv4_send(dhcpv4_socket, &to, dontroute,
                         5, req.xid, req.chaddr, myaddr,
                         NULL, ifindex, NULL, dns, 0);
        if(rc < 0)
            perror("dhcpv4_send");
        break;
    }
    }

    goto done;

 nak:
    /* NAK is always sent to broadcast address, except in relay case. */
    if(memcmp(req.giaddr, zeroes, 4) == 0)
        memcpy(&to.sin_addr, broadcast_addr, 4);
    if(req.type == 3)
        dhcpv4_send(dhcpv4_socket, &to, dontroute, 6, req.xid, req.chaddr,
                    myaddr, req.ip, ifindex,
                    NULL, NULL, 0);
 done:
    free(req.cid);
    free(req.uc);
    destroy_prefix_list(dns);
    destroy_prefix_list(pl);
    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x7b8, %rsp            # imm = 0x7B8
movq %rsp, %rbx
leaq 0x1d0(%rsp), %rax
leaq 0x150(%rsp), %rcx
movq %rax, (%rcx)
movq $0x5dc, 0x8(%rcx)       # imm = 0x5DC
xorps %xmm0, %xmm0
leaq 0x110(%rsp), %rsi
movaps %xmm0, (%rsi)
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, 0x20(%rsi)
movq $0x0, 0x30(%rsi)
leaq 0x100(%rsp), %rax
movq %rax, (%rsi)
movl $0x10, 0x8(%rsi)
movq %rcx, 0x10(%rsi)
movq $0x1, 0x18(%rsi)
leaq 0x160(%rsp), %rax
movq %rax, 0x20(%rsi)
movq $0x64, 0x28(%rsi)
movl 0xad59(%rip), %edi      # 0x131f0
xorl %edx, %edx
callq 0x2290
movq %rax, %r12
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %r12d, %r12d
js 0x8bbc
cmpw $0x2, 0x100(%rsp)
jne 0x8bbc
cmpl $0x10, 0x118(%rsp)
jb 0x8bbc
movq 0x130(%rsp), %rax
cmpq $0x10, 0x138(%rsp)
setb %cl
testq %rax, %rax
sete %dl
orb %cl, %dl
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
jne 0x8520
movq %rbx, %r14
leaq 0x110(%rsp), %rbx
cmpl $0x0, 0x8(%rax)
jne 0x8507
cmpl $0x8, 0xc(%rax)
je 0x8519
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2340
testq %rax, %rax
jne 0x84fb
jmp 0x851d
movl 0x10(%rax), %r15d
movq %r14, %rbx
testl %r15d, %r15d
jle 0x8532
movl %r15d, %edi
callq 0x476f
movq %rax, %rbp
jmp 0x8534
xorl %ebp, %ebp
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testq %rbp, %rbp
je 0x8bbc
leaq 0x24(%rsp), %rsi
movq %rbp, %rdi
callq 0x9fca
testl %eax, %eax
jle 0x8bb7
movq %r15, 0x68(%rsp)
cmpl $0x0, 0x68(%rbp)
movq %rbx, 0x28(%rsp)
jle 0x85c4
movl $0x3c, %ebx
xorl %r15d, %r15d
movq $0x0, 0x48(%rsp)
movq 0x60(%rbp), %rax
cmpl $0x0, (%rax,%rbx)
je 0x85b2
leaq (%rax,%rbx), %r14
addq $-0x20, %r14
movq %r14, %rdi
callq 0x9ef3
testl %eax, %eax
je 0x85b2
movq 0x48(%rsp), %r13
movq %r13, %rdi
movq %r14, %rsi
callq 0x97de
testq %rax, %rax
cmovneq %rax, %r13
movq %r13, 0x48(%rsp)
incq %r15
movslq 0x68(%rbp), %rax
addq $0x70, %rbx
cmpq %rax, %r15
jl 0x8578
jmp 0x85cd
movq $0x0, 0x48(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0xb0(%rsp)
movaps %xmm0, 0xa0(%rsp)
movaps %xmm0, 0x90(%rsp)
movaps %xmm0, 0x80(%rsp)
movaps %xmm0, 0x70(%rsp)
movq $0x0, 0xc0(%rsp)
movaps %xmm0, 0x30(%rsp)
cmpl $0xec, %r12d
jl 0x8b8c
cmpb $0x1, 0x1d0(%rsp)
jne 0x8b8c
movq $0x0, 0x18(%rsp)
cmpb $0x1, 0x1d1(%rsp)
jne 0x8b95
movq %rbp, 0xf8(%rsp)
cmpb $0x6, 0x1d2(%rsp)
movl $0x0, %eax
movq %rax, 0x10(%rsp)
jne 0x8b9e
movl 0x1d4(%rsp), %eax
movl 0x1dc(%rsp), %ecx
movzbl 0x1da(%rsp), %r8d
movl 0x1e0(%rsp), %edx
movl 0x1e4(%rsp), %esi
movl 0x1e8(%rsp), %edi
movups 0x1ec(%rsp), %xmm0
movaps %xmm0, 0x30(%rsp)
cmpl $0xf0, %r12d
jl 0x8b8c
movq $0x0, 0x18(%rsp)
cmpl $0xf0, %r12d
je 0x8b95
movl %r8d, 0x64(%rsp)
movl %edi, 0xdc(%rsp)
movl %esi, 0xe0(%rsp)
movl %edx, 0xe4(%rsp)
movl %ecx, 0xe8(%rsp)
movl %eax, 0xec(%rsp)
cmpl $0x63538263, 0x2bc(%rsp) # imm = 0x63538263
movl $0x0, %eax
movq %rax, 0x10(%rsp)
jne 0x8b9e
shrl $0x7, 0x64(%rsp)
movl $0xffffffff, 0x60(%rsp) # imm = 0xFFFFFFFF
movq $0x0, 0xf0(%rsp)
movl $0xf0, %ebx
leaq 0x566c(%rip), %rdx      # 0xdd88
movl $0x0, 0x54(%rsp)
movq $0x0, 0x10(%rsp)
movq $0x0, 0x18(%rsp)
movl $0x0, 0x5c(%rsp)
movl $0x0, 0x58(%rsp)
movl %r12d, %ecx
subl %ebx, %ecx
jle 0x882d
movslq %ebx, %rax
leaq (%rsp,%rax), %r13
addq $0x1d0, %r13            # imm = 0x1D0
movzbl (%r13), %eax
cmpl $0xff, %eax
je 0x877b
testl %eax, %eax
jne 0x8787
incl %ebx
movl $0x3, %ebp
jmp 0x88ba
incl %ebx
movl $0x5, %ebp
jmp 0x88ba
cmpl $0x1, %ecx
je 0x88a2
movzbl 0x1(%r13), %r14d
leal 0x2(%r14), %r15d
cmpl %r15d, %ecx
jl 0x88a9
cmpl $0x35, %eax
jle 0x8805
cmpl $0x36, %eax
je 0x8834
cmpl $0x3d, %eax
je 0x8849
cmpl $0x4d, %eax
jne 0x889b
movl $0x2, %ebp
cmpq $0x0, 0x10(%rsp)
jne 0x88ba
movq %r14, %rdi
callq 0x2240
testq %rax, %rax
je 0x88e7
addq $0x2, %r13
movq %rax, 0x10(%rsp)
movq %rax, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x2210
movq %r14, 0xf0(%rsp)
jmp 0x887f
cmpl $0x32, %eax
je 0x8888
cmpl $0x35, %eax
jne 0x889b
movl $0x2, %ebp
cmpl $0x1, %r14d
jne 0x88ba
movzbl 0x2(%r13), %eax
movl %eax, 0x60(%rsp)
jmp 0x889b
callq 0x2e47
jmp 0x88ae
movl $0x2, %ebp
cmpl $0x4, %r14d
jne 0x88ba
movl 0x2(%r13), %eax
movl %eax, 0x5c(%rsp)
jmp 0x889b
movl $0x2, %ebp
cmpq $0x0, 0x18(%rsp)
jne 0x88ba
movq %r14, %rdi
callq 0x2240
testq %rax, %rax
je 0x88dc
addq $0x2, %r13
movq %rax, 0x18(%rsp)
movq %rax, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x2210
movl %r14d, 0x54(%rsp)
leaq 0x5502(%rip), %rdx      # 0xdd88
jmp 0x889b
movl $0x2, %ebp
cmpl $0x4, %r14d
jne 0x88ba
movl 0x2(%r13), %eax
movl %eax, 0x58(%rsp)
addl %r15d, %ebx
xorl %ebp, %ebp
jmp 0x88ba
callq 0x2e25
jmp 0x88ae
callq 0x2e03
leaq 0x54d3(%rip), %rdx      # 0xdd88
movl $0x2, %ebp
cmpl $0x5, %ebp
ja 0x89a0
movl %ebp, %eax
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
jmpq *%rax
cmpl %r12d, %ebx
jl 0x8746
jmp 0x8b9e
movq $0x0, 0x18(%rsp)
jmp 0x88f0
movq $0x0, 0x10(%rsp)
leaq 0x5491(%rip), %rdx      # 0xdd88
jmp 0x88ba
movl 0x60(%rsp), %eax
movl %eax, 0x70(%rsp)
movl 0x64(%rsp), %eax
movl %eax, 0x74(%rsp)
movaps 0x30(%rsp), %xmm0
movups %xmm0, 0x8c(%rsp)
movl 0xec(%rsp), %eax
movl %eax, 0x78(%rsp)
movl 0xe8(%rsp), %eax
movl %eax, 0x7c(%rsp)
movl 0xe4(%rsp), %eax
movl %eax, 0x80(%rsp)
movl 0xe0(%rsp), %eax
movl %eax, 0x84(%rsp)
movl 0xdc(%rsp), %eax
movl %eax, 0x88(%rsp)
movl 0x58(%rsp), %eax
movl %eax, 0x9c(%rsp)
movl 0x5c(%rsp), %eax
movl %eax, 0xa0(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0xa8(%rsp)
movl 0x54(%rsp), %eax
movl %eax, 0xb0(%rsp)
movq 0x10(%rsp), %rax
movq %rax, 0xb8(%rsp)
movq 0xf0(%rsp), %rax
movl %eax, 0xc0(%rsp)
leaq 0xa8b1(%rip), %rbx      # 0x13258
cmpl $0x2, (%rbx)
movq 0xf8(%rsp), %rax
jge 0x8bd1
movq 0xb8(%rsp), %rax
xorl %edx, %edx
movl 0xc0(%rsp), %ecx
movl $0x454d4f48, %esi       # imm = 0x454D4F48
movl $0x54454e45, %edi       # imm = 0x54454E45
movq 0x48(%rsp), %r12
leal 0x8(%rdx), %r8d
cmpl %ecx, %r8d
jge 0x8a1d
movslq %edx, %r10
movzbl (%rax,%r10), %r9d
cmpl $0x7, %r9d
jne 0x8a04
movl 0x1(%rax,%r10), %r11d
xorl %esi, %r11d
movl 0x4(%rax,%r10), %r10d
xorl %edi, %r10d
orl %r11d, %r10d
je 0x8a13
addl %r9d, %edx
incl %edx
movb $0x1, %r9b
testb %r9b, %r9b
jne 0x89d8
jmp 0x8a18
xorl %r9d, %r9d
jmp 0x8a0c
cmpl %ecx, %r8d
jl 0x8a34
cmpl $0x0, 0xa0(%rsp)
je 0x8a79
movl 0xa0(%rsp), %eax
cmpl 0x24(%rsp), %eax
je 0x8a79
cmpl $0x2, (%rbx)
jge 0x8c75
xorl %r15d, %r15d
movq 0x28(%rsp), %rbx
movq 0xa8(%rsp), %rdi
callq 0x2040
movq 0xb8(%rsp), %rdi
callq 0x2040
movq %r15, %rdi
callq 0x97c3
movq %r12, %rdi
callq 0x97c3
movl $0x1, %eax
jmp 0x8bbc
cmpl $0x2, (%rbx)
jge 0x8c84
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movw $0x2, 0x30(%rsp)
movl 0x88(%rsp), %eax
xorl %ebp, %ebp
testl %eax, %eax
movq 0x28(%rsp), %rbx
jne 0x8ac2
xorl %ecx, %ecx
cmpl 0x74(%rsp), %ecx
movl $0x0, %eax
sbbl %eax, %eax
movl 0x7c(%rsp), %edx
cmpl $0x1, %edx
sbbl %ecx, %ecx
orl %edx, %eax
orl %ecx, %eax
movl $0x1, %ebp
movl %eax, 0x34(%rsp)
movw $0x4400, 0x32(%rsp)     # imm = 0x4400
movq 0xf8(%rsp), %rdi
callq 0x81a6
testl %eax, %eax
je 0x8b84
xorl %edi, %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0x50b9
movq %rax, %r15
movl 0x70(%rsp), %eax
leal -0x1(%rax), %ecx
cmpl $0x7, %ecx
ja 0x8a45
leaq 0x5296(%rip), %rdx      # 0xdda0
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
cmpl $0x1, %eax
je 0x8b20
movl 0x7c(%rsp), %ecx
testl %ecx, %ecx
jne 0x8b27
movl 0x9c(%rsp), %ecx
movl %ecx, 0xc(%rsp)
movl 0xc(%rsp), %ebx
movl %eax, %ecx
xorl $0x3, %ecx
orl %ebx, %ecx
je 0x8e2c
cmpl $0x1, %eax
jne 0x8c7f
leaq 0x8c(%rsp), %rdx
movq 0x1c(%rdx), %rdi
movl 0x24(%rdx), %esi
movq %r12, %rcx
callq 0x8ed7
movq %r12, %r13
testq %rax, %rax
je 0x8c8e
movq %rax, %r12
movq %rax, %rdi
movq %r13, %rsi
callq 0x9b0e
xorl %r14d, %r14d
testl %eax, %eax
cmovneq %r12, %r14
jmp 0x8c91
xorl %r15d, %r15d
jmp 0x8e31
movq $0x0, 0x18(%rsp)
movq $0x0, 0x10(%rsp)
leaq 0x30(%rsp), %rdx
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x2f7d
movq 0x28(%rsp), %rbx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq %rbx, %rsp
addq $0x7b8, %rsp            # imm = 0x7B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x70(%rsp), %edx
movq (%rax), %rcx
leaq 0x5223(%rip), %rsi      # 0xde02
movl $0x2, %edi
xorl %eax, %eax
callq 0x319e
jmp 0x89b8
leaq 0x78(%rsp), %rcx
leaq 0x8c(%rsp), %r8
subq $0x8, %rsp
xorl %eax, %eax
leaq 0x38(%rsp), %rdi
leaq 0x2c(%rsp), %r9
movl %ebp, %esi
movl $0x5, %edx
pushq $0x0
pushq %r15
pushq %rax
pushq 0x88(%rsp)
pushq %rax
callq 0x9138
addq $0x30, %rsp
testl %eax, %eax
jns 0x8a45
leaq 0x51f7(%rip), %rdi      # 0xde30
callq 0x22e0
jmp 0x8a45
leaq 0x8c(%rsp), %rdx
movq 0x1c(%rdx), %rdi
movl 0x24(%rdx), %esi
xorl %ecx, %ecx
callq 0x8ed7
testq %rax, %rax
je 0x8a45
leaq 0xa607(%rip), %rcx      # 0x13270
movq (%rcx), %rcx
movq %rcx, 0x28(%rax)
jmp 0x8a45
callq 0x2f66
jmp 0x8a3d
xorl %r14d, %r14d
jmp 0x8c94
callq 0x2e69
jmp 0x8a82
xorl %r14d, %r14d
movq %r13, %r12
testl %ebx, %ebx
setne %al
testq %r14, %r14
sete %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x8d08
leaq 0xc(%rsp), %rdi
movq %r12, %rsi
callq 0x9b0e
testl %eax, %eax
je 0x8d05
xorl %esi, %esi
cmpl $0x1, 0x70(%rsp)
sete %sil
leaq 0xc(%rsp), %rdi
callq 0x80d7
testq %rax, %rax
je 0x8d05
movq %rax, %r14
movq 0x28(%rax), %rax
leaq 0xa591(%rip), %rcx      # 0x13270
cmpq (%rcx), %rax
jl 0x8d08
leaq 0x8c(%rsp), %rdx
movq 0x1c(%rdx), %rdi
movl 0x24(%rdx), %esi
movq %r14, %rcx
callq 0x8f5f
xorl %ecx, %ecx
testl %eax, %eax
cmoveq %rcx, %r14
jmp 0x8d08
xorl %r14d, %r14d
testq %r14, %r14
je 0x8d29
leaq 0xd0(%rsp), %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x909a
testl %eax, %eax
jns 0x8d63
jmp 0x8e2c
cmpl $0x3, 0x70(%rsp)
je 0x8e2c
leaq 0xc(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
movq %r12, %rdx
callq 0x8fad
testl %eax, %eax
js 0x8e2c
leaq 0xc(%rsp), %rdi
movl $0x1, %esi
callq 0x80d7
movq %rax, %r14
testq %r14, %r14
je 0x8e2c
leaq 0x8c(%rsp), %r12
movups (%r12), %xmm0
movups %xmm0, 0x8(%r14)
movq 0x68(%rsp), %rax
movl %eax, 0x4(%r14)
leaq 0xa4e2(%rip), %rax      # 0x13270
movq (%rax), %rcx
leaq 0x712(%rcx), %rax
cmpl $0x1, -0x1c(%r12)
cmoveq %rcx, %rax
cmpq %rax, 0x28(%r14)
jge 0x8dac
movq %rax, 0x28(%r14)
movq 0x18(%r14), %rdi
callq 0x2040
leaq 0x78(%rsp), %rcx
movl 0x38(%rcx), %eax
movl %eax, 0x20(%r14)
movq 0x30(%rcx), %rax
movq %rax, 0x18(%r14)
movq $0x0, 0x30(%rcx)
xorl %eax, %eax
cmpl $0x1, -0x8(%rcx)
setne %al
leal (%rax,%rax,2), %edx
addl $0x2, %edx
subq $0x8, %rsp
leaq 0xd8(%rsp), %rax
leaq 0x38(%rsp), %rdi
leaq 0x2c(%rsp), %r9
movl %ebp, %esi
movq %r12, %r8
pushq $0x708                  # imm = 0x708
pushq %r15
pushq %rax
pushq 0x88(%rsp)
pushq %r14
callq 0x9138
addq $0x30, %rsp
testl %eax, %eax
movq 0x28(%rsp), %rbx
js 0x8ec6
movq 0x48(%rsp), %r12
jmp 0x8a45
movq 0x28(%rsp), %rbx
cmpl $0x0, 0x88(%rsp)
jne 0x8e43
movl $0xffffffff, 0x34(%rsp) # imm = 0xFFFFFFFF
cmpl $0x3, 0x70(%rsp)
jne 0x8a45
leaq 0x78(%rsp), %rcx
leaq 0x8c(%rsp), %r8
leaq 0x9c(%rsp), %rax
subq $0x30, %rsp
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rsp)
movq 0x98(%rsp), %rdx
movl %edx, 0x8(%rsp)
movq %rax, (%rsp)
movl $0x0, 0x20(%rsp)
leaq 0x60(%rsp), %rdi
leaq 0x54(%rsp), %r9
movl %ebp, %esi
movl $0x6, %edx
callq 0x9138
addq $0x30, %rsp
jmp 0x8a45
leaq 0x70(%rsp), %rdi
leaq 0xd0(%rsp), %r14
movq %r15, %rsi
movq %r14, %rdx
callq 0x2e80
movq (%r14), %r15
jmp 0x8a45
leaq 0x4f63(%rip), %rdi      # 0xde30
callq 0x22e0
jmp 0x8e22