// File: /workspace/github_cpp_makefile_star2_O2/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 -0x190(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
xorl %ecx, %ecx
movb %cl, (%rax)
leaq -0x170(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %cl, (%rax)
leaq -0x1c8(%rbp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
leaq -0x598(%rbp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
leaq -0x658(%rbp), %rdi
callq 0x6a44
leaq 0x1f4ab(%rip), %rsi     # 0x24022
leaq -0x570(%rbp), %rdi
leaq -0x120(%rbp), %rdx
callq 0x4140
leaq -0x658(%rbp), %rdi
leaq -0x570(%rbp), %rsi
callq 0x6ab0
movq %rax, %r15
leaq 0x1f4ac(%rip), %rsi     # 0x24053
leaq -0x550(%rbp), %rdi
leaq -0x330(%rbp), %rdx
callq 0x4140
leaq 0x1f986(%rip), %rsi     # 0x24547
leaq -0x530(%rbp), %rdi
leaq -0x310(%rbp), %rdx
callq 0x4140
leaq 0x1f96c(%rip), %rsi     # 0x24547
leaq -0x510(%rbp), %rdi
leaq -0xa8(%rbp), %rdx
callq 0x4140
leaq 0x1f456(%rip), %rsi     # 0x2404b
leaq -0x4f0(%rbp), %rdi
leaq -0x80(%rbp), %rdx
callq 0x4140
pushq $0x68
popq %rsi
leaq -0x550(%rbp), %rdx
leaq -0x530(%rbp), %rcx
leaq -0x510(%rbp), %r8
leaq -0x4f0(%rbp), %r9
movq %r15, %rdi
callq 0x6ac8
movq %rax, %r15
leaq 0x1f422(%rip), %rsi     # 0x24058
leaq -0x4d0(%rbp), %rdi
leaq -0x60(%rbp), %rdx
callq 0x4140
leaq 0x1f41b(%rip), %rsi     # 0x24068
leaq -0x4b0(%rbp), %rdi
leaq -0x88(%rbp), %rdx
callq 0x4140
leaq 0x1f8e0(%rip), %rsi     # 0x24547
leaq -0x490(%rbp), %rdi
leaq -0x38(%rbp), %rdx
callq 0x4140
leaq 0x1f3ee(%rip), %rsi     # 0x2406c
leaq -0x470(%rbp), %rdi
leaq -0x68(%rbp), %rdx
callq 0x4140
pushq $0x76
popq %rsi
leaq -0x4d0(%rbp), %rdx
leaq -0x4b0(%rbp), %rcx
leaq -0x490(%rbp), %r8
leaq -0x470(%rbp), %r9
movq %r15, %rdi
callq 0x6ac8
movq %rax, %r15
leaq 0x1f3c0(%rip), %rsi     # 0x2407f
leaq -0x450(%rbp), %rdi
leaq -0x29(%rbp), %rdx
callq 0x4140
leaq 0x1f392(%rip), %rsi     # 0x24068
leaq -0x430(%rbp), %rdi
leaq -0x3f(%rbp), %rdx
callq 0x4140
leaq 0x1f85a(%rip), %rsi     # 0x24547
leaq -0x410(%rbp), %rdi
leaq -0x3e(%rbp), %rdx
callq 0x4140
leaq 0x1f38c(%rip), %rsi     # 0x24090
leaq -0x3f0(%rbp), %rdi
leaq -0x3d(%rbp), %rdx
callq 0x4140
pushq $0x74
popq %rsi
leaq -0x450(%rbp), %rdx
leaq -0x430(%rbp), %rcx
leaq -0x410(%rbp), %r8
leaq -0x3f0(%rbp), %r9
movq %r15, %rdi
callq 0x6ac8
movq %rax, %r15
leaq 0x1f35d(%rip), %rsi     # 0x240a2
leaq -0x3d0(%rbp), %rdi
leaq -0x3c(%rbp), %rdx
callq 0x4140
leaq 0x1f7eb(%rip), %rsi     # 0x24547
leaq -0x3b0(%rbp), %rdi
leaq -0x3b(%rbp), %rdx
callq 0x4140
leaq 0x1f7d4(%rip), %rsi     # 0x24547
leaq -0x390(%rbp), %rdi
leaq -0x3a(%rbp), %rdx
callq 0x4140
leaq 0x1f31e(%rip), %rsi     # 0x240a8
leaq -0x370(%rbp), %rdi
leaq -0x39(%rbp), %rdx
callq 0x4140
pushq $0x38
popq %rsi
leaq -0x3d0(%rbp), %rdx
leaq -0x3b0(%rbp), %rcx
leaq -0x390(%rbp), %r8
leaq -0x370(%rbp), %r9
movq %r15, %rdi
callq 0x6ac8
leaq -0x370(%rbp), %rdi
callq 0x46a8
leaq -0x390(%rbp), %rdi
callq 0x46a8
leaq -0x3b0(%rbp), %rdi
callq 0x46a8
leaq -0x3d0(%rbp), %rdi
callq 0x46a8
leaq -0x3f0(%rbp), %rdi
callq 0x46a8
leaq -0x410(%rbp), %rdi
callq 0x46a8
leaq -0x430(%rbp), %rdi
callq 0x46a8
leaq -0x450(%rbp), %rdi
callq 0x46a8
leaq -0x470(%rbp), %rdi
callq 0x46a8
leaq -0x490(%rbp), %rdi
callq 0x46a8
leaq -0x4b0(%rbp), %rdi
callq 0x46a8
leaq -0x4d0(%rbp), %rdi
callq 0x46a8
leaq -0x4f0(%rbp), %rdi
callq 0x46a8
leaq -0x510(%rbp), %rdi
callq 0x46a8
leaq -0x530(%rbp), %rdi
callq 0x46a8
leaq -0x550(%rbp), %rdi
callq 0x46a8
leaq -0x570(%rbp), %rdi
callq 0x46a8
leaq -0x658(%rbp), %rdi
movl %r14d, %esi
movq %rbx, %rdx
callq 0x732e
movq -0x5b8(%rbp), %rax
subq -0x5c0(%rbp), %rax
cmpq $0x40, %rax
je 0x4ecc
movq 0x31106(%rip), %rax     # 0x35fc0
movq (%rax), %rsi
leaq -0x658(%rbp), %rdi
pushq $0x1
popq %rdx
callq 0x7816
leaq 0x1f1cf(%rip), %rsi     # 0x240a2
leaq -0x350(%rbp), %rdi
leaq -0x120(%rbp), %rdx
callq 0x4140
leaq -0x658(%rbp), %rdi
leaq -0x350(%rbp), %rsi
callq 0x73ce
movb 0x4a(%rax), %r13b
leaq -0x350(%rbp), %rdi
callq 0x46a8
movq -0x5c0(%rbp), %rsi
leaq -0x330(%rbp), %rdi
callq 0x4460
movq -0x5c0(%rbp), %rsi
addq $0x20, %rsi
leaq -0x310(%rbp), %rdi
callq 0x4460
leaq 0x1f21b(%rip), %rsi     # 0x24155
leaq -0x160(%rbp), %rdi
leaq -0x120(%rbp), %rdx
callq 0x4140
leaq -0x658(%rbp), %rdi
leaq -0x160(%rbp), %rsi
callq 0x73ce
cmpb $0x0, 0x4a(%rax)
je 0x501b
leaq -0x160(%rbp), %rdi
callq 0x46a8
leaq 0x1f1d8(%rip), %rsi     # 0x24155
leaq -0x140(%rbp), %rdi
leaq -0x120(%rbp), %rdx
callq 0x4140
leaq -0x658(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0x73ce
cmpb $0x1, 0x4a(%rax)
jne 0x508e
leaq 0x1f164(%rip), %rsi     # 0x24118
leaq -0x2d0(%rbp), %rdi
leaq -0xa8(%rbp), %rdx
callq 0x4140
leaq -0x658(%rbp), %rdi
leaq -0x2d0(%rbp), %rsi
callq 0x73ce
movb 0x4a(%rax), %bl
leaq -0x2d0(%rbp), %rdi
callq 0x46a8
leaq -0x140(%rbp), %rdi
callq 0x46a8
cmpb $0x1, %bl
jne 0x509a
movq 0x30fe3(%rip), %rdi     # 0x35fe8
leaq 0x1f0e4(%rip), %rsi     # 0x240f0
callq 0x4340
movq %rax, %rdi
callq 0x4180
jmp 0x5086
leaq 0x1f0f6(%rip), %rsi     # 0x24118
leaq -0x2f0(%rbp), %rdi
leaq -0xa8(%rbp), %rdx
callq 0x4140
leaq -0x658(%rbp), %rdi
leaq -0x2f0(%rbp), %rsi
callq 0x73ce
movb 0x4a(%rax), %bl
leaq -0x2f0(%rbp), %rdi
callq 0x46a8
leaq -0x160(%rbp), %rdi
callq 0x46a8
testb %bl, %bl
jne 0x4f76
movq 0x30f76(%rip), %rdi     # 0x35fe8
leaq 0x1f04f(%rip), %rsi     # 0x240c8
callq 0x4340
movq %rax, %rdi
callq 0x4180
pushq $0x1
popq %rdi
callq 0x43c0
leaq -0x140(%rbp), %rdi
callq 0x46a8
leaq 0x1f0b4(%rip), %rsi     # 0x24155
leaq -0x2b0(%rbp), %rdi
leaq -0x120(%rbp), %rdx
callq 0x4140
leaq -0x658(%rbp), %rdi
leaq -0x2b0(%rbp), %rsi
callq 0x73ce
movb 0x4a(%rax), %bl
leaq -0x2b0(%rbp), %rdi
callq 0x46a8
movzbl %r13b, %eax
movl %eax, -0x64(%rbp)
cmpb $0x1, %bl
jne 0x51c3
leaq 0x1f068(%rip), %rsi     # 0x24155
leaq -0x290(%rbp), %rdi
leaq -0x120(%rbp), %rdx
callq 0x4140
leaq -0x658(%rbp), %rdi
leaq -0x290(%rbp), %rsi
callq 0x73ce
movq %rax, %rdi
callq 0x6a30
leaq -0x1a0(%rbp), %rdi
movq %rax, %rsi
callq 0x41c0
leaq -0x290(%rbp), %rdi
callq 0x46a8
movq 0x30eab(%rip), %rdi     # 0x35fe8
leaq 0x1efe0(%rip), %rsi     # 0x24124
callq 0x4340
leaq -0x1a0(%rbp), %rsi
movq %rax, %rdi
callq 0x4300
movq %rax, %rdi
callq 0x4180
leaq -0x270(%rbp), %rdi
leaq -0x1a0(%rbp), %rsi
callq 0x4460
leaq -0x270(%rbp), %rdi
leaq -0x1d0(%rbp), %rsi
leaq -0x68(%rbp), %rdx
movl -0x64(%rbp), %ecx
callq 0x1c16a
movl %eax, %ebx
leaq -0x270(%rbp), %rdi
callq 0x46a8
testl %ebx, %ebx
jns 0x52f4
movq 0x30e3e(%rip), %rdi     # 0x35fe8
leaq 0x1ef87(%rip), %rsi     # 0x24138
callq 0x4340
movq %rax, %rdi
callq 0x4180
jmp 0x5086
xorl %r14d, %r14d
leaq 0x1ef4b(%rip), %rsi     # 0x24118
leaq -0x250(%rbp), %rdi
leaq -0x120(%rbp), %rdx
callq 0x4140
leaq -0x658(%rbp), %rdi
leaq -0x250(%rbp), %rsi
callq 0x73ce
movb 0x4a(%rax), %bl
leaq -0x250(%rbp), %rdi
callq 0x46a8
movb %bl, -0x2a(%rbp)
cmpb $0x1, %bl
jne 0x53f0
leaq 0x1ef03(%rip), %rsi     # 0x24118
leaq -0x230(%rbp), %rdi
leaq -0x120(%rbp), %rdx
callq 0x4140
leaq -0x658(%rbp), %rdi
leaq -0x230(%rbp), %rsi
callq 0x73ce
movq %rax, %rdi
callq 0x6a30
leaq -0x180(%rbp), %rdi
movq %rax, %rsi
callq 0x41c0
leaq -0x230(%rbp), %rdi
callq 0x46a8
movq 0x30d83(%rip), %rdi     # 0x35fe8
leaq 0x1ef0c(%rip), %rsi     # 0x24178
callq 0x4340
leaq -0x180(%rbp), %rsi
movq %rax, %rdi
callq 0x4300
movq %rax, %rdi
callq 0x4180
leaq -0x5a0(%rbp), %rdi
leaq -0x180(%rbp), %rsi
callq 0x20728
movl %eax, %ebx
leaq -0x5a0(%rbp), %rdi
leaq -0x1d0(%rbp), %rsi
callq 0x20e08
movl $0x120, %edi            # imm = 0x120
callq 0x4350
movq %rax, %r14
leaq -0x1d0(%rbp), %rsi
movq %rax, %rdi
callq 0xc0fc
testl %ebx, %ebx
jns 0x5383
movq 0x30d0d(%rip), %rdi     # 0x35fe8
leaq 0x1eeab(%rip), %rsi     # 0x2418d
callq 0x4340
movq %rax, %rdi
callq 0x4180
jmp 0x5086
movq 0x30ced(%rip), %rdi     # 0x35fe8
leaq 0x1f244(%rip), %rsi     # 0x24546
callq 0x4340
leaq 0x1eeb3(%rip), %rsi     # 0x241c1
movq %rax, %rdi
callq 0x4340
movq -0x1a8(%rbp), %rsi
movq %rax, %rdi
callq 0x4250
movq %rax, %rdi
callq 0x4180
movq 0x30cb4(%rip), %rdi     # 0x35fe8
leaq 0x1f20b(%rip), %rsi     # 0x24546
callq 0x4340
leaq 0x1ee19(%rip), %rsi     # 0x24160
movq %rax, %rdi
callq 0x4340
movl -0x68(%rbp), %esi
movq %rax, %rdi
callq 0x45c0
movq %rax, %rdi
callq 0x4180
movl $0x120, %edi            # imm = 0x120
callq 0x4350
movq %rax, %r14
leaq -0x1d0(%rbp), %rsi
movq %rax, %rdi
callq 0xc0fc
jmp 0x51c6
movq 0x30c5e(%rip), %rdi     # 0x35fe8
leaq 0x1f1b5(%rip), %rsi     # 0x24546
callq 0x4340
leaq 0x1ee19(%rip), %rsi     # 0x241b6
movq %rax, %rdi
callq 0x4340
movq -0x578(%rbp), %rsi
movq %rax, %rdi
callq 0x4250
movq %rax, %rdi
callq 0x4180
movq 0x30c25(%rip), %rdi     # 0x35fe8
leaq 0x1f17c(%rip), %rsi     # 0x24546
callq 0x4340
leaq 0x1edf2(%rip), %rsi     # 0x241c8
movq %rax, %rdi
callq 0x4340
movq %rax, %rdi
movl %ebx, %esi
callq 0x45c0
movq %rax, %rdi
callq 0x4180
movq 0x30bf1(%rip), %rdi     # 0x35fe8
leaq 0x1edd8(%rip), %rsi     # 0x241d6
callq 0x4340
movq %rax, %rdi
callq 0x4180
leaq -0x210(%rbp), %rdi
leaq -0x330(%rbp), %rsi
callq 0x4460
leaq -0x88(%rbp), %rdi
leaq -0x210(%rbp), %rsi
callq 0x60fc
leaq -0x210(%rbp), %rdi
callq 0x46a8
leaq -0x1f0(%rbp), %rdi
leaq -0x310(%rbp), %rsi
callq 0x4460
leaq -0x38(%rbp), %rdi
leaq -0x1f0(%rbp), %rsi
callq 0x62d8
leaq -0x1f0(%rbp), %rdi
callq 0x46a8
leaq -0x98(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq -0x120(%rbp), %rbx
movq -0x88(%rbp), %rdi
movq (%rdi), %rax
leaq -0xa8(%rbp), %rsi
callq *(%rax)
testb %al, %al
je 0x5776
xorps %xmm0, %xmm0
movaps %xmm0, -0x80(%rbp)
andq $0x0, -0x70(%rbp)
testb %r13b, %r13b
je 0x551b
andl $0x0, -0x120(%rbp)
leaq -0x80(%rbp), %rdi
movq %rbx, %rsi
callq 0x5b66
andl $0x0, -0x120(%rbp)
xorl %eax, %eax
movl %eax, %eax
cmpq %rax, -0xa0(%rbp)
jbe 0x556a
movq -0xa8(%rbp), %rcx
movb (%rcx,%rax), %dl
pushq $0x1
popq %rcx
testb %dl, %dl
jns 0x54ff
pushq $0x4
popq %rcx
cmpb $-0x11, %dl
ja 0x54ff
cmpb $-0x20, %dl
pushq $0x2
popq %rcx
sbbl $-0x1, %ecx
addl %ecx, %eax
movl %eax, -0x120(%rbp)
leaq -0x80(%rbp), %rdi
movq %rbx, %rsi
callq 0x5b40
movl -0x120(%rbp), %eax
jmp 0x54ce
movq %rbx, %rdi
leaq -0xa8(%rbp), %rsi
callq 0x4460
movq -0x80(%rbp), %rax
cmpq %rax, -0x78(%rbp)
je 0x5538
movq %rax, -0x78(%rbp)
xorl %eax, %eax
movl %eax, -0x60(%rbp)
movl %eax, %eax
movq -0x118(%rbp), %rcx
incq %rcx
cmpq %rax, %rcx
jbe 0x5562
leaq -0x80(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x5b40
movl -0x60(%rbp), %eax
incl %eax
jmp 0x553a
movq %rbx, %rdi
callq 0x46a8
pushq $0x1
popq %rax
movl %eax, %r15d
leal -0x1(%r15), %ecx
movq -0x80(%rbp), %rax
movq -0x78(%rbp), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
decq %rdx
cmpq %rcx, %rdx
jbe 0x55d4
movl (%rax,%rcx,4), %edx
movl %r15d, %ecx
movl (%rax,%rcx,4), %ecx
subl %edx, %ecx
movq %rbx, %rdi
leaq -0xa8(%rbp), %rsi
callq 0x4360
movq %r14, %rdi
movq %rbx, %rsi
callq 0xc5e6
testb %al, %al
jne 0x55c7
movq %r14, %rdi
movq %rbx, %rsi
movsd 0x1ea46(%rip), %xmm0    # 0x24008
callq 0xc2fe
movq %rbx, %rdi
callq 0x46a8
incl %r15d
jmp 0x5570
xorps %xmm0, %xmm0
movaps %xmm0, -0x60(%rbp)
andq $0x0, -0x50(%rbp)
cmpb $0x0, -0x2a(%rbp)
je 0x563c
movq %rbx, %rdi
leaq -0xa8(%rbp), %rsi
leaq 0x30d89(%rip), %rdx     # 0x36380
movq %r14, %rcx
xorl %r8d, %r8d
callq 0xdd5c
leaq -0x5a0(%rbp), %rdi
movq %rbx, %rsi
leaq -0x60(%rbp), %rdx
pushq $0x1
popq %rcx
callq 0x1687b
movq -0x60(%rbp), %rsi
leaq -0x60(%rbp), %rdi
callq 0x5aae
movq -0x58(%rbp), %rsi
leaq -0x60(%rbp), %rdi
callq 0x5aae
movq %rbx, %rdi
callq 0xf0e0
jmp 0x5656
movq %r14, %rdi
leaq -0xa8(%rbp), %rsi
leaq -0x60(%rbp), %rdx
pushq $0x1
popq %rcx
movl -0x64(%rbp), %r8d
callq 0x15d83
movq -0x60(%rbp), %rdi
movq -0x58(%rbp), %rax
cmpq %rdi, %rax
je 0x5735
xorl %r15d, %r15d
movl %r15d, %r15d
subq %rdi, %rax
sarq $0x5, %rax
cmpq %r15, %rax
jbe 0x570c
movq %r15, %r12
shlq $0x5, %r12
addq %r12, %rdi
leaq 0x1ed26(%rip), %rsi     # 0x243b4
callq 0x5ab8
testb %al, %al
je 0x56c0
movq %rbx, %rdi
leaq 0x1eea5(%rip), %rsi     # 0x24546
leaq -0x29(%rbp), %rdx
callq 0x4140
leaq -0x38(%rbp), %rdi
movq %rbx, %rsi
callq 0x6410
movq %rbx, %rdi
callq 0x46a8
jmp 0x56fc
testq %r15, %r15
je 0x56ec
movq %rbx, %rdi
leaq 0x1ece5(%rip), %rsi     # 0x243b4
leaq -0x29(%rbp), %rdx
callq 0x4140
leaq -0x38(%rbp), %rdi
movq %rbx, %rsi
callq 0x6410
movq %rbx, %rdi
callq 0x46a8
addq -0x60(%rbp), %r12
leaq -0x38(%rbp), %rdi
movq %r12, %rsi
callq 0x6410
incl %r15d
movq -0x60(%rbp), %rdi
movq -0x58(%rbp), %rax
jmp 0x566a
movq %rbx, %rdi
leaq 0x1ec88(%rip), %rsi     # 0x2439e
leaq -0x29(%rbp), %rdx
callq 0x4140
leaq -0x38(%rbp), %rdi
movq %rbx, %rsi
callq 0x6410
movq %rbx, %rdi
callq 0x46a8
jmp 0x575f
movq 0x308ac(%rip), %rdi     # 0x35fe8
leaq 0x1eaa5(%rip), %rsi     # 0x241e8
callq 0x4340
movq %rax, %rdi
leaq -0xa8(%rbp), %rsi
callq 0x4300
movq %rax, %rdi
callq 0x4180
leaq -0x60(%rbp), %rdi
callq 0x5ac8
leaq -0x80(%rbp), %rdi
callq 0x601c
jmp 0x5486
leaq -0x38(%rbp), %rdi
callq 0x63e0
testq %r14, %r14
je 0x5794
movq %r14, %rdi
callq 0xc3b0
movq %r14, %rdi
callq 0x4320
xorl %edi, %edi
callq 0x43c0
jmp 0x57ba
jmp 0x57d9
jmp 0x57ea
jmp 0x57a5
jmp 0x57a5
movq %rax, %rbx
leaq -0x120(%rbp), %rdi
callq 0xf0e0
jmp 0x57ed
jmp 0x57ea
jmp 0x57fc
movq %rax, %rbx
jmp 0x5819
jmp 0x57c3
jmp 0x57ea
movq %rax, %rbx
movq %r14, %rdi
callq 0x4320
jmp 0x58fe
jmp 0x57d9
jmp 0x57ea
jmp 0x57ea
movq %rax, %rbx
leaq -0x120(%rbp), %rdi
callq 0x46a8
jmp 0x57ed
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
callq 0x5ac8
jmp 0x5810
jmp 0x5801
jmp 0x57fc
movq %rax, %rbx
jmp 0x5810
movq %rax, %rbx
leaq -0x120(%rbp), %rdi
callq 0x46a8
leaq -0x80(%rbp), %rdi
callq 0x601c
leaq -0xa8(%rbp), %rdi
callq 0x46a8
leaq -0x38(%rbp), %rdi
callq 0x63cc
jmp 0x5858
jmp 0x58fb
movq %rax, %rbx
leaq -0x1f0(%rbp), %rdi
callq 0x46a8
jmp 0x5858
movq %rax, %rbx
leaq -0x270(%rbp), %rdi
jmp 0x58f4
movq %rax, %rbx
leaq -0x88(%rbp), %rdi
callq 0x61f0
jmp 0x58fe
jmp 0x58fb
movq %rax, %rbx
leaq -0x210(%rbp), %rdi
jmp 0x58f4
jmp 0x58fb
movq %rax, %rbx
leaq -0x230(%rbp), %rdi
jmp 0x58f4
jmp 0x58fb
movq %rax, %rbx
leaq -0x250(%rbp), %rdi
jmp 0x58f4
movq %rax, %rbx
leaq -0x290(%rbp), %rdi
jmp 0x58f4
jmp 0x58fb
jmp 0x58fb
movq %rax, %rbx
leaq -0x2d0(%rbp), %rdi
callq 0x46a8
jmp 0x58dd
movq %rax, %rbx
leaq -0x2b0(%rbp), %rdi
jmp 0x58f4
jmp 0x58da
jmp 0x58fb
jmp 0x58fb
movq %rax, %rbx
leaq -0x2f0(%rbp), %rdi
callq 0x46a8
jmp 0x58ed
movq %rax, %rbx
leaq -0x140(%rbp), %rdi
jmp 0x58f4
jmp 0x58ea
jmp 0x58fb
movq %rax, %rbx
leaq -0x160(%rbp), %rdi
callq 0x46a8
jmp 0x58fe
movq %rax, %rbx
leaq -0x310(%rbp), %rdi
callq 0x46a8
jmp 0x590f
movq %rax, %rbx
leaq -0x330(%rbp), %rdi
jmp 0x5a5b
jmp 0x5a62
movq %rax, %rbx
leaq -0x350(%rbp), %rdi
jmp 0x5a5b
jmp 0x5a62
jmp 0x5a62
movq %rax, %rbx
leaq -0x370(%rbp), %rdi
callq 0x46a8
jmp 0x594d
movq %rax, %rbx
leaq -0x390(%rbp), %rdi
callq 0x46a8
jmp 0x595e
movq %rax, %rbx
leaq -0x3b0(%rbp), %rdi
callq 0x46a8
jmp 0x596f
movq %rax, %rbx
leaq -0x3d0(%rbp), %rdi
callq 0x46a8
jmp 0x5982
jmp 0x597f
movq %rax, %rbx
leaq -0x3f0(%rbp), %rdi
callq 0x46a8
jmp 0x5993
movq %rax, %rbx
leaq -0x410(%rbp), %rdi
callq 0x46a8
jmp 0x59a4
movq %rax, %rbx
leaq -0x430(%rbp), %rdi
callq 0x46a8
jmp 0x59b5
movq %rax, %rbx
leaq -0x450(%rbp), %rdi
callq 0x46a8
jmp 0x59c8
jmp 0x59c5
movq %rax, %rbx
leaq -0x470(%rbp), %rdi
callq 0x46a8
jmp 0x59d9
movq %rax, %rbx
leaq -0x490(%rbp), %rdi
callq 0x46a8
jmp 0x59ea
movq %rax, %rbx
leaq -0x4b0(%rbp), %rdi
callq 0x46a8
jmp 0x59fb
movq %rax, %rbx
leaq -0x4d0(%rbp), %rdi
callq 0x46a8
jmp 0x5a0e
jmp 0x5a0b
movq %rax, %rbx
leaq -0x4f0(%rbp), %rdi
callq 0x46a8
jmp 0x5a1f
movq %rax, %rbx
leaq -0x510(%rbp), %rdi
callq 0x46a8
jmp 0x5a30
movq %rax, %rbx
leaq -0x530(%rbp), %rdi
callq 0x46a8
jmp 0x5a41
movq %rax, %rbx
leaq -0x550(%rbp), %rdi
callq 0x46a8
jmp 0x5a54
jmp 0x5a51
movq %rax, %rbx
leaq -0x570(%rbp), %rdi
callq 0x46a8
jmp 0x5a65
movq %rax, %rbx
leaq -0x658(%rbp), %rdi
callq 0x5af4
jmp 0x5a76
movq %rax, %rbx
leaq -0x5a0(%rbp), %rdi
callq 0x5f0c
leaq -0x1d0(%rbp), %rdi
callq 0x5fa4
leaq -0x180(%rbp), %rdi
callq 0x46a8
leaq -0x1a0(%rbp), %rdi
callq 0x46a8
movq %rbx, %rdi
callq 0x45e0