// File: /workspace/github_cpp_makefile_star2_O3/aalto-speech[P]ftk/src/segtext.cc
// Function: main
int main(int argc, char* argv[]) {

    string vocab_fname;
    string trans_fname;
    int maxlen;
    map<string, flt_type> vocab;
    StringSet *ss_vocab = NULL;
    transitions_t transitions;
    flt_type one_char_min_lp = -50.0;
    bool unigram = true;

    conf::Config config;
    config("usage: segtext [OPTION...] INPUT OUTPUT\n")
      ('h', "help", "", "", "display help")
      ('v', "vocabulary=FILE", "arg", "", "Unigram model file")
      ('t', "transitions=FILE", "arg", "", "Bigram model file")
      ('8', "utf-8", "", "", "Utf-8 character encoding in use");
    config.default_parse(argc, argv);
    if (config.arguments.size() != 2) config.print_help(stderr, 1);

    bool utf8_encoding = config["utf-8"].specified;
    string in_fname = config.arguments[0];
    string out_fname = config.arguments[1];

    if (!config["vocabulary"].specified && !config["transitions"].specified) {
        cerr << "Please define vocabulary or transitions" << endl;
        exit(EXIT_FAILURE);
    }

    if (config["vocabulary"].specified && config["transitions"].specified) {
        cerr << "Please don't define both vocabulary and transitions" << endl;
        exit(EXIT_FAILURE);
    }

    if (config["vocabulary"].specified) {
        vocab_fname = config["vocabulary"].get_str();
        cerr << "Reading vocabulary " << vocab_fname << endl;
        int retval = Unigrams::read_vocab(vocab_fname, vocab, maxlen, utf8_encoding);
        if (retval < 0) {
            cerr << "something went wrong reading vocabulary" << endl;
            exit(EXIT_FAILURE);
        }
        cerr << "\t" << "size: " << vocab.size() << endl;
        cerr << "\t" << "maximum string length: " << maxlen << endl;
        ss_vocab = new StringSet(vocab);
    }

    if (config["transitions"].specified) {
        unigram = false;
        trans_fname = config["transitions"].get_str();
        cerr << "Reading transitions " << trans_fname << endl;
        int retval = Bigrams::read_transitions(transitions, trans_fname);
        Bigrams::trans_to_vocab(transitions, vocab);
        ss_vocab = new StringSet(vocab);
        if (retval < 0) {
            cerr << "something went wrong reading transitions" << endl;
            exit(EXIT_FAILURE);
        }
        cerr << "\t" << "vocabulary size: " << transitions.size() << endl;
        cerr << "\t" << "transitions: " << retval << endl;
    }

    cerr << "Segmenting corpus" << endl;
    SimpleFileInput infile(in_fname);
    SimpleFileOutput outfile(out_fname);

    string line;
    while (infile.getline(line)) {

        vector<unsigned int> char_positions;
        get_character_positions(line, char_positions, utf8_encoding);
        for (unsigned int i=0; i<char_positions.size()-1; i++) {
            unsigned int start_pos = char_positions[i];
            unsigned int end_pos = char_positions[i+1];
            string currchr = line.substr(start_pos, end_pos-start_pos);
            if (!ss_vocab->includes(currchr))
                ss_vocab->add(currchr, one_char_min_lp);
        }

        vector<string> best_path;
        if (unigram)
            viterbi(*ss_vocab, line, best_path, true, utf8_encoding);
        else {
            FactorGraph fg(line, start_end_symbol, *ss_vocab);
            viterbi(transitions, fg, best_path);
            best_path.erase(best_path.begin());
            best_path.erase(best_path.end());
        }

        if (best_path.size() == 0) {
            cerr << "warning, no segmentation for line: " << line << endl;
            continue;
        }

        for (unsigned int i=0; i<best_path.size(); i++) {
            if (best_path[i] == " ")
                outfile << "\t";
            else {
                if (i>0) outfile << " ";
                outfile << best_path[i];
            }
        }
        outfile << "\n";
    }

    outfile.close();
    if (ss_vocab != NULL) delete ss_vocab;
    exit(EXIT_SUCCESS);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x638, %rsp            # imm = 0x638
movq %rsi, %rbx
movl %edi, %r14d
leaq -0x3f0(%rbp), %r12
movq %r12, -0x10(%r12)
xorl %eax, %eax
movq %rax, -0x8(%r12)
movb %al, (%r12)
leaq -0x450(%rbp), %r13
movq %r13, -0x10(%r13)
movq %rax, -0x8(%r13)
movb %al, (%r13)
leaq -0x568(%rbp), %rcx
movl %eax, (%rcx)
movq %rax, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movq %rax, 0x20(%rcx)
leaq -0x598(%rbp), %rcx
movl %eax, (%rcx)
movq %rax, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movq %rax, 0x20(%rcx)
leaq -0x658(%rbp), %rdi
callq 0x779e
leaq -0x3d0(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x21ee0(%rip), %rsi     # 0x27020
leaq 0x21f01(%rip), %rdx     # 0x27048
leaq -0x3e0(%rbp), %rdi
callq 0x6c5c
leaq -0x658(%rbp), %rdi
leaq -0x3e0(%rbp), %rsi
callq 0x7804
movq %rax, %r15
leaq -0x3b0(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x21ed6(%rip), %rsi     # 0x27051
leaq 0x21ed3(%rip), %rdx     # 0x27055
leaq -0x3c0(%rbp), %rdi
callq 0x6c5c
leaq -0x390(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x22417(%rip), %rdx     # 0x275b7
leaq -0x3a0(%rbp), %rdi
movq %rdx, %rsi
callq 0x6c5c
leaq -0x370(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x223f6(%rip), %rdx     # 0x275b7
leaq -0x380(%rbp), %rdi
movq %rdx, %rsi
callq 0x6c5c
leaq -0x350(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x21e67(%rip), %rsi     # 0x27049
leaq 0x21e6c(%rip), %rdx     # 0x27055
leaq -0x360(%rbp), %rdi
callq 0x6c5c
leaq -0x3c0(%rbp), %rdx
leaq -0x3a0(%rbp), %rcx
leaq -0x380(%rbp), %r8
leaq -0x360(%rbp), %r9
movq %r15, %rdi
movl $0x68, %esi
callq 0x781c
movq %rax, %r15
leaq -0x330(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x21e23(%rip), %rsi     # 0x27056
leaq 0x21e2b(%rip), %rdx     # 0x27065
leaq -0x340(%rbp), %rdi
callq 0x6c5c
leaq -0x310(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x21e0e(%rip), %rsi     # 0x27066
leaq 0x21e0a(%rip), %rdx     # 0x27069
leaq -0x320(%rbp), %rdi
callq 0x6c5c
leaq -0x2f0(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x2233a(%rip), %rdx     # 0x275b7
leaq -0x300(%rbp), %rdi
movq %rdx, %rsi
callq 0x6c5c
leaq -0x2d0(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x21dcc(%rip), %rsi     # 0x2706a
leaq 0x21dd7(%rip), %rdx     # 0x2707c
leaq -0x2e0(%rbp), %rdi
callq 0x6c5c
leaq -0x340(%rbp), %rdx
leaq -0x320(%rbp), %rcx
leaq -0x300(%rbp), %r8
leaq -0x2e0(%rbp), %r9
movq %r15, %rdi
movl $0x76, %esi
callq 0x781c
movq %rax, %r15
leaq -0x2b0(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x21d8e(%rip), %rsi     # 0x2707d
leaq 0x21d97(%rip), %rdx     # 0x2708d
leaq -0x2c0(%rbp), %rdi
callq 0x6c5c
leaq -0x290(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x21d52(%rip), %rsi     # 0x27066
leaq 0x21d4e(%rip), %rdx     # 0x27069
leaq -0x2a0(%rbp), %rdi
callq 0x6c5c
leaq -0x270(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x2227e(%rip), %rdx     # 0x275b7
leaq -0x280(%rbp), %rdi
movq %rdx, %rsi
callq 0x6c5c
leaq -0x250(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x21d34(%rip), %rsi     # 0x2708e
leaq 0x21d3e(%rip), %rdx     # 0x2709f
leaq -0x260(%rbp), %rdi
callq 0x6c5c
leaq -0x2c0(%rbp), %rdx
leaq -0x2a0(%rbp), %rcx
leaq -0x280(%rbp), %r8
leaq -0x260(%rbp), %r9
movq %r15, %rdi
movl $0x74, %esi
callq 0x781c
movq %rax, %r15
leaq -0x230(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x21cf5(%rip), %rsi     # 0x270a0
leaq 0x21cf3(%rip), %rdx     # 0x270a5
leaq -0x240(%rbp), %rdi
callq 0x6c5c
leaq -0x210(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x221e7(%rip), %rdx     # 0x275b7
leaq -0x220(%rbp), %rdi
movq %rdx, %rsi
callq 0x6c5c
leaq -0x1f0(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x221c6(%rip), %rdx     # 0x275b7
leaq -0x200(%rbp), %rdi
movq %rdx, %rsi
callq 0x6c5c
leaq -0x1d0(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x21c94(%rip), %rsi     # 0x270a6
leaq 0x21cac(%rip), %rdx     # 0x270c5
leaq -0x1e0(%rbp), %rdi
callq 0x6c5c
leaq -0x240(%rbp), %rdx
leaq -0x220(%rbp), %rcx
leaq -0x200(%rbp), %r8
leaq -0x1e0(%rbp), %r9
movq %r15, %rdi
movl $0x38, %esi
callq 0x781c
movq -0x1e0(%rbp), %rdi
leaq -0x1d0(%rbp), %rax
cmpq %rax, %rdi
je 0x5466
callq 0x4350
movq -0x200(%rbp), %rdi
leaq -0x1f0(%rbp), %rax
cmpq %rax, %rdi
je 0x547e
callq 0x4350
movq -0x220(%rbp), %rdi
leaq -0x210(%rbp), %rax
cmpq %rax, %rdi
je 0x5496
callq 0x4350
movq -0x240(%rbp), %rdi
leaq -0x230(%rbp), %rax
cmpq %rax, %rdi
je 0x54ae
callq 0x4350
movq -0x260(%rbp), %rdi
leaq -0x250(%rbp), %rax
cmpq %rax, %rdi
je 0x54c6
callq 0x4350
movq -0x280(%rbp), %rdi
leaq -0x270(%rbp), %rax
cmpq %rax, %rdi
je 0x54de
callq 0x4350
movq -0x2a0(%rbp), %rdi
leaq -0x290(%rbp), %rax
cmpq %rax, %rdi
je 0x54f6
callq 0x4350
movq -0x2c0(%rbp), %rdi
leaq -0x2b0(%rbp), %rax
cmpq %rax, %rdi
je 0x550e
callq 0x4350
movq -0x2e0(%rbp), %rdi
leaq -0x2d0(%rbp), %rax
cmpq %rax, %rdi
je 0x5526
callq 0x4350
movq -0x300(%rbp), %rdi
leaq -0x2f0(%rbp), %rax
cmpq %rax, %rdi
je 0x553e
callq 0x4350
movq -0x320(%rbp), %rdi
leaq -0x310(%rbp), %rax
cmpq %rax, %rdi
je 0x5556
callq 0x4350
movq -0x340(%rbp), %rdi
leaq -0x330(%rbp), %rax
cmpq %rax, %rdi
je 0x556e
callq 0x4350
movq -0x360(%rbp), %rdi
leaq -0x350(%rbp), %rax
cmpq %rax, %rdi
je 0x5586
callq 0x4350
movq -0x380(%rbp), %rdi
leaq -0x370(%rbp), %rax
cmpq %rax, %rdi
je 0x559e
callq 0x4350
movq -0x3a0(%rbp), %rdi
leaq -0x390(%rbp), %rax
cmpq %rax, %rdi
je 0x55b6
callq 0x4350
movq -0x3c0(%rbp), %rdi
leaq -0x3b0(%rbp), %rax
cmpq %rax, %rdi
je 0x55ce
callq 0x4350
movq -0x3e0(%rbp), %rdi
leaq -0x3d0(%rbp), %rax
cmpq %rax, %rdi
je 0x55e6
callq 0x4350
leaq -0x658(%rbp), %rdi
movl %r14d, %esi
movq %rbx, %rdx
callq 0x8244
movq -0x5b8(%rbp), %rax
subq -0x5c0(%rbp), %rax
cmpq $0x40, %rax
je 0x5627
movq 0x2f9b5(%rip), %rax     # 0x34fc8
movq (%rax), %rsi
leaq -0x658(%rbp), %rdi
movl $0x1, %edx
callq 0x87e6
leaq -0x530(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x21a67(%rip), %rsi     # 0x270a0
leaq 0x21a65(%rip), %rdx     # 0x270a5
leaq -0x540(%rbp), %rdi
callq 0x6c5c
leaq -0x658(%rbp), %rdi
leaq -0x540(%rbp), %rsi
callq 0x82fe
movb 0x4a(%rax), %r15b
movq -0x540(%rbp), %rdi
cmpq %r14, %rdi
je 0x5674
callq 0x4350
movq -0x5c0(%rbp), %rax
leaq -0x430(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq -0x440(%rbp), %rdi
callq 0x6bbe
movq -0x5c0(%rbp), %rax
leaq -0x410(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq 0x20(%rax), %rsi
movq 0x28(%rax), %rdx
addq %rsi, %rdx
leaq -0x420(%rbp), %rdi
callq 0x6bbe
leaq -0x510(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x21a7c(%rip), %rsi     # 0x27153
leaq 0x21a7f(%rip), %rdx     # 0x2715d
leaq -0x520(%rbp), %rdi
callq 0x6c5c
leaq -0x658(%rbp), %rdi
leaq -0x520(%rbp), %rsi
callq 0x82fe
cmpb $0x0, 0x4a(%rax)
je 0x574c
xorl %ebx, %ebx
movq -0x520(%rbp), %rdi
cmpq %r14, %rdi
je 0x5716
callq 0x4350
testb %bl, %bl
je 0x57ab
movq 0x2f8c3(%rip), %rdi     # 0x34fe8
leaq 0x2199a(%rip), %rsi     # 0x270c6
movl $0x27, %edx
callq 0x4400
movq 0x2f8ab(%rip), %rdi     # 0x34fe8
callq 0x4180
movl $0x1, %edi
callq 0x4420
leaq -0x1b0(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x219b8(%rip), %rsi     # 0x27116
leaq 0x219bc(%rip), %rdx     # 0x27121
leaq -0x1c0(%rbp), %rdi
callq 0x6c5c
leaq -0x658(%rbp), %rdi
leaq -0x1c0(%rbp), %rsi
callq 0x82fe
movb 0x4a(%rax), %bl
xorb $0x1, %bl
movq -0x1c0(%rbp), %rdi
leaq -0x1b0(%rbp), %rax
cmpq %rax, %rdi
je 0x5705
callq 0x4350
jmp 0x5705
leaq -0x4f0(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x21996(%rip), %rsi     # 0x27153
leaq 0x21999(%rip), %rdx     # 0x2715d
leaq -0x500(%rbp), %rdi
callq 0x6c5c
leaq -0x658(%rbp), %rdi
leaq -0x500(%rbp), %rsi
callq 0x82fe
cmpb $0x1, 0x4a(%rax)
jne 0x583e
leaq -0x190(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x2191b(%rip), %rsi     # 0x27116
leaq 0x2191f(%rip), %rdx     # 0x27121
leaq -0x1a0(%rbp), %rdi
callq 0x6c5c
leaq -0x658(%rbp), %rdi
leaq -0x1a0(%rbp), %rsi
callq 0x82fe
movb 0x4a(%rax), %bl
movq -0x1a0(%rbp), %rdi
leaq -0x190(%rbp), %rax
cmpq %rax, %rdi
je 0x5840
callq 0x4350
jmp 0x5840
xorl %ebx, %ebx
movq -0x500(%rbp), %rdi
cmpq %r14, %rdi
je 0x5851
callq 0x4350
testb %bl, %bl
je 0x587e
movq 0x2f78c(%rip), %rdi     # 0x34fe8
leaq 0x2188b(%rip), %rsi     # 0x270ee
movl $0x33, %edx
callq 0x4400
movq 0x2f774(%rip), %rdi     # 0x34fe8
callq 0x4180
jmp 0x5742
leaq -0x4d0(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x218c3(%rip), %rsi     # 0x27153
leaq 0x218c6(%rip), %rdx     # 0x2715d
leaq -0x4e0(%rbp), %rdi
callq 0x6c5c
leaq -0x658(%rbp), %rdi
leaq -0x4e0(%rbp), %rsi
callq 0x82fe
movb 0x4a(%rax), %bl
movq -0x4e0(%rbp), %rdi
cmpq %r14, %rdi
je 0x58ca
callq 0x4350
testb %bl, %bl
je 0x59f3
leaq -0x4b0(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x2186f(%rip), %rsi     # 0x27153
leaq 0x21872(%rip), %rdx     # 0x2715d
leaq -0x4c0(%rbp), %rdi
callq 0x6c5c
leaq -0x658(%rbp), %rdi
leaq -0x4c0(%rbp), %rsi
callq 0x82fe
movq %rax, %rdi
callq 0x778a
leaq -0x400(%rbp), %rdi
movq %rax, %rsi
callq 0x41c0
movq -0x4c0(%rbp), %rdi
cmpq %r14, %rdi
je 0x5932
callq 0x4350
movq 0x2f6af(%rip), %rdi     # 0x34fe8
leaq 0x217e2(%rip), %rsi     # 0x27122
movl $0x13, %edx
callq 0x4400
movq -0x400(%rbp), %rsi
movq -0x3f8(%rbp), %rdx
movq 0x2f689(%rip), %rdi     # 0x34fe8
callq 0x4400
movq %rax, %rdi
callq 0x4180
leaq -0x490(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0x400(%rbp), %rsi
movq -0x3f8(%rbp), %rdx
addq %rsi, %rdx
leaq -0x4a0(%rbp), %rdi
callq 0x6bbe
movzbl %r15b, %ecx
leaq -0x4a0(%rbp), %rdi
leaq -0x570(%rbp), %rsi
leaq -0x64(%rbp), %rdx
callq 0x1dfaa
movl %eax, %ebx
movq -0x4a0(%rbp), %rdi
cmpq %r14, %rdi
je 0x59c2
callq 0x4350
testl %ebx, %ebx
jns 0x5b65
movq 0x2f617(%rip), %rdi     # 0x34fe8
leaq 0x2175e(%rip), %rsi     # 0x27136
movl $0x27, %edx
callq 0x4400
movq 0x2f5ff(%rip), %rdi     # 0x34fe8
callq 0x4180
jmp 0x5742
xorl %r14d, %r14d
leaq -0x170(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x2170e(%rip), %rsi     # 0x27116
leaq 0x21712(%rip), %rdx     # 0x27121
leaq -0x180(%rbp), %rdi
callq 0x6c5c
leaq -0x658(%rbp), %rdi
leaq -0x180(%rbp), %rsi
callq 0x82fe
movb 0x4a(%rax), %al
movb %al, -0x29(%rbp)
movq -0x180(%rbp), %rdi
leaq -0x170(%rbp), %rax
cmpq %rax, %rdi
je 0x5a4c
callq 0x4350
cmpb $0x0, -0x29(%rbp)
je 0x5ca9
leaq -0x470(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x216ae(%rip), %rsi     # 0x27116
leaq 0x216b2(%rip), %rdx     # 0x27121
leaq -0x480(%rbp), %rdi
callq 0x6c5c
leaq -0x658(%rbp), %rdi
leaq -0x480(%rbp), %rsi
callq 0x82fe
movq %rax, %rdi
callq 0x778a
leaq -0x460(%rbp), %rdi
movq %rax, %rsi
callq 0x41c0
movq -0x480(%rbp), %rdi
cmpq %r14, %rdi
je 0x5ab6
callq 0x4350
movq 0x2f52b(%rip), %rdi     # 0x34fe8
leaq 0x216b2(%rip), %rsi     # 0x27176
movl $0x14, %edx
callq 0x4400
movq -0x460(%rbp), %rsi
movq -0x458(%rbp), %rdx
movq 0x2f505(%rip), %rdi     # 0x34fe8
callq 0x4400
movq %rax, %rdi
callq 0x4180
leaq -0x5a0(%rbp), %rdi
leaq -0x460(%rbp), %rsi
callq 0x23072
movl %eax, %ebx
leaq -0x5a0(%rbp), %rdi
leaq -0x570(%rbp), %rsi
callq 0x238ae
movl $0x120, %edi            # imm = 0x120
callq 0x4390
movq %rax, %r14
leaq -0x570(%rbp), %rsi
movq %rax, %rdi
callq 0xd4d4
testl %ebx, %ebx
jns 0x5c18
movq 0x2f4a5(%rip), %rdi     # 0x34fe8
leaq 0x21641(%rip), %rsi     # 0x2718b
movl $0x28, %edx
callq 0x4400
movq 0x2f48d(%rip), %rdi     # 0x34fe8
callq 0x4180
jmp 0x5742
movq 0x2f47c(%rip), %rdi     # 0x34fe8
leaq 0x21a43(%rip), %rsi     # 0x275b6
movl $0x1, %edx
callq 0x4400
movq 0x2f464(%rip), %rdi     # 0x34fe8
leaq 0x21634(%rip), %rsi     # 0x271bf
movl $0x6, %edx
callq 0x4400
movq -0x548(%rbp), %rsi
movq 0x2f445(%rip), %rdi     # 0x34fe8
callq 0x4250
movq %rax, %rdi
callq 0x4180
movq 0x2f431(%rip), %rdi     # 0x34fe8
leaq 0x219f8(%rip), %rsi     # 0x275b6
movl $0x1, %edx
callq 0x4400
movq 0x2f419(%rip), %rdi     # 0x34fe8
leaq 0x21588(%rip), %rsi     # 0x2715e
movl $0x17, %edx
callq 0x4400
movl -0x64(%rbp), %esi
movq 0x2f3fe(%rip), %rdi     # 0x34fe8
callq 0x4610
movq %rax, %rdi
callq 0x4180
movl $0x120, %edi            # imm = 0x120
callq 0x4390
movq %rax, %r14
leaq -0x570(%rbp), %rsi
movq %rax, %rdi
callq 0xd4d4
jmp 0x59f6
movq 0x2f3c9(%rip), %rdi     # 0x34fe8
leaq 0x21990(%rip), %rsi     # 0x275b6
movl $0x1, %edx
callq 0x4400
movq 0x2f3b1(%rip), %rdi     # 0x34fe8
leaq 0x21576(%rip), %rsi     # 0x271b4
movl $0x11, %edx
callq 0x4400
movq -0x578(%rbp), %rsi
movq 0x2f392(%rip), %rdi     # 0x34fe8
callq 0x4250
movq %rax, %rdi
callq 0x4180
movq 0x2f37e(%rip), %rdi     # 0x34fe8
leaq 0x21945(%rip), %rsi     # 0x275b6
movl $0x1, %edx
callq 0x4400
movq 0x2f366(%rip), %rdi     # 0x34fe8
leaq 0x2153d(%rip), %rsi     # 0x271c6
movl $0xd, %edx
callq 0x4400
movq 0x2f34e(%rip), %rdi     # 0x34fe8
movl %ebx, %esi
callq 0x4610
movq %rax, %rdi
callq 0x4180
movq 0x2f338(%rip), %rdi     # 0x34fe8
leaq 0x2151d(%rip), %rsi     # 0x271d4
movl $0x11, %edx
callq 0x4400
movq 0x2f320(%rip), %rdi     # 0x34fe8
callq 0x4180
leaq -0x150(%rbp), %rax
movq %rax, -0x10(%rax)
movq -0x440(%rbp), %rsi
movq -0x438(%rbp), %rdx
addq %rsi, %rdx
leaq -0x160(%rbp), %rdi
callq 0x6bbe
leaq -0x88(%rbp), %rdi
leaq -0x160(%rbp), %rsi
callq 0x6d70
movq -0x160(%rbp), %rdi
leaq -0x150(%rbp), %rax
cmpq %rax, %rdi
je 0x5d20
callq 0x4350
leaq -0x130(%rbp), %rax
movq %rax, -0x10(%rax)
movq -0x420(%rbp), %rsi
movq -0x418(%rbp), %rdx
addq %rsi, %rdx
leaq -0x140(%rbp), %rdi
callq 0x6bbe
leaq -0x38(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0x6fc2
movq -0x140(%rbp), %rdi
leaq -0x130(%rbp), %rax
cmpq %rax, %rdi
je 0x5d70
callq 0x4350
leaq -0x98(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movzbl %r15b, %eax
movl %eax, -0x3c(%rbp)
movq -0x88(%rbp), %rdi
movq (%rdi), %rax
leaq -0xa8(%rbp), %rsi
callq *(%rax)
testb %al, %al
je 0x60a3
xorps %xmm0, %xmm0
movaps %xmm0, -0x80(%rbp)
movq $0x0, -0x70(%rbp)
leaq -0xa8(%rbp), %rdi
leaq -0x80(%rbp), %rsi
movl -0x3c(%rbp), %edx
callq 0x6575
movq -0x80(%rbp), %rax
movq -0x78(%rbp), %rcx
subq %rax, %rcx
cmpq $0x4, %rcx
je 0x5e5f
movl $0x1, %ecx
xorl %ebx, %ebx
movl (%rax,%rbx,4), %edx
movl %ecx, %ebx
movl (%rax,%rbx,4), %ecx
subl %edx, %ecx
leaq -0x120(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x43b0
movq %r14, %rdi
leaq -0x120(%rbp), %rsi
callq 0xdae6
testb %al, %al
jne 0x5e2d
movq %r14, %rdi
leaq -0x120(%rbp), %rsi
movsd 0x211e0(%rip), %xmm0    # 0x27008
callq 0xd780
movq -0x120(%rbp), %rdi
leaq -0x110(%rbp), %rax
cmpq %rax, %rdi
je 0x5e45
callq 0x4350
movq -0x80(%rbp), %rax
movq -0x78(%rbp), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
decq %rdx
leal 0x1(%rbx), %ecx
cmpq %rbx, %rdx
ja 0x5de6
xorps %xmm0, %xmm0
movaps %xmm0, -0x60(%rbp)
movq $0x0, -0x50(%rbp)
cmpb $0x0, -0x29(%rbp)
je 0x5ed8
leaq -0x120(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
leaq 0x2f51f(%rip), %rdx     # 0x353a8
movq %r14, %rcx
xorl %r8d, %r8d
callq 0xf120
leaq -0x5a0(%rbp), %rdi
leaq -0x120(%rbp), %rsi
leaq -0x60(%rbp), %rdx
movl $0x1, %ecx
callq 0x1834f
movq -0x60(%rbp), %rsi
leaq -0x60(%rbp), %rdi
callq 0x6cfa
movq -0x58(%rbp), %rsi
leaq -0x60(%rbp), %rdi
callq 0x6cfa
leaq -0x120(%rbp), %rdi
callq 0x10b0c
jmp 0x5ef4
movq %r14, %rdi
leaq -0xa8(%rbp), %rsi
leaq -0x60(%rbp), %rdx
movl $0x1, %ecx
movl -0x3c(%rbp), %r8d
callq 0x1766c
movq -0x60(%rbp), %rdi
cmpq %rdi, -0x58(%rbp)
je 0x6049
movl $0x1, %r15d
xorl %ebx, %ebx
shlq $0x5, %rbx
addq %rbx, %rdi
leaq 0x214c4(%rip), %rsi     # 0x273dc
callq 0x40f0
testl %eax, %eax
je 0x5f89
cmpl $0x1, %r15d
je 0x5f77
leaq -0x110(%rbp), %rax
movq %rax, -0x120(%rbp)
leaq -0x120(%rbp), %rdi
leaq 0x21499(%rip), %rsi     # 0x273dc
leaq 0x21493(%rip), %rdx     # 0x273dd
callq 0x6c5c
leaq -0x38(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0x7186
movq -0x120(%rbp), %rdi
leaq -0x110(%rbp), %rax
cmpq %rax, %rdi
je 0x5f77
callq 0x4350
addq -0x60(%rbp), %rbx
leaq -0x38(%rbp), %rdi
movq %rbx, %rsi
callq 0x7186
jmp 0x5fd9
leaq -0x110(%rbp), %rax
movq %rax, -0x120(%rbp)
leaq -0x120(%rbp), %rdi
leaq 0x21611(%rip), %rsi     # 0x275b6
leaq 0x2160b(%rip), %rdx     # 0x275b7
callq 0x6c5c
leaq -0x38(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0x7186
movq -0x120(%rbp), %rdi
leaq -0x110(%rbp), %rax
cmpq %rax, %rdi
je 0x5fd9
callq 0x4350
movl %r15d, %ebx
movq -0x60(%rbp), %rdi
movq -0x58(%rbp), %rax
subq %rdi, %rax
sarq $0x5, %rax
incl %r15d
cmpq %rbx, %rax
ja 0x5f0a
leaq -0x110(%rbp), %rax
movq %rax, -0x120(%rbp)
leaq -0x120(%rbp), %rdi
leaq 0x213b3(%rip), %rsi     # 0x273c6
leaq 0x213ad(%rip), %rdx     # 0x273c7
callq 0x6c5c
leaq -0x38(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0x7186
movq -0x120(%rbp), %rdi
leaq -0x110(%rbp), %rax
cmpq %rax, %rdi
je 0x6083
callq 0x4350
jmp 0x6083
movl $0x23, %edx
movq 0x2ef93(%rip), %rdi     # 0x34fe8
leaq 0x2118a(%rip), %rsi     # 0x271e6
callq 0x4400
movq -0xa8(%rbp), %rsi
movq -0xa0(%rbp), %rdx
movq 0x2ef72(%rip), %rdi     # 0x34fe8
callq 0x4400
movq %rax, %rdi
callq 0x4180
leaq -0x60(%rbp), %rdi
callq 0x66ec
movq -0x80(%rbp), %rdi
testq %rdi, %rdi
je 0x5d8d
callq 0x4350
jmp 0x5d8d
leaq -0x38(%rbp), %rdi
callq 0x7154
testq %r14, %r14
je 0x60c1
movq %r14, %rdi
callq 0xd854
movq %r14, %rdi
callq 0x4350
xorl %edi, %edi
callq 0x4420
jmp 0x60e9
jmp 0x611e
jmp 0x60ff
jmp 0x611e
jmp 0x60d4
jmp 0x60d4
movq %rax, %rbx
leaq -0x120(%rbp), %rdi
callq 0x10b0c
jmp 0x6121
jmp 0x611e
jmp 0x612c
movq %rax, %rbx
jmp 0x615a
jmp 0x60f0
movq %rax, %rbx
movq %r14, %rdi
jmp 0x628d
jmp 0x60ff
jmp 0x611e
movq %rax, %rbx
movq -0x120(%rbp), %rdi
leaq -0x110(%rbp), %rax
cmpq %rax, %rdi
je 0x6121
callq 0x4350
jmp 0x6121
jmp 0x611e
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
callq 0x66ec
jmp 0x614c
movq %rax, %rbx
jmp 0x614c
movq %rax, %rbx
movq -0x120(%rbp), %rdi
leaq -0x110(%rbp), %rax
cmpq %rax, %rdi
je 0x614c
callq 0x4350
movq -0x80(%rbp), %rdi
testq %rdi, %rdi
je 0x615a
callq 0x4350
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
cmpq %rax, %rdi
je 0x6172
callq 0x4350
leaq -0x38(%rbp), %rdi
callq 0x711a
jmp 0x61b1
jmp 0x6294
movq %rax, %rbx
movq -0x140(%rbp), %rdi
leaq -0x130(%rbp), %rax
cmpq %rax, %rdi
je 0x61b1
callq 0x4350
jmp 0x61b1
movq %rax, %rbx
movq -0x4a0(%rbp), %rdi
jmp 0x6288
movq %rax, %rbx
leaq -0x88(%rbp), %rdi
callq 0x6ec2
jmp 0x6297
jmp 0x6294
movq %rax, %rbx
movq -0x160(%rbp), %rdi
leaq -0x150(%rbp), %rax
jmp 0x6204
jmp 0x6294
movq %rax, %rbx
movq -0x480(%rbp), %rdi
jmp 0x6288
jmp 0x6294
movq %rax, %rbx
movq -0x180(%rbp), %rdi
leaq -0x170(%rbp), %rax
cmpq %rax, %rdi
jne 0x628d
jmp 0x6297
movq %rax, %rbx
movq -0x4c0(%rbp), %rdi
jmp 0x6288
jmp 0x6294
jmp 0x6294
movq %rax, %rbx
movq -0x4e0(%rbp), %rdi
jmp 0x6288
movq %rax, %rbx
movq -0x1a0(%rbp), %rdi
leaq -0x190(%rbp), %rax
cmpq %rax, %rdi
je 0x6252
callq 0x4350
jmp 0x6252
jmp 0x6294
jmp 0x624f
movq %rax, %rbx
movq -0x500(%rbp), %rdi
jmp 0x6288
movq %rax, %rbx
movq -0x1c0(%rbp), %rdi
leaq -0x1b0(%rbp), %rax
cmpq %rax, %rdi
je 0x6281
callq 0x4350
jmp 0x6281
jmp 0x6294
jmp 0x627e
jmp 0x6294
movq %rax, %rbx
movq -0x520(%rbp), %rdi
cmpq %r14, %rdi
je 0x6297
callq 0x4350
jmp 0x6297
movq %rax, %rbx
movq -0x420(%rbp), %rdi
leaq -0x410(%rbp), %rax
cmpq %rax, %rdi
je 0x62b4
callq 0x4350
jmp 0x62b4
movq %rax, %rbx
movq -0x440(%rbp), %rdi
leaq -0x430(%rbp), %rax
jmp 0x64d7
jmp 0x64e3
movq %rax, %rbx
movq -0x540(%rbp), %rdi
cmpq %r14, %rdi
jne 0x64dc
jmp 0x64e6
jmp 0x64e3
jmp 0x64e3
movq %rax, %rbx
movq -0x1e0(%rbp), %rdi
leaq -0x1d0(%rbp), %rax
cmpq %rax, %rdi
je 0x630e
callq 0x4350
jmp 0x630e
movq %rax, %rbx
movq -0x200(%rbp), %rdi
leaq -0x1f0(%rbp), %rax
cmpq %rax, %rdi
je 0x632b
callq 0x4350
jmp 0x632b
movq %rax, %rbx
movq -0x220(%rbp), %rdi
leaq -0x210(%rbp), %rax
cmpq %rax, %rdi
je 0x6348
callq 0x4350
jmp 0x6348
movq %rax, %rbx
movq -0x240(%rbp), %rdi
leaq -0x230(%rbp), %rax
cmpq %rax, %rdi
je 0x6367
callq 0x4350
jmp 0x6367
jmp 0x6364
movq %rax, %rbx
movq -0x260(%rbp), %rdi
leaq -0x250(%rbp), %rax
cmpq %rax, %rdi
je 0x6384
callq 0x4350
jmp 0x6384
movq %rax, %rbx
movq -0x280(%rbp), %rdi
leaq -0x270(%rbp), %rax
cmpq %rax, %rdi
je 0x63a1
callq 0x4350
jmp 0x63a1
movq %rax, %rbx
movq -0x2a0(%rbp), %rdi
leaq -0x290(%rbp), %rax
cmpq %rax, %rdi
je 0x63be
callq 0x4350
jmp 0x63be
movq %rax, %rbx
movq -0x2c0(%rbp), %rdi
leaq -0x2b0(%rbp), %rax
cmpq %rax, %rdi
je 0x63dd
callq 0x4350
jmp 0x63dd
jmp 0x63da
movq %rax, %rbx
movq -0x2e0(%rbp), %rdi
leaq -0x2d0(%rbp), %rax
cmpq %rax, %rdi
je 0x63fa
callq 0x4350
jmp 0x63fa
movq %rax, %rbx
movq -0x300(%rbp), %rdi
leaq -0x2f0(%rbp), %rax
cmpq %rax, %rdi
je 0x6417
callq 0x4350
jmp 0x6417
movq %rax, %rbx
movq -0x320(%rbp), %rdi
leaq -0x310(%rbp), %rax
cmpq %rax, %rdi
je 0x6434
callq 0x4350
jmp 0x6434
movq %rax, %rbx
movq -0x340(%rbp), %rdi
leaq -0x330(%rbp), %rax
cmpq %rax, %rdi
je 0x6453
callq 0x4350
jmp 0x6453
jmp 0x6450
movq %rax, %rbx
movq -0x360(%rbp), %rdi
leaq -0x350(%rbp), %rax
cmpq %rax, %rdi
je 0x6470
callq 0x4350
jmp 0x6470
movq %rax, %rbx
movq -0x380(%rbp), %rdi
leaq -0x370(%rbp), %rax
cmpq %rax, %rdi
je 0x648d
callq 0x4350
jmp 0x648d
movq %rax, %rbx
movq -0x3a0(%rbp), %rdi
leaq -0x390(%rbp), %rax
cmpq %rax, %rdi
je 0x64aa
callq 0x4350
jmp 0x64aa
movq %rax, %rbx
movq -0x3c0(%rbp), %rdi
leaq -0x3b0(%rbp), %rax
cmpq %rax, %rdi
je 0x64c9
callq 0x4350
jmp 0x64c9
jmp 0x64c6
movq %rax, %rbx
movq -0x3e0(%rbp), %rdi
leaq -0x3d0(%rbp), %rax
cmpq %rax, %rdi
je 0x64e6
callq 0x4350
jmp 0x64e6
movq %rax, %rbx
leaq -0x5c0(%rbp), %rdi
callq 0x66ec
leaq -0x5f0(%rbp), %rdi
callq 0x6992
leaq -0x620(%rbp), %rdi
callq 0x69fc
leaq -0x638(%rbp), %r14
movq %r14, %rdi
callq 0x695e
movq -0x20(%r14), %rdi
leaq -0x648(%rbp), %rax
cmpq %rax, %rdi
je 0x6533
callq 0x4350
jmp 0x6533
movq %rax, %rbx
leaq -0x5a0(%rbp), %rdi
callq 0x6ac6
leaq -0x570(%rbp), %rdi
callq 0x6b54
movq -0x460(%rbp), %rdi
cmpq %r13, %rdi
je 0x655c
callq 0x4350
movq -0x400(%rbp), %rdi
cmpq %r12, %rdi
je 0x656d
callq 0x4350
movq %rbx, %rdi
callq 0x4640