// File: /workspace/github_cpp_makefile_star2_O3/YerevaNN[P]pmi/train.cpp
// Function: std::vector<unsigned long, std::allocator<unsigned long>> getNgrams<std::_Deque_iterator<unsigned long, unsigned long&, unsigned long*>>(std::_Deque_iterator<unsigned long, unsigned long&, unsigned long*> const&, std::_Deque_iterator<unsigned long, unsigned long&, unsigned long*> const&)
std::vector<ngram> getNgrams(const T& begin, const T& end) {
    std::vector<ngram> ngrams;
    
    if(std::distance(begin, end) >= 1) {
        auto unigrams = getUnigrams(begin, end);
        ngrams.insert(ngrams.end(), unigrams.begin(), unigrams.end());
    }
    if(std::distance(begin, end) >= 2) {
        auto bigrams = getBigrams(begin, end);
        ngrams.insert(ngrams.end(), bigrams.begin(), bigrams.end());
    }
    if(std::distance(begin, end) >= 3) {
        auto trigrams = getTrigrams(begin, end);
        ngrams.insert(ngrams.end(), trigrams.begin(), trigrams.end());
    }
    
    return ngrams;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movq 0x10(%rsi), %rax
movq 0x18(%rdx), %rdx
movq %rdx, %rcx
subq 0x18(%rsi), %rcx
movq (%r14), %rsi
sarq $0x3, %rcx
cmpq $0x1, %rdx
movq %rcx, %rdi
adcq $-0x1, %rdi
subq 0x8(%r14), %rsi
shlq $0x6, %rdi
sarq $0x3, %rsi
subq (%r15), %rax
sarq $0x3, %rax
addq %rsi, %rax
addq %rax, %rdi
testq %rdi, %rdi
jle 0x5090
leaq 0x8(%rsp), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x51af
movq 0x8(%rbx), %rsi
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rcx
movq %rbx, %rdi
callq 0x5932
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x5068
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x2130
movq 0x10(%r15), %rax
movq (%r14), %rsi
movq 0x18(%r14), %rdx
movq %rdx, %rcx
subq 0x18(%r15), %rcx
sarq $0x3, %rcx
subq 0x8(%r14), %rsi
sarq $0x3, %rsi
subq (%r15), %rax
sarq $0x3, %rax
addq %rsi, %rax
cmpq $0x1, %rdx
movq %rcx, %rsi
adcq $-0x1, %rsi
shlq $0x6, %rsi
addq %rax, %rsi
cmpq $0x2, %rsi
jl 0x510d
leaq 0x8(%rsp), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x529f
movq 0x8(%rbx), %rsi
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rcx
movq %rbx, %rdi
callq 0x5932
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x50e5
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x2130
movq 0x10(%r15), %rax
movq (%r14), %rsi
movq 0x18(%r14), %rdx
movq %rdx, %rcx
subq 0x18(%r15), %rcx
sarq $0x3, %rcx
subq 0x8(%r14), %rsi
sarq $0x3, %rsi
subq (%r15), %rax
sarq $0x3, %rax
addq %rsi, %rax
cmpq $0x1, %rdx
adcq $-0x1, %rcx
shlq $0x6, %rcx
addq %rax, %rcx
cmpq $0x3, %rcx
jl 0x515f
leaq 0x8(%rsp), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x53c9
movq 0x8(%rbx), %rsi
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rcx
movq %rbx, %rdi
callq 0x5932
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x515f
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x2130
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
jmp 0x5174
jmp 0x5190
jmp 0x5174
jmp 0x5190
movq %rax, %r14
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x5193
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x2130
jmp 0x5193
movq %rax, %r14
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x51a7
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x2130
movq %r14, %rdi
callq 0x2220