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

    conf::Config config;
    config("usage: 1g-threshold [OPTION...] WORDLIST VOCAB_INIT VOCAB_FINAL\n")
      ('h', "help", "", "", "display help")
      ('i', "threshold-increment=FLOAT", "arg", "1.0", "Threshold increment for each iteration, DEFAULT: 1.0")
      ('m', "min-length=INT", "arg", "2", "Minimum length of subwords to remove, DEFAULT: 2")
      ('v', "vocab-size=INT", "arg must", "", "Target vocabulary size")
      ('s', "stop-list=STRING", "arg", "", "Text file containing subwords that should not be removed")
      ('f', "forward-backward", "", "", "Use Forward-backward segmentation instead of Viterbi")
      ('8', "utf-8", "", "", "Utf-8 character encoding in use");
    config.default_parse(argc, argv);
    if (config.arguments.size() != 3) config.print_help(stderr, 1);

    flt_type subword_min_lp = -25.0;
    string wordlist_fname = config.arguments[0];
    string vocab_fname = config.arguments[1];
    string out_vocab_fname = config.arguments[2];
    float threshold_increment = config["threshold-increment"].get_float();
    unsigned int min_removal_length = config["min-length"].get_int();
    unsigned int target_vocab_size = config["vocab-size"].get_int();
    bool enable_forward_backward = config["forward-backward"].specified;
    bool utf8_encoding = config["utf-8"].specified;

    set<string> stoplist;
    if (config["stop-list"].specified) {
        vector<string> stopstrings;
        Unigrams::read_sents(config["stop-list"].get_str(), stopstrings);
        stoplist.insert(stopstrings.begin(), stopstrings.end());
    }

    cerr << setprecision(15) << std::boolalpha;
    cerr << "parameters, wordlist: " << wordlist_fname << endl;
    cerr << "parameters, initial vocabulary: " << vocab_fname << endl;
    cerr << "parameters, final vocabulary: " << out_vocab_fname << endl;
    cerr << "parameters, threshold increment: " << threshold_increment << endl;
    cerr << "parameters, minimum length for subwords to remove: " << min_removal_length << endl;
    if (stoplist.size() > 0)
        cerr << "parameters, stoplist with " << stoplist.size() << " subwords" << endl;
    cerr << "parameters, target vocab size: " << target_vocab_size << endl;
    cerr << "parameters, use forward-backward: " << enable_forward_backward << endl;
    cerr << "parameters, utf-8 encoding: " << utf8_encoding << endl;

    int maxlen, word_maxlen;
    set<string> short_subwords;
    map<string, flt_type> vocab;
    map<string, flt_type> freqs;
    map<string, flt_type> words;

    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;
    find_short_factors(vocab, short_subwords, min_removal_length, utf8_encoding);

    set<string> stop_union;
    set_union(stoplist.begin(), stoplist.end(),
              short_subwords.begin(), short_subwords.end(),
              inserter(stop_union, stop_union.begin()));
    stoplist = stop_union;

    cerr << "Reading word list " << wordlist_fname << endl;
    retval = Unigrams::read_vocab(wordlist_fname, words, word_maxlen, utf8_encoding);
    if (retval < 0) {
        cerr << "something went wrong reading word list" << endl;
        exit(EXIT_FAILURE);
    }
    cerr << "\t" << "wordlist size: " << words.size() << endl;
    cerr << "\t" << "maximum word length: " << word_maxlen << endl;

    Unigrams ug;
    if (enable_forward_backward)
        ug.set_segmentation_method(forward_backward);
    else
        ug.set_segmentation_method(viterbi);
    ug.set_utf8(utf8_encoding);

    flt_type cost = ug.resegment_words(words, vocab, freqs);
    cerr << endl << "Initial likelihood: " << cost << endl;

    flt_type threshold_value = 0.0;
    while (target_vocab_size > 0 && vocab.size() > target_vocab_size) {
        threshold_value += threshold_increment;
        ug.cutoff(freqs, threshold_value, stoplist, min_removal_length);
        cerr << "\tthreshold: " << threshold_value << "\t" << "vocabulary size: " << freqs.size() << endl;
        vocab = freqs;
        Unigrams::freqs_to_logprobs(vocab);
        assert_factors(vocab, stoplist, subword_min_lp);
        cost = ug.resegment_words(words, vocab, freqs);
        cerr << "likelihood: " << cost << endl;
    }

    Unigrams::write_vocab(out_vocab_fname, vocab);
    exit(EXIT_SUCCESS);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x818, %rsp            # imm = 0x818
