// File: /workspace/github_cpp_makefile_star2_O2/rowdyroad[P]dtmfdecoder/./DTMFDecoder.h
// Function: DTMFDecoder<short>::decode(std::vector<short, std::allocator<short>> const&, unsigned long)
void decode(const std::vector<T>& frames, size_t framesCount)
      {
        size_t offset = 0;
        while (framesCount > 0) {
          size_t len = std::min(framesCount, framesCount_ - windowFrames_.size());
          windowFrames_.insert(windowFrames_.end(), frames.begin() + offset, frames.begin() + offset + len);
          offset += len;
          framesCount -= len;
          if (windowFrames_.size() >= framesCount_) {
              std::vector<double> resultedFrames(framesCount_);
              for (size_t i = 0; i < framesCount_; ++i) {
                resultedFrames[i] = windowFunctionTable_[i] * windowFrames_[i];
              }
              Frequency low = getExistsFrequency(resultedFrames, kLowFreqs_),
                        high = getExistsFrequency(resultedFrames, kHighFreqs_);

              if (low == kUndefinedFrequency || high == kUndefinedFrequency) {
                truncateDtmfStatTable();
              } else {
                  auto r = dtmfStatsTable_.find(std::make_pair(low, high));
                  truncateDtmfStatTable(&r->first);
                  auto duration = r->second.duration;
                  r->second.duration += overlapFramesCount_;
                  if (duration < framesCount_ && r->second.duration >= framesCount_) {
                    handler_->OnCodeBegin(this, r->second.code);
                  } else if (r->second.duration % framesCount_ == 0) {
                    handler_->OnCode(this, r->second.code, r->second.duration / samplesPerMilliseconds_);
                  }
              }

              windowFrames_.erase(windowFrames_.begin(), windowFrames_.begin() + overlapFramesCount_);
          }
          timestamp_ += len;
        }
      }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, %rbx
movq %rsi, 0x28(%rsp)
movq %rdi, %r15
leaq 0x88(%rdi), %rax
movq %rax, 0x8(%rsp)
leaq 0x8(%rdi), %rax
movq %rax, 0x20(%rsp)
leaq 0x20(%rdi), %rax
movq %rax, 0x18(%rsp)
leaq 0xb8(%rdi), %rax
movq %rax, 0x10(%rsp)
xorl %r14d, %r14d
leaq 0x30(%rsp), %r12
testq %rbx, %rbx
je 0x29d3
movq 0x68(%r15), %r13
movq 0x90(%r15), %rsi
movq %rsi, %rax
subq 0x88(%r15), %rax
sarq %rax
subq %rax, %r13
cmpq %rbx, %r13
cmovaeq %rbx, %r13
leaq (%r14,%r14), %rdx
movq 0x28(%rsp), %rax
addq (%rax), %rdx
leaq (%rdx,%r13,2), %rcx
movq 0x8(%rsp), %rdi
callq 0x34d4
movq 0x68(%r15), %rsi
movq 0x90(%r15), %rax
subq 0x88(%r15), %rax
sarq %rax
cmpq %rsi, %rax
jb 0x29c4
movq %r12, %rdi
leaq 0x4(%rsp), %rdx
callq 0x34f4
movq 0x68(%r15), %rax
movq 0x88(%r15), %rcx
movq 0xa0(%r15), %rdx
movq 0x30(%rsp), %rsi
xorl %edi, %edi
cmpq %rdi, %rax
je 0x28d0
movswl (%rcx,%rdi,2), %r8d
cvtsi2sd %r8d, %xmm0
mulsd (%rdx,%rdi,8), %xmm0
movsd %xmm0, (%rsi,%rdi,8)
incq %rdi
jmp 0x28b2
movq %r15, %rdi
movq %r12, %rsi
movq 0x20(%rsp), %rdx
callq 0x3546
movq %r12, %rsi
movl %eax, %ebp
movq %r15, %rdi
movq 0x18(%rsp), %rdx
callq 0x3546
movzwl (%r15), %ecx
cmpw %cx, %bp
setne %dl
cmpw %cx, %ax
setne %cl
testb %cl, %dl
jne 0x2915
movq %r15, %rdi
xorl %esi, %esi
callq 0x35be
jmp 0x29a3
shll $0x10, %eax
movzwl %bp, %ecx
orl %eax, %ecx
movl %ecx, 0x4(%rsp)
movq 0x10(%rsp), %rdi
leaq 0x4(%rsp), %rsi
callq 0x39ba
movq %rax, %rbp
leaq 0x20(%rax), %rsi
movq %r15, %rdi
callq 0x35be
movq 0x28(%rbp), %rax
movq 0x70(%r15), %rcx
addq %rax, %rcx
movq %rcx, 0x28(%rbp)
movq 0x68(%r15), %rsi
cmpq %rsi, %rax
setae %al
cmpq %rsi, %rcx
setb %dl
orb %al, %dl
je 0x2993
movq %rcx, %rax
xorl %edx, %edx
divq %rsi
testq %rdx, %rdx
jne 0x29a3
movq 0x48(%r15), %rdi
movzbl 0x30(%rbp), %r8d
movq %rcx, %rax
xorl %edx, %edx
divq 0x58(%r15)
movq (%rdi), %r9
movq %r15, %rsi
movl %r8d, %edx
movq %rax, %rcx
callq *0x8(%r9)
jmp 0x29a3
movq 0x48(%r15), %rdi
movzbl 0x30(%rbp), %edx
movq (%rdi), %rax
movq %r15, %rsi
callq *(%rax)
movq 0x70(%r15), %rax
movq 0x88(%r15), %rsi
leaq (%rsi,%rax,2), %rdx
movq 0x8(%rsp), %rdi
callq 0x3640
movq %r12, %rdi
callq 0x2b6c
addq %r13, %r14
subq %r13, %rbx
addq %r13, 0x78(%r15)
jmp 0x2829
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x29ec
jmp 0x29ec
jmp 0x29ec
jmp 0x29ec
jmp 0x29ec
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x2b6c
movq %rbx, %rdi
callq 0x2200
nop