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

    conf::Config config;
    config("usage: substrings [OPTION...] INPUT OUTPUT\n")
      ('h', "help", "", "", "display help")
      ('8', "utf-8", "", "", "Utf-8 character encoding in use")
      ('l', "max-length=INT", "arg must", "100", "Maximum length of the substrings");
    config.default_parse(argc, argv);
    if (config.arguments.size() != 2) config.print_help(stderr, 1);

    string infname = config.arguments[0];
    string outfname = config.arguments[1];
    unsigned int maxlen = config["max-length"].get_int();
    bool utf8_encoding = config["utf-8"].specified;

    map<string, float> substrs;
    int substr_count = get_substrings(infname, maxlen, substrs, utf8_encoding);

    vector<pair<string, float> > sorted_substrs;
    for (auto it = substrs.cbegin(); it != substrs.cend(); ++it)
        sorted_substrs.push_back(make_pair(it->first, it->second));
    sort(sorted_substrs.begin(), sorted_substrs.end(), desc_sort);

    cerr << substr_count << " substrings in total up to length of " << maxlen << endl;
    write_substrings(outfname, sorted_substrs);

    exit(EXIT_SUCCESS);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x358, %rsp            # imm = 0x358
movq %rsi, %rbx
movl %edi, %r14d
leaq -0x380(%rbp), %rdi
callq 0x7414
leaq 0x1f145(%rip), %rsi     # 0x2407d
leaq -0x2a0(%rbp), %rdi
leaq -0x80(%rbp), %rdx
callq 0x4140
leaq -0x380(%rbp), %rdi
leaq -0x2a0(%rbp), %rsi
callq 0x7480
movq %rax, %r15
leaq 0x1f14c(%rip), %rsi     # 0x240b1
leaq -0x280(%rbp), %rdi
leaq -0x2c8(%rbp), %rdx
callq 0x4140
leaq 0x1f508(%rip), %rsi     # 0x24487
leaq -0x260(%rbp), %rdi
leaq -0x100(%rbp), %rdx
callq 0x4140
leaq 0x1f4ee(%rip), %rsi     # 0x24487
leaq -0x240(%rbp), %rdi
leaq -0xe0(%rbp), %rdx
callq 0x4140
leaq 0x1f0f6(%rip), %rsi     # 0x240a9
leaq -0x220(%rbp), %rdi
leaq -0x50(%rbp), %rdx
callq 0x4140
pushq $0x68
popq %rsi
leaq -0x280(%rbp), %rdx
leaq -0x260(%rbp), %rcx
leaq -0x240(%rbp), %r8
leaq -0x220(%rbp), %r9
movq %r15, %rdi
callq 0x7498
movq %rax, %r15
leaq 0x1f0c2(%rip), %rsi     # 0x240b6
leaq -0x200(%rbp), %rdi
leaq -0x30(%rbp), %rdx
callq 0x4140
leaq 0x1f47c(%rip), %rsi     # 0x24487
leaq -0x1e0(%rbp), %rdi
leaq -0x2f(%rbp), %rdx
callq 0x4140
leaq 0x1f465(%rip), %rsi     # 0x24487
leaq -0x1c0(%rbp), %rdi
leaq -0x2e(%rbp), %rdx
callq 0x4140
leaq 0x1f083(%rip), %rsi     # 0x240bc
leaq -0x1a0(%rbp), %rdi
leaq -0x2d(%rbp), %rdx
callq 0x4140
pushq $0x38
popq %rsi
leaq -0x200(%rbp), %rdx
leaq -0x1e0(%rbp), %rcx
leaq -0x1c0(%rbp), %r8
leaq -0x1a0(%rbp), %r9
movq %r15, %rdi
callq 0x7498
movq %rax, %r15
leaq 0x1f062(%rip), %rsi     # 0x240dc
leaq -0x180(%rbp), %rdi
leaq -0x2c(%rbp), %rdx
callq 0x4140
leaq 0x1f05a(%rip), %rsi     # 0x240eb
leaq -0x160(%rbp), %rdi
leaq -0x2b(%rbp), %rdx
callq 0x4140
leaq 0x1f04c(%rip), %rsi     # 0x240f4
leaq -0x140(%rbp), %rdi
leaq -0x2a(%rbp), %rdx
callq 0x4140
leaq 0x1f039(%rip), %rsi     # 0x240f8
leaq -0x120(%rbp), %rdi
leaq -0x29(%rbp), %rdx
callq 0x4140
pushq $0x6c
popq %rsi
leaq -0x180(%rbp), %rdx
leaq -0x160(%rbp), %rcx
leaq -0x140(%rbp), %r8
leaq -0x120(%rbp), %r9
movq %r15, %rdi
callq 0x7498
leaq -0x120(%rbp), %rdi
callq 0x46b8
leaq -0x140(%rbp), %rdi
callq 0x46b8
leaq -0x160(%rbp), %rdi
callq 0x46b8
leaq -0x180(%rbp), %rdi
callq 0x46b8
leaq -0x1a0(%rbp), %rdi
callq 0x46b8
leaq -0x1c0(%rbp), %rdi
callq 0x46b8
leaq -0x1e0(%rbp), %rdi
callq 0x46b8
leaq -0x200(%rbp), %rdi
callq 0x46b8
leaq -0x220(%rbp), %rdi
callq 0x46b8
leaq -0x240(%rbp), %rdi
callq 0x46b8
leaq -0x260(%rbp), %rdi
callq 0x46b8
leaq -0x280(%rbp), %rdi
callq 0x46b8
leaq -0x2a0(%rbp), %rdi
callq 0x46b8
leaq -0x380(%rbp), %rdi
movl %r14d, %esi
movq %rbx, %rdx
callq 0x7cfe
movq -0x2e8(%rbp), %rsi
movq -0x2e0(%rbp), %rax
subq %rsi, %rax
cmpq $0x40, %rax
je 0x51db
movq 0x30dfe(%rip), %rax     # 0x35fc0
movq (%rax), %rsi
leaq -0x380(%rbp), %rdi
pushq $0x1
popq %rdx
callq 0x81e6
movq -0x2e8(%rbp), %rsi
leaq -0x100(%rbp), %rdi
callq 0x4460
movq -0x2e8(%rbp), %rsi
addq $0x20, %rsi
leaq -0xe0(%rbp), %rdi
callq 0x4460
leaq 0x1ef14(%rip), %rsi     # 0x24119
leaq -0xc0(%rbp), %rdi
leaq -0x80(%rbp), %rdx
callq 0x4140
leaq -0x380(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x7d9e
movq %rax, %rdi
callq 0x72e4
movl %eax, %ebx
leaq -0xc0(%rbp), %rdi
callq 0x46b8
leaq 0x1ee71(%rip), %rsi     # 0x240b6
leaq -0xa0(%rbp), %rdi
leaq -0x80(%rbp), %rdx
callq 0x4140
leaq -0x380(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x7d9e
movzbl 0x4a(%rax), %r15d
leaq -0xa0(%rbp), %rdi
callq 0x46b8
leaq -0x78(%rbp), %r14
andl $0x0, (%r14)
andq $0x0, 0x8(%r14)
movq %r14, 0x10(%r14)
movq %r14, 0x18(%r14)
andq $0x0, 0x20(%r14)
leaq -0x100(%rbp), %rdi
leaq -0x80(%rbp), %rdx
movl %ebx, %esi
movl %r15d, %ecx
callq 0x4b0e
movl %eax, -0x34(%rbp)
leaq -0x50(%rbp), %r15
andq $0x0, 0x10(%r15)
xorps %xmm0, %xmm0
movaps %xmm0, (%r15)
movq -0x68(%rbp), %r13
leaq -0x2c8(%rbp), %r12
cmpq %r14, %r13
je 0x52fb
leaq 0x20(%r13), %rsi
leaq 0x40(%r13), %rdx
movq %r12, %rdi
callq 0x580a
movq %r15, %rdi
movq %r12, %rsi
callq 0x5ec6
movq %r12, %rdi
callq 0x46b8
movq %r13, %rdi
callq 0x43b0
movq %rax, %r13
jmp 0x52c6
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rsi
leaq -0x80e(%rip), %rdx      # 0x4afc
callq 0x60d8
movq 0x30cd2(%rip), %rdi     # 0x35fe8
movl -0x34(%rbp), %esi
callq 0x45c0
leaq 0x1edff(%rip), %rsi     # 0x24124
movq %rax, %rdi
callq 0x4340
movl %ebx, %esi
movq %rax, %rdi
callq 0x4250
movq %rax, %rdi
callq 0x4180
leaq -0xe0(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x4e23
xorl %edi, %edi
callq 0x43c0
jmp 0x5369
movq %rax, %rbx
leaq -0x2c8(%rbp), %rdi
callq 0x46b8
jmp 0x536c
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x5532
jmp 0x537a
movq %rax, %rbx
leaq -0x80(%rbp), %rdi
callq 0x582c
jmp 0x53a7
movq %rax, %rbx
leaq -0xa0(%rbp), %rdi
jmp 0x539d
jmp 0x53a4
movq %rax, %rbx
leaq -0xc0(%rbp), %rdi
callq 0x46b8
jmp 0x53a7
movq %rax, %rbx
leaq -0xe0(%rbp), %rdi
callq 0x46b8
jmp 0x53b8
movq %rax, %rbx
leaq -0x100(%rbp), %rdi
jmp 0x54aa
jmp 0x54b1
jmp 0x54b1
movq %rax, %rbx
leaq -0x120(%rbp), %rdi
callq 0x46b8
jmp 0x53e2
movq %rax, %rbx
leaq -0x140(%rbp), %rdi
callq 0x46b8
jmp 0x53f3
movq %rax, %rbx
leaq -0x160(%rbp), %rdi
callq 0x46b8
jmp 0x5404
movq %rax, %rbx
leaq -0x180(%rbp), %rdi
callq 0x46b8
jmp 0x5417
jmp 0x5414
movq %rax, %rbx
leaq -0x1a0(%rbp), %rdi
callq 0x46b8
jmp 0x5428
movq %rax, %rbx
leaq -0x1c0(%rbp), %rdi
callq 0x46b8
jmp 0x5439
movq %rax, %rbx
leaq -0x1e0(%rbp), %rdi
callq 0x46b8
jmp 0x544a
movq %rax, %rbx
leaq -0x200(%rbp), %rdi
callq 0x46b8
jmp 0x545d
jmp 0x545a
movq %rax, %rbx
leaq -0x220(%rbp), %rdi
callq 0x46b8
jmp 0x546e
movq %rax, %rbx
leaq -0x240(%rbp), %rdi
callq 0x46b8
jmp 0x547f
movq %rax, %rbx
leaq -0x260(%rbp), %rdi
callq 0x46b8
jmp 0x5490
movq %rax, %rbx
leaq -0x280(%rbp), %rdi
callq 0x46b8
jmp 0x54a3
jmp 0x54a0
movq %rax, %rbx
leaq -0x2a0(%rbp), %rdi
callq 0x46b8
jmp 0x54b4
movq %rax, %rbx
leaq -0x380(%rbp), %rdi
callq 0x555e
movq %rbx, %rdi
callq 0x45e0