movq %rsi, %rbx
movl %edi, %r14d
leaq -0x808(%rbp), %rdi
callq 0x7f34
leaq 0x1f4f9(%rip), %rsi     # 0x24022
leaq -0x750(%rbp), %rdi
leaq -0xb8(%rbp), %rdx
callq 0x4140
leaq -0x808(%rbp), %rdi
leaq -0x750(%rbp), %rsi
callq 0x7fa0
movq %rax, %r15
leaq 0x1f512(%rip), %rsi     # 0x2406b
leaq -0x730(%rbp), %rdi
leaq -0xf0(%rbp), %rdx
callq 0x4140
leaq 0x1fbf4(%rip), %rsi     # 0x24767
leaq -0x710(%rbp), %rdi
leaq -0x120(%rbp), %rdx
callq 0x4140
leaq 0x1fbda(%rip), %rsi     # 0x24767
leaq -0x6f0(%rbp), %rdi
leaq -0x2b0(%rbp), %rdx
callq 0x4140
leaq 0x1f4bc(%rip), %rsi     # 0x24063
leaq -0x6d0(%rbp), %rdi
leaq -0x220(%rbp), %rdx
callq 0x4140
pushq $0x68
popq %rsi
leaq -0x730(%rbp), %rdx
leaq -0x710(%rbp), %rcx
leaq -0x6f0(%rbp), %r8
leaq -0x6d0(%rbp), %r9
movq %r15, %rdi
callq 0x7fb8
movq %rax, %r15
leaq 0x1f485(%rip), %rsi     # 0x24070
leaq -0x6b0(%rbp), %rdi
leaq -0x158(%rbp), %rdx
callq 0x4140
leaq 0x1f485(%rip), %rsi     # 0x2408a
leaq -0x690(%rbp), %rdi
leaq -0x1d0(%rbp), %rdx
callq 0x4140
leaq 0x1f4a0(%rip), %rsi     # 0x240bf
leaq -0x670(%rbp), %rdi
leaq -0x1b0(%rbp), %rdx
callq 0x4140
leaq 0x1f455(%rip), %rsi     # 0x2408e
leaq -0x650(%rbp), %rdi
leaq -0x1f0(%rbp), %rdx
callq 0x4140
pushq $0x69
popq %rsi
leaq -0x6b0(%rbp), %rdx
leaq -0x690(%rbp), %rcx
leaq -0x670(%rbp), %r8
leaq -0x650(%rbp), %r9
movq %r15, %rdi
callq 0x7fb8
movq %rax, %r15
leaq 0x1f446(%rip), %rsi     # 0x240c3
leaq -0x630(%rbp), %rdi
leaq -0x80(%rbp), %rdx
callq 0x4140
leaq 0x1f3f6(%rip), %rsi     # 0x2408a
leaq -0x610(%rbp), %rdi
leaq -0x30(%rbp), %rdx
callq 0x4140
leaq 0x1f456(%rip), %rsi     # 0x24101
leaq -0x5f0(%rbp), %rdi
leaq -0x68(%rbp), %rdx
callq 0x4140
leaq 0x1f410(%rip), %rsi     # 0x240d2
leaq -0x5d0(%rbp), %rdi
leaq -0x49(%rbp), %rdx
callq 0x4140
pushq $0x6d
popq %rsi
leaq -0x630(%rbp), %rdx
leaq -0x610(%rbp), %rcx
leaq -0x5f0(%rbp), %r8
leaq -0x5d0(%rbp), %r9
movq %r15, %rdi
callq 0x7fb8
movq %rax, %r15
leaq 0x1f400(%rip), %rsi     # 0x24103
leaq -0x5b0(%rbp), %rdi
leaq -0x48(%rbp), %rdx
callq 0x4140
leaq 0x1f3f8(%rip), %rsi     # 0x24112
leaq -0x590(%rbp), %rdi
leaq -0x47(%rbp), %rdx
callq 0x4140
leaq 0x1fa36(%rip), %rsi     # 0x24767
leaq -0x570(%rbp), %rdi
leaq -0x46(%rbp), %rdx
callq 0x4140
leaq 0x1f3d3(%rip), %rsi     # 0x2411b
leaq -0x550(%rbp), %rdi
leaq -0x45(%rbp), %rdx
callq 0x4140
pushq $0x76
popq %rsi
leaq -0x5b0(%rbp), %rdx
leaq -0x590(%rbp), %rcx
leaq -0x570(%rbp), %r8
leaq -0x550(%rbp), %r9
movq %r15, %rdi
callq 0x7fb8
movq %rax, %r15
leaq 0x1f3a9(%rip), %rsi     # 0x24132
leaq -0x530(%rbp), %rdi
leaq -0x44(%rbp), %rdx
callq 0x4140
leaq 0x1f2ea(%rip), %rsi     # 0x2408a
leaq -0x510(%rbp), %rdi
leaq -0x43(%rbp), %rdx
callq 0x4140
leaq 0x1f9b0(%rip), %rsi     # 0x24767
leaq -0x4f0(%rbp), %rdi
leaq -0x42(%rbp), %rdx
callq 0x4140
leaq 0x1f375(%rip), %rsi     # 0x24143
leaq -0x4d0(%rbp), %rdi
leaq -0x41(%rbp), %rdx
callq 0x4140
pushq $0x73
popq %rsi
leaq -0x530(%rbp), %rdx
leaq -0x510(%rbp), %rcx
leaq -0x4f0(%rbp), %r8
leaq -0x4d0(%rbp), %r9
movq %r15, %rdi
callq 0x7fb8
movq %rax, %r15
leaq 0x1f36d(%rip), %rsi     # 0x2417c
leaq -0x4b0(%rbp), %rdi
leaq -0x40(%rbp), %rdx
callq 0x4140
leaq 0x1f941(%rip), %rsi     # 0x24767
leaq -0x490(%rbp), %rdi
leaq -0x3f(%rbp), %rdx
callq 0x4140
leaq 0x1f92a(%rip), %rsi     # 0x24767
leaq -0x470(%rbp), %rdi
leaq -0x3e(%rbp), %rdx
callq 0x4140
leaq 0x1f339(%rip), %rsi     # 0x2418d
leaq -0x450(%rbp), %rdi
leaq -0x3d(%rbp), %rdx
callq 0x4140
pushq $0x66
popq %rsi
leaq -0x4b0(%rbp), %rdx
leaq -0x490(%rbp), %rcx
leaq -0x470(%rbp), %r8
leaq -0x450(%rbp), %r9
movq %r15, %rdi
callq 0x7fb8
movq %rax, %r15
leaq 0x1f32d(%rip), %rsi     # 0x241c2
leaq -0x430(%rbp), %rdi
leaq -0x3c(%rbp), %rdx
callq 0x4140
leaq 0x1f8bb(%rip), %rsi     # 0x24767
leaq -0x410(%rbp), %rdi
leaq -0x3b(%rbp), %rdx
callq 0x4140
leaq 0x1f8a4(%rip), %rsi     # 0x24767
leaq -0x3f0(%rbp), %rdi
leaq -0x3a(%rbp), %rdx
callq 0x4140
leaq 0x1f2ee(%rip), %rsi     # 0x241c8
leaq -0x3d0(%rbp), %rdi
leaq -0x39(%rbp), %rdx
callq 0x4140
pushq $0x38
popq %rsi
leaq -0x430(%rbp), %rdx
leaq -0x410(%rbp), %rcx
leaq -0x3f0(%rbp), %r8
leaq -0x3d0(%rbp), %r9
movq %r15, %rdi
callq 0x7fb8
leaq -0x3d0(%rbp), %rdi
callq 0x46b8
leaq -0x3f0(%rbp), %rdi
callq 0x46b8
leaq -0x410(%rbp), %rdi
callq 0x46b8
leaq -0x430(%rbp), %rdi
callq 0x46b8
leaq -0x450(%rbp), %rdi
callq 0x46b8
leaq -0x470(%rbp), %rdi
callq 0x46b8
leaq -0x490(%rbp), %rdi
callq 0x46b8
leaq -0x4b0(%rbp), %rdi
callq 0x46b8
leaq -0x4d0(%rbp), %rdi
callq 0x46b8
leaq -0x4f0(%rbp), %rdi
callq 0x46b8
leaq -0x510(%rbp), %rdi
callq 0x46b8
leaq -0x530(%rbp), %rdi
callq 0x46b8
leaq -0x550(%rbp), %rdi
callq 0x46b8
leaq -0x570(%rbp), %rdi
callq 0x46b8
leaq -0x590(%rbp), %rdi
callq 0x46b8
leaq -0x5b0(%rbp), %rdi
callq 0x46b8
leaq -0x5d0(%rbp), %rdi
callq 0x46b8
leaq -0x5f0(%rbp), %rdi
callq 0x46b8
leaq -0x610(%rbp), %rdi
callq 0x46b8
leaq -0x630(%rbp), %rdi
callq 0x46b8
leaq -0x650(%rbp), %rdi
callq 0x46b8
leaq -0x670(%rbp), %rdi
callq 0x46b8
leaq -0x690(%rbp), %rdi
callq 0x46b8
leaq -0x6b0(%rbp), %rdi
callq 0x46b8
leaq -0x6d0(%rbp), %rdi
callq 0x46b8
leaq -0x6f0(%rbp), %rdi
callq 0x46b8
leaq -0x710(%rbp), %rdi
callq 0x46b8
leaq -0x730(%rbp), %rdi
callq 0x46b8
leaq -0x750(%rbp), %rdi
callq 0x46b8
leaq -0x808(%rbp), %rdi
movl %r14d, %esi
movq %rbx, %rdx
callq 0x881e
movq -0x770(%rbp), %rsi
movq -0x768(%rbp), %rax
subq %rsi, %rax
cmpq $0x60, %rax
je 0x50b6
movq 0x30f23(%rip), %rax     # 0x35fc0
movq (%rax), %rsi
leaq -0x808(%rbp), %rdi
pushq $0x1
popq %rdx
callq 0x8d06
movq -0x770(%rbp), %rsi
leaq -0x1d0(%rbp), %rdi
callq 0x4460
movq -0x770(%rbp), %rsi
addq $0x20, %rsi
leaq -0x1b0(%rbp), %rdi
callq 0x4460
movq -0x770(%rbp), %rsi
addq $0x40, %rsi
leaq -0x1f0(%rbp), %rdi
callq 0x4460
leaq 0x1f0f1(%rip), %rsi     # 0x241e8
leaq -0x3b0(%rbp), %rdi
leaq -0xb8(%rbp), %rdx
callq 0x4140
leaq -0x808(%rbp), %rdi
leaq -0x3b0(%rbp), %rsi
callq 0x88be
movq %rax, %rdi
callq 0x7e64
movss %xmm0, -0x58(%rbp)
leaq -0x3b0(%rbp), %rdi
callq 0x46b8
leaq 0x1f0bf(%rip), %rsi     # 0x241fc
leaq -0x390(%rbp), %rdi
leaq -0xb8(%rbp), %rdx
callq 0x4140
leaq -0x808(%rbp), %rdi
leaq -0x390(%rbp), %rsi
callq 0x88be
movq %rax, %rdi
callq 0x7e04
movl %eax, -0x64(%rbp)
leaq -0x390(%rbp), %rdi
callq 0x46b8
leaq 0x1f086(%rip), %rsi     # 0x24207
leaq -0x370(%rbp), %rdi
leaq -0xb8(%rbp), %rdx
callq 0x4140
leaq -0x808(%rbp), %rdi
leaq -0x370(%rbp), %rsi
callq 0x88be
movq %rax, %rdi
callq 0x7e04
movl %eax, -0x60(%rbp)
leaq -0x370(%rbp), %rdi
callq 0x46b8
leaq 0x1efb7(%rip), %rsi     # 0x2417c
leaq -0x350(%rbp), %rdi
leaq -0xb8(%rbp), %rdx
callq 0x4140
leaq -0x808(%rbp), %rdi
leaq -0x350(%rbp), %rsi
callq 0x88be
movb 0x4a(%rax), %al
movb %al, -0x29(%rbp)
leaq -0x350(%rbp), %rdi
callq 0x46b8
leaq 0x1efbe(%rip), %rsi     # 0x241c2
leaq -0x330(%rbp), %rdi
leaq -0xb8(%rbp), %rdx
callq 0x4140
leaq -0x808(%rbp), %rdi
leaq -0x330(%rbp), %rsi
callq 0x88be
movb 0x4a(%rax), %al
movb %al, -0x38(%rbp)
leaq -0x330(%rbp), %rdi
callq 0x46b8
leaq -0xb0(%rbp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
leaq 0x1efb3(%rip), %rsi     # 0x24212
leaq -0x310(%rbp), %rdi
leaq -0xf0(%rbp), %rdx
callq 0x4140
leaq -0x808(%rbp), %rdi
leaq -0x310(%rbp), %rsi
callq 0x88be
movb 0x4a(%rax), %bl
leaq -0x310(%rbp), %rdi
callq 0x46b8
cmpb $0x1, %bl
jne 0x5344
xorps %xmm0, %xmm0
movaps %xmm0, -0xf0(%rbp)
andq $0x0, -0xe0(%rbp)
leaq 0x1ef5c(%rip), %rsi     # 0x24212
leaq -0x2d0(%rbp), %rdi
leaq -0x120(%rbp), %rdx
callq 0x4140
leaq -0x808(%rbp), %rdi
leaq -0x2d0(%rbp), %rsi
callq 0x88be
movq %rax, %rdi
callq 0x7f20
leaq -0x2f0(%rbp), %rdi
movq %rax, %rsi
callq 0x4460
leaq -0x2f0(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
callq 0x1d642
leaq -0x2f0(%rbp), %rdi
callq 0x46b8
leaq -0x2d0(%rbp), %rdi
callq 0x46b8
movq -0xf0(%rbp), %rsi
movq -0xe8(%rbp), %rdx
leaq -0xb8(%rbp), %rdi
callq 0x71a2
leaq -0xf0(%rbp), %rdi
callq 0x5f0a
movq 0x30c9d(%rip), %rdi     # 0x35fe8
movq (%rdi), %rax
movq -0x18(%rax), %rcx
movq $0xf, 0x8(%rdi,%rcx)
movq -0x18(%rax), %rax
orl $0x1, 0x18(%rdi,%rax)
leaq 0x1eeb1(%rip), %rsi     # 0x2421c
callq 0x4340
leaq -0x1d0(%rbp), %rsi
movq %rax, %rdi
callq 0x4300
movq %rax, %rdi
callq 0x4180
movq 0x30c5a(%rip), %rdi     # 0x35fe8
leaq 0x1ee9e(%rip), %rsi     # 0x24233
callq 0x4340
leaq -0x1b0(%rbp), %rsi
movq %rax, %rdi
callq 0x4300
movq %rax, %rdi
callq 0x4180
movq 0x30c30(%rip), %rdi     # 0x35fe8
leaq 0x1ee95(%rip), %rsi     # 0x24254
callq 0x4340
leaq -0x1f0(%rbp), %rsi
movq %rax, %rdi
callq 0x4300
movq %rax, %rdi
callq 0x4180
movq 0x30c06(%rip), %rdi     # 0x35fe8
leaq 0x1ee8a(%rip), %rsi     # 0x24273
callq 0x4340
movq %rax, %rdi
movss -0x58(%rbp), %xmm0
callq 0x42a0
movq %rax, %rdi
callq 0x4180
movq 0x30bde(%rip), %rdi     # 0x35fe8
leaq 0x1ee84(%rip), %rsi     # 0x24295
callq 0x4340
movl -0x64(%rbp), %esi
movq %rax, %rdi
movq %rsi, -0x88(%rbp)
callq 0x4250
movq %rax, %rdi
callq 0x4180
cmpq $0x0, -0x90(%rbp)
je 0x5473
movq 0x30ba7(%rip), %rdi     # 0x35fe8
leaq 0x1ee81(%rip), %rsi     # 0x242c9
callq 0x4340
movq -0x90(%rbp), %rsi
movq %rax, %rdi
callq 0x4250
leaq 0x1ee81(%rip), %rsi     # 0x242e4
movq %rax, %rdi
callq 0x4340
movq %rax, %rdi
callq 0x4180
movq 0x30b6e(%rip), %rdi     # 0x35fe8
leaq 0x1ee6d(%rip), %rsi     # 0x242ee
callq 0x4340
movl -0x60(%rbp), %esi
movq %rax, %rdi
movq %rsi, -0x128(%rbp)
callq 0x4250
movq %rax, %rdi
callq 0x4180
movq 0x30b41(%rip), %rdi     # 0x35fe8
leaq 0x1ee60(%rip), %rsi     # 0x2430e
callq 0x4340
movzbl -0x29(%rbp), %esi
movq %rax, %rdi
callq 0x4570
movq %rax, %rdi
callq 0x4180
movq 0x30b1a(%rip), %rdi     # 0x35fe8
leaq 0x1ee5c(%rip), %rsi     # 0x24331
callq 0x4340
movzbl -0x38(%rbp), %esi
movq %rax, %rdi
movl %esi, -0x5c(%rbp)
callq 0x4570
movq %rax, %rdi
callq 0x4180
leaq -0xe8(%rbp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
leaq -0x118(%rbp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
leaq -0x2a8(%rbp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
leaq -0x218(%rbp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
movq 0x30a80(%rip), %rdi     # 0x35fe8
leaq 0x1eddf(%rip), %rsi     # 0x2434e
callq 0x4340
leaq -0x1b0(%rbp), %rsi
movq %rax, %rdi
callq 0x4300
movq %rax, %rdi
callq 0x4180
leaq -0x280(%rbp), %rdi
leaq -0x1b0(%rbp), %rsi
callq 0x4460
leaq -0x280(%rbp), %rdi
leaq -0x120(%rbp), %rsi
leaq -0x68(%rbp), %rdx
movl -0x5c(%rbp), %ecx
callq 0x1d00e
movl %eax, %ebx
leaq -0x280(%rbp), %rdi
callq 0x46b8
testl %ebx, %ebx
jns 0x55ea
movq 0x30a17(%rip), %rdi     # 0x35fe8
leaq 0x1ed8a(%rip), %rsi     # 0x24362
callq 0x4340
movq %rax, %rdi
callq 0x4180
jmp 0x5858
movq 0x309f7(%rip), %rdi     # 0x35fe8
leaq 0x1f16e(%rip), %rsi     # 0x24766
callq 0x4340
leaq 0x1ed03(%rip), %rsi     # 0x24307
movq %rax, %rdi
callq 0x4340
movq -0xf8(%rbp), %rsi
movq %rax, %rdi
callq 0x4250
movq %rax, %rdi
callq 0x4180
movq 0x309be(%rip), %rdi     # 0x35fe8
leaq 0x1f135(%rip), %rsi     # 0x24766
callq 0x4340
leaq 0x1ed4d(%rip), %rsi     # 0x2438a
movq %rax, %rdi
callq 0x4340
movl -0x68(%rbp), %esi
movq %rax, %rdi
callq 0x45d0
movq %rax, %rdi
callq 0x4180
movq -0x108(%rbp), %r15
leaq -0x80(%rbp), %r12
leaq -0x158(%rbp), %r13
leaq -0x30(%rbp), %rbx
leaq -0x118(%rbp), %rax
cmpq %rax, %r15
je 0x577c
andq $0x0, -0x70(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0x80(%rbp)
leaq 0x20(%r15), %r14
cmpb $0x0, -0x38(%rbp)
je 0x56f4
andl $0x0, -0x158(%rbp)
movq %r12, %rdi
movq %r13, %rsi
callq 0x5fa8
andl $0x0, -0x158(%rbp)
xorl %eax, %eax
movl %eax, %eax
cmpq %rax, 0x28(%r15)
jbe 0x573d
movq (%r14), %rcx
movb (%rcx,%rax), %dl
pushq $0x1
popq %rcx
testb %dl, %dl
jns 0x56d9
pushq $0x4
popq %rcx
cmpb $-0x11, %dl
ja 0x56d9
cmpb $-0x20, %dl
pushq $0x2
popq %rcx
sbbl $-0x1, %ecx
addl %ecx, %eax
movl %eax, -0x158(%rbp)
movq %r12, %rdi
movq %r13, %rsi
callq 0x5f82
movl -0x158(%rbp), %eax
jmp 0x56af
movq %r13, %rdi
movq %r14, %rsi
callq 0x4460
movq -0x80(%rbp), %rax
cmpq %rax, -0x78(%rbp)
je 0x570d
movq %rax, -0x78(%rbp)
xorl %eax, %eax
movl %eax, -0x30(%rbp)
movl %eax, %eax
movq -0x150(%rbp), %rcx
incq %rcx
cmpq %rax, %rcx
jbe 0x5735
movq %r12, %rdi
movq %rbx, %rsi
callq 0x5f82
movl -0x30(%rbp), %eax
incl %eax
jmp 0x570f
movq %r13, %rdi
callq 0x46b8
movq -0x78(%rbp), %rax
subq -0x80(%rbp), %rax
sarq $0x2, %rax
decq %rax
cmpq -0x88(%rbp), %rax
jae 0x5764
leaq -0xf0(%rbp), %rdi
movq %r14, %rsi
callq 0x61e2
movq %r12, %rdi
callq 0x6412
movq %r15, %rdi
callq 0x43b0
movq %rax, %r15
jmp 0x566e
leaq -0x150(%rbp), %r9
andl $0x0, (%r9)
andq $0x0, 0x8(%r9)
movq %r9, 0x10(%r9)
movq %r9, 0x18(%r9)
andq $0x0, 0x20(%r9)
movq -0xa0(%rbp), %rdi
movq -0xd8(%rbp), %rdx
leaq -0x158(%rbp), %r8
leaq -0xb0(%rbp), %rsi
leaq -0xe8(%rbp), %rcx
callq 0x7435
leaq -0xb8(%rbp), %rdi
leaq -0x158(%rbp), %rsi
callq 0x6426
movq 0x3080d(%rip), %rdi     # 0x35fe8
leaq 0x1ebc0(%rip), %rsi     # 0x243a2
callq 0x4340
leaq -0x1d0(%rbp), %rsi
movq %rax, %rdi
callq 0x4300
movq %rax, %rdi
callq 0x4180
leaq -0x260(%rbp), %rdi
leaq -0x1d0(%rbp), %rsi
callq 0x4460
leaq -0x260(%rbp), %rdi
leaq -0x220(%rbp), %rsi
leaq -0x30(%rbp), %rdx
movl -0x5c(%rbp), %ecx
callq 0x1d00e
movl %eax, %ebx
leaq -0x260(%rbp), %rdi
callq 0x46b8
testl %ebx, %ebx
jns 0x5860
movq 0x307a4(%rip), %rdi     # 0x35fe8
leaq 0x1eb6a(%rip), %rsi     # 0x243b5
callq 0x4340
movq %rax, %rdi
callq 0x4180
pushq $0x1
popq %rdi
callq 0x43c0
movq 0x30781(%rip), %rdi     # 0x35fe8
leaq 0x1eef8(%rip), %rsi     # 0x24766
callq 0x4340
leaq 0x1eb62(%rip), %rsi     # 0x243dc
movq %rax, %rdi
callq 0x4340
movq -0x1f8(%rbp), %rsi
movq %rax, %rdi
callq 0x4250
movq %rax, %rdi
callq 0x4180
movq 0x30748(%rip), %rdi     # 0x35fe8
leaq 0x1eebf(%rip), %rsi     # 0x24766
callq 0x4340
leaq 0x1eb39(%rip), %rsi     # 0x243ec
movq %rax, %rdi
callq 0x4340
movl -0x30(%rbp), %esi
movq %rax, %rdi
callq 0x45d0
movq %rax, %rdi
callq 0x4180
cmpb $0x0, -0x29(%rbp)
je 0x58dd
leaq 0x11dff(%rip), %rax     # 0x176da
jmp 0x58e4
leaq 0x11952(%rip), %rax     # 0x17236
leaq -0x80(%rbp), %rdi
movq %rax, (%rdi)
movb -0x38(%rbp), %al
movb %al, 0x8(%rdi)
leaq -0x838(%rbp), %rax
xorps %xmm0, %xmm0
movaps %xmm0, -0x8(%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
leaq -0x220(%rbp), %rsi
leaq -0x120(%rbp), %rdx
leaq -0x2b0(%rbp), %rcx
leaq -0x840(%rbp), %r8
callq 0x1d860
movsd %xmm0, -0x38(%rbp)
leaq -0x840(%rbp), %rdi
callq 0x675c
movq 0x3069e(%rip), %rdi     # 0x35fe8
callq 0x4180
leaq 0x1eaac(%rip), %rsi     # 0x24402
movq %rax, %rdi
callq 0x4340
movq %rax, %rdi
movsd -0x38(%rbp), %xmm0
callq 0x4530
movq %rax, %rdi
callq 0x4180
cmpl $0x0, -0x60(%rbp)
jne 0x59b7
leaq -0x240(%rbp), %rdi
leaq -0x1f0(%rbp), %rsi
callq 0x4460
leaq -0x240(%rbp), %rdi
leaq -0x120(%rbp), %rsi
pushq $0x6
popq %rcx
xorl %edx, %edx
callq 0x1d38c
leaq -0x240(%rbp), %rdi
callq 0x46b8
xorl %edi, %edi
callq 0x43c0
cvtss2sd -0x58(%rbp), %xmm0
movsd %xmm0, -0x88(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x58(%rbp)
leaq -0x2b0(%rbp), %r13
leaq -0x120(%rbp), %r15
movabsq $-0x3fc7000000000000, %r12 # imm = 0xC039000000000000
movq -0x128(%rbp), %rax
cmpq %rax, -0xf8(%rbp)
jbe 0x5979
movsd -0x58(%rbp), %xmm0
addsd -0x88(%rbp), %xmm0
leaq -0x80(%rbp), %rdi
movq %r13, %rsi
movsd %xmm0, -0x58(%rbp)
leaq -0xb8(%rbp), %rdx
movl -0x64(%rbp), %ecx
callq 0x1deb2
movq 0x305c5(%rip), %rdi     # 0x35fe8
leaq 0x1e9ed(%rip), %rsi     # 0x24417
callq 0x4340
movq %rax, %rdi
movsd -0x58(%rbp), %xmm0
callq 0x4530
movq %rax, %rdi
leaq 0x1ed20(%rip), %rsi     # 0x24766
callq 0x4340
movq %rax, %rdi
leaq 0x1e9cf(%rip), %rsi     # 0x24424
callq 0x4340
movq -0x288(%rbp), %rsi
movq %rax, %rdi
callq 0x4250
movq %rax, %rdi
callq 0x4180
movq %r15, %rdi
movq %r13, %rsi
callq 0x6774
movq %r15, %rdi
movsd 0x1e581(%rip), %xmm0    # 0x24008
callq 0x1d906
movq -0xa0(%rbp), %rbx
leaq -0xb0(%rbp), %rax
cmpq %rax, %rbx
je 0x5ad5
leaq 0x20(%rbx), %r14
movq %r15, %rdi
movq %r14, %rsi
callq 0x6c04
leaq -0x118(%rbp), %rcx
cmpq %rcx, %rax
jne 0x5ac8
movq %r15, %rdi
movq %r14, %rsi
callq 0x6b7c
movq %r12, (%rax)
movq %rbx, %rdi
callq 0x43b0
movq %rax, %rbx
jmp 0x5a93
xorps %xmm0, %xmm0
movaps %xmm0, -0x190(%rbp)
andq $0x0, -0x180(%rbp)
leaq -0x188(%rbp), %rax
movq %rax, -0x178(%rbp)
movq %rax, -0x170(%rbp)
andq $0x0, -0x168(%rbp)
leaq -0x80(%rbp), %rdi
leaq -0x220(%rbp), %rsi
movq %r15, %rdx
movq %r13, %rcx
leaq -0x190(%rbp), %r8
callq 0x1d860
movsd %xmm0, -0x38(%rbp)
leaq -0x190(%rbp), %rdi
callq 0x675c
movq 0x304af(%rip), %rdi     # 0x35fe8
leaq 0x1e8ca(%rip), %rsi     # 0x2440a
callq 0x4340
movq %rax, %rdi
movsd -0x38(%rbp), %xmm0
callq 0x4530
movq %rax, %rdi
callq 0x4180
jmp 0x59e4
jmp 0x5b90
movq %rax, %rbx
leaq -0x190(%rbp), %rdi
jmp 0x5b89
jmp 0x5b90
movq %rax, %rbx
leaq -0x240(%rbp), %rdi
jmp 0x5bab
jmp 0x5b90
jmp 0x5b90
movq %rax, %rbx
leaq -0x840(%rbp), %rdi
callq 0x675c
jmp 0x5b93
movq %rax, %rbx
leaq -0x158(%rbp), %rdi
callq 0x675c
jmp 0x5be9
movq %rax, %rbx
leaq -0x260(%rbp), %rdi
callq 0x46b8
jmp 0x5b93
jmp 0x5bc5
movq %rax, %rbx
leaq -0x158(%rbp), %rdi
callq 0x46b8
jmp 0x5bc8
movq %rax, %rbx
leaq -0x80(%rbp), %rdi
callq 0x6412
jmp 0x5be9
jmp 0x5be6
movq %rax, %rbx
leaq -0x280(%rbp), %rdi
callq 0x46b8
jmp 0x5be9
movq %rax, %rbx
leaq -0x220(%rbp), %rdi
callq 0x6fe4
leaq -0x2b0(%rbp), %rdi
callq 0x6fe4
leaq -0x120(%rbp), %rdi
callq 0x6fe4
leaq -0xf0(%rbp), %rdi
callq 0x675c
jmp 0x5c66
jmp 0x5c63
jmp 0x5c41
movq %rax, %rbx
leaq -0x2f0(%rbp), %rdi
callq 0x46b8
jmp 0x5c33
movq %rax, %rbx
leaq -0x2d0(%rbp), %rdi
callq 0x46b8
jmp 0x5c44
movq %rax, %rbx
leaq -0xf0(%rbp), %rdi
callq 0x5f0a
jmp 0x5c66
movq %rax, %rbx
leaq -0x310(%rbp), %rdi
callq 0x46b8
jmp 0x5c66
movq %rax, %rbx
leaq -0xb8(%rbp), %rdi
callq 0x675c
jmp 0x5cc0
movq %rax, %rbx
leaq -0x330(%rbp), %rdi
jmp 0x5cb6
jmp 0x5cbd
movq %rax, %rbx
leaq -0x350(%rbp), %rdi
jmp 0x5cb6
jmp 0x5cbd
movq %rax, %rbx
leaq -0x370(%rbp), %rdi
jmp 0x5cb6
jmp 0x5cbd
movq %rax, %rbx
leaq -0x390(%rbp), %rdi
jmp 0x5cb6
jmp 0x5cbd
movq %rax, %rbx
leaq -0x3b0(%rbp), %rdi
callq 0x46b8
jmp 0x5cc0
movq %rax, %rbx
leaq -0x1f0(%rbp), %rdi
callq 0x46b8
jmp 0x5cd1
movq %rax, %rbx
leaq -0x1b0(%rbp), %rdi
callq 0x46b8
jmp 0x5ce2
movq %rax, %rbx
leaq -0x1d0(%rbp), %rdi
jmp 0x5eec
jmp 0x5ef3
jmp 0x5ef3
movq %rax, %rbx
leaq -0x3d0(%rbp), %rdi
callq 0x46b8
jmp 0x5d0c
movq %rax, %rbx
leaq -0x3f0(%rbp), %rdi
callq 0x46b8
jmp 0x5d1d
movq %rax, %rbx
leaq -0x410(%rbp), %rdi
callq 0x46b8
jmp 0x5d2e
movq %rax, %rbx
leaq -0x430(%rbp), %rdi
callq 0x46b8
jmp 0x5d41
jmp 0x5d3e
movq %rax, %rbx
leaq -0x450(%rbp), %rdi
callq 0x46b8
jmp 0x5d52
movq %rax, %rbx
leaq -0x470(%rbp), %rdi
callq 0x46b8
jmp 0x5d63
movq %rax, %rbx
leaq -0x490(%rbp), %rdi
callq 0x46b8
jmp 0x5d74
movq %rax, %rbx
leaq -0x4b0(%rbp), %rdi
callq 0x46b8
jmp 0x5d87
jmp 0x5d84
movq %rax, %rbx
leaq -0x4d0(%rbp), %rdi
callq 0x46b8
jmp 0x5d98
movq %rax, %rbx
leaq -0x4f0(%rbp), %rdi
callq 0x46b8
jmp 0x5da9
movq %rax, %rbx
leaq -0x510(%rbp), %rdi
callq 0x46b8
jmp 0x5dba
movq %rax, %rbx
leaq -0x530(%rbp), %rdi
callq 0x46b8
jmp 0x5dcd
jmp 0x5dca
movq %rax, %rbx
leaq -0x550(%rbp), %rdi
callq 0x46b8
jmp 0x5dde
movq %rax, %rbx
leaq -0x570(%rbp), %rdi
callq 0x46b8
jmp 0x5def
movq %rax, %rbx
leaq -0x590(%rbp), %rdi
callq 0x46b8
jmp 0x5e00
movq %rax, %rbx
leaq -0x5b0(%rbp), %rdi
callq 0x46b8
jmp 0x5e13
jmp 0x5e10
movq %rax, %rbx
leaq -0x5d0(%rbp), %rdi
callq 0x46b8
jmp 0x5e24
movq %rax, %rbx
leaq -0x5f0(%rbp), %rdi
callq 0x46b8
jmp 0x5e35
movq %rax, %rbx
leaq -0x610(%rbp), %rdi
callq 0x46b8
jmp 0x5e46
movq %rax, %rbx
leaq -0x630(%rbp), %rdi
callq 0x46b8
jmp 0x5e59
jmp 0x5e56
movq %rax, %rbx
leaq -0x650(%rbp), %rdi
callq 0x46b8
jmp 0x5e6a
movq %rax, %rbx
leaq -0x670(%rbp), %rdi
callq 0x46b8
jmp 0x5e7b
movq %rax, %rbx
leaq -0x690(%rbp), %rdi
callq 0x46b8
jmp 0x5e8c
movq %rax, %rbx
leaq -0x6b0(%rbp), %rdi
callq 0x46b8
jmp 0x5e9f
jmp 0x5e9c
movq %rax, %rbx
leaq -0x6d0(%rbp), %rdi
callq 0x46b8
jmp 0x5eb0
movq %rax, %rbx
leaq -0x6f0(%rbp), %rdi
callq 0x46b8
jmp 0x5ec1
movq %rax, %rbx
leaq -0x710(%rbp), %rdi
callq 0x46b8
jmp 0x5ed2
movq %rax, %rbx
leaq -0x730(%rbp), %rdi
callq 0x46b8
jmp 0x5ee5
jmp 0x5ee2
movq %rax, %rbx
leaq -0x750(%rbp), %rdi
callq 0x46b8
jmp 0x5ef6
movq %rax, %rbx
leaq -0x808(%rbp), %rdi
callq 0x5f36
movq %rbx, %rdi
callq 0x45f0