// File: /workspace/github_c_makefile_star2_O0/jech[P]dht/dht.c
// Function: dht_periodic
int
dht_periodic(const void *buf, size_t buflen,
             const struct sockaddr *from, int fromlen,
             time_t *tosleep,
             dht_callback_t *callback, void *closure)
{
    dht_gettimeofday(&now, NULL);

    if(buflen > 0) {
        int message;
        struct parsed_message m;
        unsigned short ttid;

        if(is_martian(from))
            goto dontread;

        if(node_blacklisted(from, fromlen)) {
            debugf("Received packet from blacklisted node.\n");
            goto dontread;
        }

        if(((char*)buf)[buflen] != '\0') {
            debugf("Unterminated message.\n");
            errno = EINVAL;
            return -1;
        }

        memset(&m, 0, sizeof(m));
        message = parse_message(buf, buflen, &m);

        if(message < 0 || message == ERROR || id_cmp(m.id, zeroes) == 0) {
            debugf("Unparseable message: ");
            debug_printable(buf, buflen);
            debugf("\n");
            goto dontread;
        }

        if(id_cmp(m.id, myid) == 0) {
            debugf("Received message from self.\n");
            goto dontread;
        }

        if(message > REPLY) {
            /* Rate limit requests. */
            if(!token_bucket()) {
                debugf("Dropping request due to rate limiting.\n");
                goto dontread;
            }
        }

        switch(message) {
        case REPLY:
            if(m.tid_len != 4) {
                debugf("Broken node truncates transaction ids: ");
                debug_printable(buf, buflen);
                debugf("\n");
                /* This is really annoying, as it means that we will
                   time-out all our searches that go through this node.
                   Kill it. */
                blacklist_node(m.id, from, fromlen);
                goto dontread;
            }
            if(tid_match(m.tid, "pn", NULL)) {
                debugf("Pong!\n");
                new_node(m.id, from, fromlen, 2);
            } else if(tid_match(m.tid, "fn", NULL) ||
                      tid_match(m.tid, "gp", NULL)) {
                int gp = 0;
                struct search *sr = NULL;
                if(tid_match(m.tid, "gp", &ttid)) {
                    gp = 1;
                    sr = find_search(ttid, from->sa_family);
                }
                debugf("Nodes found (%d+%d)%s!\n",
                       m.nodes_len/26, m.nodes6_len/38,
                       gp ? " for get_peers" : "");
                if(m.nodes_len % 26 != 0 || m.nodes6_len % 38 != 0) {
                    debugf("Unexpected length for node info!\n");
                    blacklist_node(m.id, from, fromlen);
                } else if(gp && sr == NULL) {
                    debugf("Unknown search!\n");
                    new_node(m.id, from, fromlen, 1);
                } else {
                    int i;
                    new_node(m.id, from, fromlen, 2);
                    for(i = 0; i < m.nodes_len / 26; i++) {
                        unsigned char *ni = m.nodes + i * 26;
                        struct sockaddr_in sin;
                        if(id_cmp(ni, myid) == 0)
                            continue;
                        memset(&sin, 0, sizeof(sin));
                        sin.sin_family = AF_INET;
                        memcpy(&sin.sin_addr, ni + 20, 4);
                        memcpy(&sin.sin_port, ni + 24, 2);
                        new_node(ni, (struct sockaddr*)&sin, sizeof(sin), 0);
                        if(sr && sr->af == AF_INET) {
                            insert_search_node(ni,
                                               (struct sockaddr*)&sin,
                                               sizeof(sin),
                                               sr, 0, NULL, 0);
                        }
                    }
                    for(i = 0; i < m.nodes6_len / 38; i++) {
                        unsigned char *ni = m.nodes6 + i * 38;
                        struct sockaddr_in6 sin6;
                        if(id_cmp(ni, myid) == 0)
                            continue;
                        memset(&sin6, 0, sizeof(sin6));
                        sin6.sin6_family = AF_INET6;
                        memcpy(&sin6.sin6_addr, ni + 20, 16);
                        memcpy(&sin6.sin6_port, ni + 36, 2);
                        new_node(ni, (struct sockaddr*)&sin6, sizeof(sin6), 0);
                        if(sr && sr->af == AF_INET6) {
                            insert_search_node(ni,
                                               (struct sockaddr*)&sin6,
                                               sizeof(sin6),
                                               sr, 0, NULL, 0);
                        }
                    }
                    if(sr)
                        /* Since we received a reply, the number of
                           requests in flight has decreased.  Let's push
                           another request. */
                        search_send_get_peers(sr, NULL);
                }
                if(sr) {
                    insert_search_node(m.id, from, fromlen, sr,
                                       1, m.token, m.token_len);
                    if(m.values_len > 0 || m.values6_len > 0) {
                        debugf("Got values (%d+%d)!\n",
                               m.values_len / 6, m.values6_len / 18);
                        if(callback) {
                            if(m.values_len > 0)
                                (*callback)(closure, DHT_EVENT_VALUES, sr->id,
                                            (void*)m.values, m.values_len);

                            if(m.values6_len > 0)
                                (*callback)(closure, DHT_EVENT_VALUES6, sr->id,
                                            (void*)m.values6, m.values6_len);
                        }
                    }
                }
            } else if(tid_match(m.tid, "ap", &ttid)) {
                struct search *sr;
                debugf("Got reply to announce_peer.\n");
                sr = find_search(ttid, from->sa_family);
                if(!sr) {
                    debugf("Unknown search!\n");
                    new_node(m.id, from, fromlen, 1);
                } else {
                    int i;
                    new_node(m.id, from, fromlen, 2);
                    for(i = 0; i < sr->numnodes; i++)
                        if(id_cmp(sr->nodes[i].id, m.id) == 0) {
                            sr->nodes[i].request_time = 0;
                            sr->nodes[i].reply_time = now.tv_sec;
                            sr->nodes[i].acked = 1;
                            sr->nodes[i].pinged = 0;
                            break;
                        }
                    /* See comment for gp above. */
                    search_send_get_peers(sr, NULL);
                }
            } else {
                debugf("Unexpected reply: ");
                debug_printable(buf, buflen);
                debugf("\n");
            }
            break;
        case PING:
            debugf("Ping (%d)!\n", m.tid_len);
            new_node(m.id, from, fromlen, 1);
            debugf("Sending pong.\n");
            send_pong(from, fromlen, m.tid, m.tid_len);
            break;
        case FIND_NODE:
            debugf("Find node!\n");
            new_node(m.id, from, fromlen, 1);
            debugf("Sending closest nodes (%d).\n", m.want);
            send_closest_nodes(from, fromlen,
                               m.tid, m.tid_len, m.target, m.want,
                               0, NULL, NULL, 0);
            break;
        case GET_PEERS:
            debugf("Get_peers!\n");
            new_node(m.id, from, fromlen, 1);
            if(id_cmp(m.info_hash, zeroes) == 0) {
                debugf("Eek!  Got get_peers with no info_hash.\n");
                send_error(from, fromlen, m.tid, m.tid_len,
                           203, "Get_peers with no info_hash");
                break;
            } else {
                struct storage *st = find_storage(m.info_hash);
                unsigned char token[TOKEN_SIZE];
                make_token(from, 0, token);
                if(st && st->numpeers > 0) {
                     debugf("Sending found%s peers.\n",
                            from->sa_family == AF_INET6 ? " IPv6" : "");
                     send_closest_nodes(from, fromlen,
                                        m.tid, m.tid_len,
                                        m.info_hash, m.want,
                                        from->sa_family, st,
                                        token, TOKEN_SIZE);
                } else {
                    debugf("Sending nodes for get_peers.\n");
                    send_closest_nodes(from, fromlen,
                                       m.tid, m.tid_len, m.info_hash, m.want,
                                       0, NULL, token, TOKEN_SIZE);
                }
            }
            break;
        case ANNOUNCE_PEER:
            debugf("Announce peer!\n");
            new_node(m.id, from, fromlen, 1);
            if(id_cmp(m.info_hash, zeroes) == 0) {
                debugf("Announce_peer with no info_hash.\n");
                send_error(from, fromlen, m.tid, m.tid_len,
                           203, "Announce_peer with no info_hash");
                break;
            }
            if(!token_match(m.token, m.token_len, from)) {
                debugf("Incorrect token for announce_peer.\n");
                send_error(from, fromlen, m.tid, m.tid_len,
                           203, "Announce_peer with wrong token");
                break;
            }
            if(m.implied_port != 0) {
                /* Do this even if port > 0.  That's what the spec says. */
                switch(from->sa_family) {
                case AF_INET:
                    m.port = htons(((struct sockaddr_in*)from)->sin_port);
                    break;
                case AF_INET6:
                    m.port = htons(((struct sockaddr_in6*)from)->sin6_port);
                    break;
                }
            }
            if(m.port == 0) {
                debugf("Announce_peer with forbidden port %d.\n", m.port);
                send_error(from, fromlen, m.tid, m.tid_len,
                           203, "Announce_peer with forbidden port number");
                break;
            }
            storage_store(m.info_hash, from, m.port);
            /* Note that if storage_store failed, we lie to the requestor.
               This is to prevent them from backtracking, and hence
               polluting the DHT. */
            debugf("Sending peer announced.\n");
            send_peer_announced(from, fromlen, m.tid, m.tid_len);
        }
    }

 dontread:
    if(now.tv_sec >= rotate_secrets_time)
        rotate_secrets();

    if(now.tv_sec >= expire_stuff_time) {
        expire_buckets(buckets);
        expire_buckets(buckets6);
        expire_storage();
        expire_searches(callback, closure);
    }

    if(search_time > 0 && now.tv_sec >= search_time) {
        struct search *sr;
        sr = searches;
        while(sr) {
            if(!sr->done &&
               sr->step_time + DHT_SEARCH_RETRANSMIT / 2 + 1 <= now.tv_sec) {
                search_step(sr, callback, closure);
            }
            sr = sr->next;
        }

        search_time = 0;

        sr = searches;
        while(sr) {
            if(!sr->done) {
                time_t tm = sr->step_time +
                    DHT_SEARCH_RETRANSMIT + random() % DHT_SEARCH_RETRANSMIT;
                if(search_time == 0 || search_time > tm)
                    search_time = tm;
            }
            sr = sr->next;
        }
    }

    if(now.tv_sec >= confirm_nodes_time) {
        int soon = 0;

        soon |= bucket_maintenance(AF_INET);
        soon |= bucket_maintenance(AF_INET6);

        if(!soon) {
            if(mybucket_grow_time >= now.tv_sec - 150)
                soon |= neighbourhood_maintenance(AF_INET);
            if(mybucket6_grow_time >= now.tv_sec - 150)
                soon |= neighbourhood_maintenance(AF_INET6);
        }

        /* Given the timeouts in bucket_maintenance, with a 22-bucket
           table, worst case is a ping every 18 seconds (22 buckets plus
           11 buckets overhead for the larger buckets).  Keep the "soon"
           case within 15 seconds, which gives some margin for neighbourhood
           maintenance. */

        if(soon)
            confirm_nodes_time = now.tv_sec + 5 + random() % 10;
        else
            confirm_nodes_time = now.tv_sec + 60 + random() % 120;
    }

    if(confirm_nodes_time > now.tv_sec)
        *tosleep = confirm_nodes_time - now.tv_sec;
    else
        *tosleep = 0;

    if(search_time > 0) {
        if(search_time <= now.tv_sec)
            *tosleep = 0;
        else if(*tosleep > search_time - now.tv_sec)
            *tosleep = search_time - now.tv_sec;
    }

    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1600, %rsp           # imm = 0x1600
movq 0x10(%rbp), %rax
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
leaq 0xb843(%rip), %rdi      # 0x10c10
xorl %eax, %eax
movl %eax, %esi
callq 0x2140
cmpq $0x0, -0x18(%rbp)
jbe 0x6169
movq -0x20(%rbp), %rdi
callq 0x64c0
cmpl $0x0, %eax
je 0x53f4
jmp 0x616b
movq -0x20(%rbp), %rdi
movl -0x24(%rbp), %esi
callq 0x6640
cmpl $0x0, %eax
je 0x5418
leaq 0x6f19(%rip), %rdi      # 0xc325
movb $0x0, %al
callq 0x3aa0
jmp 0x616b
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x544e
leaq 0x6f1d(%rip), %rdi      # 0xc34d
movb $0x0, %al
callq 0x3aa0
callq 0x2060
movl $0x16, (%rax)
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x64b1
leaq -0x151a(%rbp), %rdi
xorl %esi, %esi
movl $0x14de, %edx           # imm = 0x14DE
callq 0x2150
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movl %eax, %esi
leaq -0x151a(%rbp), %rdx
callq 0x66d0
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jl 0x54a2
cmpl $0x0, -0x3c(%rbp)
je 0x54a2
leaq -0x151a(%rbp), %rdi
addq $0x12, %rdi
leaq 0x6d98(%rip), %rsi      # 0xc230
callq 0x3b70
cmpl $0x0, %eax
jne 0x54d2
leaq 0x6ebb(%rip), %rdi      # 0xc364
movb $0x0, %al
callq 0x3aa0
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movl %eax, %esi
callq 0x71b0
leaq 0x6e57(%rip), %rdi      # 0xc31d
movb $0x0, %al
callq 0x3aa0
jmp 0x616b
leaq -0x151a(%rbp), %rdi
addq $0x12, %rdi
leaq 0xb74c(%rip), %rsi      # 0x10c30
callq 0x3b70
cmpl $0x0, %eax
jne 0x5501
leaq 0x6e85(%rip), %rdi      # 0xc37a
movb $0x0, %al
callq 0x3aa0
jmp 0x616b
cmpl $0x1, -0x3c(%rbp)
jle 0x5526
callq 0x7240
cmpl $0x0, %eax
jne 0x5524
leaq 0x6e7f(%rip), %rdi      # 0xc397
movb $0x0, %al
callq 0x3aa0
jmp 0x616b
jmp 0x5526
movl -0x3c(%rbp), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x15b0(%rbp)
subl $0x4, %eax
ja 0x6167
movq -0x15b0(%rbp), %rax
leaq 0x6cc5(%rip), %rcx      # 0xc210
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movzwl -0x150a(%rbp), %eax
cmpl $0x4, %eax
je 0x55a7
leaq 0x6e58(%rip), %rdi      # 0xc3bf
movb $0x0, %al
callq 0x3aa0
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movl %eax, %esi
callq 0x71b0
leaq 0x6d99(%rip), %rdi      # 0xc31d
movb $0x0, %al
callq 0x3aa0
leaq -0x151a(%rbp), %rdi
addq $0x12, %rdi
movq -0x20(%rbp), %rsi
movl -0x24(%rbp), %edx
callq 0x72d0
jmp 0x616b
leaq -0x151a(%rbp), %rdi
leaq 0x6e32(%rip), %rsi      # 0xc3e7
xorl %eax, %eax
movl %eax, %edx
callq 0x7400
cmpl $0x0, %eax
je 0x55f2
leaq 0x6e20(%rip), %rdi      # 0xc3ea
movb $0x0, %al
callq 0x3aa0
leaq -0x151a(%rbp), %rdi
addq $0x12, %rdi
movq -0x20(%rbp), %rsi
movl -0x24(%rbp), %edx
movl $0x2, %ecx
callq 0x7470
jmp 0x5d01
leaq -0x151a(%rbp), %rdi
leaq 0x6df1(%rip), %rsi      # 0xc3f1
xorl %eax, %eax
movl %eax, %edx
callq 0x7400
cmpl $0x0, %eax
jne 0x562e
leaq -0x151a(%rbp), %rdi
leaq 0x6dd8(%rip), %rsi      # 0xc3f4
xorl %eax, %eax
movl %eax, %edx
callq 0x7400
cmpl $0x0, %eax
je 0x5b10
movl $0x0, -0x1520(%rbp)
movq $0x0, -0x1528(%rbp)
leaq -0x151a(%rbp), %rdi
leaq 0x6da3(%rip), %rsi      # 0xc3f4
leaq -0x151c(%rbp), %rdx
callq 0x7400
cmpl $0x0, %eax
je 0x5689
movl $0x1, -0x1520(%rbp)
movw -0x151c(%rbp), %ax
movq -0x20(%rbp), %rcx
movzwl (%rcx), %esi
movzwl %ax, %edi
callq 0x79e0
movq %rax, -0x1528(%rbp)
movzwl -0x12a6(%rbp), %eax
movl $0x1a, %ecx
cltd
idivl %ecx
movl %eax, %esi
movzwl -0x1044(%rbp), %eax
movl $0x26, %ecx
cltd
idivl %ecx
movl %eax, %edx
movl -0x1520(%rbp), %edi
leaq 0x6c66(%rip), %rcx      # 0xc31e
leaq 0x6d50(%rip), %rax      # 0xc40f
cmpl $0x0, %edi
cmovneq %rax, %rcx
leaq 0x6d2a(%rip), %rdi      # 0xc3f7
movb $0x0, %al
callq 0x3aa0
movzwl -0x12a6(%rbp), %eax
movl $0x1a, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x56fc
movzwl -0x1044(%rbp), %eax
movl $0x26, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
je 0x5726
leaq 0x6d1b(%rip), %rdi      # 0xc41e
movb $0x0, %al
callq 0x3aa0
leaq -0x151a(%rbp), %rdi
addq $0x12, %rdi
movq -0x20(%rbp), %rsi
movl -0x24(%rbp), %edx
callq 0x72d0
jmp 0x59fb
cmpl $0x0, -0x1520(%rbp)
je 0x5768
cmpq $0x0, -0x1528(%rbp)
jne 0x5768
leaq 0x6d00(%rip), %rdi      # 0xc440
movb $0x0, %al
callq 0x3aa0
leaq -0x151a(%rbp), %rdi
addq $0x12, %rdi
movq -0x20(%rbp), %rsi
movl -0x24(%rbp), %edx
movl $0x1, %ecx
callq 0x7470
jmp 0x59f9
leaq -0x151a(%rbp), %rdi
addq $0x12, %rdi
movq -0x20(%rbp), %rsi
movl -0x24(%rbp), %edx
movl $0x2, %ecx
callq 0x7470
movl $0x0, -0x152c(%rbp)
movl -0x152c(%rbp), %eax
movl %eax, -0x15b4(%rbp)
movzwl -0x12a6(%rbp), %eax
movl $0x1a, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x15b4(%rbp), %eax
cmpl %ecx, %eax
jge 0x58aa
leaq -0x151a(%rbp), %rax
addq $0xd4, %rax
imull $0x1a, -0x152c(%rbp), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x1538(%rbp)
movq -0x1538(%rbp), %rdi
leaq 0xb448(%rip), %rsi      # 0x10c30
callq 0x3b70
cmpl $0x0, %eax
jne 0x57f7
jmp 0x5896
leaq -0x1548(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x2150
movw $0x2, -0x1548(%rbp)
movq -0x1538(%rbp), %rax
movl 0x14(%rax), %eax
movl %eax, -0x1544(%rbp)
movq -0x1538(%rbp), %rax
movw 0x18(%rax), %ax
movw %ax, -0x1546(%rbp)
movq -0x1538(%rbp), %rdi
leaq -0x1548(%rbp), %rsi
movl $0x10, %edx
xorl %ecx, %ecx
callq 0x7470
cmpq $0x0, -0x1528(%rbp)
je 0x5894
movq -0x1528(%rbp), %rax
cmpl $0x2, 0x4(%rax)
jne 0x5894
movq -0x1538(%rbp), %rdi
movq -0x1528(%rbp), %rcx
leaq -0x1548(%rbp), %rsi
movl $0x10, %edx
xorl %r8d, %r8d
xorl %eax, %eax
movl %eax, %r9d
movl $0x0, (%rsp)
callq 0x7a50
jmp 0x5896
movl -0x152c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x152c(%rbp)
jmp 0x578e
movl $0x0, -0x152c(%rbp)
movl -0x152c(%rbp), %eax
movl %eax, -0x15b8(%rbp)
movzwl -0x1044(%rbp), %eax
movl $0x26, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x15b8(%rbp), %eax
cmpl %ecx, %eax
jge 0x59dd
leaq -0x151a(%rbp), %rax
addq $0x276, %rax            # imm = 0x276
imull $0x26, -0x152c(%rbp), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x1550(%rbp)
movq -0x1550(%rbp), %rdi
leaq 0xb322(%rip), %rsi      # 0x10c30
callq 0x3b70
cmpl $0x0, %eax
jne 0x591d
jmp 0x59c9
leaq -0x156c(%rbp), %rdi
xorl %esi, %esi
movl $0x1c, %edx
callq 0x2150
movw $0xa, -0x156c(%rbp)
movq -0x1550(%rbp), %rax
movq 0x14(%rax), %rcx
movq %rcx, -0x1564(%rbp)
movq 0x1c(%rax), %rax
movq %rax, -0x155c(%rbp)
movq -0x1550(%rbp), %rax
movw 0x24(%rax), %ax
movw %ax, -0x156a(%rbp)
movq -0x1550(%rbp), %rdi
leaq -0x156c(%rbp), %rsi
movl $0x1c, %edx
xorl %ecx, %ecx
callq 0x7470
cmpq $0x0, -0x1528(%rbp)
je 0x59c7
movq -0x1528(%rbp), %rax
cmpl $0xa, 0x4(%rax)
jne 0x59c7
movq -0x1550(%rbp), %rdi
movq -0x1528(%rbp), %rcx
leaq -0x156c(%rbp), %rsi
movl $0x1c, %edx
xorl %r8d, %r8d
xorl %eax, %eax
movl %eax, %r9d
movl $0x0, (%rsp)
callq 0x7a50
jmp 0x59c9
movl -0x152c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x152c(%rbp)
jmp 0x58b4
cmpq $0x0, -0x1528(%rbp)
je 0x59f7
movq -0x1528(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x7cd0
jmp 0x59f9
jmp 0x59fb
cmpq $0x0, -0x1528(%rbp)
je 0x5b0b
leaq -0x151a(%rbp), %rdi
addq $0x12, %rdi
movq -0x20(%rbp), %rsi
movl -0x24(%rbp), %edx
movq -0x1528(%rbp), %rcx
leaq -0x151a(%rbp), %r9
addq $0x52, %r9
movzwl -0x1448(%rbp), %eax
movl $0x1, %r8d
movl %eax, (%rsp)
callq 0x7a50
movzwl -0x842(%rbp), %eax
cmpl $0x0, %eax
jg 0x5a5b
movzwl -0x40(%rbp), %eax
cmpl $0x0, %eax
jle 0x5b09
movzwl -0x842(%rbp), %eax
movl $0x6, %ecx
cltd
idivl %ecx
movl %eax, %esi
movzwl -0x40(%rbp), %eax
movl $0x12, %ecx
cltd
idivl %ecx
movl %eax, %edx
leaq 0x69d0(%rip), %rdi      # 0xc451
movb $0x0, %al
callq 0x3aa0
cmpq $0x0, -0x38(%rbp)
je 0x5b07
movzwl -0x842(%rbp), %eax
cmpl $0x0, %eax
jle 0x5acd
movq -0x38(%rbp), %rax
movq 0x10(%rbp), %rdi
movq -0x1528(%rbp), %rdx
addq $0x10, %rdx
leaq -0x151a(%rbp), %rcx
addq $0x4d8, %rcx            # imm = 0x4D8
movzwl -0x842(%rbp), %esi
movl %esi, %r8d
movl $0x1, %esi
callq *%rax
movzwl -0x40(%rbp), %eax
cmpl $0x0, %eax
jle 0x5b05
movq -0x38(%rbp), %rax
movq 0x10(%rbp), %rdi
movq -0x1528(%rbp), %rdx
addq $0x10, %rdx
leaq -0x151a(%rbp), %rcx
addq $0xcda, %rcx            # imm = 0xCDA
movzwl -0x40(%rbp), %esi
movl %esi, %r8d
movl $0x2, %esi
callq *%rax
jmp 0x5b07
jmp 0x5b09
jmp 0x5b0b
jmp 0x5cff
leaq -0x151a(%rbp), %rdi
leaq 0x6948(%rip), %rsi      # 0xc466
leaq -0x151c(%rbp), %rdx
callq 0x7400
cmpl $0x0, %eax
je 0x5cd2
leaq 0x692f(%rip), %rdi      # 0xc469
movb $0x0, %al
callq 0x3aa0
movw -0x151c(%rbp), %ax
movq -0x20(%rbp), %rcx
movzwl (%rcx), %esi
movzwl %ax, %edi
callq 0x79e0
movq %rax, -0x1578(%rbp)
cmpq $0x0, -0x1578(%rbp)
jne 0x5b97
leaq 0x68d1(%rip), %rdi      # 0xc440
movb $0x0, %al
callq 0x3aa0
leaq -0x151a(%rbp), %rdi
addq $0x12, %rdi
movq -0x20(%rbp), %rsi
movl -0x24(%rbp), %edx
movl $0x1, %ecx
callq 0x7470
jmp 0x5cd0
leaq -0x151a(%rbp), %rdi
addq $0x12, %rdi
movq -0x20(%rbp), %rsi
movl -0x24(%rbp), %edx
movl $0x2, %ecx
callq 0x7470
movl $0x0, -0x157c(%rbp)
movl -0x157c(%rbp), %eax
movq -0x1578(%rbp), %rcx
cmpl 0xce0(%rcx), %eax
jge 0x5cc0
movq -0x1578(%rbp), %rdi
addq $0x30, %rdi
movslq -0x157c(%rbp), %rax
imulq $0xe8, %rax, %rax
addq %rax, %rdi
leaq -0x151a(%rbp), %rsi
addq $0x12, %rsi
callq 0x3b70
cmpl $0x0, %eax
jne 0x5caa
movq -0x1578(%rbp), %rax
addq $0x30, %rax
movslq -0x157c(%rbp), %rcx
imulq $0xe8, %rcx, %rcx
addq %rcx, %rax
movq $0x0, 0xa0(%rax)
movq 0xafd7(%rip), %rcx      # 0x10c10
movq -0x1578(%rbp), %rax
addq $0x30, %rax
movslq -0x157c(%rbp), %rdx
imulq $0xe8, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0xa8(%rax)
movq -0x1578(%rbp), %rax
addq $0x30, %rax
movslq -0x157c(%rbp), %rcx
imulq $0xe8, %rcx, %rcx
addq %rcx, %rax
movl $0x1, 0xe4(%rax)
movq -0x1578(%rbp), %rax
addq $0x30, %rax
movslq -0x157c(%rbp), %rcx
imulq $0xe8, %rcx, %rcx
addq %rcx, %rax
movl $0x0, 0xb0(%rax)
jmp 0x5cc0
jmp 0x5cac
movl -0x157c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x157c(%rbp)
jmp 0x5bbd
movq -0x1578(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x7cd0
jmp 0x5cfd
leaq 0x67ad(%rip), %rdi      # 0xc486
movb $0x0, %al
callq 0x3aa0
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movl %eax, %esi
callq 0x71b0
leaq 0x6627(%rip), %rdi      # 0xc31d
movb $0x0, %al
callq 0x3aa0
jmp 0x5cff
jmp 0x5d01
jmp 0x6167
movzwl -0x150a(%rbp), %esi
leaq 0x6785(%rip), %rdi      # 0xc499
movb $0x0, %al
callq 0x3aa0
leaq -0x151a(%rbp), %rdi
addq $0x12, %rdi
movq -0x20(%rbp), %rsi
movl -0x24(%rbp), %edx
movl $0x1, %ecx
callq 0x7470
leaq 0x6767(%rip), %rdi      # 0xc4a5
movb $0x0, %al
callq 0x3aa0
movq -0x20(%rbp), %rdi
movl -0x24(%rbp), %esi
leaq -0x151a(%rbp), %rdx
movzwl -0x150a(%rbp), %ecx
callq 0x7ec0
jmp 0x6167
leaq 0x6749(%rip), %rdi      # 0xc4b4
movb $0x0, %al
callq 0x3aa0
leaq -0x151a(%rbp), %rdi
addq $0x12, %rdi
movq -0x20(%rbp), %rsi
movl -0x24(%rbp), %edx
movl $0x1, %ecx
callq 0x7470
movzwl -0x3e(%rbp), %esi
leaq 0x6727(%rip), %rdi      # 0xc4c0
movb $0x0, %al
callq 0x3aa0
movq -0x20(%rbp), %rdi
movl -0x24(%rbp), %esi
leaq -0x151a(%rbp), %rdx
movzwl -0x150a(%rbp), %ecx
leaq -0x151a(%rbp), %r8
addq $0x3a, %r8
movzwl -0x3e(%rbp), %r9d
xorl %eax, %eax
xorl %eax, %eax
movl $0x0, (%rsp)
movq $0x0, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movl $0x0, 0x18(%rsp)
callq 0x8150
jmp 0x6167
leaq 0x66e2(%rip), %rdi      # 0xc4dd
movb $0x0, %al
callq 0x3aa0
leaq -0x151a(%rbp), %rdi
addq $0x12, %rdi
movq -0x20(%rbp), %rsi
movl -0x24(%rbp), %edx
movl $0x1, %ecx
callq 0x7470
leaq -0x151a(%rbp), %rdi
addq $0x26, %rdi
leaq 0x6400(%rip), %rsi      # 0xc230
callq 0x3b70
cmpl $0x0, %eax
jne 0x5e74
leaq 0x66a8(%rip), %rdi      # 0xc4e9
movb $0x0, %al
callq 0x3aa0
movq -0x20(%rbp), %rdi
movl -0x24(%rbp), %esi
leaq -0x151a(%rbp), %rdx
movzwl -0x150a(%rbp), %ecx
movl $0xcb, %r8d
leaq 0x66a7(%rip), %r9       # 0xc511
callq 0x83f0
jmp 0x6167
leaq -0x151a(%rbp), %rdi
addq $0x26, %rdi
callq 0x3a50
movq %rax, -0x1588(%rbp)
movq -0x20(%rbp), %rdi
leaq -0x1590(%rbp), %rdx
xorl %esi, %esi
callq 0x86a0
cmpq $0x0, -0x1588(%rbp)
je 0x5f3e
movq -0x1588(%rbp), %rax
cmpl $0x0, 0x14(%rax)
jle 0x5f3e
movq -0x20(%rbp), %rax
movzwl (%rax), %ecx
leaq 0x6454(%rip), %rsi      # 0xc31e
leaq 0x6674(%rip), %rax      # 0xc545
cmpl $0xa, %ecx
cmoveq %rax, %rsi
leaq 0x664e(%rip), %rdi      # 0xc52d
movb $0x0, %al
callq 0x3aa0
movq -0x20(%rbp), %rdi
movl -0x24(%rbp), %esi
leaq -0x151a(%rbp), %rdx
movzwl -0x150a(%rbp), %ecx
leaq -0x151a(%rbp), %r8
addq $0x26, %r8
movzwl -0x3e(%rbp), %r9d
movq -0x20(%rbp), %rax
movzwl (%rax), %r11d
movq -0x1588(%rbp), %r10
leaq -0x1590(%rbp), %rax
movl %r11d, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
movl $0x8, 0x18(%rsp)
callq 0x8150
jmp 0x5fa0
leaq 0x6606(%rip), %rdi      # 0xc54b
movb $0x0, %al
callq 0x3aa0
movq -0x20(%rbp), %rdi
movl -0x24(%rbp), %esi
leaq -0x151a(%rbp), %rdx
movzwl -0x150a(%rbp), %ecx
leaq -0x151a(%rbp), %r8
addq $0x26, %r8
movzwl -0x3e(%rbp), %r9d
leaq -0x1590(%rbp), %rax
xorl %r10d, %r10d
xorl %r10d, %r10d
movl $0x0, (%rsp)
movq $0x0, 0x8(%rsp)
movq %rax, 0x10(%rsp)
movl $0x8, 0x18(%rsp)
callq 0x8150
jmp 0x5fa2
jmp 0x6167
leaq 0x65bb(%rip), %rdi      # 0xc569
movb $0x0, %al
callq 0x3aa0
leaq -0x151a(%rbp), %rdi
addq $0x12, %rdi
movq -0x20(%rbp), %rsi
movl -0x24(%rbp), %edx
movl $0x1, %ecx
callq 0x7470
leaq -0x151a(%rbp), %rdi
addq $0x26, %rdi
leaq 0x624d(%rip), %rsi      # 0xc230
callq 0x3b70
cmpl $0x0, %eax
jne 0x6027
leaq 0x6585(%rip), %rdi      # 0xc579
movb $0x0, %al
callq 0x3aa0
movq -0x20(%rbp), %rdi
movl -0x24(%rbp), %esi
leaq -0x151a(%rbp), %rdx
movzwl -0x150a(%rbp), %ecx
movl $0xcb, %r8d
leaq 0x657e(%rip), %r9       # 0xc59b
callq 0x83f0
jmp 0x6167
leaq -0x151a(%rbp), %rdi
addq $0x52, %rdi
movzwl -0x1448(%rbp), %esi
movq -0x20(%rbp), %rdx
callq 0x8780
cmpl $0x0, %eax
jne 0x6081
leaq 0x656d(%rip), %rdi      # 0xc5bb
movb $0x0, %al
callq 0x3aa0
movq -0x20(%rbp), %rdi
movl -0x24(%rbp), %esi
leaq -0x151a(%rbp), %rdx
movzwl -0x150a(%rbp), %ecx
movl $0xcb, %r8d
leaq 0x6568(%rip), %r9       # 0xc5df
callq 0x83f0
jmp 0x6167
movzwl -0x14ca(%rbp), %eax
cmpl $0x0, %eax
je 0x60da
movq -0x20(%rbp), %rax
movzwl (%rax), %eax
movl %eax, -0x15bc(%rbp)
subl $0x2, %eax
je 0x60ae
jmp 0x60a1
movl -0x15bc(%rbp), %eax
subl $0xa, %eax
je 0x60c4
jmp 0x60d8
movq -0x20(%rbp), %rax
movzwl 0x2(%rax), %edi
callq 0x2100
movw %ax, -0x14cc(%rbp)
jmp 0x60d8
movq -0x20(%rbp), %rax
movzwl 0x2(%rax), %edi
callq 0x2100
movw %ax, -0x14cc(%rbp)
jmp 0x60da
movzwl -0x14cc(%rbp), %eax
cmpl $0x0, %eax
jne 0x6124
movzwl -0x14cc(%rbp), %esi
leaq 0x650a(%rip), %rdi      # 0xc5fe
movb $0x0, %al
callq 0x3aa0
movq -0x20(%rbp), %rdi
movl -0x24(%rbp), %esi
leaq -0x151a(%rbp), %rdx
movzwl -0x150a(%rbp), %ecx
movl $0xcb, %r8d
leaq 0x6508(%rip), %r9       # 0xc625
callq 0x83f0
jmp 0x6167
leaq -0x151a(%rbp), %rdi
addq $0x26, %rdi
movq -0x20(%rbp), %rsi
movzwl -0x14cc(%rbp), %edx
callq 0x8820
leaq 0x6508(%rip), %rdi      # 0xc64e
movb $0x0, %al
callq 0x3aa0
movq -0x20(%rbp), %rdi
movl -0x24(%rbp), %esi
leaq -0x151a(%rbp), %rdx
movzwl -0x150a(%rbp), %ecx
callq 0x8b10
jmp 0x6169
jmp 0x616b
movq 0xaa9e(%rip), %rax      # 0x10c10
cmpq 0xab3f(%rip), %rax      # 0x10cb8
jl 0x6180
callq 0x4ff0
movq 0xaa89(%rip), %rax      # 0x10c10
cmpq 0xab32(%rip), %rax      # 0x10cc0
jl 0x61ba
movq 0xaab9(%rip), %rdi      # 0x10c50
callq 0x5070
movq 0xaab5(%rip), %rdi      # 0x10c58
callq 0x5070
callq 0x8da0
movq -0x38(%rbp), %rdi
movq 0x10(%rbp), %rsi
callq 0x8f50
cmpq $0x0, 0xaa86(%rip)      # 0x10c48
jle 0x62f8
movq 0xaa41(%rip), %rax      # 0x10c10
cmpq 0xaa72(%rip), %rax      # 0x10c48
jl 0x62f8
movq 0xaa25(%rip), %rax      # 0x10c08
movq %rax, -0x1598(%rbp)
cmpq $0x0, -0x1598(%rbp)
je 0x6248
movq -0x1598(%rbp), %rax
cmpl $0x0, 0x28(%rax)
jne 0x6231
movq -0x1598(%rbp), %rax
movq 0x8(%rax), %rax
addq $0x5, %rax
addq $0x1, %rax
cmpq 0xa9f5(%rip), %rax      # 0x10c10
jg 0x6231
movq -0x1598(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq 0x10(%rbp), %rdx
callq 0x3e80
movq -0x1598(%rbp), %rax
movq 0xce8(%rax), %rax
movq %rax, -0x1598(%rbp)
jmp 0x61ea
movq $0x0, 0xa9f5(%rip) # 0x10c48
movq 0xa9ae(%rip), %rax      # 0x10c08
movq %rax, -0x1598(%rbp)
cmpq $0x0, -0x1598(%rbp)
je 0x62f6
movq -0x1598(%rbp), %rax
cmpl $0x0, 0x28(%rax)
jne 0x62dc
movq -0x1598(%rbp), %rax
movq 0x8(%rax), %rax
addq $0xa, %rax
movq %rax, -0x15c8(%rbp)
callq 0x2230
movl $0xa, %ecx
cqto
idivq %rcx
movq -0x15c8(%rbp), %rax
addq %rdx, %rax
movq %rax, -0x15a0(%rbp)
cmpq $0x0, 0xa98e(%rip)      # 0x10c48
je 0x62cc
movq 0xa985(%rip), %rax      # 0x10c48
cmpq -0x15a0(%rbp), %rax
jle 0x62da
movq -0x15a0(%rbp), %rax
movq %rax, 0xa96e(%rip)      # 0x10c48
jmp 0x62dc
movq -0x1598(%rbp), %rax
movq 0xce8(%rax), %rax
movq %rax, -0x1598(%rbp)
jmp 0x6261
jmp 0x62f8
movq 0xa911(%rip), %rax      # 0x10c10
cmpq 0xa98a(%rip), %rax      # 0x10c90
jl 0x641e
movl $0x0, -0x15a4(%rbp)
movl $0x2, %edi
callq 0x9050
orl -0x15a4(%rbp), %eax
movl %eax, -0x15a4(%rbp)
movl $0xa, %edi
callq 0x9050
orl -0x15a4(%rbp), %eax
movl %eax, -0x15a4(%rbp)
cmpl $0x0, -0x15a4(%rbp)
jne 0x63ad
movq 0xa92e(%rip), %rax      # 0x10c80
movq 0xa8b7(%rip), %rcx      # 0x10c10
subq $0x96, %rcx
cmpq %rcx, %rax
jl 0x637b
movl $0x2, %edi
callq 0x9310
orl -0x15a4(%rbp), %eax
movl %eax, -0x15a4(%rbp)
movq 0xa906(%rip), %rax      # 0x10c88
movq 0xa887(%rip), %rcx      # 0x10c10
subq $0x96, %rcx
cmpq %rcx, %rax
jl 0x63ab
movl $0xa, %edi
callq 0x9310
orl -0x15a4(%rbp), %eax
movl %eax, -0x15a4(%rbp)
jmp 0x63ad
cmpl $0x0, -0x15a4(%rbp)
je 0x63ea
movq 0xa853(%rip), %rax      # 0x10c10
addq $0x5, %rax
movq %rax, -0x15d0(%rbp)
callq 0x2230
movl $0xa, %ecx
cqto
idivq %rcx
movq -0x15d0(%rbp), %rax
addq %rdx, %rax
movq %rax, 0xa8a8(%rip)      # 0x10c90
jmp 0x641c
movq 0xa81f(%rip), %rax      # 0x10c10
addq $0x3c, %rax
movq %rax, -0x15d8(%rbp)
callq 0x2230
movl $0x78, %ecx
cqto
idivq %rcx
movq -0x15d8(%rbp), %rax
addq %rdx, %rax
movq %rax, 0xa874(%rip)      # 0x10c90
jmp 0x641e
movq 0xa86b(%rip), %rax      # 0x10c90
cmpq 0xa7e4(%rip), %rax      # 0x10c10
jle 0x6445
movq 0xa85b(%rip), %rcx      # 0x10c90
subq 0xa7d4(%rip), %rcx      # 0x10c10
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
jmp 0x6450
movq -0x30(%rbp), %rax
movq $0x0, (%rax)
cmpq $0x0, 0xa7f0(%rip)      # 0x10c48
jle 0x64aa
movq 0xa7e7(%rip), %rax      # 0x10c48
cmpq 0xa7a8(%rip), %rax      # 0x10c10
jg 0x6477
movq -0x30(%rbp), %rax
movq $0x0, (%rax)
jmp 0x64a8
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq 0xa7c3(%rip), %rcx      # 0x10c48
subq 0xa784(%rip), %rcx      # 0x10c10
cmpq %rcx, %rax
jle 0x64a6
movq 0xa7b0(%rip), %rcx      # 0x10c48
subq 0xa771(%rip), %rcx      # 0x10c10
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
jmp 0x64a8
jmp 0x64aa
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x1600, %rsp           # imm = 0x1600
popq %rbp
retq
nopl (%rax)