// File: /workspace/github_cpp_makefile_star2_O1/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 0x82a6
leaq -0x260(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x2296b(%rip), %rsi     # 0x2807b
leaq 0x2298f(%rip), %rdx     # 0x280a6
leaq -0x270(%rbp), %rdi
callq 0x6556
leaq -0x380(%rbp), %rdi
leaq -0x270(%rbp), %rsi
callq 0x830c
movq %rax, %r15
leaq -0x240(%rbp), %r13
movq %r13, -0x10(%r13)
leaq 0x22964(%rip), %rsi     # 0x280af
leaq 0x22961(%rip), %rdx     # 0x280b3
leaq -0x250(%rbp), %rdi
callq 0x6556
leaq -0x1a0(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x22d87(%rip), %rdx     # 0x284f7
leaq -0x1b0(%rbp), %rdi
movq %rdx, %rsi
callq 0x6556
leaq -0x180(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x22d66(%rip), %rdx     # 0x284f7
leaq -0x190(%rbp), %rdi
movq %rdx, %rsi
callq 0x6556
leaq -0x160(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x228f5(%rip), %rsi     # 0x280a7
leaq 0x228fa(%rip), %rdx     # 0x280b3
leaq -0x170(%rbp), %rdi
callq 0x6556
leaq -0x250(%rbp), %rdx
leaq -0x1b0(%rbp), %rcx
leaq -0x190(%rbp), %r8
leaq -0x170(%rbp), %r9
movq %r15, %rdi
movl $0x68, %esi
callq 0x8324
movq %rax, %r15
leaq -0x140(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x228b1(%rip), %rsi     # 0x280b4
leaq 0x228af(%rip), %rdx     # 0x280b9
leaq -0x150(%rbp), %rdi
callq 0x6556
leaq -0x120(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x22ccf(%rip), %rdx     # 0x284f7
leaq -0x130(%rbp), %rdi
movq %rdx, %rsi
callq 0x6556
leaq -0x100(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x22cae(%rip), %rdx     # 0x284f7
leaq -0x110(%rbp), %rdi
movq %rdx, %rsi
callq 0x6556
leaq -0xe0(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x22850(%rip), %rsi     # 0x280ba
leaq 0x22868(%rip), %rdx     # 0x280d9
leaq -0xf0(%rbp), %rdi
callq 0x6556
leaq -0x150(%rbp), %rdx
leaq -0x130(%rbp), %rcx
leaq -0x110(%rbp), %r8
leaq -0xf0(%rbp), %r9
movq %r15, %rdi
movl $0x38, %esi
callq 0x8324
movq %rax, %r15
leaq -0xc0(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x2281f(%rip), %rsi     # 0x280da
leaq 0x22826(%rip), %rdx     # 0x280e8
leaq -0xd0(%rbp), %rdi
callq 0x6556
leaq -0xa0(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x22809(%rip), %rsi     # 0x280e9
leaq 0x2280a(%rip), %rdx     # 0x280f1
leaq -0xb0(%rbp), %rdi
callq 0x6556
leaq -0x80(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x227f0(%rip), %rsi     # 0x280f2
leaq 0x227ec(%rip), %rdx     # 0x280f5
leaq -0x90(%rbp), %rdi
callq 0x6556
leaq -0x60(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x227d2(%rip), %rsi     # 0x280f6
leaq 0x227eb(%rip), %rdx     # 0x28116
leaq -0x70(%rbp), %rdi
callq 0x6556
leaq -0xd0(%rbp), %rdx
leaq -0xb0(%rbp), %rcx
leaq -0x90(%rbp), %r8
leaq -0x70(%rbp), %r9
movq %r15, %rdi
movl $0x6c, %esi
callq 0x8324
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x596c
callq 0x4350
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x5981
callq 0x4350
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
je 0x5999
callq 0x4350
movq -0xd0(%rbp), %rdi
leaq -0xc0(%rbp), %rax
cmpq %rax, %rdi
je 0x59b1
callq 0x4350
movq -0xf0(%rbp), %rdi
leaq -0xe0(%rbp), %rax
cmpq %rax, %rdi
je 0x59c9
callq 0x4350
movq -0x110(%rbp), %rdi
leaq -0x100(%rbp), %rax
cmpq %rax, %rdi
je 0x59e1
callq 0x4350
movq -0x130(%rbp), %rdi
leaq -0x120(%rbp), %rax
cmpq %rax, %rdi
je 0x59f9
callq 0x4350
movq -0x150(%rbp), %rdi
leaq -0x140(%rbp), %rax
cmpq %rax, %rdi
je 0x5a11
callq 0x4350
movq -0x170(%rbp), %rdi
leaq -0x160(%rbp), %rax
cmpq %rax, %rdi
je 0x5a29
callq 0x4350
movq -0x190(%rbp), %rdi
leaq -0x180(%rbp), %rax
cmpq %rax, %rdi
je 0x5a41
callq 0x4350
movq -0x1b0(%rbp), %rdi
leaq -0x1a0(%rbp), %rax
cmpq %rax, %rdi
je 0x5a59
callq 0x4350
movq -0x250(%rbp), %rdi
cmpq %r13, %rdi
je 0x5a6a
callq 0x4350
movq -0x270(%rbp), %rdi
cmpq %r12, %rdi
je 0x5a7b
callq 0x4350
leaq -0x380(%rbp), %rdi
movl %r14d, %esi
movq %rbx, %rdx
callq 0x8d72
movq -0x2e0(%rbp), %rax
subq -0x2e8(%rbp), %rax
cmpq $0x40, %rax
je 0x5abc
movq 0x30520(%rip), %rax     # 0x35fc8
movq (%rax), %rsi
leaq -0x380(%rbp), %rdi
movl $0x1, %edx
callq 0x9314
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 0x64bc
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 0x64bc
leaq -0x1e0(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x225f8(%rip), %rsi     # 0x28117
leaq 0x225fb(%rip), %rdx     # 0x28121
leaq -0x1f0(%rbp), %rdi
callq 0x6556
leaq -0x380(%rbp), %rdi
leaq -0x1f0(%rbp), %rsi
callq 0x8e2c
movq %rax, %rdi
callq 0x81c8
movl %eax, -0x2c(%rbp)
movq -0x1f0(%rbp), %rdi
cmpq %r14, %rdi
je 0x5b61
callq 0x4350
leaq -0x1c0(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x22541(%rip), %rsi     # 0x280b4
leaq 0x2253f(%rip), %rdx     # 0x280b9
leaq -0x1d0(%rbp), %rdi
callq 0x6556
leaq -0x380(%rbp), %rdi
leaq -0x1d0(%rbp), %rsi
callq 0x8e2c
movb 0x4a(%rax), %r15b
movq -0x1d0(%rbp), %rdi
cmpq %r14, %rdi
je 0x5bae
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
je 0x5c6b
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 0x64bc
movss 0x40(%r15), %xmm0
movss %xmm0, -0x278(%rbp)
movq %r13, %rdi
movq %r12, %rsi
callq 0x694e
movq -0x298(%rbp), %rdi
cmpq %r14, %rdi
je 0x5c5b
callq 0x4350
movq %r15, %rdi
callq 0x4410
movq %rax, %r15
cmpq %rbx, %rax
jne 0x5c17
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rsi
leaq -0xb9e(%rip), %rdx      # 0x50dc
callq 0x5fab
movq 0x30362(%rip), %rdi     # 0x35fe8
movl -0x30(%rbp), %esi
callq 0x4610
movq %rax, %r15
leaq 0x2248a(%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 0x5581
xorl %edi, %edi
callq 0x4420
movq %rax, %rbx
movq -0x298(%rbp), %rdi
cmpq %r14, %rdi
je 0x5cea
callq 0x4350
jmp 0x5cea
jmp 0x5ce7
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x600a
jmp 0x5cf8
movq %rax, %rbx
leaq -0x2c8(%rbp), %rdi
callq 0x6272
jmp 0x5d2d
movq %rax, %rbx
movq -0x1d0(%rbp), %rdi
jmp 0x5d1e
jmp 0x5d2a
movq %rax, %rbx
movq -0x1f0(%rbp), %rdi
cmpq %r14, %rdi
je 0x5d2d
callq 0x4350
jmp 0x5d2d
movq %rax, %rbx
movq -0x210(%rbp), %rdi
leaq -0x200(%rbp), %rax
cmpq %rax, %rdi
je 0x5d4a
callq 0x4350
jmp 0x5d4a
movq %rax, %rbx
movq -0x230(%rbp), %rdi
leaq -0x220(%rbp), %rax
cmpq %rax, %rdi
jne 0x5ed1
jmp 0x5edb
jmp 0x5ed8
jmp 0x5ed8
movq %rax, %rbx
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x5d8a
callq 0x4350
jmp 0x5d8a
movq %rax, %rbx
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x5da4
callq 0x4350
jmp 0x5da4
movq %rax, %rbx
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
je 0x5dc1
callq 0x4350
jmp 0x5dc1
movq %rax, %rbx
movq -0xd0(%rbp), %rdi
leaq -0xc0(%rbp), %rax
cmpq %rax, %rdi
je 0x5de0
callq 0x4350
jmp 0x5de0
jmp 0x5ddd
movq %rax, %rbx
movq -0xf0(%rbp), %rdi
leaq -0xe0(%rbp), %rax
cmpq %rax, %rdi
je 0x5dfd
callq 0x4350
jmp 0x5dfd
movq %rax, %rbx
movq -0x110(%rbp), %rdi
leaq -0x100(%rbp), %rax
cmpq %rax, %rdi
je 0x5e1a
callq 0x4350
jmp 0x5e1a
movq %rax, %rbx
movq -0x130(%rbp), %rdi
leaq -0x120(%rbp), %rax
cmpq %rax, %rdi
je 0x5e37
callq 0x4350
jmp 0x5e37
movq %rax, %rbx
movq -0x150(%rbp), %rdi
leaq -0x140(%rbp), %rax
cmpq %rax, %rdi
je 0x5e56
callq 0x4350
jmp 0x5e56
jmp 0x5e53
movq %rax, %rbx
movq -0x170(%rbp), %rdi
leaq -0x160(%rbp), %rax
cmpq %rax, %rdi
je 0x5e73
callq 0x4350
jmp 0x5e73
movq %rax, %rbx
movq -0x190(%rbp), %rdi
leaq -0x180(%rbp), %rax
cmpq %rax, %rdi
je 0x5e90
callq 0x4350
jmp 0x5e90
movq %rax, %rbx
movq -0x1b0(%rbp), %rdi
leaq -0x1a0(%rbp), %rax
cmpq %rax, %rdi
je 0x5ead
callq 0x4350
jmp 0x5ead
movq %rax, %rbx
movq -0x250(%rbp), %rdi
cmpq %r13, %rdi
je 0x5ec5
callq 0x4350
jmp 0x5ec5
jmp 0x5ec2
movq %rax, %rbx
movq -0x270(%rbp), %rdi
cmpq %r12, %rdi
je 0x5edb
callq 0x4350
jmp 0x5edb
movq %rax, %rbx
leaq -0x2e8(%rbp), %rdi
callq 0x6306
leaq -0x318(%rbp), %rdi
callq 0x6388
leaq -0x348(%rbp), %rdi
callq 0x63f2
leaq -0x360(%rbp), %r14
movq %r14, %rdi
callq 0x6354
movq -0x20(%r14), %rdi
leaq -0x370(%rbp), %rax
cmpq %rax, %rdi
je 0x5f23
callq 0x4350
movq %rbx, %rdi
callq 0x4640
nop