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

    conf::Config config;
    config("usage: 1g-threshold-sents [OPTION...] CORPUS 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 factors 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 short_factor_min_lp = -25.0;
    string corpus_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, training corpus: " << corpus_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 factors 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;
    set<string> short_factors;
    map<string, flt_type> vocab;
    map<string, flt_type> freqs;
    vector<string> sents;

    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_factors, min_removal_length, utf8_encoding);

    cerr << "Reading training corpus " << corpus_fname << endl;
    retval = Unigrams::read_sents(corpus_fname, sents);
    if (retval < 0) {
        cerr << "something went wrong reading training corpus" << endl;
        exit(EXIT_FAILURE);
    }
    cerr << "\t" << "number of sentences in corpus: " << sents.size() << endl;

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

    cerr << endl << "Initial threshold" << endl;
    flt_type cost = ug.resegment_sents(sents, vocab, freqs);
    cerr << "likelihood: " << cost << endl;

    flt_type threshold_value = 0.0;
    while (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, short_factors, short_factor_min_lp);
        cost = ug.resegment_sents(sents, 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 $0x778, %rsp            # imm = 0x778
movq %rsi, %rbx
movl %edi, %r14d
leaq -0x7a0(%rbp), %rdi
callq 0x7994
leaq 0x1f4f9(%rip), %rsi     # 0x24022
leaq -0x6e8(%rbp), %rdi
leaq -0x158(%rbp), %rdx
callq 0x4140
leaq -0x7a0(%rbp), %rdi
leaq -0x6e8(%rbp), %rsi
callq 0x7a00
movq %rax, %r15
leaq 0x1f516(%rip), %rsi     # 0x2406f
leaq -0x6c8(%rbp), %rdi
leaq -0xf0(%rbp), %rdx
callq 0x4140
leaq 0x1fc14(%rip), %rsi     # 0x24787
leaq -0x6a8(%rbp), %rdi
leaq -0x120(%rbp), %rdx
callq 0x4140
leaq 0x1fbfa(%rip), %rsi     # 0x24787
leaq -0x688(%rbp), %rdi
leaq -0x248(%rbp), %rdx
callq 0x4140
leaq 0x1f4c0(%rip), %rsi     # 0x24067
leaq -0x668(%rbp), %rdi
leaq -0xa0(%rbp), %rdx
callq 0x4140
pushq $0x68
popq %rsi
leaq -0x6c8(%rbp), %rdx
leaq -0x6a8(%rbp), %rcx
leaq -0x688(%rbp), %r8
leaq -0x668(%rbp), %r9
movq %r15, %rdi
callq 0x7a18
movq %rax, %r15
leaq 0x1f489(%rip), %rsi     # 0x24074
leaq -0x648(%rbp), %rdi
leaq -0x198(%rbp), %rdx
callq 0x4140
leaq 0x1f489(%rip), %rsi     # 0x2408e
leaq -0x628(%rbp), %rdi
leaq -0x178(%rbp), %rdx
callq 0x4140
leaq 0x1f4a4(%rip), %rsi     # 0x240c3
leaq -0x608(%rbp), %rdi
leaq -0x1b8(%rbp), %rdx
callq 0x4140
leaq 0x1f459(%rip), %rsi     # 0x24092
leaq -0x5e8(%rbp), %rdi
leaq -0x80(%rbp), %rdx
callq 0x4140
pushq $0x69
popq %rsi
leaq -0x648(%rbp), %rdx
leaq -0x628(%rbp), %rcx
leaq -0x608(%rbp), %r8
leaq -0x5e8(%rbp), %r9
movq %r15, %rdi
callq 0x7a18
movq %rax, %r15
leaq 0x1f44d(%rip), %rsi     # 0x240c7
leaq -0x5c8(%rbp), %rdi
leaq -0xc0(%rbp), %rdx
callq 0x4140
leaq 0x1f3fa(%rip), %rsi     # 0x2408e
leaq -0x5a8(%rbp), %rdi
leaq -0x3c(%rbp), %rdx
callq 0x4140
leaq 0x1f459(%rip), %rsi     # 0x24104
leaq -0x588(%rbp), %rdi
leaq -0x60(%rbp), %rdx
callq 0x4140
leaq 0x1f414(%rip), %rsi     # 0x240d6
leaq -0x568(%rbp), %rdi
leaq -0x4d(%rbp), %rdx
callq 0x4140
pushq $0x6d
popq %rsi
leaq -0x5c8(%rbp), %rdx
leaq -0x5a8(%rbp), %rcx
leaq -0x588(%rbp), %r8
leaq -0x568(%rbp), %r9
movq %r15, %rdi
callq 0x7a18
movq %rax, %r15
leaq 0x1f403(%rip), %rsi     # 0x24106
leaq -0x548(%rbp), %rdi
leaq -0x4c(%rbp), %rdx
callq 0x4140
leaq 0x1f3fb(%rip), %rsi     # 0x24115
leaq -0x528(%rbp), %rdi
leaq -0x4b(%rbp), %rdx
callq 0x4140
leaq 0x1fa56(%rip), %rsi     # 0x24787
leaq -0x508(%rbp), %rdi
leaq -0x4a(%rbp), %rdx
callq 0x4140
leaq 0x1f3d6(%rip), %rsi     # 0x2411e
leaq -0x4e8(%rbp), %rdi
leaq -0x49(%rbp), %rdx
callq 0x4140
pushq $0x76
popq %rsi
leaq -0x548(%rbp), %rdx
leaq -0x528(%rbp), %rcx
leaq -0x508(%rbp), %r8
leaq -0x4e8(%rbp), %r9
movq %r15, %rdi
callq 0x7a18
movq %rax, %r15
leaq 0x1f3ac(%rip), %rsi     # 0x24135
leaq -0x4c8(%rbp), %rdi
leaq -0x48(%rbp), %rdx
callq 0x4140
leaq 0x1f2ee(%rip), %rsi     # 0x2408e
leaq -0x4a8(%rbp), %rdi
leaq -0x47(%rbp), %rdx
callq 0x4140
leaq 0x1f9d0(%rip), %rsi     # 0x24787
leaq -0x488(%rbp), %rdi
leaq -0x46(%rbp), %rdx
callq 0x4140
leaq 0x1f378(%rip), %rsi     # 0x24146
leaq -0x468(%rbp), %rdi
leaq -0x45(%rbp), %rdx
callq 0x4140
pushq $0x73
popq %rsi
leaq -0x4c8(%rbp), %rdx
leaq -0x4a8(%rbp), %rcx
leaq -0x488(%rbp), %r8
leaq -0x468(%rbp), %r9
movq %r15, %rdi
callq 0x7a18
movq %rax, %r15
leaq 0x1f370(%rip), %rsi     # 0x2417f
leaq -0x448(%rbp), %rdi
leaq -0x44(%rbp), %rdx
callq 0x4140
leaq 0x1f961(%rip), %rsi     # 0x24787
leaq -0x428(%rbp), %rdi
leaq -0x43(%rbp), %rdx
callq 0x4140
leaq 0x1f94a(%rip), %rsi     # 0x24787
leaq -0x408(%rbp), %rdi
leaq -0x42(%rbp), %rdx
callq 0x4140
leaq 0x1f33c(%rip), %rsi     # 0x24190
leaq -0x3e8(%rbp), %rdi
leaq -0x41(%rbp), %rdx
callq 0x4140
pushq $0x66
popq %rsi
leaq -0x448(%rbp), %rdx
leaq -0x428(%rbp), %rcx
leaq -0x408(%rbp), %r8
leaq -0x3e8(%rbp), %r9
movq %r15, %rdi
callq 0x7a18
movq %rax, %r15
leaq 0x1f330(%rip), %rsi     # 0x241c5
leaq -0x3c8(%rbp), %rdi
leaq -0x40(%rbp), %rdx
callq 0x4140
leaq 0x1f8db(%rip), %rsi     # 0x24787
leaq -0x3a8(%rbp), %rdi
leaq -0x3f(%rbp), %rdx
callq 0x4140
leaq 0x1f8c4(%rip), %rsi     # 0x24787
leaq -0x388(%rbp), %rdi
leaq -0x3e(%rbp), %rdx
callq 0x4140
leaq 0x1f2f1(%rip), %rsi     # 0x241cb
leaq -0x368(%rbp), %rdi
leaq -0x3d(%rbp), %rdx
callq 0x4140
pushq $0x38
popq %rsi
leaq -0x3c8(%rbp), %rdx
leaq -0x3a8(%rbp), %rcx
leaq -0x388(%rbp), %r8
leaq -0x368(%rbp), %r9
movq %r15, %rdi
callq 0x7a18
leaq -0x368(%rbp), %rdi
callq 0x46b8
leaq -0x388(%rbp), %rdi
callq 0x46b8
leaq -0x3a8(%rbp), %rdi
callq 0x46b8
leaq -0x3c8(%rbp), %rdi
callq 0x46b8
leaq -0x3e8(%rbp), %rdi
callq 0x46b8
leaq -0x408(%rbp), %rdi
callq 0x46b8
leaq -0x428(%rbp), %rdi
callq 0x46b8
leaq -0x448(%rbp), %rdi
callq 0x46b8
leaq -0x468(%rbp), %rdi
callq 0x46b8
leaq -0x488(%rbp), %rdi
callq 0x46b8
leaq -0x4a8(%rbp), %rdi
callq 0x46b8
leaq -0x4c8(%rbp), %rdi
callq 0x46b8
leaq -0x4e8(%rbp), %rdi
callq 0x46b8
leaq -0x508(%rbp), %rdi
callq 0x46b8
leaq -0x528(%rbp), %rdi
callq 0x46b8
leaq -0x548(%rbp), %rdi
callq 0x46b8
leaq -0x568(%rbp), %rdi
callq 0x46b8
leaq -0x588(%rbp), %rdi
callq 0x46b8
leaq -0x5a8(%rbp), %rdi
callq 0x46b8
leaq -0x5c8(%rbp), %rdi
callq 0x46b8
leaq -0x5e8(%rbp), %rdi
callq 0x46b8
leaq -0x608(%rbp), %rdi
callq 0x46b8
leaq -0x628(%rbp), %rdi
callq 0x46b8
leaq -0x648(%rbp), %rdi
callq 0x46b8
leaq -0x668(%rbp), %rdi
callq 0x46b8
leaq -0x688(%rbp), %rdi
callq 0x46b8
leaq -0x6a8(%rbp), %rdi
callq 0x46b8
leaq -0x6c8(%rbp), %rdi
callq 0x46b8
leaq -0x6e8(%rbp), %rdi
callq 0x46b8
leaq -0x7a0(%rbp), %rdi
movl %r14d, %esi
movq %rbx, %rdx
callq 0x827e
movq -0x708(%rbp), %rsi
movq -0x700(%rbp), %rax
subq %rsi, %rax
cmpq $0x60, %rax
je 0x50b6
movq 0x30f23(%rip), %rax     # 0x35fc0
movq (%rax), %rsi
leaq -0x7a0(%rbp), %rdi
pushq $0x1
popq %rdx
callq 0x8766
movq -0x708(%rbp), %rsi
leaq -0x198(%rbp), %rdi
callq 0x4460
movq -0x708(%rbp), %rsi
addq $0x20, %rsi
leaq -0x178(%rbp), %rdi
callq 0x4460
movq -0x708(%rbp), %rsi
addq $0x40, %rsi
leaq -0x1b8(%rbp), %rdi
callq 0x4460
leaq 0x1f0f4(%rip), %rsi     # 0x241eb
leaq -0x348(%rbp), %rdi
leaq -0x158(%rbp), %rdx
callq 0x4140
leaq -0x7a0(%rbp), %rdi
leaq -0x348(%rbp), %rsi
callq 0x831e
movq %rax, %rdi
callq 0x78c4
movss %xmm0, -0x58(%rbp)
leaq -0x348(%rbp), %rdi
callq 0x46b8
leaq 0x1f0c2(%rip), %rsi     # 0x241ff
leaq -0x328(%rbp), %rdi
leaq -0x158(%rbp), %rdx
callq 0x4140
leaq -0x7a0(%rbp), %rdi
leaq -0x328(%rbp), %rsi
callq 0x831e
movq %rax, %rdi
callq 0x7864
movl %eax, -0x5c(%rbp)
leaq -0x328(%rbp), %rdi
callq 0x46b8
leaq 0x1f089(%rip), %rsi     # 0x2420a
leaq -0x308(%rbp), %rdi
leaq -0x158(%rbp), %rdx
callq 0x4140
leaq -0x7a0(%rbp), %rdi
leaq -0x308(%rbp), %rsi
callq 0x831e
movq %rax, %rdi
callq 0x7864
movl %eax, %r14d
leaq -0x308(%rbp), %rdi
callq 0x46b8
leaq 0x1efba(%rip), %rsi     # 0x2417f
leaq -0x2e8(%rbp), %rdi
leaq -0x158(%rbp), %rdx
callq 0x4140
leaq -0x7a0(%rbp), %rdi
leaq -0x2e8(%rbp), %rsi
callq 0x831e
movb 0x4a(%rax), %al
movb %al, -0x29(%rbp)
leaq -0x2e8(%rbp), %rdi
callq 0x46b8
leaq 0x1efc1(%rip), %rsi     # 0x241c5
leaq -0x2c8(%rbp), %rdi
leaq -0x158(%rbp), %rdx
callq 0x4140
leaq -0x7a0(%rbp), %rdi
leaq -0x2c8(%rbp), %rsi
callq 0x831e
movb 0x4a(%rax), %al
movb %al, -0x38(%rbp)
leaq -0x2c8(%rbp), %rdi
callq 0x46b8
leaq -0x150(%rbp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
leaq 0x1efb6(%rip), %rsi     # 0x24215
leaq -0x2a8(%rbp), %rdi
leaq -0xf0(%rbp), %rdx
callq 0x4140
leaq -0x7a0(%rbp), %rdi
leaq -0x2a8(%rbp), %rsi
callq 0x831e
movb 0x4a(%rax), %bl
leaq -0x2a8(%rbp), %rdi
callq 0x46b8
cmpb $0x1, %bl
jne 0x5344
xorps %xmm0, %xmm0
movaps %xmm0, -0xf0(%rbp)
andq $0x0, -0xe0(%rbp)
leaq 0x1ef5f(%rip), %rsi     # 0x24215
leaq -0x268(%rbp), %rdi
leaq -0x120(%rbp), %rdx
callq 0x4140
leaq -0x7a0(%rbp), %rdi
leaq -0x268(%rbp), %rsi
callq 0x831e
movq %rax, %rdi
callq 0x7980
leaq -0x288(%rbp), %rdi
movq %rax, %rsi
callq 0x4460
leaq -0x288(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
callq 0x1d0a2
leaq -0x288(%rbp), %rdi
callq 0x46b8
leaq -0x268(%rbp), %rdi
callq 0x46b8
movq -0xf0(%rbp), %rsi
movq -0xe8(%rbp), %rdx
leaq -0x158(%rbp), %rdi
callq 0x6db6
leaq -0xf0(%rbp), %rdi
callq 0x5dee
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 0x1eeb4(%rip), %rsi     # 0x2421f
callq 0x4340
leaq -0x198(%rbp), %rsi
movq %rax, %rdi
callq 0x4300
movq %rax, %rdi
callq 0x4180
movq 0x30c5a(%rip), %rdi     # 0x35fe8
leaq 0x1eea8(%rip), %rsi     # 0x2423d
callq 0x4340
leaq -0x178(%rbp), %rsi
movq %rax, %rdi
callq 0x4300
movq %rax, %rdi
callq 0x4180
movq 0x30c30(%rip), %rdi     # 0x35fe8
leaq 0x1ee9f(%rip), %rsi     # 0x2425e
callq 0x4340
leaq -0x1b8(%rbp), %rsi
movq %rax, %rdi
callq 0x4300
movq %rax, %rdi
callq 0x4180
movq 0x30c06(%rip), %rdi     # 0x35fe8
leaq 0x1ee94(%rip), %rsi     # 0x2427d
callq 0x4340
movq %rax, %rdi
movss -0x58(%rbp), %xmm0
callq 0x42a0
movq %rax, %rdi
callq 0x4180
movq 0x30bde(%rip), %rdi     # 0x35fe8
leaq 0x1ee8e(%rip), %rsi     # 0x2429f
callq 0x4340
movl -0x5c(%rbp), %esi
movq %rax, %rdi
movq %rsi, -0x68(%rbp)
callq 0x4250
movq %rax, %rdi
callq 0x4180
cmpq $0x0, -0x130(%rbp)
je 0x5470
movq 0x30baa(%rip), %rdi     # 0x35fe8
leaq 0x1ee8d(%rip), %rsi     # 0x242d2
callq 0x4340
movq -0x130(%rbp), %rsi
movq %rax, %rdi
callq 0x4250
leaq 0x1ee8d(%rip), %rsi     # 0x242ed
movq %rax, %rdi
callq 0x4340
movq %rax, %rdi
callq 0x4180
movq 0x30b71(%rip), %rdi     # 0x35fe8
leaq 0x1ee79(%rip), %rsi     # 0x242f7
callq 0x4340
movl %r14d, %esi
movq %rax, %rdi
movq %rsi, -0x128(%rbp)
callq 0x4250
movq %rax, %rdi
callq 0x4180
movq 0x30b44(%rip), %rdi     # 0x35fe8
leaq 0x1ee6c(%rip), %rsi     # 0x24317
callq 0x4340
movzbl -0x29(%rbp), %esi
movq %rax, %rdi
callq 0x4570
movq %rax, %rdi
callq 0x4180
movq 0x30b1d(%rip), %rdi     # 0x35fe8
leaq 0x1ee68(%rip), %rsi     # 0x2433a
callq 0x4340
movzbl -0x38(%rbp), %ebx
movq %rax, %rdi
movl %ebx, %esi
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 -0x240(%rbp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
xorps %xmm0, %xmm0
movaps %xmm0, -0xc0(%rbp)
andq $0x0, -0xb0(%rbp)
movq 0x30a8e(%rip), %rdi     # 0x35fe8
leaq 0x1edf6(%rip), %rsi     # 0x24357
callq 0x4340
leaq -0x178(%rbp), %rsi
movq %rax, %rdi
callq 0x4300
movq %rax, %rdi
callq 0x4180
leaq -0x218(%rbp), %rdi
leaq -0x178(%rbp), %rsi
callq 0x4460
leaq -0x218(%rbp), %rdi
leaq -0x120(%rbp), %rsi
leaq -0x60(%rbp), %rdx
movl %ebx, %ecx
callq 0x1ca6e
movl %eax, %ebx
leaq -0x218(%rbp), %rdi
callq 0x46b8
testl %ebx, %ebx
jns 0x55db
movq 0x30a26(%rip), %rdi     # 0x35fe8
leaq 0x1eda2(%rip), %rsi     # 0x2436b
callq 0x4340
movq %rax, %rdi
callq 0x4180
jmp 0x57e9
movq 0x30a06(%rip), %rdi     # 0x35fe8
leaq 0x1f19d(%rip), %rsi     # 0x24786
callq 0x4340
leaq 0x1ed1b(%rip), %rsi     # 0x24310
movq %rax, %rdi
callq 0x4340
movq -0xf8(%rbp), %rsi
movq %rax, %rdi
callq 0x4250
movq %rax, %rdi
callq 0x4180
movq 0x309cd(%rip), %rdi     # 0x35fe8
leaq 0x1f164(%rip), %rsi     # 0x24786
callq 0x4340
leaq 0x1ed65(%rip), %rsi     # 0x24393
movq %rax, %rdi
callq 0x4340
movl -0x60(%rbp), %esi
movq %rax, %rdi
callq 0x45d0
movq %rax, %rdi
callq 0x4180
movq -0x108(%rbp), %r12
leaq -0x80(%rbp), %r14
leaq -0xa0(%rbp), %r13
leaq -0x3c(%rbp), %r15
leaq -0x118(%rbp), %rax
cmpq %rax, %r12
je 0x576c
andq $0x0, -0x70(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0x80(%rbp)
leaq 0x20(%r12), %rbx
cmpb $0x0, -0x38(%rbp)
je 0x56e7
andl $0x0, -0xa0(%rbp)
movq %r14, %rdi
movq %r13, %rsi
callq 0x5e8c
andl $0x0, -0xa0(%rbp)
xorl %eax, %eax
movl %eax, %eax
cmpq %rax, 0x28(%r12)
jbe 0x5730
movq (%rbx), %rcx
movb (%rcx,%rax), %dl
pushq $0x1
popq %rcx
testb %dl, %dl
jns 0x56cc
pushq $0x4
popq %rcx
cmpb $-0x11, %dl
ja 0x56cc
cmpb $-0x20, %dl
pushq $0x2
popq %rcx
sbbl $-0x1, %ecx
addl %ecx, %eax
movl %eax, -0xa0(%rbp)
movq %r14, %rdi
movq %r13, %rsi
callq 0x5e66
movl -0xa0(%rbp), %eax
jmp 0x56a1
movq %r13, %rdi
movq %rbx, %rsi
callq 0x4460
movq -0x80(%rbp), %rax
cmpq %rax, -0x78(%rbp)
je 0x5700
movq %rax, -0x78(%rbp)
xorl %eax, %eax
movl %eax, -0x3c(%rbp)
movl %eax, %eax
movq -0x98(%rbp), %rcx
incq %rcx
cmpq %rax, %rcx
jbe 0x5728
movq %r14, %rdi
movq %r15, %rsi
callq 0x5e66
movl -0x3c(%rbp), %eax
incl %eax
jmp 0x5702
movq %r13, %rdi
callq 0x46b8
movq -0x78(%rbp), %rax
subq -0x80(%rbp), %rax
sarq $0x2, %rax
decq %rax
cmpq -0x68(%rbp), %rax
jae 0x5754
leaq -0xf0(%rbp), %rdi
movq %rbx, %rsi
callq 0x60c6
movq %r14, %rdi
callq 0x62f6
movq %r12, %rdi
callq 0x43b0
movq %rax, %r12
jmp 0x565f
movq 0x30875(%rip), %rdi     # 0x35fe8
leaq 0x1ec31(%rip), %rsi     # 0x243ab
callq 0x4340
leaq -0x198(%rbp), %rsi
movq %rax, %rdi
callq 0x4300
movq %rax, %rdi
callq 0x4180
leaq -0x1f8(%rbp), %rdi
leaq -0x198(%rbp), %rsi
callq 0x4460
leaq -0x1f8(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x1d0a2
movl %eax, %ebx
leaq -0x1f8(%rbp), %rdi
callq 0x46b8
testl %ebx, %ebx
jns 0x57f1
movq 0x30813(%rip), %rdi     # 0x35fe8
leaq 0x1ebe8(%rip), %rsi     # 0x243c4
callq 0x4340
movq %rax, %rdi
callq 0x4180
pushq $0x1
popq %rdi
callq 0x43c0
movq 0x307f0(%rip), %rdi     # 0x35fe8
leaq 0x1ef87(%rip), %rsi     # 0x24786
callq 0x4340
leaq 0x1ebe6(%rip), %rsi     # 0x243f1
movq %rax, %rdi
callq 0x4340
movq -0xb8(%rbp), %rsi
subq -0xc0(%rbp), %rsi
sarq $0x5, %rsi
movq %rax, %rdi
callq 0x4250
movq %rax, %rdi
callq 0x4180
cmpb $0x0, -0x29(%rbp)
je 0x5844
leaq 0x118f8(%rip), %rax     # 0x1713a
jmp 0x584b
leaq 0x1144b(%rip), %rax     # 0x16c96
movq %rax, -0xa0(%rbp)
movb -0x38(%rbp), %al
movb %al, -0x98(%rbp)
movq 0x30786(%rip), %rdi     # 0x35fe8
callq 0x4180
leaq 0x1eba3(%rip), %rsi     # 0x24411
movq %rax, %rdi
callq 0x4340
movq %rax, %rdi
callq 0x4180
leaq -0xa0(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
leaq -0x120(%rbp), %rdx
leaq -0x248(%rbp), %rcx
callq 0x1d4c4
movsd %xmm0, -0x38(%rbp)
movq 0x3073d(%rip), %rdi     # 0x35fe8
leaq 0x1eb71(%rip), %rsi     # 0x24423
callq 0x4340
movq %rax, %rdi
movsd -0x38(%rbp), %xmm0
callq 0x4530
movq %rax, %rdi
callq 0x4180
cvtss2sd -0x58(%rbp), %xmm0
movsd %xmm0, -0x68(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x58(%rbp)
leaq -0x248(%rbp), %r12
leaq -0x120(%rbp), %r13
movabsq $-0x3fc7000000000000, %r14 # imm = 0xC039000000000000
movq -0x128(%rbp), %rax
cmpq %rax, -0xf8(%rbp)
jbe 0x5a36
movsd -0x58(%rbp), %xmm0
addsd -0x68(%rbp), %xmm0
leaq -0xa0(%rbp), %rdi
movq %r12, %rsi
movsd %xmm0, -0x58(%rbp)
leaq -0x158(%rbp), %rdx
movl -0x5c(%rbp), %ecx
callq 0x1d912
movq 0x306af(%rip), %rdi     # 0x35fe8
leaq 0x1eaf0(%rip), %rsi     # 0x24430
callq 0x4340
movq %rax, %rdi
movsd -0x58(%rbp), %xmm0
callq 0x4530
movq %rax, %rdi
leaq 0x1ee2a(%rip), %rsi     # 0x24786
callq 0x4340
movq %rax, %rdi
leaq 0x1ead2(%rip), %rsi     # 0x2443d
callq 0x4340
movq -0x220(%rbp), %rsi
movq %rax, %rdi
callq 0x4250
movq %rax, %rdi
callq 0x4180
movq %r13, %rdi
movq %r12, %rsi
callq 0x630a
movq %r13, %rdi
movsd 0x1e66b(%rip), %xmm0    # 0x24008
callq 0x1d366
movq -0xd8(%rbp), %rbx
leaq -0xe8(%rbp), %rax
cmpq %rax, %rbx
je 0x59eb
leaq 0x20(%rbx), %r15
movq %r13, %rdi
movq %r15, %rsi
callq 0x67a0
leaq -0x118(%rbp), %rcx
cmpq %rcx, %rax
jne 0x59de
movq %r13, %rdi
movq %r15, %rsi
callq 0x6736
movq %r14, (%rax)
movq %rbx, %rdi
callq 0x43b0
movq %rax, %rbx
jmp 0x59a9
leaq -0xa0(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
movq %r13, %rdx
movq %r12, %rcx
callq 0x1d4c4
movsd %xmm0, -0x38(%rbp)
movq 0x305d8(%rip), %rdi     # 0x35fe8
leaq 0x1ea0c(%rip), %rsi     # 0x24423
callq 0x4340
movq %rax, %rdi
movsd -0x38(%rbp), %xmm0
callq 0x4530
movq %rax, %rdi
callq 0x4180
jmp 0x58f6
leaq -0x1d8(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
callq 0x4460
leaq -0x1d8(%rbp), %rdi
leaq -0x120(%rbp), %rsi
pushq $0x6
popq %rcx
xorl %edx, %edx
callq 0x1cdec
leaq -0x1d8(%rbp), %rdi
callq 0x46b8
xorl %edi, %edi
callq 0x43c0
movq %rax, %rbx
leaq -0x1d8(%rbp), %rdi
jmp 0x5ac3
jmp 0x5aca
jmp 0x5aca
jmp 0x5aca
jmp 0x5aca
jmp 0x5aca
jmp 0x5aca
movq %rax, %rbx
leaq -0x1f8(%rbp), %rdi
jmp 0x5ac3
jmp 0x5aab
movq %rax, %rbx
leaq -0xa0(%rbp), %rdi
callq 0x46b8
jmp 0x5aae
movq %rax, %rbx
leaq -0x80(%rbp), %rdi
callq 0x62f6
jmp 0x5acd
movq %rax, %rbx
leaq -0x218(%rbp), %rdi
callq 0x46b8
jmp 0x5acd
movq %rax, %rbx
leaq -0xc0(%rbp), %rdi
callq 0x5dee
leaq -0x248(%rbp), %rdi
callq 0x6b80
leaq -0x120(%rbp), %rdi
callq 0x6b80
leaq -0xf0(%rbp), %rdi
callq 0x6b98
jmp 0x5b4a
jmp 0x5b47
jmp 0x5b25
movq %rax, %rbx
leaq -0x288(%rbp), %rdi
callq 0x46b8
jmp 0x5b17
movq %rax, %rbx
leaq -0x268(%rbp), %rdi
callq 0x46b8
jmp 0x5b28
movq %rax, %rbx
leaq -0xf0(%rbp), %rdi
callq 0x5dee
jmp 0x5b4a
movq %rax, %rbx
leaq -0x2a8(%rbp), %rdi
callq 0x46b8
jmp 0x5b4a
movq %rax, %rbx
leaq -0x158(%rbp), %rdi
callq 0x6b98
jmp 0x5ba4
movq %rax, %rbx
leaq -0x2c8(%rbp), %rdi
jmp 0x5b9a
jmp 0x5ba1
movq %rax, %rbx
leaq -0x2e8(%rbp), %rdi
jmp 0x5b9a
jmp 0x5ba1
movq %rax, %rbx
leaq -0x308(%rbp), %rdi
jmp 0x5b9a
jmp 0x5ba1
movq %rax, %rbx
leaq -0x328(%rbp), %rdi
jmp 0x5b9a
jmp 0x5ba1
movq %rax, %rbx
leaq -0x348(%rbp), %rdi
callq 0x46b8
jmp 0x5ba4
movq %rax, %rbx
leaq -0x1b8(%rbp), %rdi
callq 0x46b8
jmp 0x5bb5
movq %rax, %rbx
leaq -0x178(%rbp), %rdi
callq 0x46b8
jmp 0x5bc6
movq %rax, %rbx
leaq -0x198(%rbp), %rdi
jmp 0x5dd0
jmp 0x5dd7
jmp 0x5dd7
movq %rax, %rbx
leaq -0x368(%rbp), %rdi
callq 0x46b8
jmp 0x5bf0
movq %rax, %rbx
leaq -0x388(%rbp), %rdi
callq 0x46b8
jmp 0x5c01
movq %rax, %rbx
leaq -0x3a8(%rbp), %rdi
callq 0x46b8
jmp 0x5c12
movq %rax, %rbx
leaq -0x3c8(%rbp), %rdi
callq 0x46b8
jmp 0x5c25
jmp 0x5c22
movq %rax, %rbx
leaq -0x3e8(%rbp), %rdi
callq 0x46b8
jmp 0x5c36
movq %rax, %rbx
leaq -0x408(%rbp), %rdi
callq 0x46b8
jmp 0x5c47
movq %rax, %rbx
leaq -0x428(%rbp), %rdi
callq 0x46b8
jmp 0x5c58
movq %rax, %rbx
leaq -0x448(%rbp), %rdi
callq 0x46b8
jmp 0x5c6b
jmp 0x5c68
movq %rax, %rbx
leaq -0x468(%rbp), %rdi
callq 0x46b8
jmp 0x5c7c
movq %rax, %rbx
leaq -0x488(%rbp), %rdi
callq 0x46b8
jmp 0x5c8d
movq %rax, %rbx
leaq -0x4a8(%rbp), %rdi
callq 0x46b8
jmp 0x5c9e
movq %rax, %rbx
leaq -0x4c8(%rbp), %rdi
callq 0x46b8
jmp 0x5cb1
jmp 0x5cae
movq %rax, %rbx
leaq -0x4e8(%rbp), %rdi
callq 0x46b8
jmp 0x5cc2
movq %rax, %rbx
leaq -0x508(%rbp), %rdi
callq 0x46b8
jmp 0x5cd3
movq %rax, %rbx
leaq -0x528(%rbp), %rdi
callq 0x46b8
jmp 0x5ce4
movq %rax, %rbx
leaq -0x548(%rbp), %rdi
callq 0x46b8
jmp 0x5cf7
jmp 0x5cf4
movq %rax, %rbx
leaq -0x568(%rbp), %rdi
callq 0x46b8
jmp 0x5d08
movq %rax, %rbx
leaq -0x588(%rbp), %rdi
callq 0x46b8
jmp 0x5d19
movq %rax, %rbx
leaq -0x5a8(%rbp), %rdi
callq 0x46b8
jmp 0x5d2a
movq %rax, %rbx
leaq -0x5c8(%rbp), %rdi
callq 0x46b8
jmp 0x5d3d
jmp 0x5d3a
movq %rax, %rbx
leaq -0x5e8(%rbp), %rdi
callq 0x46b8
jmp 0x5d4e
movq %rax, %rbx
leaq -0x608(%rbp), %rdi
callq 0x46b8
jmp 0x5d5f
movq %rax, %rbx
leaq -0x628(%rbp), %rdi
callq 0x46b8
jmp 0x5d70
movq %rax, %rbx
leaq -0x648(%rbp), %rdi
callq 0x46b8
jmp 0x5d83
jmp 0x5d80
movq %rax, %rbx
leaq -0x668(%rbp), %rdi
callq 0x46b8
jmp 0x5d94
movq %rax, %rbx
leaq -0x688(%rbp), %rdi
callq 0x46b8
jmp 0x5da5
movq %rax, %rbx
leaq -0x6a8(%rbp), %rdi
callq 0x46b8
jmp 0x5db6
movq %rax, %rbx
leaq -0x6c8(%rbp), %rdi
callq 0x46b8
jmp 0x5dc9
jmp 0x5dc6
movq %rax, %rbx
leaq -0x6e8(%rbp), %rdi
callq 0x46b8
jmp 0x5dda
movq %rax, %rbx
leaq -0x7a0(%rbp), %rdi
callq 0x5e1a
movq %rbx, %rdi
callq 0x45f0