// File: adamiaonr[P]rid-analytics/src/run-analysis.cpp
// Function: main
int main (int argc, char **argv) {

    // parse the arguments with an ArgvParser
    ArgvParser * cmds = create_argv_parser();

    // .scn config file path
    char scn_file[MAX_ARRAY_SIZE];
    // dir where all .csv files with output data will be saved
    char data_dir[MAX_ARRAY_SIZE];
    // output file name for this run
    char output_label[MAX_ARRAY_SIZE];
    // // verbose mode (no verbosity by default)
    // bool verbose = false;
    // evaluation parameters
    // request size (also largest possible |F|) in # of URL parameters
    int request_size = 0;       
    // bloom filter size (in bit)
    int bf_size = 0;
    // codes for mode:
    //  - bits 0 and 1 : resolution type:
    //      - 0 (00) : AML forwarding or flood
    //      - 1 (01) : RML forwarding or 'random link'
    //      - 2 (10) : 'hard fallback'
    //      - 3 (11) : 'soft fallback'
    //  - bit 2 : resolution on/off:
    //      - 0 : OFF
    //      - 1 : ON
    //
    // note : if mode is 00 and resolution is on, we 
    //        use feedback resolution (i.e. go back to source, then origin server)
    int mode = 0;
    // origin server location. default is '1'
    char origin_server[MAX_ARRAY_SIZE];
    strncpy(origin_server, "1", MAX_ARRAY_SIZE);
    // start router id. default is '0'
    char start_router[MAX_ARRAY_SIZE];
    strncpy(start_router, "0", MAX_ARRAY_SIZE);

    // parse() takes the arguments to main() and parses them according to 
    // ArgvParser rules
    int result = cmds->parse(argc, argv);

    // if something went wrong: show help option
    if (result != ArgvParser::NoParserError) {

        fprintf(stderr, "%s\n", cmds->parseErrorDescription(result).c_str());

        if (result != ArgvParser::ParserHelpRequested) {
            fprintf(stderr, "use option -h for help.\n");
        }

        delete cmds;
        return -1;

    } else {

        // otherwise, check for the different OPTION_
        if (cmds->foundOption(OPTION_SCN_FILE)) {

            strncpy(scn_file, (char *) cmds->optionValue(OPTION_SCN_FILE).c_str(), MAX_ARRAY_SIZE);
            
        } else {

            fprintf(stderr, "no .scn file path specified. use "\
                "option -h for help.\n");

            delete cmds;
            return -1;
        }

        if (cmds->foundOption(OPTION_DATA_DIR)) {

            strncpy(data_dir, (char *) cmds->optionValue(OPTION_DATA_DIR).c_str(), MAX_ARRAY_SIZE);
        
        } else {

            fprintf(stderr, "no data directory path specified. use "\
                "option -h for help.\n");

            delete cmds;
            return -1;
        }

        if (cmds->foundOption(OPTION_OUTPUT_LABEL)) {

            strncpy(output_label, (char *) cmds->optionValue(OPTION_OUTPUT_LABEL).c_str(), MAX_ARRAY_SIZE);

        } else {

            fprintf(stderr, "no output .csv file name specified. use "\
                "option -h for help.\n");

            delete cmds;
            return -1;
        }

        if (cmds->foundOption(OPTION_BF_SIZE)) {

            bf_size = std::stoi(cmds->optionValue(OPTION_BF_SIZE));   
        }

        if (cmds->foundOption(OPTION_REQUEST_SIZE)) {

            request_size = std::stoi(cmds->optionValue(OPTION_REQUEST_SIZE));
        }

        if (cmds->foundOption(OPTION_MM_MODE)) {

            mode = std::stoi(cmds->optionValue(OPTION_MM_MODE));
        }

        // incorrect delivery resolution mode
        if (cmds->foundOption(OPTION_RESOLV_MODE)) {
            int resolv = std::stoi(cmds->optionValue(OPTION_RESOLV_MODE));
            // left-shift the resolv bits by 3 and OR-it to mode
            mode |= (resolv << 2);
        }

        if (cmds->foundOption(OPTION_ORIGIN_SERVER)) {

            strncpy(origin_server, (char *) cmds->optionValue(OPTION_ORIGIN_SERVER).c_str(), MAX_ARRAY_SIZE);
        }

        if (cmds->foundOption(OPTION_START_ROUTER)) {

            strncpy(start_router, (char *) cmds->optionValue(OPTION_START_ROUTER).c_str(), MAX_ARRAY_SIZE);
        }

        // if (cmds->foundOption(OPTION_VERBOSE)) {
        //     verbose = true;
        // }
    }

    printf("rid-analytics : request_size = %d, bf_size = %d\n", request_size, bf_size);

    if (result == ArgvParser::ParserHelpRequested) {

        delete cmds;
        return -1;
    }

    // create an rid model environment (according to the specs on nw_filename)
    RID_Analytics * rid_analytics_env = 
        new RID_Analytics(
            std::string(scn_file),          // .scn file w/ topology info
            request_size, bf_size,          // parameters for FP rate calculation
            std::string(origin_server),     // origin server location: useful for latency
            mode,                           // how to handle (1) multiple matches; and (2) wrong deliveries
            std::string(data_dir), std::string(output_label));

    // ... and run the model
    rid_analytics_env->run(std::string(scn_file), std::string(start_router));
    printf("rid-analytics : output dir = %s, output label = %s\n", data_dir, output_label);

    // clean up after yourself...
    delete rid_analytics_env;
    delete cmds;

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xca0, %rsp            # imm = 0xCA0
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
callq 0x2e040
movq %rax, -0x18(%rbp)
movl $0x0, -0x324(%rbp)
movl $0x0, -0x328(%rbp)
movl $0x0, -0x32c(%rbp)
leaq -0x430(%rbp), %rdi
leaq 0x32eef(%rip), %rsi     # 0x61bad
movl $0x100, %edx            # imm = 0x100
callq 0x5270
leaq -0x530(%rbp), %rdi
leaq 0x30978(%rip), %rsi     # 0x5f64e
movl $0x100, %edx            # imm = 0x100
callq 0x5270
movq -0x18(%rbp), %rdi
movl -0x8(%rbp), %esi
movq -0x10(%rbp), %rdx
callq 0x3ff40
movl %eax, -0x534(%rbp)
cmpl $0x0, -0x534(%rbp)
je 0x2edb5
movq 0x532be(%rip), %rax     # 0x81fc8
movq (%rax), %rax
movq %rax, -0xa58(%rbp)
movq -0x18(%rbp), %rsi
movl -0x534(%rbp), %edx
leaq -0x558(%rbp), %rdi
callq 0x42160
leaq -0x558(%rbp), %rdi
callq 0x51d0
movq -0xa58(%rbp), %rdi
movq %rax, %rdx
leaq 0x3468f(%rip), %rsi     # 0x633d6
movb $0x0, %al
callq 0x5780
leaq -0x558(%rbp), %rdi
callq 0x52f0
cmpl $0x32, -0x534(%rbp)
je 0x2ed7b
movq 0x5325e(%rip), %rax     # 0x81fc8
movq (%rax), %rdi
leaq 0x345e8(%rip), %rsi     # 0x6335c
movb $0x0, %al
callq 0x5780
movq -0x18(%rbp), %rax
movq %rax, -0xa60(%rbp)
cmpq $0x0, %rax
je 0x2eda9
movq -0xa60(%rbp), %rdi
callq 0x3fbd0
movq -0xa60(%rbp), %rdi
movl $0x158, %esi            # imm = 0x158
callq 0x54b0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x302fd
movq -0x18(%rbp), %rax
movq %rax, -0xa70(%rbp)
leaq -0x579(%rbp), %rdi
movq %rdi, -0xa68(%rbp)
callq 0x5930
movq -0xa68(%rbp), %rdx
leaq 0x34263(%rip), %rsi     # 0x63044
leaq -0x578(%rbp), %rdi
callq 0x30320
jmp 0x2edef
movq -0xa70(%rbp), %rdi
leaq -0x578(%rbp), %rsi
callq 0x3fdd0
movb %al, -0xa71(%rbp)
jmp 0x2ee0a
leaq -0x578(%rbp), %rdi
callq 0x52f0
leaq -0x579(%rbp), %rdi
callq 0x5510
movb -0xa71(%rbp), %al
testb $0x1, %al
jne 0x2ee31
jmp 0x2ef64
leaq -0x120(%rbp), %rax
movq %rax, -0xa90(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0xa88(%rbp)
leaq -0x5d1(%rbp), %rdi
movq %rdi, -0xa80(%rbp)
callq 0x5930
movq -0xa80(%rbp), %rdx
leaq 0x341d9(%rip), %rsi     # 0x63044
leaq -0x5d0(%rbp), %rdi
callq 0x30320
jmp 0x2ee79
movq -0xa88(%rbp), %rsi
leaq -0x5b0(%rbp), %rdi
leaq -0x5d0(%rbp), %rdx
callq 0x3fe50
jmp 0x2ee95
leaq -0x5b0(%rbp), %rdi
callq 0x51d0
movq -0xa90(%rbp), %rdi
movq %rax, %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x5270
leaq -0x5b0(%rbp), %rdi
callq 0x52f0
leaq -0x5d0(%rbp), %rdi
callq 0x52f0
leaq -0x5d1(%rbp), %rdi
callq 0x5510
jmp 0x2efb6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x588(%rbp)
movl %eax, -0x58c(%rbp)
jmp 0x2ef10
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x588(%rbp)
movl %eax, -0x58c(%rbp)
leaq -0x578(%rbp), %rdi
callq 0x52f0
leaq -0x579(%rbp), %rdi
callq 0x5510
jmp 0x30309
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x588(%rbp)
movl %eax, -0x58c(%rbp)
jmp 0x2ef53
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x588(%rbp)
movl %eax, -0x58c(%rbp)
leaq -0x5d0(%rbp), %rdi
callq 0x52f0
leaq -0x5d1(%rbp), %rdi
callq 0x5510
jmp 0x30309
movq 0x5305d(%rip), %rax     # 0x81fc8
movq (%rax), %rdi
leaq 0x34352(%rip), %rsi     # 0x632c7
movb $0x0, %al
callq 0x5780
movq -0x18(%rbp), %rax
movq %rax, -0xa98(%rbp)
cmpq $0x0, %rax
je 0x2efaa
movq -0xa98(%rbp), %rdi
callq 0x3fbd0
movq -0xa98(%rbp), %rdi
movl $0x158, %esi            # imm = 0x158
callq 0x54b0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x302fd
movq -0x18(%rbp), %rax
movq %rax, -0xaa8(%rbp)
leaq -0x5f9(%rbp), %rdi
movq %rdi, -0xaa0(%rbp)
callq 0x5930
movq -0xaa0(%rbp), %rdx
leaq 0x3409d(%rip), %rsi     # 0x6307f
leaq -0x5f8(%rbp), %rdi
callq 0x30320
jmp 0x2eff0
movq -0xaa8(%rbp), %rdi
leaq -0x5f8(%rbp), %rsi
callq 0x3fdd0
movb %al, -0xaa9(%rbp)
jmp 0x2f00b
leaq -0x5f8(%rbp), %rdi
callq 0x52f0
leaq -0x5f9(%rbp), %rdi
callq 0x5510
movb -0xaa9(%rbp), %al
testb $0x1, %al
jne 0x2f032
jmp 0x2f165
leaq -0x220(%rbp), %rax
movq %rax, -0xac8(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0xac0(%rbp)
leaq -0x641(%rbp), %rdi
movq %rdi, -0xab8(%rbp)
callq 0x5930
movq -0xab8(%rbp), %rdx
leaq 0x34013(%rip), %rsi     # 0x6307f
leaq -0x640(%rbp), %rdi
callq 0x30320
jmp 0x2f07a
movq -0xac0(%rbp), %rsi
leaq -0x620(%rbp), %rdi
leaq -0x640(%rbp), %rdx
callq 0x3fe50
jmp 0x2f096
leaq -0x620(%rbp), %rdi
callq 0x51d0
movq -0xac8(%rbp), %rdi
movq %rax, %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x5270
leaq -0x620(%rbp), %rdi
callq 0x52f0
leaq -0x640(%rbp), %rdi
callq 0x52f0
leaq -0x641(%rbp), %rdi
callq 0x5510
jmp 0x2f1b7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x588(%rbp)
movl %eax, -0x58c(%rbp)
jmp 0x2f111
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x588(%rbp)
movl %eax, -0x58c(%rbp)
leaq -0x5f8(%rbp), %rdi
callq 0x52f0
leaq -0x5f9(%rbp), %rdi
callq 0x5510
jmp 0x30309
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x588(%rbp)
movl %eax, -0x58c(%rbp)
jmp 0x2f154
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x588(%rbp)
movl %eax, -0x58c(%rbp)
leaq -0x640(%rbp), %rdi
callq 0x52f0
leaq -0x641(%rbp), %rdi
callq 0x5510
jmp 0x30309
movq 0x52e5c(%rip), %rax     # 0x81fc8
movq (%rax), %rdi
leaq 0x34187(%rip), %rsi     # 0x632fd
movb $0x0, %al
callq 0x5780
movq -0x18(%rbp), %rax
movq %rax, -0xad0(%rbp)
cmpq $0x0, %rax
je 0x2f1ab
movq -0xad0(%rbp), %rdi
callq 0x3fbd0
movq -0xad0(%rbp), %rdi
movl $0x158, %esi            # imm = 0x158
callq 0x54b0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x302fd
movq -0x18(%rbp), %rax
movq %rax, -0xae0(%rbp)
leaq -0x669(%rbp), %rdi
movq %rdi, -0xad8(%rbp)
callq 0x5930
movq -0xad8(%rbp), %rdx
leaq 0x33ede(%rip), %rsi     # 0x630c1
leaq -0x668(%rbp), %rdi
callq 0x30320
jmp 0x2f1f1
movq -0xae0(%rbp), %rdi
leaq -0x668(%rbp), %rsi
callq 0x3fdd0
movb %al, -0xae1(%rbp)
jmp 0x2f20c
leaq -0x668(%rbp), %rdi
callq 0x52f0
leaq -0x669(%rbp), %rdi
callq 0x5510
movb -0xae1(%rbp), %al
testb $0x1, %al
jne 0x2f233
jmp 0x2f366
leaq -0x320(%rbp), %rax
movq %rax, -0xb00(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0xaf8(%rbp)
leaq -0x6b1(%rbp), %rdi
movq %rdi, -0xaf0(%rbp)
callq 0x5930
movq -0xaf0(%rbp), %rdx
leaq 0x33e54(%rip), %rsi     # 0x630c1
leaq -0x6b0(%rbp), %rdi
callq 0x30320
jmp 0x2f27b
movq -0xaf8(%rbp), %rsi
leaq -0x690(%rbp), %rdi
leaq -0x6b0(%rbp), %rdx
callq 0x3fe50
jmp 0x2f297
leaq -0x690(%rbp), %rdi
callq 0x51d0
movq -0xb00(%rbp), %rdi
movq %rax, %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x5270
leaq -0x690(%rbp), %rdi
callq 0x52f0
leaq -0x6b0(%rbp), %rdi
callq 0x52f0
leaq -0x6b1(%rbp), %rdi
callq 0x5510
jmp 0x2f3b8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x588(%rbp)
movl %eax, -0x58c(%rbp)
jmp 0x2f312
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x588(%rbp)
movl %eax, -0x58c(%rbp)
leaq -0x668(%rbp), %rdi
callq 0x52f0
leaq -0x669(%rbp), %rdi
callq 0x5510
jmp 0x30309
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x588(%rbp)
movl %eax, -0x58c(%rbp)
jmp 0x2f355
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x588(%rbp)
movl %eax, -0x58c(%rbp)
leaq -0x6b0(%rbp), %rdi
callq 0x52f0
leaq -0x6b1(%rbp), %rdi
callq 0x5510
jmp 0x30309
movq 0x52c5b(%rip), %rax     # 0x81fc8
movq (%rax), %rdi
leaq 0x33fc1(%rip), %rsi     # 0x63338
movb $0x0, %al
callq 0x5780
movq -0x18(%rbp), %rax
movq %rax, -0xb08(%rbp)
cmpq $0x0, %rax
je 0x2f3ac
movq -0xb08(%rbp), %rdi
callq 0x3fbd0
movq -0xb08(%rbp), %rdi
movl $0x158, %esi            # imm = 0x158
callq 0x54b0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x302fd
movq -0x18(%rbp), %rax
movq %rax, -0xb18(%rbp)
leaq -0x6d9(%rbp), %rdi
movq %rdi, -0xb10(%rbp)
callq 0x5930
movq -0xb10(%rbp), %rdx
leaq 0x33d2c(%rip), %rsi     # 0x63110
leaq -0x6d8(%rbp), %rdi
callq 0x30320
jmp 0x2f3f2
movq -0xb18(%rbp), %rdi
leaq -0x6d8(%rbp), %rsi
callq 0x3fdd0
movb %al, -0xb19(%rbp)
jmp 0x2f40d
leaq -0x6d8(%rbp), %rdi
callq 0x52f0
leaq -0x6d9(%rbp), %rdi
callq 0x5510
movb -0xb19(%rbp), %al
testb $0x1, %al
jne 0x2f434
jmp 0x2f582
movq -0x18(%rbp), %rax
movq %rax, -0xb30(%rbp)
leaq -0x721(%rbp), %rdi
movq %rdi, -0xb28(%rbp)
callq 0x5930
movq -0xb28(%rbp), %rdx
leaq 0x33cb0(%rip), %rsi     # 0x63110
leaq -0x720(%rbp), %rdi
callq 0x30320
jmp 0x2f46e
movq -0xb30(%rbp), %rsi
leaq -0x700(%rbp), %rdi
leaq -0x720(%rbp), %rdx
callq 0x3fe50
jmp 0x2f48a
xorl %eax, %eax
movl %eax, %esi
leaq -0x700(%rbp), %rdi
movl $0xa, %edx
callq 0x303d0
movl %eax, -0xb34(%rbp)
jmp 0x2f4a7
movl -0xb34(%rbp), %eax
movl %eax, -0x328(%rbp)
leaq -0x700(%rbp), %rdi
callq 0x52f0
leaq -0x720(%rbp), %rdi
callq 0x52f0
leaq -0x721(%rbp), %rdi
callq 0x5510
jmp 0x2f582
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x588(%rbp)
movl %eax, -0x58c(%rbp)
jmp 0x2f50e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x588(%rbp)
movl %eax, -0x58c(%rbp)
leaq -0x6d8(%rbp), %rdi
callq 0x52f0
leaq -0x6d9(%rbp), %rdi
callq 0x5510
jmp 0x30309
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x588(%rbp)
movl %eax, -0x58c(%rbp)
jmp 0x2f571
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x588(%rbp)
movl %eax, -0x58c(%rbp)
jmp 0x2f565
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x588(%rbp)
movl %eax, -0x58c(%rbp)
leaq -0x700(%rbp), %rdi
callq 0x52f0
leaq -0x720(%rbp), %rdi
callq 0x52f0
leaq -0x721(%rbp), %rdi
callq 0x5510
jmp 0x30309
movq -0x18(%rbp), %rax
movq %rax, -0xb48(%rbp)
leaq -0x749(%rbp), %rdi
movq %rdi, -0xb40(%rbp)
callq 0x5930
movq -0xb40(%rbp), %rdx
leaq 0x33b89(%rip), %rsi     # 0x63137
leaq -0x748(%rbp), %rdi
callq 0x30320
jmp 0x2f5bc
movq -0xb48(%rbp), %rdi
leaq -0x748(%rbp), %rsi
callq 0x3fdd0
movb %al, -0xb49(%rbp)
jmp 0x2f5d7
leaq -0x748(%rbp), %rdi
callq 0x52f0
leaq -0x749(%rbp), %rdi
callq 0x5510
movb -0xb49(%rbp), %al
testb $0x1, %al
jne 0x2f5fe
jmp 0x2f74c
movq -0x18(%rbp), %rax
movq %rax, -0xb60(%rbp)
leaq -0x791(%rbp), %rdi
movq %rdi, -0xb58(%rbp)
callq 0x5930
movq -0xb58(%rbp), %rdx
leaq 0x33b0d(%rip), %rsi     # 0x63137
leaq -0x790(%rbp), %rdi
callq 0x30320
jmp 0x2f638
movq -0xb60(%rbp), %rsi
leaq -0x770(%rbp), %rdi
leaq -0x790(%rbp), %rdx
callq 0x3fe50
jmp 0x2f654
xorl %eax, %eax
movl %eax, %esi
leaq -0x770(%rbp), %rdi
movl $0xa, %edx
callq 0x303d0
movl %eax, -0xb64(%rbp)
jmp 0x2f671
movl -0xb64(%rbp), %eax
movl %eax, -0x324(%rbp)
leaq -0x770(%rbp), %rdi
callq 0x52f0
leaq -0x790(%rbp), %rdi
callq 0x52f0
leaq -0x791(%rbp), %rdi
callq 0x5510
jmp 0x2f74c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x588(%rbp)
movl %eax, -0x58c(%rbp)
jmp 0x2f6d8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x588(%rbp)
movl %eax, -0x58c(%rbp)
leaq -0x748(%rbp), %rdi
callq 0x52f0
leaq -0x749(%rbp), %rdi
callq 0x5510
jmp 0x30309
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x588(%rbp)
movl %eax, -0x58c(%rbp)
jmp 0x2f73b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x588(%rbp)
movl %eax, -0x58c(%rbp)
jmp 0x2f72f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x588(%rbp)
movl %eax, -0x58c(%rbp)
leaq -0x770(%rbp), %rdi
callq 0x52f0
leaq -0x790(%rbp), %rdi
callq 0x52f0
leaq -0x791(%rbp), %rdi
callq 0x5510
jmp 0x30309
movq -0x18(%rbp), %rax
movq %rax, -0xb78(%rbp)
leaq -0x7b9(%rbp), %rdi
movq %rdi, -0xb70(%rbp)
callq 0x5930
movq -0xb70(%rbp), %rdx
leaq 0x339f4(%rip), %rsi     # 0x6316c
leaq -0x7b8(%rbp), %rdi
callq 0x30320
jmp 0x2f786
movq -0xb78(%rbp), %rdi
leaq -0x7b8(%rbp), %rsi
callq 0x3fdd0
movb %al, -0xb79(%rbp)
jmp 0x2f7a1
leaq -0x7b8(%rbp), %rdi
callq 0x52f0
leaq -0x7b9(%rbp), %rdi
callq 0x5510
movb -0xb79(%rbp), %al
testb $0x1, %al
jne 0x2f7c8
jmp 0x2f916
movq -0x18(%rbp), %rax
movq %rax, -0xb90(%rbp)
leaq -0x801(%rbp), %rdi
movq %rdi, -0xb88(%rbp)
callq 0x5930
movq -0xb88(%rbp), %rdx
leaq 0x33978(%rip), %rsi     # 0x6316c
leaq -0x800(%rbp), %rdi
callq 0x30320
jmp 0x2f802
movq -0xb90(%rbp), %rsi
leaq -0x7e0(%rbp), %rdi
leaq -0x800(%rbp), %rdx
callq 0x3fe50
jmp 0x2f81e
xorl %eax, %eax
movl %eax, %esi
leaq -0x7e0(%rbp), %rdi
movl $0xa, %edx
callq 0x303d0
movl %eax, -0xb94(%rbp)
jmp 0x2f83b
movl -0xb94(%rbp), %eax
movl %eax, -0x32c(%rbp)
leaq -0x7e0(%rbp), %rdi
callq 0x52f0
leaq -0x800(%rbp), %rdi
callq 0x52f0
leaq -0x801(%rbp), %rdi
callq 0x5510
jmp 0x2f916
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x588(%rbp)
movl %eax, -0x58c(%rbp)
jmp 0x2f8a2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x588(%rbp)
movl %eax, -0x58c(%rbp)
leaq -0x7b8(%rbp), %rdi
callq 0x52f0
leaq -0x7b9(%rbp), %rdi
callq 0x5510
jmp 0x30309
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x588(%rbp)
movl %eax, -0x58c(%rbp)
jmp 0x2f905
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x588(%rbp)
movl %eax, -0x58c(%rbp)
jmp 0x2f8f9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x588(%rbp)
movl %eax, -0x58c(%rbp)
leaq -0x7e0(%rbp), %rdi
callq 0x52f0
leaq -0x800(%rbp), %rdi
callq 0x52f0
leaq -0x801(%rbp), %rdi
callq 0x5510
jmp 0x30309
movq -0x18(%rbp), %rax
movq %rax, -0xba8(%rbp)
leaq -0x829(%rbp), %rdi
movq %rdi, -0xba0(%rbp)
callq 0x5930
movq -0xba0(%rbp), %rdx
leaq 0x338b5(%rip), %rsi     # 0x631f7
leaq -0x828(%rbp), %rdi
callq 0x30320
jmp 0x2f950
movq -0xba8(%rbp), %rdi
leaq -0x828(%rbp), %rsi
callq 0x3fdd0
movb %al, -0xba9(%rbp)
jmp 0x2f96b
leaq -0x828(%rbp), %rdi
callq 0x52f0
leaq -0x829(%rbp), %rdi
callq 0x5510
movb -0xba9(%rbp), %al
testb $0x1, %al
jne 0x2f992
jmp 0x2faf5
movq -0x18(%rbp), %rax
movq %rax, -0xbc0(%rbp)
leaq -0x871(%rbp), %rdi
movq %rdi, -0xbb8(%rbp)
callq 0x5930
movq -0xbb8(%rbp), %rdx
leaq 0x33839(%rip), %rsi     # 0x631f7
leaq -0x870(%rbp), %rdi
callq 0x30320
jmp 0x2f9cc
movq -0xbc0(%rbp), %rsi
leaq -0x850(%rbp), %rdi
leaq -0x870(%rbp), %rdx
callq 0x3fe50
jmp 0x2f9e8
xorl %eax, %eax
movl %eax, %esi
leaq -0x850(%rbp), %rdi
movl $0xa, %edx
callq 0x303d0
movl %eax, -0xbc4(%rbp)
jmp 0x2fa05
leaq -0x850(%rbp), %rdi
callq 0x52f0
leaq -0x870(%rbp), %rdi
callq 0x52f0
leaq -0x871(%rbp), %rdi
callq 0x5510
movl -0xbc4(%rbp), %eax
movl %eax, -0x830(%rbp)
movl -0x830(%rbp), %eax
shll $0x2, %eax
orl -0x32c(%rbp), %eax
movl %eax, -0x32c(%rbp)
jmp 0x2faf5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x588(%rbp)
movl %eax, -0x58c(%rbp)
jmp 0x2fa81
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x588(%rbp)
movl %eax, -0x58c(%rbp)
leaq -0x828(%rbp), %rdi
callq 0x52f0
leaq -0x829(%rbp), %rdi
callq 0x5510
jmp 0x30309
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x588(%rbp)
movl %eax, -0x58c(%rbp)
jmp 0x2fae4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x588(%rbp)
movl %eax, -0x58c(%rbp)
jmp 0x2fad8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x588(%rbp)
movl %eax, -0x58c(%rbp)
leaq -0x850(%rbp), %rdi
callq 0x52f0
leaq -0x870(%rbp), %rdi
callq 0x52f0
leaq -0x871(%rbp), %rdi
callq 0x5510
jmp 0x30309
movq -0x18(%rbp), %rax
movq %rax, -0xbd8(%rbp)
leaq -0x899(%rbp), %rdi
movq %rdi, -0xbd0(%rbp)
callq 0x5930
movq -0xbd0(%rbp), %rdx
leaq 0x3373f(%rip), %rsi     # 0x63260
leaq -0x898(%rbp), %rdi
callq 0x30320
jmp 0x2fb2f
movq -0xbd8(%rbp), %rdi
leaq -0x898(%rbp), %rsi
callq 0x3fdd0
movb %al, -0xbd9(%rbp)
jmp 0x2fb4a
leaq -0x898(%rbp), %rdi
callq 0x52f0
leaq -0x899(%rbp), %rdi
callq 0x5510
movb -0xbd9(%rbp), %al
testb $0x1, %al
jne 0x2fb71
jmp 0x2fca4
leaq -0x430(%rbp), %rax
movq %rax, -0xbf8(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0xbf0(%rbp)
leaq -0x8e1(%rbp), %rdi
movq %rdi, -0xbe8(%rbp)
callq 0x5930
movq -0xbe8(%rbp), %rdx
leaq 0x336b5(%rip), %rsi     # 0x63260
leaq -0x8e0(%rbp), %rdi
callq 0x30320
jmp 0x2fbb9
movq -0xbf0(%rbp), %rsi
leaq -0x8c0(%rbp), %rdi
leaq -0x8e0(%rbp), %rdx
callq 0x3fe50
jmp 0x2fbd5
leaq -0x8c0(%rbp), %rdi
callq 0x51d0
movq -0xbf8(%rbp), %rdi
movq %rax, %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x5270
leaq -0x8c0(%rbp), %rdi
callq 0x52f0
leaq -0x8e0(%rbp), %rdi
callq 0x52f0
leaq -0x8e1(%rbp), %rdi
callq 0x5510
jmp 0x2fca4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x588(%rbp)
movl %eax, -0x58c(%rbp)
jmp 0x2fc50
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x588(%rbp)
movl %eax, -0x58c(%rbp)
leaq -0x898(%rbp), %rdi
callq 0x52f0
leaq -0x899(%rbp), %rdi
callq 0x5510
jmp 0x30309
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x588(%rbp)
movl %eax, -0x58c(%rbp)
jmp 0x2fc93
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x588(%rbp)
movl %eax, -0x58c(%rbp)
leaq -0x8e0(%rbp), %rdi
callq 0x52f0
leaq -0x8e1(%rbp), %rdi
callq 0x5510
jmp 0x30309
movq -0x18(%rbp), %rax
movq %rax, -0xc08(%rbp)
leaq -0x909(%rbp), %rdi
movq %rdi, -0xc00(%rbp)
callq 0x5930
movq -0xc00(%rbp), %rdx
leaq 0x335c3(%rip), %rsi     # 0x63293
leaq -0x908(%rbp), %rdi
callq 0x30320
jmp 0x2fcde
movq -0xc08(%rbp), %rdi
leaq -0x908(%rbp), %rsi
callq 0x3fdd0
movb %al, -0xc09(%rbp)
jmp 0x2fcf9
leaq -0x908(%rbp), %rdi
callq 0x52f0
leaq -0x909(%rbp), %rdi
callq 0x5510
movb -0xc09(%rbp), %al
testb $0x1, %al
jne 0x2fd20
jmp 0x2fe53
leaq -0x530(%rbp), %rax
movq %rax, -0xc28(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0xc20(%rbp)
leaq -0x951(%rbp), %rdi
movq %rdi, -0xc18(%rbp)
callq 0x5930
movq -0xc18(%rbp), %rdx
leaq 0x33539(%rip), %rsi     # 0x63293
leaq -0x950(%rbp), %rdi
callq 0x30320
jmp 0x2fd68
movq -0xc20(%rbp), %rsi
leaq -0x930(%rbp), %rdi
leaq -0x950(%rbp), %rdx
callq 0x3fe50
jmp 0x2fd84
leaq -0x930(%rbp), %rdi
callq 0x51d0
movq -0xc28(%rbp), %rdi
movq %rax, %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x5270
leaq -0x930(%rbp), %rdi
callq 0x52f0
leaq -0x950(%rbp), %rdi
callq 0x52f0
leaq -0x951(%rbp), %rdi
callq 0x5510
jmp 0x2fe53
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x588(%rbp)
movl %eax, -0x58c(%rbp)
jmp 0x2fdff
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x588(%rbp)
movl %eax, -0x58c(%rbp)
leaq -0x908(%rbp), %rdi
callq 0x52f0
leaq -0x909(%rbp), %rdi
callq 0x5510
jmp 0x30309
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x588(%rbp)
movl %eax, -0x58c(%rbp)
jmp 0x2fe42
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x588(%rbp)
movl %eax, -0x58c(%rbp)
leaq -0x950(%rbp), %rdi
callq 0x52f0
leaq -0x951(%rbp), %rdi
callq 0x5510
jmp 0x30309
jmp 0x2fe55
movl -0x324(%rbp), %esi
movl -0x328(%rbp), %edx
leaq 0x3350d(%rip), %rdi     # 0x63375
movb $0x0, %al
callq 0x5090
cmpl $0x32, -0x534(%rbp)
jne 0x2feb2
movq -0x18(%rbp), %rax
movq %rax, -0xc30(%rbp)
cmpq $0x0, %rax
je 0x2fea6
movq -0xc30(%rbp), %rdi
callq 0x3fbd0
movq -0xc30(%rbp), %rdi
movl $0x158, %esi            # imm = 0x158
callq 0x54b0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x302fd
movl $0xb0, %edi
callq 0x54a0
movq %rax, -0xc40(%rbp)
movb $0x1, -0x9fa(%rbp)
leaq -0x981(%rbp), %rdi
movq %rdi, -0xc38(%rbp)
callq 0x5930
movq -0xc38(%rbp), %rdx
leaq -0x980(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0x30320
jmp 0x2fef9
movb -0x324(%rbp), %al
movb %al, -0xc4b(%rbp)
movw -0x328(%rbp), %ax
movw %ax, -0xc4a(%rbp)
leaq -0x9a9(%rbp), %rdi
movq %rdi, -0xc48(%rbp)
callq 0x5930
movq -0xc48(%rbp), %rdx
leaq -0x9a8(%rbp), %rdi
leaq -0x430(%rbp), %rsi
callq 0x30320
jmp 0x2ff42
movl -0x32c(%rbp), %eax
movl %eax, -0xc5c(%rbp)
leaq -0x9d1(%rbp), %rdi
movq %rdi, -0xc58(%rbp)
callq 0x5930
movq -0xc58(%rbp), %rdx
leaq -0x9d0(%rbp), %rdi
leaq -0x220(%rbp), %rsi
callq 0x30320
jmp 0x2ff7d
leaq -0x9f9(%rbp), %rdi
movq %rdi, -0xc68(%rbp)
callq 0x5930
movq -0xc68(%rbp), %rdx
leaq -0x9f8(%rbp), %rdi
leaq -0x320(%rbp), %rsi
callq 0x30320
jmp 0x2ffac
movl -0xc5c(%rbp), %r9d
movq -0xc40(%rbp), %rdi
movw -0xc4a(%rbp), %ax
movb -0xc4b(%rbp), %cl
movq %rsp, %rdx
leaq -0x9f8(%rbp), %rsi
movq %rsi, 0x8(%rdx)
leaq -0x9d0(%rbp), %rsi
movq %rsi, (%rdx)
movzbl %cl, %edx
movzwl %ax, %ecx
leaq -0x980(%rbp), %rsi
leaq -0x9a8(%rbp), %r8
callq 0x4b3a0
jmp 0x2fffa
movb $0x0, -0x9fa(%rbp)
leaq -0x9f8(%rbp), %rdi
callq 0x52f0
leaq -0x9f9(%rbp), %rdi
callq 0x5510
leaq -0x9d0(%rbp), %rdi
callq 0x52f0
leaq -0x9d1(%rbp), %rdi
callq 0x5510
leaq -0x9a8(%rbp), %rdi
callq 0x52f0
leaq -0x9a9(%rbp), %rdi
callq 0x5510
leaq -0x980(%rbp), %rdi
callq 0x52f0
leaq -0x981(%rbp), %rdi
callq 0x5510
movq -0xc40(%rbp), %rax
movq %rax, -0x960(%rbp)
movq -0x960(%rbp), %rax
movq %rax, -0xc78(%rbp)
leaq -0xa21(%rbp), %rdi
movq %rdi, -0xc70(%rbp)
callq 0x5930
movq -0xc70(%rbp), %rdx
leaq -0xa20(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0x30320
jmp 0x300ac
leaq -0xa49(%rbp), %rdi
movq %rdi, -0xc80(%rbp)
callq 0x5930
movq -0xc80(%rbp), %rdx
leaq -0xa48(%rbp), %rdi
leaq -0x530(%rbp), %rsi
callq 0x30320
jmp 0x300db
movq -0xc78(%rbp), %rdi
leaq -0xa20(%rbp), %rsi
leaq -0xa48(%rbp), %rdx
callq 0x51530
jmp 0x300f7
leaq -0xa48(%rbp), %rdi
callq 0x52f0
leaq -0xa49(%rbp), %rdi
callq 0x5510
leaq -0xa20(%rbp), %rdi
callq 0x52f0
leaq -0xa21(%rbp), %rdi
callq 0x5510
leaq -0x220(%rbp), %rsi
leaq -0x320(%rbp), %rdx
leaq 0x3326a(%rip), %rdi     # 0x633a6
movb $0x0, %al
callq 0x5090
movq -0x960(%rbp), %rax
movq %rax, -0xc88(%rbp)
cmpq $0x0, %rax
je 0x30174
movq -0xc88(%rbp), %rdi
callq 0x4df70
movq -0xc88(%rbp), %rdi
movl $0xb0, %esi
callq 0x54b0
movq -0x18(%rbp), %rax
movq %rax, -0xc90(%rbp)
cmpq $0x0, %rax
je 0x301a2
movq -0xc90(%rbp), %rdi
callq 0x3fbd0
movq -0xc90(%rbp), %rdi
movl $0x158, %esi            # imm = 0x158
callq 0x54b0
movl $0x0, -0x4(%rbp)
jmp 0x302fd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x588(%rbp)
movl %eax, -0x58c(%rbp)
jmp 0x30267
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x588(%rbp)
movl %eax, -0x58c(%rbp)
jmp 0x3024f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x588(%rbp)
movl %eax, -0x58c(%rbp)
jmp 0x30237
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x588(%rbp)
movl %eax, -0x58c(%rbp)
jmp 0x3021f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x588(%rbp)
movl %eax, -0x58c(%rbp)
leaq -0x9f8(%rbp), %rdi
callq 0x52f0
leaq -0x9f9(%rbp), %rdi
callq 0x5510
leaq -0x9d0(%rbp), %rdi
callq 0x52f0
leaq -0x9d1(%rbp), %rdi
callq 0x5510
leaq -0x9a8(%rbp), %rdi
callq 0x52f0
leaq -0x9a9(%rbp), %rdi
callq 0x5510
leaq -0x980(%rbp), %rdi
callq 0x52f0
leaq -0x981(%rbp), %rdi
callq 0x5510
testb $0x1, -0x9fa(%rbp)
jne 0x3027e
jmp 0x3028f
movq -0xc40(%rbp), %rdi
movl $0xb0, %esi
callq 0x54b0
jmp 0x30309
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x588(%rbp)
movl %eax, -0x58c(%rbp)
jmp 0x302ef
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x588(%rbp)
movl %eax, -0x58c(%rbp)
jmp 0x302d7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x588(%rbp)
movl %eax, -0x58c(%rbp)
leaq -0xa48(%rbp), %rdi
callq 0x52f0
leaq -0xa49(%rbp), %rdi
callq 0x5510
leaq -0xa20(%rbp), %rdi
callq 0x52f0
leaq -0xa21(%rbp), %rdi
callq 0x5510
jmp 0x30309
movl -0x4(%rbp), %eax
addq $0xca0, %rsp            # imm = 0xCA0
popq %rbp
retq
movq -0x588(%rbp), %rdi
callq 0x5920
nopw %cs:(%rax,%rax)
nop