// File: /workspace/github_c_makefile_star2_O3/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
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 0x6a70(%rip), %rdx      # 0x9048
movq %rsi, 0x28(%rsp)
callq 0x22c0
movl $0x0, 0x10(%rsp)
testl %eax, %eax
js 0x26fd
leaq 0x6a40(%rip), %rcx      # 0x9039
movq %rcx, 0x18(%rsp)
movl $0x1, 0x14(%rsp)
leaq 0x6a3b(%rip), %r15      # 0x9048
movq 0x99c4(%rip), %r12      # 0xbfd8
leaq 0x120(%rsp), %rbx
movl $0x1, %r14d
movq %rbx, %r13
cmpl $0x61, %eax
jle 0x2646
cmpl $0x62, %eax
je 0x2659
cmpl $0x69, %eax
je 0x267c
movl $0x1, 0x10(%rsp)
cmpl $0x71, %eax
je 0x26be
jmp 0x2ee6
cmpl $0x34, %eax
je 0x2687
cmpl $0x36, %eax
jne 0x2ee6
xorl %r14d, %r14d
jmp 0x26be
movq (%r12), %rsi
movl $0x2, %edi
movq %rbx, %rdx
callq 0x2210
cmpl $0x1, %eax
jne 0x2691
movl 0x120(%rsp), %eax
movl %eax, 0x44(%rsp)
jmp 0x26be
movq (%r12), %rax
movq %rax, 0x18(%rsp)
jmp 0x26be
movl $0x0, 0x14(%rsp)
jmp 0x26be
movq (%r12), %rsi
movl $0xa, %edi
movq %rbx, %rdx
callq 0x2210
cmpl $0x1, %eax
jne 0x2ee6
movaps 0x120(%rsp), %xmm0
leaq 0x88(%rsp), %rax
movups %xmm0, (%rax)
movl %ebp, %edi
movq 0x28(%rsp), %rsi
movq %r15, %rdx
callq 0x22c0
testl %eax, %eax
movq %r13, %rbx
jns 0x2625
cmpl $0x0, 0x14(%rsp)
sete %al
movl %eax, 0x24(%rsp)
testl %r14d, %r14d
sete %al
cmpl $0x0, 0x10(%rsp)
movq 0x18(%rsp), %rdi
sete %bl
movl %eax, 0x10(%rsp)
jmp 0x270e
movb $0x1, %bl
leaq 0x6933(%rip), %rdi      # 0x9039
movl $0x0, 0x24(%rsp)
movq %rdi, %r14
xorl %esi, %esi
xorl %eax, %eax
callq 0x22a0
testl %eax, %eax
js 0x2760
movl %eax, %r15d
leaq 0x60(%rsp), %rsi
movl $0x14, %edx
movl %eax, %edi
callq 0x2180
movq %rax, %r12
movl %r15d, %edi
callq 0x2160
leaq 0x690c(%rip), %rdi      # 0x9050
xorl %esi, %esi
xorl %eax, %eax
callq 0x22a0
testl %eax, %eax
js 0x2f08
movl %eax, %r15d
cmpl $0x14, %r12d
jne 0x277b
jmp 0x27de
leaq 0x68e9(%rip), %rdi      # 0x9050
xorl %esi, %esi
xorl %eax, %eax
callq 0x22a0
movl %eax, %r15d
testl %eax, %eax
js 0x2f08
leaq 0x60(%rsp), %rsi
movl $0x14, %edx
movl %r15d, %edi
callq 0x2180
testl %eax, %eax
js 0x2f17
movl %r15d, %edi
callq 0x2160
movq %r14, %rdi
movl $0x241, %esi            # imm = 0x241
movl $0x1b6, %edx            # imm = 0x1B6
xorl %eax, %eax
callq 0x22a0
testl %eax, %eax
js 0x27de
movl %eax, %r12d
leaq 0x60(%rsp), %rsi
movl $0x14, %edx
movl %eax, %edi
callq 0x20e0
cmpl $0x13, %eax
jg 0x27d6
movq %r14, %rdi
callq 0x2080
movl %r12d, %edi
callq 0x2160
movb %bl, 0xf(%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 0x2ee6
movq 0x97b6(%rip), %rax      # 0xbfd0
movslq (%rax), %rbx
cmpl %ebp, %ebx
jge 0x2ee6
movq 0x28(%rsp), %rax
movq (%rax,%rbx,8), %rdi
callq 0x22e0
movq %rax, 0x50(%rsp)
addl $0xffff0000, %eax       # imm = 0xFFFF0000
cmpl $0xffff0001, %eax       # imm = 0xFFFF0001
jb 0x2ee6
incl %ebx
cmpl %ebp, %ebx
jge 0x2948
movslq %ebx, %r14
movl %ebp, %r15d
movl 0x24(%rsp), %eax
movl %eax, %ecx
orb 0x10(%rsp), %cl
movb %cl, 0x18(%rsp)
xorb $0x1, %al
movzbl %al, %eax
leal 0x2(,%rax,8), %eax
movl %eax, 0x14(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x120(%rsp)
movaps %xmm0, 0x130(%rsp)
movaps %xmm0, 0x140(%rsp)
movl $0x2, 0x128(%rsp)
testb $0x1, 0x18(%rsp)
je 0x28ae
movl 0x14(%rsp), %eax
movl %eax, 0x124(%rsp)
movq 0x28(%rsp), %rax
movq (%rax,%r14,8), %rdi
movq 0x8(%rax,%r14,8), %rsi
leaq 0x120(%rsp), %rdx
leaq 0x37d0(%rsp), %rcx
callq 0x2310
testl %eax, %eax
jne 0x2f01
leaq 0x1(%r14), %rax
cmpq %r15, %rax
jge 0x2ee6
movq 0x37d0(%rsp), %r12
testq %r12, %r12
je 0x2933
movslq 0xa2e6(%rip), %rbp      # 0xcbe0
leal 0x1(%rbp), %ebx
shlq $0x7, %rbp
leaq 0x98d8(%rip), %rax      # 0xc1e0
addq %rax, %rbp
movq %r12, %r13
movq 0x18(%r13), %rsi
movl 0x10(%r13), %edx
movq %rbp, %rdi
callq 0x2200
movq 0x28(%r13), %r13
movl %ebx, 0xa2b8(%rip)      # 0xcbe0
subq $-0x80, %rbp
incl %ebx
testq %r13, %r13
jne 0x290e
movq %r12, %rdi
callq 0x2350
addq $0x2, %r14
cmpq %r15, %r14
jl 0x2876
cmpb $0x0, 0xf(%rsp)
je 0x2963
movq 0x9672(%rip), %rax      # 0xbfc8
movq (%rax), %rax
leaq 0xb2a0(%rip), %rcx      # 0xdc00
movq %rax, (%rcx)
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpb $0x0, 0x10(%rsp)
jne 0x299e
movl $0x2, %edi
movl $0x2, %esi
xorl %edx, %edx
callq 0x2360
movl %eax, %ebp
testl %eax, %eax
js 0x2ec4
movl %ebp, %edi
callq 0x2f35
testl %eax, %eax
js 0x2f2b
cmpb $0x0, 0x24(%rsp)
movq 0x50(%rsp), %r14
jne 0x29d4
movl $0xa, %edi
movl $0x2, %esi
xorl %edx, %edx
callq 0x2360
movl %eax, %ebx
testl %eax, %eax
js 0x2ed5
movl %ebx, %edi
callq 0x2f35
testl %eax, %eax
js 0x2f30
testl %ebp, %ebx
js 0x2f0d
testl %ebp, %ebp
js 0x2a04
movl %r14d, %eax
rolw $0x8, %ax
leaq 0x40(%rsp), %rsi
movw %ax, 0x2(%rsi)
movl %ebp, %edi
movl $0x10, %edx
callq 0x2280
testl %eax, %eax
js 0x2f1c
testl %ebx, %ebx
js 0x2a5b
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 0x2f21
rolw $0x8, %r14w
leaq 0x80(%rsp), %rsi
movw %r14w, 0x2(%rsi)
movl %ebx, %edi
movl $0x1c, %edx
callq 0x2280
testl %eax, %eax
js 0x2f26
leaq 0x65d2(%rip), %rcx      # 0x9034
leaq 0x60(%rsp), %rdx
movl %ebp, %edi
movl %ebx, %esi
callq 0x4345
testl %eax, %eax
js 0x2f12
leaq 0x37d0(%rsp), %r14
movq %r14, %rdi
callq 0x21d0
leaq 0x6ed(%rip), %rax       # 0x317c
leaq 0x128(%rsp), %r15
movq %rax, -0x8(%r15)
movl $0x10, %ecx
movq %r15, %rdi
movq %r14, %rsi
rep  movsq (%rsi), %es:(%rdi)
xorl %r13d, %r13d
movl %r13d, 0x80(%r15)
leaq 0x120(%rsp), %r12
movl $0xa, %edi
movq %r12, %rsi
xorl %edx, %edx
callq 0x20b0
movq %r14, %rdi
callq 0x21d0
leaq 0x6ae(%rip), %rax       # 0x3187
movq %rax, (%r12)
movl $0x10, %ecx
movq %r15, %rdi
movq %r14, %rsi
rep  movsq (%rsi), %es:(%rdi)
movl %r13d, 0x88(%r12)
movl $0xc, %edi
movq %r12, %rsi
xorl %edx, %edx
callq 0x20b0
movq %r14, %rdi
callq 0x21d0
leaq 0x681(%rip), %rax       # 0x3192
movq %rax, (%r12)
movl $0x10, %ecx
movq %r15, %rdi
movq %r14, %rsi
rep  movsq (%rsi), %es:(%rdi)
movl %r13d, 0x88(%r12)
movl $0x2, %edi
movq %r12, %rsi
xorl %edx, %edx
callq 0x20b0
cmpl %r13d, 0xa09f(%rip)     # 0xcbe0
jle 0x2bdf
leaq 0x9692(%rip), %r14      # 0xc1e0
xorl %r15d, %r15d
movabsq $0x346dc5d63886594b, %r12 # imm = 0x346DC5D63886594B
movabsq $0x29f16b11c6d1e109, %r13 # imm = 0x29F16B11C6D1E109
cmpw $0x2, (%r14)
movl $0x10, %esi
je 0x2b76
movl $0x1c, %esi
movq %r14, %rdi
callq 0x7ecc
callq 0x2230
movq %rax, %rdi
cmpq $0x80, %r15
ja 0x2ba9
imulq %r12
movq %rdx, %rax
shrq $0x3f, %rax
shrq $0xb, %rdx
addl %eax, %edx
imull $0x2710, %edx, %eax     # imm = 0x2710
subl %eax, %edi
jmp 0x2bc7
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 0xa00a(%rip), %rax      # 0xcbe0
subq $-0x80, %r14
cmpq %rax, %r15
jl 0x2b65
movl $0x1, %eax
movl $0x1, %edx
movl %ebp, %ecx
shlq %cl, %rdx
movq %rdx, 0x28(%rsp)
movl %ebp, %r13d
movl %ebx, %ecx
shlq %cl, %rax
movq %rax, 0x18(%rsp)
shrl $0x6, %r13d
movl %ebx, %r15d
shrl $0x6, %r15d
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 0x2cad
movq 0x28(%rsp), %rax
orq %rax, 0x120(%rsp,%r13,8)
testl %ebx, %ebx
js 0x2cbe
movq 0x18(%rsp), %rax
orq %rax, 0x120(%rsp,%r15,8)
movl %r14d, %edi
leaq 0x120(%rsp), %rsi
xorl %edx, %edx
xorl %ecx, %ecx
leaq 0x37d0(%rsp), %r8
callq 0x2220
movl %eax, %r12d
testl %eax, %eax
jns 0x2cef
callq 0x2060
cmpl $0x4, (%rax)
jne 0x2e5d
cmpl $0x0, 0x9eee(%rip)      # 0xcbe4
jne 0x2e67
testl %r12d, %r12d
jle 0x2d8c
movl $0x80, 0x34(%rsp)
testl %ebp, %ebp
js 0x2d22
movl %ebp, %edi
movq 0x28(%rsp), %rax
testq %rax, 0x120(%rsp,%r13,8)
jne 0x2d3f
testl %ebx, %ebx
js 0x2efc
movl %ebx, %edi
movq 0x18(%rsp), %rax
testq %rax, 0x120(%rsp,%r15,8)
je 0x2efc
movl $0xfff, %edx            # imm = 0xFFF
leaq 0x9ea5(%rip), %rsi      # 0xcbf0
xorl %ecx, %ecx
leaq 0xa0(%rsp), %r8
leaq 0x34(%rsp), %r9
callq 0x2250
testl %eax, %eax
jle 0x2d8c
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
leaq 0x9e81(%rip), %rdi      # 0xcbf0
movb $0x0, (%rax,%rdi)
movl 0x34(%rsp), %ecx
movq $0x0, (%rsp)
movq %rax, %rsi
leaq 0xa0(%rsp), %rdx
jmp 0x2d9c
movq $0x0, (%rsp)
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
leaq 0x38(%rsp), %r8
leaq 0x1c3(%rip), %r9        # 0x2f6b
callq 0x480a
testl %eax, %eax
js 0x2e35
cmpl $0x0, 0xae34(%rip)      # 0xdbf0
je 0x2e0a
testl %ebp, %ebp
js 0x2ddf
leaq 0x6257(%rip), %rdi      # 0x9020
xorl %esi, %esi
movl $0x2, %edx
leaq 0x194(%rip), %rcx       # 0x2f6b
xorl %r8d, %r8d
callq 0x31a0
testl %ebx, %ebx
js 0x2e00
leaq 0x6236(%rip), %rdi      # 0x9020
xorl %esi, %esi
movl $0xa, %edx
leaq 0x173(%rip), %rcx       # 0x2f6b
xorl %r8d, %r8d
callq 0x31a0
movl $0x0, 0xade6(%rip)      # 0xdbf0
cmpl $0x0, 0xade3(%rip)      # 0xdbf4
je 0x2c17
movq 0x91aa(%rip), %rax      # 0xbfc8
movq (%rax), %rdi
callq 0x3c42
movl $0x0, 0xadc4(%rip)      # 0xdbf4
jmp 0x2c17
callq 0x2060
cmpl $0x4, (%rax)
je 0x2c17
leaq 0x62c7(%rip), %rdi      # 0x9111
callq 0x22b0
movq $0x1, 0x38(%rsp)
jmp 0x2db5
callq 0x2410
jmp 0x2cef
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 0x7be4
movl (%rbx), %edx
movl (%r14), %ecx
leaq 0x627c(%rip), %rdi      # 0x911e
movl %eax, %esi
xorl %eax, %eax
callq 0x2100
callq 0x46dc
xorl %eax, %eax
addq $0x5718, %rsp           # imm = 0x5718
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x61bd(%rip), %rdi      # 0x9088
callq 0x22b0
jmp 0x298f
leaq 0x61cf(%rip), %rdi      # 0x90ab
callq 0x22b0
jmp 0x29c5
leaq 0x629a(%rip), %rdi      # 0x9187
callq 0x20a0
movl $0x1, %edi
callq 0x22f0
callq 0x2050
movl %eax, %edi
callq 0x2395
callq 0x247e
callq 0x23eb
callq 0x242a
callq 0x2380
callq 0x2469
callq 0x2454
callq 0x243f
callq 0x23c1
callq 0x23d6