// File: /workspace/github_cpp_makefile_star2_O1/sunpihai-up[P]MulThreadsWordsCounter/WordsCounter-v3.cpp
// Function: main
int main()
{
    size_t cores = std::thread::hardware_concurrency();
    cout << cores << " concurrent threads are supported.\n";

    string path;
    cout << instruct << endl;
    while (cin >> path)
    {
        if (path == "exit" || path == "quit")
        {
            return 0;
        }

        auto start = high_resolution_clock::now();

        // launch threads to process
        std::vector<pthread_t *> threadGroup;
        threadLauncher(threadGroup, cores, path);

        auto stop = high_resolution_clock::now();
        auto duration = duration_cast<milliseconds>(stop - start);
        cout << "Time taken by function: "
             << duration.count() << " milliseconds" << endl;

        cout << endl
             << instruct << endl;
        initVariable();
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
callq 0x2270
movl %eax, %ebx
movl %eax, %esi
movq 0x4b8c(%rip), %r14      # 0x7fd0
movq %r14, %rdi
callq 0x2140
leaq 0x1c6d(%rip), %rsi      # 0x50c0
movl $0x23, %edx
movq %rax, %rdi
callq 0x2220
leaq -0x50(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq 0x4e9e(%rip), %rsi      # 0x8318
movq 0x4e9f(%rip), %rdx      # 0x8320
movq %r14, %rdi
callq 0x2220
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x21f0
movsbl %al, %esi
movq %r15, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2150
leaq -0x60(%rbp), %r12
movq 0x4b22(%rip), %rdi      # 0x7fe0
movq %r12, %rsi
callq 0x2250
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x3632
movq %r12, %rdi
leaq 0x1c02(%rip), %rsi      # 0x50e4
callq 0x20c0
testl %eax, %eax
je 0x3632
movq %r12, %rdi
leaq 0x1b64(%rip), %rsi      # 0x505d
callq 0x20c0
testl %eax, %eax
je 0x3632
callq 0x2070
movq %rax, %r13
xorps %xmm0, %xmm0
movaps %xmm0, -0x40(%rbp)
movq $0x0, -0x30(%rbp)
leaq -0x40(%rbp), %rdi
movl %ebx, %esi
movq %r12, %rdx
callq 0x3257
callq 0x2070
movq %rax, %r15
movl $0x18, %edx
movq %r14, %rdi
leaq 0x1ba7(%rip), %rsi      # 0x50e9
callq 0x2220
subq %r13, %r15
movq %r15, %rax
movabsq $0x431bde82d7b634db, %rcx # imm = 0x431BDE82D7B634DB
imulq %rcx
movq %rdx, %rsi
shrq $0x3f, %rsi
sarq $0x12, %rdx
addq %rdx, %rsi
movq %r14, %rdi
callq 0x21e0
movq %rax, %r13
movl $0xd, %edx
movq %rax, %rdi
leaq 0x1b80(%rip), %rsi      # 0x5102
callq 0x2220
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x21f0
movsbl %al, %esi
movq %r13, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2150
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21f0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2150
movq 0x4d3b(%rip), %rsi      # 0x8318
movq 0x4d3c(%rip), %rdx      # 0x8320
movq %rax, %rdi
callq 0x2220
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x21f0
movsbl %al, %esi
movq %r13, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2150
callq 0x33db
movq -0x40(%rbp), %rdi
testq %rdi, %rdi
je 0x34b7
callq 0x21d0
jmp 0x34b7
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
cmpq %rax, %rdi
je 0x3644
callq 0x21d0
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3659
jmp 0x365e
movq %rax, %rbx
jmp 0x366f
movq %rax, %rbx
movq -0x40(%rbp), %rdi
testq %rdi, %rdi
je 0x366f
callq 0x21d0
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
cmpq %rax, %rdi
je 0x3681
callq 0x21d0
movq %rbx, %rdi
callq 0x2380
nop