// File: /workspace/github_c_makefile_star2_O0/Ziddykins[P]Dawn/src/main.c
// Function: main
int main (int argc, char **argv) {
    //For getops();
    int opt;

    //Default settings for the bot
    //These will be overwritten if a configuration file is found
    //or values are specified on the command line
    char *monsters = "monsters.raw";
    char *port     = "6667";
    char *server   = "irc.dal.net";
    //char *password = "none";
    int mflag, sflag, pflag;
    mflag = sflag = pflag = 0;

    //The bot structure it self
    CALLEXIT(!(dawn = calloc(1, sizeof *dawn)))

    //Initial settings
    strncpy(dawn->nickname, "Dawn-19", MAX_NICK_LENGTH);
    strcpy(dawn->realname, "dongs");
    strcpy(dawn->ident,    "hehe");
    strcpy(dawn->password, "temp");
    strncpy(dawn->active_room, "#stacked", MAX_CHANNEL_LENGTH);

    //Load players
    persistent_load();

    while ((opt = getopt(argc, argv, "hm:n:p:r:s:")) != -1) {
        switch (opt) {
            case 'h': //print help
                print_usage(argv);
                return 0;
            case 'm': //raw monsters file
                CALLEXIT(!(monsters = malloc(strlen(optarg) + 1)))
                strcpy(monsters, optarg);
                mflag = 1;
                break;
            case 'n': //bot's nickname
                strncpy(dawn->nickname, optarg, MAX_NICK_LENGTH-1);
                break;
            case 'p': //server port
                CALLEXIT(!(port = malloc(strlen(optarg) + 1)))
                strcpy(port, optarg);
                pflag = 1;
                break;
            case 'r': //room to join
                dawn->active_room[0] = '#';
                strncpy(dawn->active_room+1, optarg, MAX_CHANNEL_LENGTH-2);
                break;
            case 's': //server to connect to
                CALLEXIT(!(server = malloc(16))) //do we need IPV6 support?
                hostname_to_ip(optarg, server);  //network.c
                sflag = 1;
                break;
            case 'w': //nickserv password
                strncpy(dawn->password, optarg, 64-1);
                break;
            default:
                print_usage(argv);
                return 1;
        }
    }

    FILE *urandom;
    CALLEXIT(!(urandom = fopen("/dev/urandom", "r")))

    unsigned int seed;
    CALLEXIT(!(fread(&seed, sizeof (seed), 1, urandom)))
    srand(seed);
    fclose(urandom);

    FILE *auth_key_file;
    CALLEXIT(!(auth_key_file = fopen("auth_key.txt", "w")))
    CALLEXIT(!(auth_key = calloc(AUTH_KEY_LEN+1, 1)))

    for(size_t i = 0; i < AUTH_KEY_LEN; i++) {
        do {
            auth_key[i] = (char)(rand() % 32);
        } while(auth_key[i] >= 26);

        if (rand()%2) {
            auth_key[i] += 'a';
        } else {
            auth_key[i] += 'A';
        }
    }

    CALLEXIT(!(fwrite(auth_key, AUTH_KEY_LEN, sizeof *auth_key, auth_key_file)))

    fclose(auth_key_file);

    printf(INFO "auth_key: %s\n", auth_key);
    auth_key_valid = 1;

    int match;
    ssize_t len;

    if (access(monsters, F_OK) != -1) {
        FILE *file = fopen(monsters, "r");
        char line[MAX_MESSAGE_BUFFER];
        char name[MAX_MONSTER_LENGTH];
        int count = 0;
        int hp, str, def, intel, mdef, gold, exp, mhp, drop_level;

        if (!file) {
            fprintf(stderr, ERR "Error opening raw monsters\n");
            return 1;
        }
        while (fgets(line, sizeof(line), file)) {
            //TODO: Add ranges to raw files
            if (sscanf(line, "%[^:]:%d:%d:%d:%d:%d:%d:%d:%d:%d",
                    name, &hp, &str, &def, &intel, &mdef, &gold, &exp, &mhp, &drop_level) != 10) {
                fprintf(stderr, ERR "main: Malformed monster file at line %d\n", count);
                return 1;
            }
            strncpy(dawn->monsters[count].name, name, 64);
            dawn->monsters[count].hp         = hp;
            dawn->monsters[count].str        = str;
            dawn->monsters[count].def        = def;
            dawn->monsters[count].intel      = intel;
            dawn->monsters[count].mdef       = mdef;
            dawn->monsters[count].gold       = gold;
            dawn->monsters[count].exp        = exp;
            dawn->monsters[count].mhp        = mhp;
            dawn->monsters[count].drop_level = drop_level;
            dawn->monsters[count].slay_cost  = gold;
            dawn->monsters[count].active     = 0;
            dawn->monsters[count].type       = DEFMON;
            dawn->monsters[count].alignment  = NEUTRAL;
            count++;
        }
        fclose(file);
    }

    dawn->login_sent = 0;
    dawn->in_rooms   = 0;

    init_send_queue();
    init_cmds();

    if (init_connect_server(server, port) == 0) {
        while ((len = recv(con_socket, buffer, MAX_RECV_BUFFER, 0)) != -1) {
            char out[MAX_MESSAGE_BUFFER];
            buffer[len] = '\0';

            //Handle keepalive pings from the server
            if (matches_regex(buffer, "PING :(.*)")) {
                printf("PONG: %s\n", regex_group[1]);
                sprintf(out, "PONG :%s\r\n", regex_group[1]);
                add_msg(out, strlen(out));
            }

            //Connected to the server, send nick/user details
            if (dawn->login_sent == 0) {
                match = matches_regex(buffer, "AUTH") || matches_regex(buffer, "Looking up your hostname...");
                if (match) {
                    printf(INFO "Server checking for AUTH, sending nick/user\n");
                    handle_login(dawn->nickname, dawn->password, dawn->realname, dawn->ident);
                    dawn->login_sent = 1;
                }
            }

            //Nickname is in use, add a random suffix
            if (matches_regex(buffer, ":.*?\\s433\\s*\\s.*")) {
                int rand_suffix = rand() % 10;
                size_t nicklen = strlen(dawn->nickname);

                fprintf(stderr, WARN "Username %s in use\n", dawn->nickname);
                snprintf(dawn->nickname+nicklen, MAX_NICK_LENGTH-nicklen, "%d", rand_suffix);
                handle_login(dawn->nickname, dawn->password, dawn->realname, dawn->ident);
            }


            //If we're logged in and we're received a
            //welcome message, join the rooms
            if (!dawn->in_rooms && dawn->login_sent == 1) {
                match = matches_regex(buffer, ":(.*?)\\s001(.*)");

                if (match) {
                    printf(INFO "Got welcome message from server, joining rooms\n");
                    sprintf(out, "JOIN %s\r\n", dawn->active_room);
                    fluctuate_market();
                    add_msg(out, strlen(out));
                    dawn->in_rooms = 1;
                }
            }

            //Upon joining rooms the bot will search for status 353, which is names, and will
            //iterate through the online people, setting their status to available if they
            //have an account on the bot
            if (dawn->in_rooms) {
                struct Message message;

                //Set lengths based on server rather than assuming
                if (matches_regex(buffer, ":.*?005.*?CHANNELLEN=(\\d+)\\s.*?NICKLEN=(\\d+)")) {
                    MAX_CHANNEL_LENGTH = (unsigned int)strtoul(regex_group[1], 0, 10) + 1;
                    MAX_NICK_LENGTH    = (unsigned int)strtoul(regex_group[2], 0, 10) + 1;
                    dawn->nickname[MAX_NICK_LENGTH] = '\0';
                    dawn->active_room[MAX_CHANNEL_LENGTH] = '\0';
                }

                //Check if user is identified
                if (matches_regex(buffer, ":(.*?)\\s307\\s(.*?)\\s(.*?)\\s:")) {
                    int pindex = get_pindex(regex_group[3]);

                    if (pindex != -1 && (dawn->players[pindex].max_auth > AL_USER || dawn->players[pindex].auth_level > AL_NOAUTH)) {
                        if (dawn->players[pindex].max_auth < AL_REG) { //upgrade
                            dawn->players[pindex].max_auth = AL_REG;
                        }

                        if (dawn->players[pindex].auth_level < dawn->players[pindex].max_auth) {
                            dawn->players[pindex].auth_level = dawn->players[pindex].max_auth;
                            snprintf(out, MAX_MESSAGE_BUFFER, "PRIVMSG %s :%s has been verified. (%s)\r\n",
                                dawn->active_room,
                                dawn->players[pindex].username,
                                auth_level_to_str((enum auth_level)(dawn->players[pindex].auth_level)));
                            add_msg(out, strlen(out));
                        } else {
                            snprintf(out, MAX_MESSAGE_BUFFER, "PRIVMSG %s :%s is already verified. (%s)\r\n",
                                dawn->active_room,
                                dawn->players[pindex].username,
                                auth_level_to_str((enum auth_level)(dawn->players[pindex].auth_level)));
                            add_msg(out, strlen(out));
                        }
                    }
                }

                //NAMES (Status 353)
                //This will split up the received users in the room and set
                //their status availability to 1, stripping their name of status symbols
                //and converting their username to lowercase
                if (matches_regex(buffer, ":(.*?)\\s353\\s(.*?)\\s@\\s(.*?)\\s:(.*)")) {
                    char *ch_ptr;
                    ch_ptr = strtok(regex_group[4], " @&+");
                    while (ch_ptr != NULL) {
                        int index = get_pindex(to_lower(ch_ptr));
                        if (index != -1){
                            dawn->players[index].available = 1;
                            dawn->players[index].auth_level = AL_NOAUTH;
                            sprintf(out, "WHOIS %s\r\n", dawn->players[index].username);
                            add_msg(out, strlen(out));
                        }
                        ch_ptr = strtok(NULL, " @&+\r\n");
                    }
                }

                //Kicks
                if (matches_regex(buffer, ":(.*?)!~?(.*?)@(.*?)\\s(\\w+)\\s(.*?)\\s(.*?)\\s:(.*)")) {
                    if (strcmp(regex_group[4], "KICK") == 0) {
                        int index = get_pindex(to_lower(regex_group[6]));
                        if (index != -1) {
                            dawn->players[index].available = 0;
                            dawn->players[index].auth_level = AL_NOAUTH;
                        }
                    }
                }

                //Nick changes
                if (matches_regex(buffer, ":(.*?)!~?.*?@.*?\\sNICK\\s:(.*?)\r\n")) {
                    int oldindex = get_pindex(to_lower(regex_group[1]));
                    int newindex = get_pindex(to_lower(regex_group[2]));
                    if (oldindex != -1) {
                        dawn->players[oldindex].available = 0;
                        dawn->players[oldindex].auth_level = AL_NOAUTH;
                    }
                    if (newindex != -1) {
                        dawn->players[newindex].available = 1;
                        dawn->players[newindex].auth_level = AL_NOAUTH;
                    }
                }

                //Parting and joining
                if (matches_regex(buffer, ":(.*?)!~?(.*?)@(.*?)\\s(.*?)\\s(.*?)")) {
                    int pindex = get_pindex(to_lower(regex_group[1]));
                    if (pindex != -1) {
                        if (strcmp(regex_group[4], "PART") == 0) {
                            dawn->players[pindex].available = 0;
                            dawn->players[pindex].auth_level = AL_NOAUTH;
                        } else if (strcmp(regex_group[4], "JOIN") == 0) {
                            dawn->players[pindex].available = 1;
                            dawn->players[pindex].auth_level = AL_NOAUTH;
                            sprintf(out, "WHOIS %s\r\n", regex_group[1]);
                            add_msg(out, strlen(out));
                        } else if (strcmp(regex_group[4], "QUIT") == 0) {
                            dawn->players[pindex].available = 0;
                        }
                    }
                    if (dawn->player_count == 0) {
                        struct Message temp;
                        strncpy(temp.sender_nick, dawn->nickname, MAX_NICK_LENGTH);
                        strncpy(temp.sender_hostmask, regex_group[3], MAX_HOSTNAME_LENGTH);
                        init_new_character(&temp);
                    }
                }

                //Regular messages and notices
                if (matches_regex(buffer, ":(.*?)!~?(.*?)@(.*?)\\s(.*?)\\s(.*?)\\s:(.*)\r\n")) {
                    strncpy(message.sender_nick,     to_lower(regex_group[1]), MAX_NICK_LENGTH);
                    strncpy(message.sender_ident,    regex_group[2], MAX_IDENT_LENGTH);
                    strncpy(message.sender_hostmask, regex_group[3], MAX_HOSTNAME_LENGTH);
                    strncpy(message.receiver,        regex_group[5], MAX_NICK_LENGTH);
                    strncpy(message.message,         regex_group[6], MAX_MESSAGE_BUFFER);

                    if (strcmp(regex_group[4], "PRIVMSG") == 0) {
                        if (matches_regex(message.message, CMD_LIT)) {
                            if (message.receiver[0] == '#') {
                                invoke_cmd(0, get_pindex(message.sender_nick), regex_group[0], &message, CMD_EXEC);
                            } else {
                                parse_private_message(&message);
                            }
                        }
                    } else if (strcmp(regex_group[4], "NOTICE") == 0) {
                    //    parse_notice_message(&message);
                    }
                }
            }
            bzero(buffer, MAX_MESSAGE_BUFFER);
        }
    } else {
        perror(ERR "main: Failed to connect");
        close(con_socket);
        return 1;
    }

    if (len != -1) {
        close(con_socket);
    }

    if (sflag) {
         free(server);
    }

    if (pflag) {
        free(port);
    }

    if (mflag) {
        free(monsters);
    }

    free_msg_hist_list();
    free_msg_list();
    free_event_list();
    free_cmds();
    free_map();
    free(dawn);

    if (auth_key_valid || auth_key) {
        free(auth_key);
    }

    printf(INFO "Program exiting normally [%s]\n", timestamp());

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x16e8, %rsp           # imm = 0x16E8
movl $0x0, -0x1c(%rbp)
movl %edi, -0x20(%rbp)
movq %rsi, -0x28(%rbp)
leaq 0x1204f(%rip), %rax     # 0x1d7a4
movq %rax, -0x38(%rbp)
leaq 0x12051(%rip), %rax     # 0x1d7b1
movq %rax, -0x40(%rbp)
leaq 0x1204b(%rip), %rax     # 0x1d7b6
movq %rax, -0x48(%rbp)
movl $0x0, -0x54(%rbp)
movl $0x0, -0x50(%rbp)
movl $0x0, -0x4c(%rbp)
movl $0x1, %edi
movl $0xf2eb8, %esi          # imm = 0xF2EB8
callq 0x2110
leaq 0x1d2d6(%rip), %rcx     # 0x28a70
movq %rax, (%rcx)
cmpq $0x0, %rax
jne 0xb7b9
leaq 0x12018(%rip), %rdi     # 0x1d7c2
callq 0x2190
movl $0x1, %edi
callq 0x2260
leaq 0x1d2b0(%rip), %rax     # 0x28a70
movq (%rax), %rdi
movl 0x1aa93(%rip), %eax     # 0x2625c
movl %eax, %edx
leaq 0x12034(%rip), %rsi     # 0x1d806
callq 0x20e0
leaq 0x1d292(%rip), %rax     # 0x28a70
movq (%rax), %rdi
addq $0x40, %rdi
leaq 0x12022(%rip), %rsi     # 0x1d80e
callq 0x21c0
leaq 0x1d278(%rip), %rax     # 0x28a70
movq (%rax), %rdi
addq $0x80, %rdi
leaq 0x1200b(%rip), %rsi     # 0x1d814
callq 0x21c0
leaq 0x1d25b(%rip), %rax     # 0x28a70
movq (%rax), %rdi
addq $0xc0, %rdi
leaq 0x11ff3(%rip), %rsi     # 0x1d819
callq 0x21c0
leaq 0x1d23e(%rip), %rax     # 0x28a70
movq (%rax), %rdi
addq $0x100, %rdi            # imm = 0x100
movl 0x1aa16(%rip), %eax     # 0x26258
movl %eax, %edx
leaq 0x11fd3(%rip), %rsi     # 0x1d81e
callq 0x20e0
callq 0x13b70
movl -0x20(%rbp), %edi
movq -0x28(%rbp), %rsi
leaq 0x11fc4(%rip), %rdx     # 0x1d827
callq 0x2060
movl %eax, -0x2c(%rbp)
cmpl $-0x1, %eax
je 0xba65
movl -0x2c(%rbp), %eax
addl $-0x68, %eax
movl %eax, %ecx
movq %rcx, -0x1660(%rbp)
subl $0xf, %eax
ja 0xba4b
movq -0x1660(%rbp), %rax
leaq 0x11eca(%rip), %rcx     # 0x1d764
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x28(%rbp), %rdi
callq 0xcef0
movl $0x0, -0x1c(%rbp)
jmp 0xced8
movq 0x1a709(%rip), %rax     # 0x25fc8
movq (%rax), %rdi
callq 0x20c0
movq %rax, %rdi
addq $0x1, %rdi
callq 0x22b0
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
jne 0xb8f3
leaq 0x11f4f(%rip), %rdi     # 0x1d833
callq 0x2190
movl $0x1, %edi
callq 0x2260
movq -0x38(%rbp), %rdi
movq 0x1a6ca(%rip), %rax     # 0x25fc8
movq (%rax), %rsi
callq 0x21c0
movl $0x1, -0x4c(%rbp)
jmp 0xba60
leaq 0x1d157(%rip), %rax     # 0x28a70
movq (%rax), %rdi
movq 0x1a6a5(%rip), %rax     # 0x25fc8
movq (%rax), %rsi
movl 0x1a930(%rip), %eax     # 0x2625c
subl $0x1, %eax
movl %eax, %eax
movl %eax, %edx
callq 0x20e0
jmp 0xba60
movq 0x1a684(%rip), %rax     # 0x25fc8
movq (%rax), %rdi
callq 0x20c0
movq %rax, %rdi
addq $0x1, %rdi
callq 0x22b0
movq %rax, -0x40(%rbp)
cmpq $0x0, %rax
jne 0xb978
leaq 0x11f15(%rip), %rdi     # 0x1d87e
callq 0x2190
movl $0x1, %edi
callq 0x2260
movq -0x40(%rbp), %rdi
movq 0x1a645(%rip), %rax     # 0x25fc8
movq (%rax), %rsi
callq 0x21c0
movl $0x1, -0x54(%rbp)
jmp 0xba60
leaq 0x1d0d2(%rip), %rax     # 0x28a70
movq (%rax), %rax
movb $0x23, 0x100(%rax)
leaq 0x1d0c1(%rip), %rax     # 0x28a70
movq (%rax), %rdi
addq $0x100, %rdi            # imm = 0x100
addq $0x1, %rdi
movq 0x1a604(%rip), %rax     # 0x25fc8
movq (%rax), %rsi
movl 0x1a88b(%rip), %eax     # 0x26258
subl $0x2, %eax
movl %eax, %eax
movl %eax, %edx
callq 0x20e0
jmp 0xba60
movl $0x10, %edi
callq 0x22b0
movq %rax, -0x48(%rbp)
cmpq $0x0, %rax
jne 0xba08
leaq 0x11ecc(%rip), %rdi     # 0x1d8c5
callq 0x2190
movl $0x1, %edi
callq 0x2260
movq 0x1a5b9(%rip), %rax     # 0x25fc8
movq (%rax), %rdi
movq -0x48(%rbp), %rsi
callq 0x12bf0
movl $0x1, -0x50(%rbp)
jmp 0xba60
leaq 0x1d045(%rip), %rax     # 0x28a70
movq (%rax), %rdi
addq $0xc0, %rdi
movq 0x1a58c(%rip), %rax     # 0x25fc8
movq (%rax), %rsi
movl $0x3f, %edx
callq 0x20e0
jmp 0xba60
movq -0x28(%rbp), %rdi
callq 0xcef0
movl $0x1, -0x1c(%rbp)
jmp 0xced8
jmp 0xb855
leaq 0x11e92(%rip), %rdi     # 0x1d8fe
leaq 0x1193c(%rip), %rsi     # 0x1d3af
callq 0x2230
movq %rax, -0x60(%rbp)
cmpq $0x0, %rax
jne 0xba98
leaq 0x11e82(%rip), %rdi     # 0x1d90b
callq 0x2190
movl $0x1, %edi
callq 0x2260
movq -0x60(%rbp), %rcx
leaq -0x64(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0x2320
cmpq $0x0, %rax
jne 0xbacb
leaq 0x11e99(%rip), %rdi     # 0x1d955
callq 0x2190
movl $0x1, %edi
callq 0x2260
movl -0x64(%rbp), %edi
callq 0x21d0
movq -0x60(%rbp), %rdi
callq 0x21f0
leaq 0x11ebf(%rip), %rdi     # 0x1d9a2
leaq 0x11cc5(%rip), %rsi     # 0x1d7af
callq 0x2230
movq %rax, -0x70(%rbp)
cmpq $0x0, %rax
jne 0xbb0f
leaq 0x11eaf(%rip), %rdi     # 0x1d9af
callq 0x2190
movl $0x1, %edi
callq 0x2260
movl $0x19, %edi
movl $0x1, %esi
callq 0x2110
movq %rax, 0x1a753(%rip)     # 0x26278
cmpq $0x0, %rax
jne 0xbb41
leaq 0x11ecd(%rip), %rdi     # 0x1d9ff
callq 0x2190
movl $0x1, %edi
callq 0x2260
movq $0x0, -0x78(%rbp)
cmpq $0x18, -0x78(%rbp)
jae 0xbbd6
jmp 0xbb56
callq 0x2080
movl $0x20, %ecx
cltd
idivl %ecx
movq 0x1a70e(%rip), %rax     # 0x26278
movq -0x78(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq 0x1a700(%rip), %rax     # 0x26278
movq -0x78(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x1a, %eax
jge 0xbb56
callq 0x2080
movl $0x2, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
je 0xbbae
movq 0x1a6da(%rip), %rax     # 0x26278
movq -0x78(%rbp), %rcx
movsbl (%rax,%rcx), %edx
addl $0x61, %edx
movb %dl, (%rax,%rcx)
jmp 0xbbc3
movq 0x1a6c3(%rip), %rax     # 0x26278
movq -0x78(%rbp), %rcx
movsbl (%rax,%rcx), %edx
addl $0x41, %edx
movb %dl, (%rax,%rcx)
jmp 0xbbc5
movq -0x78(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x78(%rbp)
jmp 0xbb49
movq 0x1a69b(%rip), %rdi     # 0x26278
movq -0x70(%rbp), %rcx
movl $0x18, %esi
movl $0x1, %edx
callq 0x2470
cmpq $0x0, %rax
jne 0xbc0c
leaq 0x11e4c(%rip), %rdi     # 0x1da49
callq 0x2190
movl $0x1, %edi
callq 0x2260
movq -0x70(%rbp), %rdi
callq 0x21f0
movq 0x1a65c(%rip), %rsi     # 0x26278
leaq 0x11e8c(%rip), %rdi     # 0x1daaf
movb $0x0, %al
callq 0x2040
leaq 0x1a63f(%rip), %rax     # 0x26270
movl $0x1, (%rax)
movq -0x38(%rbp), %rdi
xorl %esi, %esi
callq 0x23c0
cmpl $-0x1, %eax
je 0xbfaa
movq -0x38(%rbp), %rdi
leaq 0x11759(%rip), %rsi     # 0x1d3af
callq 0x2230
movq %rax, -0x90(%rbp)
movl $0x0, -0x264(%rbp)
cmpq $0x0, -0x90(%rbp)
jne 0xbc9a
movq 0x1a363(%rip), %rax     # 0x25fe0
movq (%rax), %rdi
leaq 0x11e49(%rip), %rsi     # 0x1dad0
movb $0x0, %al
callq 0x2310
movl $0x1, -0x1c(%rbp)
jmp 0xced8
jmp 0xbc9c
leaq -0x220(%rbp), %rdi
movq -0x90(%rbp), %rdx
movl $0x190, %esi            # imm = 0x190
callq 0x2380
cmpq $0x0, %rax
je 0xbf9e
leaq -0x220(%rbp), %rdi
leaq -0x260(%rbp), %rdx
leaq 0x11e2c(%rip), %rsi     # 0x1daff
leaq -0x268(%rbp), %rcx
leaq -0x26c(%rbp), %r8
leaq -0x270(%rbp), %r9
leaq -0x274(%rbp), %r15
leaq -0x278(%rbp), %r14
leaq -0x27c(%rbp), %rbx
leaq -0x280(%rbp), %r11
leaq -0x284(%rbp), %r10
leaq -0x288(%rbp), %rax
movq %r15, (%rsp)
movq %r14, 0x8(%rsp)
movq %rbx, 0x10(%rsp)
movq %r11, 0x18(%rsp)
movq %r10, 0x20(%rsp)
movq %rax, 0x28(%rsp)
movb $0x0, %al
callq 0x21e0
cmpl $0xa, %eax
je 0xbd65
movq 0x1a29e(%rip), %rax     # 0x25fe0
movq (%rax), %rdi
movl -0x264(%rbp), %edx
leaq 0x11dce(%rip), %rsi     # 0x1db20
movb $0x0, %al
callq 0x2310
movl $0x1, -0x1c(%rbp)
jmp 0xced8
leaq 0x1cd04(%rip), %rax     # 0x28a70
movq (%rax), %rdi
addq $0xf1b40, %rdi          # imm = 0xF1B40
movslq -0x264(%rbp), %rax
imulq $0x78, %rax, %rax
addq %rax, %rdi
leaq -0x260(%rbp), %rsi
movl $0x40, %edx
callq 0x20e0
movl -0x268(%rbp), %ecx
leaq 0x1ccce(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0xf1b40, %rax          # imm = 0xF1B40
movslq -0x264(%rbp), %rdx
imulq $0x78, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x40(%rax)
movl -0x26c(%rbp), %ecx
leaq 0x1cca7(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0xf1b40, %rax          # imm = 0xF1B40
movslq -0x264(%rbp), %rdx
imulq $0x78, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x4c(%rax)
movl -0x270(%rbp), %ecx
leaq 0x1cc80(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0xf1b40, %rax          # imm = 0xF1B40
movslq -0x264(%rbp), %rdx
imulq $0x78, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x48(%rax)
movl -0x274(%rbp), %ecx
leaq 0x1cc59(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0xf1b40, %rax          # imm = 0xF1B40
movslq -0x264(%rbp), %rdx
imulq $0x78, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x50(%rax)
movl -0x278(%rbp), %ecx
leaq 0x1cc32(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0xf1b40, %rax          # imm = 0xF1B40
movslq -0x264(%rbp), %rdx
imulq $0x78, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x54(%rax)
movl -0x27c(%rbp), %ecx
leaq 0x1cc0b(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0xf1b40, %rax          # imm = 0xF1B40
movslq -0x264(%rbp), %rdx
imulq $0x78, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x58(%rax)
movl -0x280(%rbp), %ecx
leaq 0x1cbe4(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0xf1b40, %rax          # imm = 0xF1B40
movslq -0x264(%rbp), %rdx
imulq $0x78, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x5c(%rax)
movl -0x284(%rbp), %ecx
leaq 0x1cbbd(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0xf1b40, %rax          # imm = 0xF1B40
movslq -0x264(%rbp), %rdx
imulq $0x78, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x44(%rax)
movl -0x288(%rbp), %ecx
leaq 0x1cb96(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0xf1b40, %rax          # imm = 0xF1B40
movslq -0x264(%rbp), %rdx
imulq $0x78, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x60(%rax)
movl -0x27c(%rbp), %ecx
leaq 0x1cb6f(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0xf1b40, %rax          # imm = 0xF1B40
movslq -0x264(%rbp), %rdx
imulq $0x78, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x68(%rax)
leaq 0x1cb4e(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0xf1b40, %rax          # imm = 0xF1B40
movslq -0x264(%rbp), %rcx
imulq $0x78, %rcx, %rcx
addq %rcx, %rax
movl $0x0, 0x64(%rax)
leaq 0x1cb29(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0xf1b40, %rax          # imm = 0xF1B40
movslq -0x264(%rbp), %rcx
imulq $0x78, %rcx, %rcx
addq %rcx, %rax
movl $0x5, 0x70(%rax)
leaq 0x1cb04(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0xf1b40, %rax          # imm = 0xF1B40
movslq -0x264(%rbp), %rcx
imulq $0x78, %rcx, %rcx
addq %rcx, %rax
movl $0x2, 0x74(%rax)
movl -0x264(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x264(%rbp)
jmp 0xbc9c
movq -0x90(%rbp), %rdi
callq 0x21f0
leaq 0x1cabf(%rip), %rax     # 0x28a70
movq (%rax), %rax
movl $0x0, 0x140(%rax)
leaq 0x1caab(%rip), %rax     # 0x28a70
movq (%rax), %rax
movl $0x0, 0x144(%rax)
callq 0x123c0
callq 0x54f0
movq -0x48(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x124c0
cmpl $0x0, %eax
jne 0xce06
jmp 0xbff4
leaq 0x1a2b5(%rip), %rax     # 0x262b0
movl (%rax), %edi
leaq 0x1a2bc(%rip), %rsi     # 0x262c0
movl $0x1000, %edx           # imm = 0x1000
xorl %ecx, %ecx
callq 0x20a0
movq %rax, -0x88(%rbp)
cmpq $-0x1, %rax
je 0xce04
movq -0x88(%rbp), %rcx
leaq 0x1a291(%rip), %rax     # 0x262c0
movb $0x0, (%rax,%rcx)
leaq 0x1a286(%rip), %rdi     # 0x262c0
leaq 0x11b1b(%rip), %rsi     # 0x1db5c
callq 0x13090
cmpl $0x0, %eax
je 0xc0b3
leaq 0x11b15(%rip), %rdi     # 0x1db67
leaq 0x1b277(%rip), %rsi     # 0x272d0
addq $0x190, %rsi            # imm = 0x190
movb $0x0, %al
callq 0x2040
leaq -0x420(%rbp), %rdi
leaq 0x11afc(%rip), %rsi     # 0x1db71
leaq 0x1b254(%rip), %rdx     # 0x272d0
addq $0x190, %rdx            # imm = 0x190
movb $0x0, %al
callq 0x2050
leaq -0x420(%rbp), %rax
movq %rax, -0x1668(%rbp)
leaq -0x420(%rbp), %rdi
callq 0x20c0
movq -0x1668(%rbp), %rdi
movq %rax, %rsi
callq 0x12840
leaq 0x1c9b6(%rip), %rax     # 0x28a70
movq (%rax), %rax
cmpl $0x0, 0x140(%rax)
jne 0xc182
leaq 0x1a1ef(%rip), %rdi     # 0x262c0
leaq 0x14c30(%rip), %rsi     # 0x20d08
callq 0x13090
movl %eax, %ecx
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, -0x1669(%rbp)
jne 0xc10b
leaq 0x1a1cd(%rip), %rdi     # 0x262c0
leaq 0x11a82(%rip), %rsi     # 0x1db7c
callq 0x13090
cmpl $0x0, %eax
setne %al
movb %al, -0x1669(%rbp)
movb -0x1669(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x7c(%rbp)
cmpl $0x0, -0x7c(%rbp)
je 0xc180
leaq 0x11a72(%rip), %rdi     # 0x1db98
movb $0x0, %al
callq 0x2040
leaq 0x1c93c(%rip), %rax     # 0x28a70
movq (%rax), %rdi
leaq 0x1c932(%rip), %rax     # 0x28a70
movq (%rax), %rsi
addq $0xc0, %rsi
leaq 0x1c921(%rip), %rax     # 0x28a70
movq (%rax), %rdx
addq $0x40, %rdx
leaq 0x1c913(%rip), %rax     # 0x28a70
movq (%rax), %rcx
addq $0x80, %rcx
callq 0x13270
leaq 0x1c8fd(%rip), %rax     # 0x28a70
movq (%rax), %rax
movl $0x1, 0x140(%rax)
jmp 0xc182
leaq 0x1a137(%rip), %rdi     # 0x262c0
leaq 0x11a48(%rip), %rsi     # 0x1dbd8
callq 0x13090
cmpl $0x0, %eax
je 0xc25c
callq 0x2080
movl $0xa, %ecx
cltd
idivl %ecx
movl %edx, -0x424(%rbp)
leaq 0x1c8b8(%rip), %rax     # 0x28a70
movq (%rax), %rdi
callq 0x20c0
movq %rax, -0x430(%rbp)
movq 0x19e12(%rip), %rax     # 0x25fe0
movq (%rax), %rdi
leaq 0x1c898(%rip), %rax     # 0x28a70
movq (%rax), %rdx
leaq 0x11a07(%rip), %rsi     # 0x1dbe9
movb $0x0, %al
callq 0x2310
leaq 0x1c880(%rip), %rax     # 0x28a70
movq (%rax), %rdi
addq -0x430(%rbp), %rdi
movl 0x1a05c(%rip), %eax     # 0x2625c
movl %eax, %esi
subq -0x430(%rbp), %rsi
movl -0x424(%rbp), %ecx
leaq 0x10ff1(%rip), %rdx     # 0x1d207
movb $0x0, %al
callq 0x2390
leaq 0x1c84c(%rip), %rax     # 0x28a70
movq (%rax), %rdi
leaq 0x1c842(%rip), %rax     # 0x28a70
movq (%rax), %rsi
addq $0xc0, %rsi
leaq 0x1c831(%rip), %rax     # 0x28a70
movq (%rax), %rdx
addq $0x40, %rdx
leaq 0x1c823(%rip), %rax     # 0x28a70
movq (%rax), %rcx
addq $0x80, %rcx
callq 0x13270
leaq 0x1c80d(%rip), %rax     # 0x28a70
movq (%rax), %rax
cmpl $0x0, 0x144(%rax)
jne 0xc31e
leaq 0x1c7f6(%rip), %rax     # 0x28a70
movq (%rax), %rax
cmpl $0x1, 0x140(%rax)
jne 0xc31e
leaq 0x1a02f(%rip), %rdi     # 0x262c0
leaq 0x11978(%rip), %rsi     # 0x1dc10
callq 0x13090
movl %eax, -0x7c(%rbp)
cmpl $0x0, -0x7c(%rbp)
je 0xc31c
leaq 0x11973(%rip), %rdi     # 0x1dc20
movb $0x0, %al
callq 0x2040
leaq -0x420(%rbp), %rdi
leaq 0x1c7ae(%rip), %rax     # 0x28a70
movq (%rax), %rdx
addq $0x100, %rdx            # imm = 0x100
leaq 0x11990(%rip), %rsi     # 0x1dc63
movb $0x0, %al
callq 0x2050
callq 0xfbd0
leaq -0x420(%rbp), %rax
movq %rax, -0x1678(%rbp)
leaq -0x420(%rbp), %rdi
callq 0x20c0
movq -0x1678(%rbp), %rdi
movq %rax, %rsi
callq 0x12840
leaq 0x1c761(%rip), %rax     # 0x28a70
movq (%rax), %rax
movl $0x1, 0x144(%rax)
jmp 0xc31e
leaq 0x1c74b(%rip), %rax     # 0x28a70
movq (%rax), %rax
cmpl $0x0, 0x144(%rax)
je 0xcdec
leaq 0x19f84(%rip), %rdi     # 0x262c0
leaq 0x1192a(%rip), %rsi     # 0x1dc6d
callq 0x13090
cmpl $0x0, %eax
je 0xc3c3
leaq 0x1af7c(%rip), %rdi     # 0x272d0
addq $0x190, %rdi            # imm = 0x190
xorl %eax, %eax
movl %eax, %esi
movl $0xa, %edx
callq 0x2090
addl $0x1, %eax
movl %eax, 0x19ee6(%rip)     # 0x26258
leaq 0x1af57(%rip), %rdi     # 0x272d0
addq $0x320, %rdi            # imm = 0x320
xorl %eax, %eax
movl %eax, %esi
movl $0xa, %edx
callq 0x2090
addl $0x1, %eax
movl %eax, 0x19ec5(%rip)     # 0x2625c
leaq 0x1c6d2(%rip), %rax     # 0x28a70
movq (%rax), %rax
movl 0x19eb5(%rip), %ecx     # 0x2625c
movb $0x0, (%rax,%rcx)
leaq 0x1c6be(%rip), %rax     # 0x28a70
movq (%rax), %rax
movl 0x19e9d(%rip), %ecx     # 0x26258
movb $0x0, 0x100(%rax,%rcx)
leaq 0x19ef6(%rip), %rdi     # 0x262c0
leaq 0x118c9(%rip), %rsi     # 0x1dc9a
callq 0x13090
cmpl $0x0, %eax
je 0xc704
leaq 0x1aeea(%rip), %rdi     # 0x272d0
addq $0x4b0, %rdi            # imm = 0x4B0
callq 0x13ba0
movl %eax, -0xd34(%rbp)
cmpl $-0x1, -0xd34(%rbp)
je 0xc702
leaq 0x1c664(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0xd34(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
movzbl 0x26a1(%rax), %eax
cmpl $0x1, %eax
jg 0xc463
leaq 0x1c637(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0xd34(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
movzbl 0x26a0(%rax), %eax
cmpl $0x0, %eax
jle 0xc702
leaq 0x1c606(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0xd34(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
movzbl 0x26a1(%rax), %eax
cmpl $0x2, %eax
jge 0xc4b8
leaq 0x1c5d9(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0xd34(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
movb $0x2, 0x26a1(%rax)
leaq 0x1c5b1(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0xd34(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
movzbl 0x26a0(%rax), %eax
leaq 0x1c589(%rip), %rcx     # 0x28a70
movq (%rcx), %rcx
addq $0x1a0, %rcx            # imm = 0x1A0
movslq -0xd34(%rbp), %rdx
imulq $0x26a8, %rdx, %rdx     # imm = 0x26A8
addq %rdx, %rcx
movzbl 0x26a1(%rcx), %ecx
cmpl %ecx, %eax
jge 0xc632
leaq 0x1c558(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0xd34(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
movb 0x26a1(%rax), %cl
leaq 0x1c531(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0xd34(%rbp), %rdx
imulq $0x26a8, %rdx, %rdx     # imm = 0x26A8
addq %rdx, %rax
movb %cl, 0x26a0(%rax)
leaq -0x420(%rbp), %rax
movq %rax, -0x1698(%rbp)
leaq 0x1c4fc(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x100, %rax            # imm = 0x100
movq %rax, -0x1690(%rbp)
leaq 0x1c4e5(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0xd34(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
movq %rax, -0x1688(%rbp)
leaq 0x1c4bd(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0xd34(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
movzbl 0x26a0(%rax), %edi
callq 0x15110
movq -0x1698(%rbp), %rdi
movq -0x1690(%rbp), %rcx
movq -0x1688(%rbp), %r8
movq %rax, %r9
movl $0x190, %esi            # imm = 0x190
leaq 0xf3c3(%rip), %rdx      # 0x1b9c0
movb $0x0, %al
callq 0x2390
leaq -0x420(%rbp), %rax
movq %rax, -0x1680(%rbp)
leaq -0x420(%rbp), %rdi
callq 0x20c0
movq -0x1680(%rbp), %rdi
movq %rax, %rsi
callq 0x12840
jmp 0xc700
leaq -0x420(%rbp), %rax
movq %rax, -0x16b8(%rbp)
leaq 0x1c429(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x100, %rax            # imm = 0x100
movq %rax, -0x16b0(%rbp)
leaq 0x1c412(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0xd34(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
movq %rax, -0x16a8(%rbp)
leaq 0x1c3ea(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0xd34(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
movzbl 0x26a0(%rax), %edi
callq 0x15110
movq -0x16b8(%rbp), %rdi
movq -0x16b0(%rbp), %rcx
movq -0x16a8(%rbp), %r8
movq %rax, %r9
movl $0x190, %esi            # imm = 0x190
leaq 0x115e7(%rip), %rdx     # 0x1dcb7
movb $0x0, %al
callq 0x2390
leaq -0x420(%rbp), %rax
movq %rax, -0x16a0(%rbp)
leaq -0x420(%rbp), %rdi
callq 0x20c0
movq -0x16a0(%rbp), %rdi
movq %rax, %rsi
callq 0x12840
jmp 0xc702
jmp 0xc704
leaq 0x19bb5(%rip), %rdi     # 0x262c0
leaq 0x115d0(%rip), %rsi     # 0x1dce2
callq 0x13090
cmpl $0x0, %eax
je 0xc847
leaq 0x1aba9(%rip), %rdi     # 0x272d0
addq $0x640, %rdi            # imm = 0x640
leaq 0x115d1(%rip), %rsi     # 0x1dd06
callq 0x2370
movq %rax, -0xd40(%rbp)
cmpq $0x0, -0xd40(%rbp)
je 0xc845
movq -0xd40(%rbp), %rdi
callq 0x12d60
movq %rax, %rdi
callq 0x13ba0
movl %eax, -0xd44(%rbp)
cmpl $-0x1, -0xd44(%rbp)
je 0xc829
leaq 0x1c2f3(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0xd44(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
movl $0x1, 0x2664(%rax)
leaq 0x1c2c8(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0xd44(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
movb $0x0, 0x26a0(%rax)
leaq -0x420(%rbp), %rdi
leaq 0x1c299(%rip), %rax     # 0x28a70
movq (%rax), %rdx
addq $0x1a0, %rdx            # imm = 0x1A0
movslq -0xd44(%rbp), %rax
imulq $0x26a8, %rax, %rax     # imm = 0x26A8
addq %rax, %rdx
leaq 0xf135(%rip), %rsi      # 0x1b92e
movb $0x0, %al
callq 0x2050
leaq -0x420(%rbp), %rax
movq %rax, -0x16c0(%rbp)
leaq -0x420(%rbp), %rdi
callq 0x20c0
movq -0x16c0(%rbp), %rdi
movq %rax, %rsi
callq 0x12840
xorl %eax, %eax
movl %eax, %edi
leaq 0x114d7(%rip), %rsi     # 0x1dd0b
callq 0x2370
movq %rax, -0xd40(%rbp)
jmp 0xc741
jmp 0xc847
leaq 0x19a72(%rip), %rdi     # 0x262c0
leaq 0x114bd(%rip), %rsi     # 0x1dd12
callq 0x13090
cmpl $0x0, %eax
je 0xc903
leaq 0x1aa66(%rip), %rdi     # 0x272d0
addq $0x640, %rdi            # imm = 0x640
leaq 0x114cb(%rip), %rsi     # 0x1dd43
callq 0x22d0
cmpl $0x0, %eax
jne 0xc901
leaq 0x1aa47(%rip), %rdi     # 0x272d0
addq $0x960, %rdi            # imm = 0x960
callq 0x12d60
movq %rax, %rdi
callq 0x13ba0
movl %eax, -0xd48(%rbp)
cmpl $-0x1, -0xd48(%rbp)
je 0xc8ff
leaq 0x1c1bd(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0xd48(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
movl $0x0, 0x2664(%rax)
leaq 0x1c192(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0xd48(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
movb $0x0, 0x26a0(%rax)
jmp 0xc901
jmp 0xc903
leaq 0x199b6(%rip), %rdi     # 0x262c0
leaq 0x11437(%rip), %rsi     # 0x1dd48
callq 0x13090
cmpl $0x0, %eax
je 0xca1b
leaq 0x1a9aa(%rip), %rdi     # 0x272d0
addq $0x190, %rdi            # imm = 0x190
callq 0x12d60
movq %rax, %rdi
callq 0x13ba0
movl %eax, -0xd4c(%rbp)
leaq 0x1a989(%rip), %rdi     # 0x272d0
addq $0x320, %rdi            # imm = 0x320
callq 0x12d60
movq %rax, %rdi
callq 0x13ba0
movl %eax, -0xd50(%rbp)
cmpl $-0x1, -0xd4c(%rbp)
je 0xc9bd
leaq 0x1c0ff(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0xd4c(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
movl $0x0, 0x2664(%rax)
leaq 0x1c0d4(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0xd4c(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
movb $0x0, 0x26a0(%rax)
cmpl $-0x1, -0xd50(%rbp)
je 0xca19
leaq 0x1c0a3(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0xd50(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
movl $0x1, 0x2664(%rax)
leaq 0x1c078(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0xd50(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
movb $0x0, 0x26a0(%rax)
jmp 0xca1b
leaq 0x1989e(%rip), %rdi     # 0x262c0
leaq 0x11340(%rip), %rsi     # 0x1dd69
callq 0x13090
cmpl $0x0, %eax
je 0xcc55
leaq 0x1a892(%rip), %rdi     # 0x272d0
addq $0x190, %rdi            # imm = 0x190
callq 0x12d60
movq %rax, %rdi
callq 0x13ba0
movl %eax, -0xd54(%rbp)
cmpl $-0x1, -0xd54(%rbp)
je 0xcbf0
leaq 0x1a864(%rip), %rdi     # 0x272d0
addq $0x640, %rdi            # imm = 0x640
leaq 0x11312(%rip), %rsi     # 0x1dd8c
callq 0x22d0
cmpl $0x0, %eax
jne 0xcadc
leaq 0x1bfe5(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0xd54(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
movl $0x0, 0x2664(%rax)
leaq 0x1bfba(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0xd54(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
movb $0x0, 0x26a0(%rax)
jmp 0xcbee
leaq 0x1a7ed(%rip), %rdi     # 0x272d0
addq $0x640, %rdi            # imm = 0x640
leaq 0x112a0(%rip), %rsi     # 0x1dd91
callq 0x22d0
cmpl $0x0, %eax
jne 0xcba0
leaq 0x1bf6a(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0xd54(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
movl $0x1, 0x2664(%rax)
leaq 0x1bf3f(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0xd54(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
movb $0x0, 0x26a0(%rax)
leaq -0x420(%rbp), %rdi
leaq 0xedce(%rip), %rsi      # 0x1b92e
leaq 0x1a769(%rip), %rdx     # 0x272d0
addq $0x190, %rdx            # imm = 0x190
movb $0x0, %al
callq 0x2050
leaq -0x420(%rbp), %rax
movq %rax, -0x16c8(%rbp)
leaq -0x420(%rbp), %rdi
callq 0x20c0
movq -0x16c8(%rbp), %rdi
movq %rax, %rsi
callq 0x12840
jmp 0xcbec
leaq 0x1a729(%rip), %rdi     # 0x272d0
addq $0x640, %rdi            # imm = 0x640
leaq 0x111e1(%rip), %rsi     # 0x1dd96
callq 0x22d0
cmpl $0x0, %eax
jne 0xcbea
leaq 0x1beaa(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0xd54(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
movl $0x0, 0x2664(%rax)
jmp 0xcbec
jmp 0xcbee
jmp 0xcbf0
leaq 0x1be79(%rip), %rax     # 0x28a70
movq (%rax), %rax
cmpl $0x0, 0x148(%rax)
jne 0xcc53
leaq -0x1654(%rbp), %rdi
leaq 0x1be5f(%rip), %rax     # 0x28a70
movq (%rax), %rsi
movl 0x19642(%rip), %eax     # 0x2625c
movl %eax, %edx
callq 0x20e0
leaq -0x1654(%rbp), %rdi
addq $0x80, %rdi
leaq 0x1a69a(%rip), %rsi     # 0x272d0
addq $0x4b0, %rsi            # imm = 0x4B0
movl $0x3f, %edx
callq 0x20e0
leaq -0x1654(%rbp), %rdi
callq 0x13cc0
jmp 0xcc55
leaq 0x19664(%rip), %rdi     # 0x262c0
leaq 0x11138(%rip), %rsi     # 0x1dd9b
callq 0x13090
cmpl $0x0, %eax
je 0xcdea
leaq -0xd30(%rbp), %rax
movq %rax, -0x16d0(%rbp)
leaq 0x1a64a(%rip), %rdi     # 0x272d0
addq $0x190, %rdi            # imm = 0x190
callq 0x12d60
movq -0x16d0(%rbp), %rdi
movq %rax, %rsi
movl 0x195ba(%rip), %eax     # 0x2625c
movl %eax, %edx
callq 0x20e0
leaq -0xd30(%rbp), %rdi
addq $0x40, %rdi
leaq 0x1a615(%rip), %rsi     # 0x272d0
addq $0x320, %rsi            # imm = 0x320
movl $0xa, %edx
callq 0x20e0
leaq -0xd30(%rbp), %rdi
addq $0x80, %rdi
leaq 0x1a5ef(%rip), %rsi     # 0x272d0
addq $0x4b0, %rsi            # imm = 0x4B0
movl $0x3f, %edx
callq 0x20e0
leaq -0xd30(%rbp), %rdi
addq $0xc0, %rdi
movl 0x19556(%rip), %eax     # 0x2625c
movl %eax, %edx
leaq 0x1a5c1(%rip), %rsi     # 0x272d0
addq $0x7d0, %rsi            # imm = 0x7D0
callq 0x20e0
leaq -0xd30(%rbp), %rdi
addq $0x100, %rdi            # imm = 0x100
leaq 0x1a5a0(%rip), %rsi     # 0x272d0
addq $0x960, %rsi            # imm = 0x960
movl $0x190, %edx            # imm = 0x190
callq 0x20e0
leaq 0x1a588(%rip), %rdi     # 0x272d0
addq $0x640, %rdi            # imm = 0x640
leaq 0x11071(%rip), %rsi     # 0x1ddc7
callq 0x22d0
cmpl $0x0, %eax
jne 0xcdc5
leaq -0xd30(%rbp), %rdi
addq $0x100, %rdi            # imm = 0x100
leaq 0xec94(%rip), %rsi      # 0x1ba09
callq 0x13090
cmpl $0x0, %eax
je 0xcdc3
movsbl -0xc70(%rbp), %eax
cmpl $0x23, %eax
jne 0xcdb5
leaq -0xd30(%rbp), %rdi
callq 0x13ba0
movl %eax, %esi
xorl %eax, %eax
movl %eax, %edi
leaq 0x1a52c(%rip), %rdx     # 0x272d0
leaq -0xd30(%rbp), %rcx
xorl %r8d, %r8d
callq 0x40c0
jmp 0xcdc1
leaq -0xd30(%rbp), %rdi
callq 0x13320
jmp 0xcdc3
jmp 0xcde8
leaq 0x1a504(%rip), %rdi     # 0x272d0
addq $0x640, %rdi            # imm = 0x640
leaq 0x10ff5(%rip), %rsi     # 0x1ddcf
callq 0x22d0
cmpl $0x0, %eax
jne 0xcde6
jmp 0xcde6
jmp 0xcde8
jmp 0xcdea
jmp 0xcdec
leaq 0x194cd(%rip), %rdi     # 0x262c0
xorl %esi, %esi
movl $0x190, %edx            # imm = 0x190
callq 0x20f0
jmp 0xbff4
jmp 0xce2c
leaq 0x10fc9(%rip), %rdi     # 0x1ddd6
callq 0x2190
leaq 0x19497(%rip), %rax     # 0x262b0
movl (%rax), %edi
callq 0x2480
movl $0x1, -0x1c(%rbp)
jmp 0xced8
cmpq $-0x1, -0x88(%rbp)
je 0xce44
leaq 0x19473(%rip), %rax     # 0x262b0
movl (%rax), %edi
callq 0x2480
cmpl $0x0, -0x50(%rbp)
je 0xce53
movq -0x48(%rbp), %rdi
callq 0x2240
cmpl $0x0, -0x54(%rbp)
je 0xce62
movq -0x40(%rbp), %rdi
callq 0x2240
cmpl $0x0, -0x4c(%rbp)
je 0xce71
movq -0x38(%rbp), %rdi
callq 0x2240
callq 0x12630
callq 0x127c0
callq 0x175c0
callq 0x87c0
callq 0xeb40
leaq 0x1bbdf(%rip), %rax     # 0x28a70
movq (%rax), %rdi
callq 0x2240
leaq 0x193d0(%rip), %rax     # 0x26270
cmpl $0x0, (%rax)
jne 0xceaf
cmpq $0x0, 0x193cb(%rip)     # 0x26278
je 0xcebb
movq 0x193c2(%rip), %rdi     # 0x26278
callq 0x2240
callq 0xcf80
movq %rax, %rsi
leaq 0x10f37(%rip), %rdi     # 0x1de01
movb $0x0, %al
callq 0x2040
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
addq $0x16e8, %rsp           # imm = 0x16E8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)