// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x5880, %rsp           # imm = 0x5880
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0xffffffff, -0x20(%rbp) # imm = 0xFFFFFFFF
movl $0xffffffff, -0x24(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x2c(%rbp)
movq $0x0, -0x48(%rbp)
leaq 0x9b7c(%rip), %rax      # 0xc029
movq %rax, -0x50(%rbp)
movl $0x0, -0x58(%rbp)
movl $0x1, -0x5c(%rbp)
movl $0x1, -0x60(%rbp)
leaq -0x70(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x2150
movw $0x2, -0x70(%rbp)
leaq -0x8c(%rbp), %rdi
xorl %esi, %esi
movl $0x1c, %edx
callq 0x2150
movw $0xa, -0x8c(%rbp)
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
leaq 0x9b32(%rip), %rdx      # 0xc038
callq 0x22c0
movl %eax, -0x54(%rbp)
cmpl $0x0, -0x54(%rbp)
jge 0x2519
jmp 0x2622
movl -0x54(%rbp), %eax
movl %eax, -0x5850(%rbp)
subl $0x34, %eax
je 0x2571
jmp 0x2529
movl -0x5850(%rbp), %eax
subl $0x36, %eax
je 0x257d
jmp 0x2536
movl -0x5850(%rbp), %eax
subl $0x62, %eax
je 0x2589
jmp 0x2543
movl -0x5850(%rbp), %eax
subl $0x69, %eax
je 0x2608
jmp 0x2554
movl -0x5850(%rbp), %eax
subl $0x71, %eax
jne 0x2618
jmp 0x2565
movl $0x1, -0x58(%rbp)
jmp 0x261d
movl $0x0, -0x60(%rbp)
jmp 0x261d
movl $0x0, -0x5c(%rbp)
jmp 0x261d
movq 0xca48(%rip), %rax      # 0xefd8
movq (%rax), %rsi
leaq -0x130(%rbp), %rdx
movl $0x2, %edi
callq 0x2210
movl %eax, -0x134(%rbp)
cmpl $0x1, -0x134(%rbp)
jne 0x25be
movl -0x130(%rbp), %eax
movl %eax, -0x6c(%rbp)
jmp 0x261d
movq 0xca13(%rip), %rax      # 0xefd8
movq (%rax), %rsi
leaq -0x130(%rbp), %rdx
movl $0xa, %edi
callq 0x2210
movl %eax, -0x134(%rbp)
cmpl $0x1, -0x134(%rbp)
jne 0x2603
movq -0x130(%rbp), %rax
movq %rax, -0x84(%rbp)
movq -0x128(%rbp), %rax
movq %rax, -0x7c(%rbp)
jmp 0x261d
jmp 0x3033
movq 0xc9c9(%rip), %rax      # 0xefd8
movq (%rax), %rax
movq %rax, -0x50(%rbp)
jmp 0x261d
jmp 0x3033
jmp 0x24f8
movq -0x50(%rbp), %rdi
xorl %esi, %esi
movb $0x0, %al
callq 0x22a0
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jl 0x2661
movl -0x1c(%rbp), %edi
leaq -0x40(%rbp), %rsi
movl $0x14, %edx
callq 0x2180
movl %eax, -0x18(%rbp)
cmpl $0x14, -0x18(%rbp)
jne 0x2659
movl $0x1, -0x2c(%rbp)
movl -0x1c(%rbp), %edi
callq 0x2170
leaq 0x99d8(%rip), %rdi      # 0xc040
xorl %esi, %esi
movb $0x0, %al
callq 0x22a0
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jge 0x2690
leaq 0x99cc(%rip), %rdi      # 0xc04d
callq 0x22b0
movl $0x1, %edi
callq 0x2300
cmpl $0x0, -0x2c(%rbp)
jne 0x2730
movl -0x1c(%rbp), %edi
leaq -0x40(%rbp), %rsi
movl $0x14, %edx
callq 0x2180
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
jge 0x26ca
leaq 0x999f(%rip), %rdi      # 0xc05a
callq 0x22b0
movl $0x1, %edi
callq 0x2300
movl $0x1, -0x2c(%rbp)
movl -0x1c(%rbp), %edi
callq 0x2170
movq -0x50(%rbp), %rdi
movl $0x241, %esi            # imm = 0x241
movl $0x1b6, %edx            # imm = 0x1B6
movb $0x0, %al
callq 0x22a0
movl %eax, -0x138(%rbp)
cmpl $0x0, -0x138(%rbp)
jl 0x272e
movl -0x138(%rbp), %edi
leaq -0x40(%rbp), %rsi
movl $0x14, %edx
callq 0x20e0
movl %eax, -0x18(%rbp)
cmpl $0x14, -0x18(%rbp)
jge 0x2723
movq -0x50(%rbp), %rdi
callq 0x2080
movl -0x138(%rbp), %edi
callq 0x2170
jmp 0x2730
movl -0x1c(%rbp), %edi
leaq -0x13c(%rbp), %rsi
movl $0x4, %edx
callq 0x2180
movl -0x13c(%rbp), %edi
callq 0x2070
movl -0x1c(%rbp), %edi
callq 0x2170
cmpl $0x2, -0x8(%rbp)
jge 0x2762
jmp 0x3033
movq 0xc867(%rip), %rax      # 0xefd0
movl (%rax), %eax
movl %eax, -0x14(%rbp)
movl -0x8(%rbp), %eax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jge 0x2780
jmp 0x3033
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x14(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x22e0
movl %eax, -0x28(%rbp)
cmpl $0x0, -0x28(%rbp)
jle 0x27ad
cmpl $0x10000, -0x28(%rbp)   # imm = 0x10000
jl 0x27b2
jmp 0x3033
jmp 0x27b4
movl -0x14(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x291d
leaq -0x170(%rbp), %rdi
xorl %esi, %esi
movl $0x30, %edx
callq 0x2150
movl $0x2, -0x168(%rbp)
cmpl $0x0, -0x60(%rbp)
jne 0x27ef
movl $0x2, -0x16c(%rbp)
jmp 0x280d
cmpl $0x0, -0x5c(%rbp)
jne 0x2801
movl $0xa, -0x16c(%rbp)
jmp 0x280b
movl $0x0, -0x16c(%rbp)
jmp 0x280d
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rsi
leaq -0x170(%rbp), %rdx
leaq -0x178(%rbp), %rcx
callq 0x2310
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
je 0x2881
movq 0xc7ab(%rip), %rax      # 0xeff8
movq (%rax), %rax
movq %rax, -0x5858(%rbp)
movl -0x18(%rbp), %edi
callq 0x2130
movq -0x5858(%rbp), %rdi
movq %rax, %rdx
leaq 0x97f7(%rip), %rsi      # 0xc067
movb $0x0, %al
callq 0x21c0
movl $0x1, %edi
callq 0x2300
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x8(%rbp), %eax
jl 0x2897
jmp 0x3033
movq -0x178(%rbp), %rax
movq %rax, -0x180(%rbp)
cmpq $0x0, -0x180(%rbp)
je 0x2903
movslq 0xd32a(%rip), %rax      # 0xfbe0
leaq 0xc923(%rip), %rdi      # 0xf1e0
shlq $0x7, %rax
addq %rax, %rdi
movq -0x180(%rbp), %rax
movq 0x18(%rax), %rsi
movq -0x180(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, %edx
callq 0x2200
movq -0x180(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x180(%rbp)
movl 0xd2e8(%rip), %eax      # 0xfbe0
addl $0x1, %eax
movl %eax, 0xd2df(%rip)      # 0xfbe0
jmp 0x28a5
movq -0x178(%rbp), %rdi
callq 0x2350
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x27b4
cmpl $0x0, -0x58(%rbp)
jne 0x2937
movq 0xc69e(%rip), %rax      # 0xefc8
movq (%rax), %rcx
leaq 0xe2cc(%rip), %rax      # 0x10c00
movq %rcx, (%rax)
cmpl $0x0, -0x5c(%rbp)
je 0x298e
movl $0x2, %esi
xorl %edx, %edx
movl %esi, %edi
callq 0x2360
movl %eax, -0x20(%rbp)
cmpl $0x0, -0x20(%rbp)
jge 0x2960
leaq 0x971d(%rip), %rdi      # 0xc078
callq 0x22b0
movl -0x20(%rbp), %edi
movl $0x1, %esi
callq 0x3050
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
jge 0x298c
leaq 0x9708(%rip), %rdi      # 0xc085
callq 0x22b0
movl $0x1, %edi
callq 0x2300
jmp 0x298e
cmpl $0x0, -0x60(%rbp)
je 0x29e8
movl $0xa, %edi
movl $0x2, %esi
xorl %edx, %edx
callq 0x2360
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jge 0x29ba
leaq 0x96e6(%rip), %rdi      # 0xc09b
callq 0x22b0
movl -0x24(%rbp), %edi
movl $0x1, %esi
callq 0x3050
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
jge 0x29e6
leaq 0x96d1(%rip), %rdi      # 0xc0a8
callq 0x22b0
movl $0x1, %edi
callq 0x2300
jmp 0x29e8
cmpl $0x0, -0x20(%rbp)
jge 0x2a16
cmpl $0x0, -0x24(%rbp)
jge 0x2a16
movq 0xc5fd(%rip), %rax      # 0xeff8
movq (%rax), %rdi
leaq 0x96b9(%rip), %rsi      # 0xc0be
movb $0x0, %al
callq 0x21c0
movl $0x1, %edi
callq 0x2300
cmpl $0x0, -0x20(%rbp)
jl 0x2a6b
movl -0x28(%rbp), %eax
movzwl %ax, %edi
callq 0x2100
movw %ax, -0x6e(%rbp)
movl -0x20(%rbp), %edi
leaq -0x70(%rbp), %rax
movq %rax, -0x188(%rbp)
movq -0x188(%rbp), %rsi
movl $0x10, %edx
callq 0x2280
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
jge 0x2a69
leaq 0x9669(%rip), %rdi      # 0xc0c3
callq 0x22b0
movl $0x1, %edi
callq 0x2300
jmp 0x2a6b
cmpl $0x0, -0x24(%rbp)
jl 0x2b1e
movl $0x1, -0x190(%rbp)
movl -0x24(%rbp), %edi
movl $0x29, %esi
movl $0x1a, %edx
leaq -0x190(%rbp), %rcx
movl $0x4, %r8d
callq 0x20c0
movl %eax, -0x18c(%rbp)
cmpl $0x0, -0x18c(%rbp)
jge 0x2ac3
leaq 0x961a(%rip), %rdi      # 0xc0ce
callq 0x22b0
movl $0x1, %edi
callq 0x2300
movl -0x28(%rbp), %eax
movzwl %ax, %edi
callq 0x2100
movw %ax, -0x8a(%rbp)
movl -0x24(%rbp), %edi
leaq -0x8c(%rbp), %rax
movq %rax, -0x198(%rbp)
movq -0x198(%rbp), %rsi
movl $0x1c, %edx
callq 0x2280
movl %eax, -0x18c(%rbp)
cmpl $0x0, -0x18c(%rbp)
jge 0x2b1c
leaq 0x95d9(%rip), %rdi      # 0xc0e6
callq 0x22b0
movl $0x1, %edi
callq 0x2300
jmp 0x2b1e
movl -0x20(%rbp), %edi
movl -0x24(%rbp), %esi
leaq -0x40(%rbp), %rdx
leaq 0x94f5(%rip), %rcx      # 0xc024
callq 0x4d40
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
jge 0x2b53
leaq 0x95ad(%rip), %rdi      # 0xc0f1
callq 0x22b0
movl $0x1, %edi
callq 0x2300
callq 0x30e0
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl 0xd078(%rip), %eax      # 0xfbe0
jge 0x2c09
movslq -0x14(%rbp), %rcx
leaq 0xc667(%rip), %rax      # 0xf1e0
shlq $0x7, %rcx
addq %rcx, %rax
movzwl (%rax), %eax
cmpl $0x2, %eax
jne 0x2b94
movl $0x10, -0x19c(%rbp)
jmp 0x2b9e
movl $0x1c, -0x19c(%rbp)
movslq -0x14(%rbp), %rax
leaq 0xc637(%rip), %rdi      # 0xf1e0
shlq $0x7, %rax
addq %rax, %rdi
movl -0x19c(%rbp), %esi
callq 0x9940
cmpl $0x80, -0x14(%rbp)
jg 0x2bdc
callq 0x2230
movl $0x2710, %ecx           # imm = 0x2710
cqto
idivq %rcx
movl %edx, %edi
callq 0x2340
jmp 0x2bf9
callq 0x2230
movl $0x61a80, %ecx          # imm = 0x61A80
cqto
idivq %rcx
addq $0x7a120, %rdx          # imm = 0x7A120
movl %edx, %edi
callq 0x2340
jmp 0x2bfb
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x2b5f
jmp 0x2c0b
movq -0x48(%rbp), %rax
movq %rax, -0x1b0(%rbp)
callq 0x2230
movl $0xf4240, %ecx          # imm = 0xF4240
cqto
idivq %rcx
movq %rdx, -0x1a8(%rbp)
leaq -0x230(%rbp), %rax
movq %rax, -0x240(%rbp)
movl $0x0, -0x234(%rbp)
movl -0x234(%rbp), %eax
cmpq $0x10, %rax
jae 0x2c76
movq -0x240(%rbp), %rax
movl -0x234(%rbp), %ecx
movq $0x0, (%rax,%rcx,8)
movl -0x234(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x234(%rbp)
jmp 0x2c44
jmp 0x2c78
cmpl $0x0, -0x20(%rbp)
jl 0x2cb5
movl -0x20(%rbp), %eax
movl $0x40, %ecx
cltd
idivl %ecx
movl %edx, %eax
movl %eax, %ecx
movl $0x1, %eax
shlq %cl, %rax
movq %rax, %rcx
movl -0x20(%rbp), %eax
movl $0x40, %esi
cltd
idivl %esi
cltq
orq -0x230(%rbp,%rax,8), %rcx
movq %rcx, -0x230(%rbp,%rax,8)
cmpl $0x0, -0x24(%rbp)
jl 0x2cf2
movl -0x24(%rbp), %eax
movl $0x40, %ecx
cltd
idivl %ecx
movl %edx, %eax
movl %eax, %ecx
movl $0x1, %eax
shlq %cl, %rax
movq %rax, %rcx
movl -0x24(%rbp), %eax
movl $0x40, %esi
cltd
idivl %esi
cltq
orq -0x230(%rbp,%rax,8), %rcx
movq %rcx, -0x230(%rbp,%rax,8)
movl -0x20(%rbp), %eax
cmpl -0x24(%rbp), %eax
jle 0x2d08
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x585c(%rbp)
jmp 0x2d14
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x585c(%rbp)
movl -0x585c(%rbp), %edi
leaq -0x230(%rbp), %rsi
xorl %eax, %eax
movl %eax, %ecx
leaq -0x1b0(%rbp), %r8
movq %rcx, %rdx
callq 0x2220
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
jge 0x2d5f
callq 0x2060
cmpl $0x4, (%rax)
je 0x2d5d
leaq 0x93ac(%rip), %rdi      # 0xc0fa
callq 0x22b0
movl $0x1, %edi
callq 0x2330
jmp 0x2d5f
movl 0xce7f(%rip), %eax      # 0xfbe4
cmpl $0x0, %eax
je 0x2d6f
jmp 0x2fc8
cmpl $0x0, -0x18(%rbp)
jle 0x2e91
movl $0x80, -0x114(%rbp)
cmpl $0x0, -0x20(%rbp)
jl 0x2e07
movl -0x20(%rbp), %eax
movl $0x40, %ecx
cltd
idivl %ecx
cltq
movq -0x230(%rbp,%rax,8), %rax
movq %rax, -0x5868(%rbp)
movl -0x20(%rbp), %eax
movl $0x40, %ecx
cltd
idivl %ecx
movq -0x5868(%rbp), %rax
movl %edx, %ecx
movl $0x1, %edx
shlq %cl, %rdx
movq %rdx, %rcx
andq %rcx, %rax
cmpq $0x0, %rax
je 0x2e07
movl -0x20(%rbp), %edi
leaq -0x110(%rbp), %rax
movq %rax, -0x248(%rbp)
movq -0x248(%rbp), %r8
leaq 0xce04(%rip), %rsi      # 0xfbf0
movl $0xfff, %edx            # imm = 0xFFF
xorl %ecx, %ecx
leaq -0x114(%rbp), %r9
callq 0x2250
movl %eax, -0x18(%rbp)
jmp 0x2e8f
cmpl $0x0, -0x24(%rbp)
jl 0x2e88
movl -0x24(%rbp), %eax
movl $0x40, %ecx
cltd
idivl %ecx
cltq
movq -0x230(%rbp,%rax,8), %rax
movq %rax, -0x5870(%rbp)
movl -0x24(%rbp), %eax
movl $0x40, %ecx
cltd
idivl %ecx
movq -0x5870(%rbp), %rax
movl %edx, %ecx
movl $0x1, %edx
shlq %cl, %rdx
movq %rdx, %rcx
andq %rcx, %rax
cmpq $0x0, %rax
je 0x2e88
movl -0x24(%rbp), %edi
leaq -0x110(%rbp), %rax
movq %rax, -0x250(%rbp)
movq -0x250(%rbp), %r8
leaq 0xcd80(%rip), %rsi      # 0xfbf0
movl $0xfff, %edx            # imm = 0xFFF
xorl %ecx, %ecx
leaq -0x114(%rbp), %r9
callq 0x2250
movl %eax, -0x18(%rbp)
jmp 0x2e8d
callq 0x2050
jmp 0x2e8f
jmp 0x2e91
cmpl $0x0, -0x18(%rbp)
jle 0x2edd
movslq -0x18(%rbp), %rcx
leaq 0xcd4e(%rip), %rax      # 0xfbf0
movb $0x0, (%rax,%rcx)
movslq -0x18(%rbp), %rsi
movl -0x114(%rbp), %ecx
leaq 0xcd39(%rip), %rdi      # 0xfbf0
leaq -0x110(%rbp), %rdx
leaq -0x48(%rbp), %r8
leaq 0x327(%rip), %r9        # 0x31f0
xorl %eax, %eax
movq $0x0, (%rsp)
callq 0x53a0
movl %eax, -0x18(%rbp)
jmp 0x2f04
xorl %eax, %eax
movl %eax, %edx
xorl %ecx, %ecx
leaq -0x48(%rbp), %r8
leaq 0x302(%rip), %r9        # 0x31f0
movq %rdx, %rdi
movq %rdx, %rsi
movq $0x0, (%rsp)
callq 0x53a0
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
jge 0x2f40
callq 0x2060
cmpl $0x4, (%rax)
jne 0x2f19
jmp 0x2c0b
leaq 0x91e1(%rip), %rdi      # 0xc101
callq 0x22b0
cmpl $0x16, -0x18(%rbp)
je 0x2f31
cmpl $0xe, -0x18(%rbp)
jne 0x2f36
callq 0x2050
movq $0x1, -0x48(%rbp)
jmp 0x2f40
movl 0xdcaa(%rip), %eax      # 0x10bf0
cmpl $0x0, %eax
je 0x2f9f
cmpl $0x0, -0x20(%rbp)
jl 0x2f70
leaq 0x90b8(%rip), %rdi      # 0xc010
xorl %esi, %esi
movl $0x2, %edx
leaq 0x28a(%rip), %rcx       # 0x31f0
xorl %eax, %eax
movl %eax, %r8d
callq 0x3560
cmpl $0x0, -0x24(%rbp)
jl 0x2f95
leaq 0x9093(%rip), %rdi      # 0xc010
xorl %esi, %esi
movl $0xa, %edx
leaq 0x265(%rip), %rcx       # 0x31f0
xorl %eax, %eax
movl %eax, %r8d
callq 0x3560
movl $0x0, 0xdc51(%rip)      # 0x10bf0
movl 0xdc4f(%rip), %eax      # 0x10bf4
cmpl $0x0, %eax
je 0x2fc3
movq 0xc017(%rip), %rax      # 0xefc8
movq (%rax), %rdi
callq 0x43a0
movl $0x0, 0xdc31(%rip)      # 0x10bf4
jmp 0x2c0b
movl $0x1f4, -0x5844(%rbp)   # imm = 0x1F4
movl $0x1f4, -0x5848(%rbp)   # imm = 0x1F4
leaq -0x2190(%rbp), %rdi
leaq -0x5840(%rbp), %rdx
leaq -0x5844(%rbp), %rsi
leaq -0x5848(%rbp), %rcx
callq 0x94f0
movl %eax, -0x584c(%rbp)
movl -0x584c(%rbp), %esi
movl -0x5844(%rbp), %edx
movl -0x5848(%rbp), %ecx
leaq 0x90f2(%rip), %rdi      # 0xc10e
movb $0x0, %al
callq 0x2110
callq 0x5200
xorl %eax, %eax
addq $0x5880, %rsp           # imm = 0x5880
popq %rbp
retq
leaq 0x90f4(%rip), %rdi      # 0xc12e
movb $0x0, %al
callq 0x2110
movl $0x1, %edi
callq 0x2300
nopl (%rax,%rax)