// File: /workspace/github_cpp_makefile_star2_O3/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 0x827e
leaq -0x260(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x2298e(%rip), %rsi     # 0x2807b
leaq 0x229b2(%rip), %rdx     # 0x280a6
leaq -0x270(%rbp), %rdi
callq 0x6554
leaq -0x380(%rbp), %rdi
leaq -0x270(%rbp), %rsi
callq 0x82e4
movq %rax, %r15
leaq -0x240(%rbp), %r13
movq %r13, -0x10(%r13)
leaq 0x22987(%rip), %rsi     # 0x280af
leaq 0x22984(%rip), %rdx     # 0x280b3
leaq -0x250(%rbp), %rdi
callq 0x6554
leaq -0x1a0(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x22daa(%rip), %rdx     # 0x284f7
leaq -0x1b0(%rbp), %rdi
movq %rdx, %rsi
callq 0x6554
leaq -0x180(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x22d89(%rip), %rdx     # 0x284f7
leaq -0x190(%rbp), %rdi
movq %rdx, %rsi
callq 0x6554
leaq -0x160(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x22918(%rip), %rsi     # 0x280a7
leaq 0x2291d(%rip), %rdx     # 0x280b3
leaq -0x170(%rbp), %rdi
callq 0x6554
leaq -0x250(%rbp), %rdx
leaq -0x1b0(%rbp), %rcx
leaq -0x190(%rbp), %r8
leaq -0x170(%rbp), %r9
movq %r15, %rdi
movl $0x68, %esi
callq 0x82fc
movq %rax, %r15
leaq -0x140(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x228d4(%rip), %rsi     # 0x280b4
leaq 0x228d2(%rip), %rdx     # 0x280b9
leaq -0x150(%rbp), %rdi
callq 0x6554
leaq -0x120(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x22cf2(%rip), %rdx     # 0x284f7
leaq -0x130(%rbp), %rdi
movq %rdx, %rsi
callq 0x6554
leaq -0x100(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x22cd1(%rip), %rdx     # 0x284f7
leaq -0x110(%rbp), %rdi
movq %rdx, %rsi
callq 0x6554
leaq -0xe0(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x22873(%rip), %rsi     # 0x280ba
leaq 0x2288b(%rip), %rdx     # 0x280d9
leaq -0xf0(%rbp), %rdi
callq 0x6554
leaq -0x150(%rbp), %rdx
leaq -0x130(%rbp), %rcx
leaq -0x110(%rbp), %r8
leaq -0xf0(%rbp), %r9
movq %r15, %rdi
movl $0x38, %esi
callq 0x82fc
movq %rax, %r15
leaq -0xc0(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x22842(%rip), %rsi     # 0x280da
leaq 0x22849(%rip), %rdx     # 0x280e8
leaq -0xd0(%rbp), %rdi
callq 0x6554
leaq -0xa0(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x2282c(%rip), %rsi     # 0x280e9
leaq 0x2282d(%rip), %rdx     # 0x280f1
leaq -0xb0(%rbp), %rdi
callq 0x6554
leaq -0x80(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x22813(%rip), %rsi     # 0x280f2
leaq 0x2280f(%rip), %rdx     # 0x280f5
leaq -0x90(%rbp), %rdi
callq 0x6554
leaq -0x60(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x227f5(%rip), %rsi     # 0x280f6
leaq 0x2280e(%rip), %rdx     # 0x28116
leaq -0x70(%rbp), %rdi
callq 0x6554
leaq -0xd0(%rbp), %rdx
leaq -0xb0(%rbp), %rcx
leaq -0x90(%rbp), %r8
leaq -0x70(%rbp), %r9
movq %r15, %rdi
movl $0x6c, %esi
callq 0x82fc
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x5949
callq 0x4350
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x595e
callq 0x4350
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
je 0x5976
callq 0x4350
movq -0xd0(%rbp), %rdi
leaq -0xc0(%rbp), %rax
cmpq %rax, %rdi
je 0x598e
callq 0x4350
movq -0xf0(%rbp), %rdi
leaq -0xe0(%rbp), %rax
cmpq %rax, %rdi
je 0x59a6
callq 0x4350
movq -0x110(%rbp), %rdi
leaq -0x100(%rbp), %rax
cmpq %rax, %rdi
je 0x59be
callq 0x4350
movq -0x130(%rbp), %rdi
leaq -0x120(%rbp), %rax
cmpq %rax, %rdi
je 0x59d6
callq 0x4350
movq -0x150(%rbp), %rdi
leaq -0x140(%rbp), %rax
cmpq %rax, %rdi
je 0x59ee
callq 0x4350
movq -0x170(%rbp), %rdi
leaq -0x160(%rbp), %rax
cmpq %rax, %rdi
je 0x5a06
callq 0x4350
movq -0x190(%rbp), %rdi
leaq -0x180(%rbp), %rax
cmpq %rax, %rdi
je 0x5a1e
callq 0x4350
movq -0x1b0(%rbp), %rdi
leaq -0x1a0(%rbp), %rax
cmpq %rax, %rdi
je 0x5a36
callq 0x4350
movq -0x250(%rbp), %rdi
cmpq %r13, %rdi
je 0x5a47
callq 0x4350
movq -0x270(%rbp), %rdi
cmpq %r12, %rdi
je 0x5a58
callq 0x4350
leaq -0x380(%rbp), %rdi
movl %r14d, %esi
movq %rbx, %rdx
callq 0x8d24
movq -0x2e8(%rbp), %rax
movq -0x2e0(%rbp), %rcx
subq %rax, %rcx
cmpq $0x40, %rcx
je 0x5aa3
movq 0x30540(%rip), %rax     # 0x35fc8
movq (%rax), %rsi
leaq -0x380(%rbp), %rdi
movl $0x1, %edx
callq 0x92c6
movq -0x2e8(%rbp), %rax
leaq -0x220(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq -0x230(%rbp), %rdi
callq 0x64b6
movq -0x2e8(%rbp), %rax
leaq -0x200(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq 0x20(%rax), %rsi
movq 0x28(%rax), %rdx
addq %rsi, %rdx
leaq -0x210(%rbp), %rdi
callq 0x64b6
leaq -0x1e0(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x22618(%rip), %rsi     # 0x28117
leaq 0x2261b(%rip), %rdx     # 0x28121
leaq -0x1f0(%rbp), %rdi
callq 0x6554
leaq -0x380(%rbp), %rdi
leaq -0x1f0(%rbp), %rsi
callq 0x8dde
movq %rax, %rdi
callq 0x81a0
movl %eax, -0x2c(%rbp)
movq -0x1f0(%rbp), %rdi
cmpq %r14, %rdi
je 0x5b41
callq 0x4350
leaq -0x1c0(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x22561(%rip), %rsi     # 0x280b4
leaq 0x2255f(%rip), %rdx     # 0x280b9
leaq -0x1d0(%rbp), %rdi
callq 0x6554
leaq -0x380(%rbp), %rdi
leaq -0x1d0(%rbp), %rsi
callq 0x8dde
movb 0x4a(%rax), %r15b
movq -0x1d0(%rbp), %rdi
cmpq %r14, %rdi
je 0x5b8e
callq 0x4350
leaq -0x2c0(%rbp), %rbx
movl $0x0, (%rbx)
xorl %eax, %eax
movq %rax, 0x8(%rbx)
movq %rbx, 0x10(%rbx)
movq %rbx, 0x18(%rbx)
movq %rax, 0x20(%rbx)
movzbl %r15b, %ecx
leaq -0x230(%rbp), %rdi
leaq -0x2c8(%rbp), %rdx
movl -0x2c(%rbp), %esi
callq 0x50ee
movl %eax, -0x30(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0x50(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x2b0(%rbp), %r15
cmpq %rbx, %r15
jne 0x5beb
xorl %esi, %esi
xorl %edi, %edi
jmp 0x5c59
leaq -0x288(%rbp), %r14
leaq -0x298(%rbp), %r12
leaq -0x50(%rbp), %r13
movq %r14, -0x298(%rbp)
movq 0x20(%r15), %rsi
movq 0x28(%r15), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0x64b6
movss 0x40(%r15), %xmm0
movss %xmm0, -0x278(%rbp)
movq %r13, %rdi
movq %r12, %rsi
callq 0x6946
movq -0x298(%rbp), %rdi
cmpq %r14, %rdi
je 0x5c41
callq 0x4350
movq %r15, %rdi
callq 0x4410
movq %rax, %r15
cmpq %rbx, %rax
jne 0x5bfd
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rsi
leaq -0xb84(%rip), %rdx      # 0x50dc
callq 0x5f91
movq 0x3037c(%rip), %rdi     # 0x35fe8
movl -0x30(%rbp), %esi
callq 0x4610
movq %rax, %r15
leaq 0x224a4(%rip), %rsi     # 0x28122
movl $0x25, %edx
movq %rax, %rdi
callq 0x4400
movl -0x2c(%rbp), %esi
movq %r15, %rdi
callq 0x4250
movq %rax, %rdi
callq 0x4180
leaq -0x210(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x555e
xorl %edi, %edi
callq 0x4420
movq %rax, %rbx
movq -0x298(%rbp), %rdi
cmpq %r14, %rdi
je 0x5cd0
callq 0x4350
jmp 0x5cd0
jmp 0x5ccd
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x5ff0
jmp 0x5cde
movq %rax, %rbx
leaq -0x2c8(%rbp), %rdi
callq 0x6262
jmp 0x5d13
movq %rax, %rbx
movq -0x1d0(%rbp), %rdi
jmp 0x5d04
jmp 0x5d10
movq %rax, %rbx
movq -0x1f0(%rbp), %rdi
cmpq %r14, %rdi
je 0x5d13
callq 0x4350
jmp 0x5d13
movq %rax, %rbx
movq -0x210(%rbp), %rdi
leaq -0x200(%rbp), %rax
cmpq %rax, %rdi
je 0x5d30
callq 0x4350
jmp 0x5d30
movq %rax, %rbx
movq -0x230(%rbp), %rdi
leaq -0x220(%rbp), %rax
cmpq %rax, %rdi
jne 0x5eb7
jmp 0x5ec1
jmp 0x5ebe
jmp 0x5ebe
movq %rax, %rbx
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x5d70
callq 0x4350
jmp 0x5d70
movq %rax, %rbx
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x5d8a
callq 0x4350
jmp 0x5d8a
movq %rax, %rbx
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
je 0x5da7
callq 0x4350
jmp 0x5da7
movq %rax, %rbx
movq -0xd0(%rbp), %rdi
leaq -0xc0(%rbp), %rax
cmpq %rax, %rdi
je 0x5dc6
callq 0x4350
jmp 0x5dc6
jmp 0x5dc3
movq %rax, %rbx
movq -0xf0(%rbp), %rdi
leaq -0xe0(%rbp), %rax
cmpq %rax, %rdi
je 0x5de3
callq 0x4350
jmp 0x5de3
movq %rax, %rbx
movq -0x110(%rbp), %rdi
leaq -0x100(%rbp), %rax
cmpq %rax, %rdi
je 0x5e00
callq 0x4350
jmp 0x5e00
movq %rax, %rbx
movq -0x130(%rbp), %rdi
leaq -0x120(%rbp), %rax
cmpq %rax, %rdi
je 0x5e1d
callq 0x4350
jmp 0x5e1d
movq %rax, %rbx
movq -0x150(%rbp), %rdi
leaq -0x140(%rbp), %rax
cmpq %rax, %rdi
je 0x5e3c
callq 0x4350
jmp 0x5e3c
jmp 0x5e39
movq %rax, %rbx
movq -0x170(%rbp), %rdi
leaq -0x160(%rbp), %rax
cmpq %rax, %rdi
je 0x5e59
callq 0x4350
jmp 0x5e59
movq %rax, %rbx
movq -0x190(%rbp), %rdi
leaq -0x180(%rbp), %rax
cmpq %rax, %rdi
je 0x5e76
callq 0x4350
jmp 0x5e76
movq %rax, %rbx
movq -0x1b0(%rbp), %rdi
leaq -0x1a0(%rbp), %rax
cmpq %rax, %rdi
je 0x5e93
callq 0x4350
jmp 0x5e93
movq %rax, %rbx
movq -0x250(%rbp), %rdi
cmpq %r13, %rdi
je 0x5eab
callq 0x4350
jmp 0x5eab
jmp 0x5ea8
movq %rax, %rbx
movq -0x270(%rbp), %rdi
cmpq %r12, %rdi
je 0x5ec1
callq 0x4350
jmp 0x5ec1
movq %rax, %rbx
leaq -0x2e8(%rbp), %rdi
callq 0x62f6
leaq -0x318(%rbp), %rdi
callq 0x6382
leaq -0x348(%rbp), %rdi
callq 0x63ec
leaq -0x360(%rbp), %r14
movq %r14, %rdi
callq 0x634e
movq -0x20(%r14), %rdi
leaq -0x370(%rbp), %rax
cmpq %rax, %rdi
je 0x5f09
callq 0x4350
movq %rbx, %rdi
callq 0x4640
nop