// File: /workspace/github_cpp_makefile_star2_O1/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 (%rdx), %rcx
movq 0x18(%rdx), %rdx
movq %rdx, %rsi
subq 0x18(%r15), %rsi
shrq $0x3, %rsi
cmpq $0x1, %rdx
adcq $-0x1, %rsi
subq 0x8(%r14), %rcx
shlq $0x6, %rsi
sarq $0x3, %rcx
subq (%r15), %rax
sarq $0x3, %rax
addq %rcx, %rax
addq %rsi, %rax
testq %rax, %rax
jle 0x502f
leaq 0x8(%rsp), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x5173
movq 0x8(%rbx), %rsi
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rcx
movq %rbx, %rdi
callq 0x58f8
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x502f
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x2130
movq 0x10(%r15), %rax
movq (%r14), %rcx
movq 0x18(%r14), %rdx
movq %rdx, %rsi
subq 0x18(%r15), %rsi
shrq $0x3, %rsi
cmpq $0x1, %rdx
adcq $-0x1, %rsi
subq 0x8(%r14), %rcx
shlq $0x6, %rsi
sarq $0x3, %rcx
subq (%r15), %rax
sarq $0x3, %rax
addq %rcx, %rax
addq %rsi, %rax
cmpq $0x2, %rax
jl 0x50a9
leaq 0x8(%rsp), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x525c
movq 0x8(%rbx), %rsi
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rcx
movq %rbx, %rdi
callq 0x58f8
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x50a9
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x2130
movq 0x10(%r15), %rax
movq (%r14), %rcx
movq 0x18(%r14), %rdx
movq %rdx, %rsi
subq 0x18(%r15), %rsi
shrq $0x3, %rsi
cmpq $0x1, %rdx
adcq $-0x1, %rsi
subq 0x8(%r14), %rcx
shlq $0x6, %rsi
sarq $0x3, %rcx
subq (%r15), %rax
sarq $0x3, %rax
addq %rcx, %rax
addq %rsi, %rax
cmpq $0x3, %rax
jl 0x5123
leaq 0x8(%rsp), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x5377
movq 0x8(%rbx), %rsi
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rcx
movq %rbx, %rdi
callq 0x58f8
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x5123
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x2130
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
jmp 0x5138
jmp 0x5154
jmp 0x5138
jmp 0x5154
movq %rax, %r14
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x5157
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x2130
jmp 0x5157
movq %rax, %r14
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x516b
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x2130
movq %r14, %rdi
callq 0x2220