// File: /workspace/github_c_makefile_star2_O3/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 $0x798, %rsp            # imm = 0x798
movq %rsp, %r14
leaq 0x1b0(%rsp), %rax
leaq 0x130(%rsp), %rcx
movq %rax, (%rcx)
movq $0x5dc, 0x8(%rcx)       # imm = 0x5DC
xorps %xmm0, %xmm0
leaq 0xf8(%rsp), %rsi
movups %xmm0, 0x8(%rsi)
movups %xmm0, 0x18(%rsi)
movups %xmm0, 0x28(%rsi)
leaq 0xe8(%rsp), %rax
movq %rax, (%rsi)
movl $0x10, 0x8(%rsi)
movq %rcx, 0x10(%rsi)
movq $0x1, 0x18(%rsi)
leaq 0x140(%rsp), %rax
movq %rax, 0x20(%rsi)
movq $0x64, 0x28(%rsi)
movl 0xb197(%rip), %edi      # 0x131f0
xorl %edx, %edx
callq 0x2290
movq %rax, %r12
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testl %r12d, %r12d
js 0x80c4
cmpw $0x2, 0xe8(%rsp)
jne 0x80c4
cmpl $0x10, 0x100(%rsp)
jb 0x80c4
movq 0x118(%rsp), %rax
cmpq $0x10, 0x120(%rsp)
setb %cl
testq %rax, %rax
sete %dl
orb %cl, %dl
jne 0x80c4
leaq 0xf8(%rsp), %rbx
cmpl $0x0, 0x8(%rax)
jne 0x80b4
cmpl $0x8, 0xc(%rax)
je 0x80db
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2340
testq %rax, %rax
jne 0x80a8
movq %r14, %rsp
movl %ebp, %eax
addq $0x798, %rsp            # imm = 0x798
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x10(%rax), %ebx
testl %ebx, %ebx
jle 0x80c4
movl %ebx, %edi
callq 0x45ef
testq %rax, %rax
je 0x80c4
leaq 0x4(%rsp), %rsi
movq %rax, %rdi
movq %rax, %r15
callq 0x9ac0
testl %eax, %eax
jle 0x80c4
movq %rbx, 0x38(%rsp)
movq %r14, 0xc0(%rsp)
cmpl $0x0, 0x68(%r15)
movq %r15, %rdi
movq %r15, 0x18(%rsp)
jle 0x8172
movl $0x3c, %r14d
xorl %r15d, %r15d
xorl %r13d, %r13d
movq 0x60(%rdi), %rax
cmpl $0x0, (%rax,%r14)
je 0x8160
leaq (%rax,%r14), %rbx
addq $-0x20, %rbx
movq %rbx, %rdi
callq 0x99f6
testl %eax, %eax
je 0x815b
movq %r13, %rdi
movq %rbx, %rsi
callq 0x92ec
testq %rax, %rax
cmovneq %rax, %r13
movq 0x18(%rsp), %rdi
incq %r15
movslq 0x68(%rdi), %rax
addq $0x70, %r14
cmpq %rax, %r15
jl 0x812a
jmp 0x8175
xorl %r13d, %r13d
xorps %xmm0, %xmm0
movaps %xmm0, 0x80(%rsp)
movaps %xmm0, 0x70(%rsp)
movaps %xmm0, 0x60(%rsp)
movaps %xmm0, 0x50(%rsp)
movaps %xmm0, 0x40(%rsp)
movq $0x0, 0x90(%rsp)
movq $0x0, 0x8(%rsp)
cmpl $0xec, %r12d
jl 0x8621
cmpb $0x1, 0x1b0(%rsp)
jne 0x8621
cmpb $0x1, 0x1b1(%rsp)
jne 0x8621
movq %r13, 0x10(%rsp)
cmpb $0x6, 0x1b2(%rsp)
movl $0x0, %r10d
jne 0x8624
cmpl $0xf0, %r12d
jb 0x8618
movq $0x0, 0x8(%rsp)
cmpl $0xf0, %r12d
je 0x8621
cmpl $0x63538263, 0x29c(%rsp) # imm = 0x63538263
movl $0x0, %r10d
jne 0x8624
leaq 0x1cc(%rsp), %rcx
movl -0x18(%rcx), %eax
movl %eax, 0xbc(%rsp)
movzbl -0x12(%rcx), %eax
shrl $0x7, %eax
movl %eax, 0xb8(%rsp)
movups -0x10(%rcx), %xmm0
movaps %xmm0, 0xd0(%rsp)
movl $0xffffffff, 0x34(%rsp) # imm = 0xFFFFFFFF
movl $0xf0, %r13d
movl $0x0, 0x28(%rsp)
movl $0x0, 0x24(%rsp)
xorl %r10d, %r10d
movq $0x0, 0x8(%rsp)
movl $0x0, 0x30(%rsp)
movl $0x0, 0x2c(%rsp)
movl %r12d, %ecx
subl %r13d, %ecx
jle 0x8603
movslq %r13d, %rax
leaq (%rsp,%rax), %rbx
addq $0x1b0, %rbx            # imm = 0x1B0
movzbl (%rbx), %eax
testl %eax, %eax
je 0x8337
cmpl $0xff, %eax
je 0x83f0
cmpl $0x1, %ecx
je 0x8603
movzbl 0x1(%rbx), %r14d
leal 0x2(%r14), %r15d
cmpl %r15d, %ecx
jb 0x8603
cmpl $0x35, %eax
jle 0x8342
cmpl $0x36, %eax
je 0x8368
cmpl $0x3d, %eax
je 0x837b
cmpl $0x4d, %eax
jne 0x83dc
testq %r10, %r10
jne 0x8624
movq %r14, %rdi
callq 0x2240
testq %rax, %rax
je 0x8621
addq $0x2, %rbx
movq %rax, %rdi
movq %rbx, %rsi
movq %r14, %rdx
movq %rax, %rbx
callq 0x2210
movq %rbx, %r10
movl %r14d, 0x28(%rsp)
movq 0x18(%rsp), %rdi
jmp 0x83dc
incl %r13d
movl %r13d, %r15d
jmp 0x83e2
cmpl $0x32, %eax
je 0x83cb
cmpl $0x35, %eax
jne 0x83dc
cmpl $0x1, %r14d
jne 0x8624
movzbl 0x2(%rbx), %eax
movl %eax, 0x34(%rsp)
jmp 0x83dc
cmpl $0x4, %r14d
jne 0x8624
movl 0x2(%rbx), %eax
movl %eax, 0x30(%rsp)
jmp 0x83dc
cmpq $0x0, 0x8(%rsp)
jne 0x8624
movq %r10, 0xc8(%rsp)
movq %r14, %rdi
callq 0x2240
testq %rax, %rax
je 0x8967
addq $0x2, %rbx
movq %rax, 0x8(%rsp)
movq %rax, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2210
movl %r14d, 0x24(%rsp)
movq 0x18(%rsp), %rdi
movq 0xc8(%rsp), %r10
jmp 0x83dc
cmpl $0x4, %r14d
jne 0x8624
movl 0x2(%rbx), %eax
movl %eax, 0x2c(%rsp)
addl %r13d, %r15d
movl %r15d, %r13d
cmpl %r12d, %r15d
jl 0x828b
jmp 0x8624
movl 0x34(%rsp), %edx
movl %edx, 0x40(%rsp)
movl 0xb8(%rsp), %eax
movl %eax, 0x44(%rsp)
leaq 0x1cc(%rsp), %rax
movups (%rax), %xmm0
movups %xmm0, 0x5c(%rsp)
movl 0xbc(%rsp), %eax
movl %eax, 0x48(%rsp)
movaps 0xd0(%rsp), %xmm0
movups %xmm0, 0x4c(%rsp)
movl 0x2c(%rsp), %eax
movl %eax, 0x6c(%rsp)
movl 0x30(%rsp), %eax
movl %eax, 0x70(%rsp)
movq 0x8(%rsp), %rax
movq %rax, 0x78(%rsp)
movl 0x24(%rsp), %eax
movl %eax, 0x80(%rsp)
movq %r10, 0x88(%rsp)
movl 0x28(%rsp), %r11d
movl %r11d, 0x90(%rsp)
leaq 0xadec(%rip), %rbx      # 0x13258
cmpl $0x2, (%rbx)
jge 0x86dc
cmpl $0x9, %r11d
movq 0x10(%rsp), %r12
jl 0x84c0
xorl %r8d, %r8d
movl $0x454d4f48, %eax       # imm = 0x454D4F48
movl $0x54454e45, %ecx       # imm = 0x54454E45
movl %r8d, %edx
movzbl (%r10,%rdx), %esi
cmpl $0x7, %esi
jne 0x84af
movl 0x1(%r10,%rdx), %r9d
xorl %eax, %r9d
movl 0x4(%r10,%rdx), %r8d
xorl %ecx, %r8d
orl %r9d, %r8d
je 0x84d1
leal (%rdx,%rsi), %r8d
incl %r8d
addl %esi, %edx
addl $0x9, %edx
cmpl %r11d, %edx
jl 0x848d
cmpl $0x0, 0x70(%rsp)
je 0x84e2
movl 0x70(%rsp), %eax
cmpl 0x4(%rsp), %eax
je 0x84e2
cmpl $0x2, (%rbx)
jge 0x895d
xorl %r15d, %r15d
jmp 0x882e
cmpl $0x2, (%rbx)
jge 0x894e
movl $0x0, 0xac(%rsp)
movq $0x0, 0xa4(%rsp)
movw $0x2, 0xa0(%rsp)
movl 0x58(%rsp), %eax
xorl %ebp, %ebp
testl %eax, %eax
jne 0x8535
xorl %ecx, %ecx
cmpl 0x44(%rsp), %ecx
movl $0x0, %eax
sbbl %eax, %eax
movl 0x4c(%rsp), %edx
cmpl $0x1, %edx
sbbl %ecx, %ecx
orl %edx, %eax
orl %ecx, %eax
movl $0x1, %ebp
leaq 0x5c(%rsp), %r14
leaq 0x48(%rsp), %rbx
leaq 0x6c(%rsp), %r13
movl %eax, 0xa4(%rsp)
movw $0x4400, 0xa2(%rsp)     # imm = 0x4400
callq 0x7d92
testl %eax, %eax
je 0x8610
xorl %edi, %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0x4f13
movq %rax, %r15
movl 0x40(%rsp), %eax
leal -0x1(%rax), %ecx
cmpl $0x7, %ecx
ja 0x882e
leaq 0x57de(%rip), %rdx      # 0xdd68
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
cmpl $0x1, %eax
je 0x85a0
movl 0x4c(%rsp), %ecx
testl %ecx, %ecx
jne 0x85a4
movl 0x6c(%rsp), %ecx
movl %ecx, (%rsp)
movl (%rsp), %r13d
movl %eax, %ecx
xorl $0x3, %ecx
orl %r13d, %ecx
je 0x87c7
cmpl $0x1, %eax
jne 0x870c
movq 0x78(%rsp), %rdi
movl 0x80(%rsp), %esi
movq %r14, %rdx
movq 0x10(%rsp), %r12
movq %r12, %rcx
callq 0x89ae
testq %rax, %rax
je 0x870c
movq %rax, %rbx
movq %rax, %rdi
movq %r12, %rsi
callq 0x962b
xorl %r12d, %r12d
testl %eax, %eax
cmovneq %rbx, %r12
jmp 0x870f
movq %r10, %rbx
callq 0x2eb4
movq %rbx, %r10
jmp 0x8624
xorl %r15d, %r15d
jmp 0x87d1
movq $0x0, 0x8(%rsp)
xorl %r10d, %r10d
movq 0xa9cd(%rip), %rax      # 0x12ff8
movq (%rax), %rcx
leaq 0x581c(%rip), %rdi      # 0xde51
movl $0x1f, %esi
movl $0x1, %edx
movq %r10, %rbx
callq 0x2330
movq 0x8(%rsp), %rdi
callq 0x2040
movq %rbx, %rdi
callq 0x2040
jmp 0x885a
subq $0x8, %rsp
xorl %eax, %eax
leaq 0xa8(%rsp), %rdi
leaq 0xc(%rsp), %r9
movl %ebp, %esi
movl $0x5, %edx
movq %rbx, %rcx
movq %r14, %r8
pushq $0x0
pushq %r15
pushq %rax
pushq 0x58(%rsp)
pushq %rax
callq 0x8c12
addq $0x30, %rsp
testl %eax, %eax
jns 0x882e
leaq 0x5758(%rip), %rdi      # 0xddf8
callq 0x22e0
jmp 0x882e
movq 0x78(%rsp), %rdi
movl 0x80(%rsp), %esi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x89ae
testq %rax, %rax
je 0x882e
leaq 0xaba0(%rip), %rcx      # 0x13270
movq (%rcx), %rcx
movq %rcx, 0x28(%rax)
jmp 0x882e
movq (%rdi), %rcx
leaq 0x56e4(%rip), %rsi      # 0xddca
movl $0x2, %edi
xorl %eax, %eax
callq 0x30a8
movq 0x18(%rsp), %rdi
movq 0x88(%rsp), %r10
movl 0x90(%rsp), %r11d
jmp 0x8475
xorl %r12d, %r12d
testl %r13d, %r13d
setne %al
testq %r12, %r12
sete %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x8867
movq %rsp, %rdi
movq 0x10(%rsp), %rbx
movq %rbx, %rsi
callq 0x962b
testl %eax, %eax
je 0x8789
xorl %esi, %esi
cmpl $0x1, 0x40(%rsp)
sete %sil
movq %rsp, %rdi
callq 0x7cb3
testq %rax, %rax
je 0x8789
movq %rax, %r12
leaq 0xab14(%rip), %rax      # 0x13270
movq (%rax), %rax
cmpq 0x28(%r12), %rax
jg 0x8875
movq 0x78(%rsp), %rdi
movl 0x80(%rsp), %esi
movq %r14, %rdx
movq %r12, %rcx
callq 0x8a4e
testl %eax, %eax
jne 0x8875
cmpl $0x3, 0x40(%rsp)
leaq 0x48(%rsp), %rbx
je 0x87c7
movq %rsp, %rdi
leaq 0xb0(%rsp), %rsi
movq 0x10(%rsp), %rdx
callq 0x8aa9
testl %eax, %eax
js 0x87c7
movq %rsp, %rdi
movl $0x1, %esi
callq 0x7cb3
movq %rax, %r12
testq %rax, %rax
jne 0x8895
movq 0x10(%rsp), %r12
leaq 0x6c(%rsp), %r13
cmpl $0x0, 0x58(%rsp)
jne 0x87e3
movl $0xffffffff, 0xa4(%rsp) # imm = 0xFFFFFFFF
cmpl $0x3, 0x40(%rsp)
jne 0x882e
subq $0x30, %rsp
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rsp)
movq 0x68(%rsp), %rax
movl %eax, 0x8(%rsp)
movq %r13, (%rsp)
movl $0x0, 0x20(%rsp)
leaq 0xd0(%rsp), %rdi
leaq 0x34(%rsp), %r9
movl %ebp, %esi
movl $0x6, %edx
movq %rbx, %rcx
movq %r14, %r8
callq 0x8c12
addq $0x30, %rsp
movq 0x78(%rsp), %rdi
callq 0x2040
movq 0x88(%rsp), %rdi
callq 0x2040
movq %r15, %rdi
callq 0x92d1
movq %r12, %rdi
callq 0x92d1
movl $0x1, %ebp
movq 0xc0(%rsp), %r14
jmp 0x80c4
testq %r12, %r12
movq 0x10(%rsp), %rbx
je 0x8789
leaq 0xb0(%rsp), %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x8b74
testl %eax, %eax
leaq 0x48(%rsp), %rbx
js 0x87c7
movups (%r14), %xmm0
movups %xmm0, 0x8(%r12)
movq 0x38(%rsp), %rax
movl %eax, 0x4(%r12)
leaq 0xa9c0(%rip), %rax      # 0x13270
movq (%rax), %rcx
leaq 0x712(%rcx), %rax
cmpl $0x1, 0x40(%rsp)
cmoveq %rcx, %rax
cmpq %rax, 0x28(%r12)
jge 0x88cf
movq %rax, 0x28(%r12)
movq 0x18(%r12), %rdi
callq 0x2040
movl 0x80(%rsp), %eax
movl %eax, 0x20(%r12)
movq 0x78(%rsp), %rax
movq %rax, 0x18(%r12)
movq $0x0, 0x78(%rsp)
xorl %eax, %eax
cmpl $0x1, 0x40(%rsp)
setne %al
leal (%rax,%rax,2), %edx
addl $0x2, %edx
subq $0x8, %rsp
leaq 0xb8(%rsp), %rax
leaq 0xa8(%rsp), %rdi
leaq 0xc(%rsp), %r9
movl %ebp, %esi
movq %rbx, %rcx
movq %r14, %r8
pushq $0x708                  # imm = 0x708
pushq %r15
pushq %rax
pushq 0x58(%rsp)
pushq %r12
callq 0x8c12
addq $0x30, %rsp
testl %eax, %eax
js 0x89a0
movq 0x10(%rsp), %r12
jmp 0x882e
callq 0x2da5
movq 0x18(%rsp), %rdi
jmp 0x84eb
callq 0x2e9d
jmp 0x84da
movq $0x0, 0x8(%rsp)
movq 0xc8(%rsp), %r10
jmp 0x8624
leaq 0x78(%rsp), %rsi
leaq 0xb0(%rsp), %rbx
movq %r13, %rdi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x2dbc
movq (%rbx), %r15
jmp 0x882e
leaq 0x5451(%rip), %rdi      # 0xddf8
callq 0x22e0
jmp 0x8944