// File: /workspace/github_c_makefile_star2_O1/jech[P]dht/dht-example.c
// Function: main
int
main(int argc, char **argv)
{
    int i, rc, fd;
    int s = -1, s6 = -1, port;
    int have_id = 0;
    unsigned char myid[20];
    time_t tosleep = 0;
    char *id_file = "dht-example.id";
    int opt;
    int quiet = 0, ipv4 = 1, ipv6 = 1;
    struct sockaddr_in sin;
    struct sockaddr_in6 sin6;
    struct sockaddr_storage from;
    socklen_t fromlen;

    memset(&sin, 0, sizeof(sin));
    sin.sin_family = AF_INET;

    memset(&sin6, 0, sizeof(sin6));
    sin6.sin6_family = AF_INET6;

    while(1) {
        opt = getopt(argc, argv, "q46b:i:");
        if(opt < 0)
            break;

        switch(opt) {
        case 'q': quiet = 1; break;
        case '4': ipv6 = 0; break;
        case '6': ipv4 = 0; break;
        case 'b': {
            char buf[16];
            int rc;
            rc = inet_pton(AF_INET, optarg, buf);
            if(rc == 1) {
                memcpy(&sin.sin_addr, buf, 4);
                break;
            }
            rc = inet_pton(AF_INET6, optarg, buf);
            if(rc == 1) {
                memcpy(&sin6.sin6_addr, buf, 16);
                break;
            }
            goto usage;
        }
            break;
        case 'i':
            id_file = optarg;
            break;
        default:
            goto usage;
        }
    }

    /* Ids need to be distributed evenly, so you cannot just use your
       bittorrent id.  Either generate it randomly, or take the SHA-1 of
       something. */
    fd = open(id_file, O_RDONLY);
    if(fd >= 0) {
        rc = read(fd, myid, 20);
        if(rc == 20)
            have_id = 1;
        close(fd);
    }

    fd = open("/dev/urandom", O_RDONLY);
    if(fd < 0) {
        perror("open(random)");
        exit(1);
    }

    if(!have_id) {
        int ofd;

        rc = read(fd, myid, 20);
        if(rc < 0) {
            perror("read(random)");
            exit(1);
        }
        have_id = 1;
        close(fd);

        ofd = open(id_file, O_WRONLY | O_CREAT | O_TRUNC, 0666);
        if(ofd >= 0) {
            rc = write(ofd, myid, 20);
            if(rc < 20)
                unlink(id_file);
            close(ofd);
        }
    }

    {
        unsigned seed;
        read(fd, &seed, sizeof(seed));
        srandom(seed);
    }

    close(fd);

    if(argc < 2)
        goto usage;

    i = optind;

    if(argc < i + 1)
        goto usage;

    port = atoi(argv[i++]);
    if(port <= 0 || port >= 0x10000)
        goto usage;

    while(i < argc) {
        struct addrinfo hints, *info, *infop;
        memset(&hints, 0, sizeof(hints));
        hints.ai_socktype = SOCK_DGRAM;
        if(!ipv6)
            hints.ai_family = AF_INET;
        else if(!ipv4)
            hints.ai_family = AF_INET6;
        else
            hints.ai_family = 0;
        rc = getaddrinfo(argv[i], argv[i + 1], &hints, &info);
        if(rc != 0) {
            fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(rc));
            exit(1);
        }

        i++;
        if(i >= argc)
            goto usage;

        infop = info;
        while(infop) {
            memcpy(&bootstrap_nodes[num_bootstrap_nodes],
                   infop->ai_addr, infop->ai_addrlen);
            infop = infop->ai_next;
            num_bootstrap_nodes++;
        }
        freeaddrinfo(info);

        i++;
    }

    /* If you set dht_debug to a stream, every action taken by the DHT will
       be logged. */
    if(!quiet)
        dht_debug = stdout;

    /* We need an IPv4 and an IPv6 socket, bound to a stable port.  Rumour
       has it that uTorrent likes you better when it is the same as your
       Bittorrent port. */
    if(ipv4) {
        s = socket(PF_INET, SOCK_DGRAM, 0);
        if(s < 0) {
            perror("socket(IPv4)");
        }
        rc = set_nonblocking(s, 1);
        if(rc < 0) {
            perror("set_nonblocking(IPv4)");
            exit(1);
        }
    }

    if(ipv6) {
        s6 = socket(PF_INET6, SOCK_DGRAM, 0);
        if(s6 < 0) {
            perror("socket(IPv6)");
        }
        rc = set_nonblocking(s6, 1);
        if(rc < 0) {
            perror("set_nonblocking(IPv6)");
            exit(1);
        }
    }

    if(s < 0 && s6 < 0) {
        fprintf(stderr, "Eek!");
        exit(1);
    }


    if(s >= 0) {
        sin.sin_port = htons(port);
        rc = bind(s, (struct sockaddr*)&sin, sizeof(sin));
        if(rc < 0) {
            perror("bind(IPv4)");
            exit(1);
        }
    }

    if(s6 >= 0) {
        int rc;
        int val = 1;

        rc = setsockopt(s6, IPPROTO_IPV6, IPV6_V6ONLY,
                        (char *)&val, sizeof(val));
        if(rc < 0) {
            perror("setsockopt(IPV6_V6ONLY)");
            exit(1);
        }

        /* BEP-32 mandates that we should bind this socket to one of our
           global IPv6 addresses.  In this simple example, this only
           happens if the user used the -b flag. */

        sin6.sin6_port = htons(port);
        rc = bind(s6, (struct sockaddr*)&sin6, sizeof(sin6));
        if(rc < 0) {
            perror("bind(IPv6)");
            exit(1);
        }
    }

    /* Init the dht. */
    rc = dht_init(s, s6, myid, (unsigned char*)"JC\0\0");
    if(rc < 0) {
        perror("dht_init");
        exit(1);
    }

    init_signals();

    /* For bootstrapping, we need an initial list of nodes.  This could be
       hard-wired, but can also be obtained from the nodes key of a torrent
       file, or from the PORT bittorrent message.

       Dht_ping_node is the brutal way of bootstrapping -- it actually
       sends a message to the peer.  If you know the nodes' ids, it is
       better to use dht_insert_node. */
    for(i = 0; i < num_bootstrap_nodes; i++) {
        socklen_t salen;
        if(bootstrap_nodes[i].ss_family == AF_INET)
            salen = sizeof(struct sockaddr_in);
        else
            salen = sizeof(struct sockaddr_in6);
        dht_ping_node((struct sockaddr*)&bootstrap_nodes[i], salen);
        /* Don't overload the DHT, or it will drop your nodes. */
        if(i <= 128)
            usleep(random() % 10000);
        else
            usleep(500000 + random() % 400000);
    }

    while(1) {
        struct timeval tv;
        fd_set readfds;
        tv.tv_sec = tosleep;
        tv.tv_usec = random() % 1000000;

        FD_ZERO(&readfds);
        if(s >= 0)
            FD_SET(s, &readfds);
        if(s6 >= 0)
            FD_SET(s6, &readfds);
        rc = select(s > s6 ? s + 1 : s6 + 1, &readfds, NULL, NULL, &tv);
        if(rc < 0) {
            if(errno != EINTR) {
                perror("select");
                sleep(1);
            }
        }

        if(exiting)
            break;

        if(rc > 0) {
            fromlen = sizeof(from);
            if(s >= 0 && FD_ISSET(s, &readfds))
                rc = recvfrom(s, buf, sizeof(buf) - 1, 0,
                              (struct sockaddr*)&from, &fromlen);
            else if(s6 >= 0 && FD_ISSET(s6, &readfds))
                rc = recvfrom(s6, buf, sizeof(buf) - 1, 0,
                              (struct sockaddr*)&from, &fromlen);
            else
                abort();
        }

        if(rc > 0) {
            buf[rc] = '\0';
            rc = dht_periodic(buf, rc, (struct sockaddr*)&from, fromlen,
                              &tosleep, callback, NULL);
        } else {
            rc = dht_periodic(NULL, 0, NULL, 0, &tosleep, callback, NULL);
        }
        if(rc < 0) {
            if(errno == EINTR) {
                continue;
            } else {
                perror("dht_periodic");
                if(rc == EINVAL || rc == EFAULT)
                    abort();
                tosleep = 1;
            }
        }

        /* This is how you trigger a search for a torrent hash.  If port
           (the second argument) is non-zero, it also performs an announce.
           Since peers expire announced data after 30 minutes, it is a good
           idea to reannounce every 28 minutes or so. */
        if(searching) {
            if(s >= 0)
                dht_search(hash, 0, AF_INET, callback, NULL);
            if(s6 >= 0)
                dht_search(hash, 0, AF_INET6, callback, NULL);
            searching = 0;
        }

        /* For debugging, or idle curiosity. */
        if(dumping) {
            dht_dump_tables(stdout);
            dumping = 0;
        }
    }

    {
        struct sockaddr_in sin[500];
        struct sockaddr_in6 sin6[500];
        int num = 500, num6 = 500;
        int i;
        i = dht_get_nodes(sin, &num, sin6, &num6);
        printf("Found %d (%d + %d) good nodes.\n", i, num, num6);
    }

    dht_uninit();
    return 0;

 usage:
    printf("Usage: dht-example [-q] [-4] [-6] [-i filename] [-b address]...\n"
           "                   port [address port]...\n");
    exit(1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x5718, %rsp           # imm = 0x5718
movq %rsi, %rbx
movl %edi, %ebp
movq $0x0, 0x38(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
movw $0x2, 0x40(%rsp)
movaps %xmm0, 0x80(%rsp)
movups %xmm0, 0x8c(%rsp)
movw $0xa, 0x80(%rsp)
leaq 0x6a6d(%rip), %rdx      # 0x9048
callq 0x22c0
movb $0x1, %r12b
movl $0x0, 0x10(%rsp)
testl %eax, %eax
js 0x2715
leaq 0x6a3f(%rip), %rcx      # 0x9039
movq %rcx, 0x28(%rsp)
movl $0x1, 0x8(%rsp)
leaq 0x6a3a(%rip), %r12      # 0x9048
movq 0x99c3(%rip), %rcx      # 0xbfd8
leaq 0x120(%rsp), %r13
movl $0x1, 0x20(%rsp)
movq %rcx, %r14
cmpl $0x61, %eax
jle 0x264d
cmpl $0x62, %eax
je 0x2665
cmpl $0x69, %eax
je 0x268a
movl $0x1, 0x10(%rsp)
cmpl $0x71, %eax
je 0x26ca
jmp 0x297b
cmpl $0x34, %eax
je 0x2694
cmpl $0x36, %eax
jne 0x297b
movl $0x0, 0x20(%rsp)
jmp 0x26ca
movq (%rcx), %rsi
movl $0x2, %edi
movq %r13, %rdx
movq %rcx, %r15
callq 0x2210
cmpl $0x1, %eax
jne 0x269e
movl 0x120(%rsp), %eax
movl %eax, 0x44(%rsp)
jmp 0x26ca
movq (%rcx), %rax
movq %rax, 0x28(%rsp)
jmp 0x26ca
movl $0x0, 0x8(%rsp)
jmp 0x26ca
movq (%r15), %rsi
movl $0xa, %edi
movq %r13, %rdx
callq 0x2210
cmpl $0x1, %eax
jne 0x297b
movaps 0x120(%rsp), %xmm0
leaq 0x88(%rsp), %rax
movups %xmm0, (%rax)
movl %ebp, %edi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x22c0
testl %eax, %eax
leaq 0x120(%rsp), %r13
movq %r14, %rcx
jns 0x2628
cmpl $0x0, 0x8(%rsp)
sete %al
movl %eax, 0x8(%rsp)
cmpl $0x0, 0x20(%rsp)
sete %al
cmpl $0x0, 0x10(%rsp)
sete %r14b
movl %eax, 0x10(%rsp)
movq 0x28(%rsp), %r13
movb $0x1, %r12b
jmp 0x2727
leaq 0x691d(%rip), %r13      # 0x9039
movb $0x1, %r14b
movl $0x0, 0x8(%rsp)
movq %r13, %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x22a0
testl %eax, %eax
js 0x275a
movl %eax, %r15d
leaq 0x60(%rsp), %rsi
movl $0x14, %edx
movl %eax, %edi
callq 0x2180
cmpl $0x14, %eax
setne %r12b
movl %r15d, %edi
callq 0x2160
leaq 0x68ef(%rip), %rdi      # 0x9050
xorl %esi, %esi
xorl %eax, %eax
callq 0x22a0
testl %eax, %eax
js 0x2f41
movl %eax, %r15d
testb %r12b, %r12b
je 0x27dd
leaq 0x60(%rsp), %rsi
movl $0x14, %edx
movl %r15d, %edi
callq 0x2180
testl %eax, %eax
js 0x2f50
movl %r15d, %edi
callq 0x2160
movq %r13, %rdi
movl $0x241, %esi            # imm = 0x241
movl $0x1b6, %edx            # imm = 0x1B6
xorl %eax, %eax
callq 0x22a0
testl %eax, %eax
js 0x27dd
movl %eax, %r12d
leaq 0x60(%rsp), %rsi
movl $0x14, %edx
movl %eax, %edi
callq 0x20e0
cmpl $0x13, %eax
jg 0x27d5
movq %r13, %rdi
callq 0x2080
movl %r12d, %edi
callq 0x2160
movb %r14b, 0x28(%rsp)
leaq 0x120(%rsp), %r14
movl $0x4, %edx
movl %r15d, %edi
movq %r14, %rsi
callq 0x2180
movl (%r14), %edi
callq 0x2070
movl %r15d, %edi
callq 0x2160
cmpl $0x2, %ebp
jl 0x297b
movq 0x97b6(%rip), %rax      # 0xbfd0
movslq (%rax), %r13
cmpl %ebp, %r13d
jge 0x297b
movq (%rbx,%r13,8), %rdi
callq 0x22e0
movq %rax, 0x20(%rsp)
addl $0xffff0000, %eax       # imm = 0xFFFF0000
cmpl $0xffff0001, %eax       # imm = 0xFFFF0001
jb 0x297b
incl %r13d
leaq 0x120(%rsp), %r15
leaq 0x37d0(%rsp), %r12
leaq 0x9982(%rip), %r14      # 0xc1e0
movl %ebp, 0x30(%rsp)
movq %rbx, 0x50(%rsp)
cmpl %ebp, %r13d
jge 0x2991
xorps %xmm0, %xmm0
movaps %xmm0, 0x120(%rsp)
movaps %xmm0, 0x130(%rsp)
movaps %xmm0, 0x140(%rsp)
movl $0x2, 0x128(%rsp)
cmpb $0x0, 0x8(%rsp)
je 0x28aa
movl $0x2, 0x124(%rsp)
jmp 0x28c9
cmpb $0x0, 0x10(%rsp)
je 0x28be
movl $0xa, 0x124(%rsp)
jmp 0x28c9
movl $0x0, 0x124(%rsp)
movslq %r13d, %rax
movq (%rbx,%rax,8), %rdi
movq 0x8(%rbx,%rax,8), %rsi
movq %r15, %rdx
movq %r12, %rcx
callq 0x2310
testl %eax, %eax
jne 0x2f35
leal 0x1(%r13), %ecx
movl $0x5, %eax
cmpl %ebp, %ecx
jge 0x2967
movq 0x37d0(%rsp), %rbp
testq %rbp, %rbp
je 0x293d
movslq 0xa2d7(%rip), %r12      # 0xcbe0
leal 0x1(%r12), %ebx
shlq $0x7, %r12
addq %r14, %r12
movq %rbp, %r15
movq 0x18(%r15), %rsi
movl 0x10(%r15), %edx
movq %r12, %rdi
callq 0x2200
movq 0x28(%r15), %r15
movl %ebx, 0xa2ae(%rip)      # 0xcbe0
subq $-0x80, %r12
incl %ebx
testq %r15, %r15
jne 0x2918
movq %rbp, %rdi
callq 0x2350
addl $0x2, %r13d
xorl %eax, %eax
movl %r13d, %ecx
movq 0x50(%rsp), %rbx
movl 0x30(%rsp), %ebp
leaq 0x120(%rsp), %r15
leaq 0x37d0(%rsp), %r12
movl %ecx, %r13d
testl %eax, %eax
je 0x2867
cmpl $0x5, %eax
jne 0x2eff
leaq 0x6805(%rip), %rdi      # 0x9187
callq 0x20a0
movl $0x1, %edi
callq 0x22f0
cmpb $0x0, 0x28(%rsp)
je 0x29ac
movq 0x9629(%rip), %rax      # 0xbfc8
movq (%rax), %rax
leaq 0xb257(%rip), %rcx      # 0xdc00
movq %rax, (%rcx)
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpb $0x0, 0x10(%rsp)
movq 0x20(%rsp), %r15
jne 0x29ec
movl $0x2, %edi
movl $0x2, %esi
xorl %edx, %edx
callq 0x2360
movl %eax, %ebp
testl %eax, %eax
js 0x2f13
movl %ebp, %edi
callq 0x2f6e
testl %eax, %eax
js 0x2f64
cmpb $0x0, 0x8(%rsp)
jne 0x2a1d
movl $0xa, %edi
movl $0x2, %esi
xorl %edx, %edx
callq 0x2360
movl %eax, %ebx
testl %eax, %eax
js 0x2f24
movl %ebx, %edi
callq 0x2f6e
testl %eax, %eax
js 0x2f69
testl %ebp, %ebx
js 0x2f46
testl %ebp, %ebp
js 0x2a4d
movl %r15d, %eax
rolw $0x8, %ax
leaq 0x40(%rsp), %rsi
movw %ax, 0x2(%rsi)
movl %ebp, %edi
movl $0x10, %edx
callq 0x2280
testl %eax, %eax
js 0x2f55
testl %ebx, %ebx
js 0x2aa4
leaq 0x120(%rsp), %rcx
movl $0x1, (%rcx)
movl %ebx, %edi
movl $0x29, %esi
movl $0x1a, %edx
movl $0x4, %r8d
callq 0x20c0
testl %eax, %eax
js 0x2f5a
rolw $0x8, %r15w
leaq 0x80(%rsp), %rsi
movw %r15w, 0x2(%rsi)
movl %ebx, %edi
movl $0x1c, %edx
callq 0x2280
testl %eax, %eax
js 0x2f5f
leaq 0x6589(%rip), %rcx      # 0x9034
leaq 0x60(%rsp), %rdx
movl %ebp, %edi
movl %ebx, %esi
callq 0x43a5
testl %eax, %eax
js 0x2f4b
leaq 0x37d0(%rsp), %r15
movq %r15, %rdi
callq 0x21d0
leaq 0x6c5(%rip), %rax       # 0x319d
leaq 0x128(%rsp), %r12
movq %rax, -0x8(%r12)
movl $0x10, %ecx
movq %r12, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
xorl %eax, %eax
movl %eax, 0x80(%r12)
leaq 0x120(%rsp), %r13
movl $0xa, %edi
movq %r13, %rsi
xorl %edx, %edx
callq 0x20b0
movq %r15, %rdi
callq 0x21d0
leaq 0x685(%rip), %rax       # 0x31a8
movq %rax, (%r13)
movl $0x10, %ecx
movq %r12, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
xorl %eax, %eax
movl %eax, 0x88(%r13)
movl $0xc, %edi
movq %r13, %rsi
xorl %edx, %edx
callq 0x20b0
movq %r15, %rdi
callq 0x21d0
leaq 0x657(%rip), %rax       # 0x31b3
movq %rax, (%r13)
movl $0x10, %ecx
movq %r12, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
xorl %eax, %eax
movl %eax, 0x88(%r13)
xorl %r15d, %r15d
movl $0x2, %edi
movq %r13, %rsi
xorl %edx, %edx
callq 0x20b0
cmpl %r15d, 0xa050(%rip)     # 0xcbe0
jle 0x2c27
xorl %r15d, %r15d
movabsq $0x346dc5d63886594b, %r12 # imm = 0x346DC5D63886594B
movabsq $0x29f16b11c6d1e109, %r13 # imm = 0x29F16B11C6D1E109
cmpw $0x2, (%r14)
movl $0x10, %esi
je 0x2bbe
movl $0x1c, %esi
movq %r14, %rdi
callq 0x7ee1
callq 0x2230
movq %rax, %rdi
cmpq $0x80, %r15
ja 0x2bf1
imulq %r12
movq %rdx, %rax
shrq $0x3f, %rax
shrq $0xb, %rdx
addl %eax, %edx
imull $0x2710, %edx, %eax     # imm = 0x2710
subl %eax, %edi
jmp 0x2c0f
imulq %r13
movq %rdx, %rax
shrq $0x3f, %rax
shrq $0x10, %rdx
addl %eax, %edx
imull $0x61a80, %edx, %eax    # imm = 0x61A80
subl %eax, %edi
addl $0x7a120, %edi          # imm = 0x7A120
callq 0x2340
incq %r15
movslq 0x9fc2(%rip), %rax      # 0xcbe0
subq $-0x80, %r14
cmpq %rax, %r15
jl 0x2bad
movl $0x1, %eax
movl $0x1, %edx
movl %ebp, %ecx
shlq %cl, %rdx
movq %rdx, 0x8(%rsp)
movl %ebp, %edx
movl %ebx, %ecx
shlq %cl, %rax
movq %rax, 0x30(%rsp)
shrl $0x6, %edx
movq %rdx, 0x10(%rsp)
movl %ebx, %r13d
shrl $0x6, %r13d
cmpl %ebx, %ebp
movl %ebx, %r14d
cmovgl %ebp, %r14d
incl %r14d
movq 0x38(%rsp), %rax
movq %rax, 0x37d0(%rsp)
callq 0x2230
movq %rax, %rcx
movabsq $0x431bde82d7b634db, %rdx # imm = 0x431BDE82D7B634DB
imulq %rdx
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x12, %rdx
addq %rax, %rdx
imulq $0xf4240, %rdx, %rax    # imm = 0xF4240
subq %rax, %rcx
movq %rcx, 0x37d8(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x120(%rsp)
movaps %xmm0, 0x130(%rsp)
movaps %xmm0, 0x140(%rsp)
movaps %xmm0, 0x150(%rsp)
movaps %xmm0, 0x160(%rsp)
movaps %xmm0, 0x170(%rsp)
movaps %xmm0, 0x180(%rsp)
movaps %xmm0, 0x190(%rsp)
testl %ebp, %ebp
js 0x2cfd
movq 0x8(%rsp), %rax
movq 0x10(%rsp), %rcx
orq %rax, 0x120(%rsp,%rcx,8)
testl %ebx, %ebx
js 0x2d0e
movq 0x30(%rsp), %rax
orq %rax, 0x120(%rsp,%r13,8)
movl %r14d, %edi
leaq 0x120(%rsp), %rsi
xorl %edx, %edx
xorl %ecx, %ecx
leaq 0x37d0(%rsp), %r8
callq 0x2220
movl %eax, %r15d
testl %eax, %eax
jns 0x2d3f
callq 0x2060
cmpl $0x4, (%rax)
jne 0x2e92
movl 0x9e9e(%rip), %r12d     # 0xcbe4
testl %r12d, %r12d
jne 0x2eb6
testl %r15d, %r15d
jle 0x2db6
movl $0x80, 0x1c(%rsp)
testl %ebp, %ebp
js 0x2d76
movl %ebp, %edi
movq 0x8(%rsp), %rax
movq 0x10(%rsp), %rcx
testq %rax, 0x120(%rsp,%rcx,8)
jne 0x2d93
testl %ebx, %ebx
js 0x2f3c
movl %ebx, %edi
movq 0x30(%rsp), %rax
testq %rax, 0x120(%rsp,%r13,8)
je 0x2f3c
movl $0xfff, %edx            # imm = 0xFFF
leaq 0x9e51(%rip), %rsi      # 0xcbf0
xorl %ecx, %ecx
leaq 0xa0(%rsp), %r8
leaq 0x1c(%rsp), %r9
callq 0x2250
movq %rax, %r15
testl %r15d, %r15d
jle 0x2ddf
movl %r15d, %esi
leaq 0x9e2b(%rip), %rdi      # 0xcbf0
movb $0x0, (%rsi,%rdi)
movl 0x1c(%rsp), %ecx
movq $0x0, (%rsp)
leaq 0xa0(%rsp), %rdx
jmp 0x2def
movq $0x0, (%rsp)
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
leaq 0x38(%rsp), %r8
leaq 0x1a9(%rip), %r9        # 0x2fa4
callq 0x4843
testl %eax, %eax
js 0x2e7d
cmpl $0x0, 0xade5(%rip)      # 0xdbf0
je 0x2e59
testl %ebp, %ebp
js 0x2e2e
leaq 0x6208(%rip), %rdi      # 0x9020
xorl %esi, %esi
movl $0x2, %edx
leaq 0x17e(%rip), %rcx       # 0x2fa4
xorl %r8d, %r8d
callq 0x31c0
testl %ebx, %ebx
js 0x2e4f
leaq 0x61e7(%rip), %rdi      # 0x9020
xorl %esi, %esi
movl $0xa, %edx
leaq 0x15d(%rip), %rcx       # 0x2fa4
xorl %r8d, %r8d
callq 0x31c0
movl $0x0, 0xad97(%rip)      # 0xdbf0
cmpl $0x0, 0xad94(%rip)      # 0xdbf4
je 0x2e87
movq 0x915f(%rip), %rax      # 0xbfc8
movq (%rax), %rdi
callq 0x3cad
movl $0x0, 0xad79(%rip)      # 0xdbf4
jmp 0x2e87
callq 0x2060
cmpl $0x4, (%rax)
jne 0x2e9c
testl %r12d, %r12d
je 0x2c62
jmp 0x2eb6
callq 0x23e4
jmp 0x2d3f
leaq 0x626e(%rip), %rdi      # 0x9111
callq 0x22b0
movq $0x1, 0x38(%rsp)
jmp 0x2e04
movl $0x1f4, %eax            # imm = 0x1F4
leaq 0x5c(%rsp), %rbx
movl %eax, (%rbx)
leaq 0x58(%rsp), %r14
movl %eax, (%r14)
leaq 0x37d0(%rsp), %rdi
leaq 0x120(%rsp), %rdx
movq %rbx, %rsi
movq %r14, %rcx
callq 0x7bf9
movl (%rbx), %edx
movl (%r14), %ecx
leaq 0x622d(%rip), %rdi      # 0x911e
movl %eax, %esi
xorl %eax, %eax
callq 0x2100
callq 0x4715
xorl %eax, %eax
addq $0x5718, %rsp           # imm = 0x5718
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x616e(%rip), %rdi      # 0x9088
callq 0x22b0
jmp 0x29dd
leaq 0x6180(%rip), %rdi      # 0x90ab
callq 0x22b0
jmp 0x2a0e
movl %eax, %edi
callq 0x2452
callq 0x2050
callq 0x247e
callq 0x23bf
callq 0x23fe
callq 0x2380
callq 0x243d
callq 0x2428
callq 0x2413
callq 0x2395
callq 0x23aa