// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: windowFullScan
static void windowFullScan(WindowCodeArg *p){
  Window *pWin;
  Parse *pParse = p->pParse;
  Window *pMWin = p->pMWin;
  Vdbe *v = p->pVdbe;

  int regCRowid = 0;              /* Current rowid value */
  int regCPeer = 0;               /* Current peer values */
  int regRowid = 0;               /* AggStep rowid value */
  int regPeer = 0;                /* AggStep peer values */

  int nPeer;
  int lblNext;
  int lblBrk;
  int addrNext;
  int csr;

  VdbeModuleComment((v, "windowFullScan begin"));

  assert( pMWin!=0 );
  csr = pMWin->csrApp;
  nPeer = (pMWin->pOrderBy ? pMWin->pOrderBy->nExpr : 0);

  lblNext = sqlite3VdbeMakeLabel(pParse);
  lblBrk = sqlite3VdbeMakeLabel(pParse);

  regCRowid = sqlite3GetTempReg(pParse);
  regRowid = sqlite3GetTempReg(pParse);
  if( nPeer ){
    regCPeer = sqlite3GetTempRange(pParse, nPeer);
    regPeer = sqlite3GetTempRange(pParse, nPeer);
  }

  sqlite3VdbeAddOp2(v, OP_Rowid, pMWin->iEphCsr, regCRowid);
  windowReadPeerValues(p, pMWin->iEphCsr, regCPeer);

  for(pWin=pMWin; pWin; pWin=pWin->pNextWin){
    sqlite3VdbeAddOp2(v, OP_Null, 0, pWin->regAccum);
  }

  sqlite3VdbeAddOp3(v, OP_SeekGE, csr, lblBrk, pMWin->regStartRowid);
  VdbeCoverage(v);
  addrNext = sqlite3VdbeCurrentAddr(v);
  sqlite3VdbeAddOp2(v, OP_Rowid, csr, regRowid);
  sqlite3VdbeAddOp3(v, OP_Gt, pMWin->regEndRowid, lblBrk, regRowid);
  VdbeCoverageNeverNull(v);

  if( pMWin->eExclude==TK_CURRENT ){
    sqlite3VdbeAddOp3(v, OP_Eq, regCRowid, lblNext, regRowid);
    VdbeCoverageNeverNull(v);
  }else if( pMWin->eExclude!=TK_NO ){
    int addr;
    int addrEq = 0;
    KeyInfo *pKeyInfo = 0;

    if( pMWin->pOrderBy ){
      pKeyInfo = sqlite3KeyInfoFromExprList(pParse, pMWin->pOrderBy, 0, 0);
    }
    if( pMWin->eExclude==TK_TIES ){
      addrEq = sqlite3VdbeAddOp3(v, OP_Eq, regCRowid, 0, regRowid);
      VdbeCoverageNeverNull(v);
    }
    if( pKeyInfo ){
      windowReadPeerValues(p, csr, regPeer);
      sqlite3VdbeAddOp3(v, OP_Compare, regPeer, regCPeer, nPeer);
      sqlite3VdbeAppendP4(v, (void*)pKeyInfo, P4_KEYINFO);
      addr = sqlite3VdbeCurrentAddr(v)+1;
      sqlite3VdbeAddOp3(v, OP_Jump, addr, lblNext, addr);
      VdbeCoverageEqNe(v);
    }else{
      sqlite3VdbeAddOp2(v, OP_Goto, 0, lblNext);
    }
    if( addrEq ) sqlite3VdbeJumpHere(v, addrEq);
  }

  windowAggStep(p, pMWin, csr, 0, p->regArg);

  sqlite3VdbeResolveLabel(v, lblNext);
  sqlite3VdbeAddOp2(v, OP_Next, csr, addrNext);
  VdbeCoverage(v);
  sqlite3VdbeJumpHere(v, addrNext-1);
  sqlite3VdbeJumpHere(v, addrNext+1);
  sqlite3ReleaseTempReg(pParse, regRowid);
  sqlite3ReleaseTempReg(pParse, regCRowid);
  if( nPeer ){
    sqlite3ReleaseTempRange(pParse, regPeer, nPeer);
    sqlite3ReleaseTempRange(pParse, regCPeer, nPeer);
  }

  windowAggFinal(p, 1);
  VdbeModuleComment((v, "windowFullScan end"));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movl $0x0, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
movl $0x0, -0x38(%rbp)
movq -0x20(%rbp), %rax
movl 0x64(%rax), %eax
movl %eax, -0x4c(%rbp)
movq -0x20(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x4589ff
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movl (%rax), %eax
movl %eax, -0x64(%rbp)
jmp 0x458a06
xorl %eax, %eax
movl %eax, -0x64(%rbp)
jmp 0x458a06
movl -0x64(%rbp), %eax
movl %eax, -0x3c(%rbp)
movq -0x18(%rbp), %rdi
callq 0x42d540
movl %eax, -0x40(%rbp)
movq -0x18(%rbp), %rdi
callq 0x42d540
movl %eax, -0x44(%rbp)
movq -0x18(%rbp), %rdi
callq 0x42f190
movl %eax, -0x2c(%rbp)
movq -0x18(%rbp), %rdi
callq 0x42f190
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x3c(%rbp)
je 0x458a60
movq -0x18(%rbp), %rdi
movl -0x3c(%rbp), %esi
callq 0x42cb30
movl %eax, -0x30(%rbp)
movq -0x18(%rbp), %rdi
movl -0x3c(%rbp), %esi
callq 0x42cb30
movl %eax, -0x38(%rbp)
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x58(%rax), %edx
movl -0x2c(%rbp), %ecx
movl $0x7f, %esi
callq 0x410100
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x58(%rax), %esi
movl -0x30(%rbp), %edx
callq 0x458cf0
movq -0x20(%rbp), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x458abf
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x5c(%rax), %ecx
movl $0x48, %esi
xorl %edx, %edx
callq 0x410100
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq %rax, -0x10(%rbp)
jmp 0x458a93
movq -0x28(%rbp), %rdi
movl -0x4c(%rbp), %edx
movl -0x44(%rbp), %ecx
movq -0x20(%rbp), %rax
movl 0x84(%rax), %r8d
movl $0x18, %esi
callq 0x410130
movq -0x28(%rbp), %rdi
callq 0x430ae0
movl %eax, -0x48(%rbp)
movq -0x28(%rbp), %rdi
movl -0x4c(%rbp), %edx
movl -0x34(%rbp), %ecx
movl $0x7f, %esi
callq 0x410100
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x88(%rax), %edx
movl -0x44(%rbp), %ecx
movl -0x34(%rbp), %r8d
movl $0x36, %esi
callq 0x410130
movq -0x20(%rbp), %rax
movzbl 0x24(%rax), %eax
cmpl $0x55, %eax
jne 0x458b47
movq -0x28(%rbp), %rdi
movl -0x2c(%rbp), %edx
movl -0x40(%rbp), %ecx
movl -0x34(%rbp), %r8d
movl $0x35, %esi
callq 0x410130
jmp 0x458c44
movq -0x20(%rbp), %rax
movzbl 0x24(%rax), %eax
cmpl $0x42, %eax
je 0x458c42
movl $0x0, -0x54(%rbp)
movq $0x0, -0x60(%rbp)
movq -0x20(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x458b8b
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rsi
xorl %ecx, %ecx
movl %ecx, %edx
callq 0x440f30
movq %rax, -0x60(%rbp)
movq -0x20(%rbp), %rax
movzbl 0x24(%rax), %eax
cmpl $0x5e, %eax
jne 0x458bb2
movq -0x28(%rbp), %rdi
movl -0x2c(%rbp), %edx
movl -0x34(%rbp), %r8d
movl $0x35, %esi
xorl %ecx, %ecx
callq 0x410130
movl %eax, -0x54(%rbp)
cmpq $0x0, -0x60(%rbp)
je 0x458c1b
movq -0x8(%rbp), %rdi
movl -0x4c(%rbp), %esi
movl -0x38(%rbp), %edx
callq 0x458cf0
movq -0x28(%rbp), %rdi
movl -0x38(%rbp), %edx
movl -0x30(%rbp), %ecx
movl -0x3c(%rbp), %r8d
movl $0x56, %esi
callq 0x410130
movq -0x28(%rbp), %rdi
movq -0x60(%rbp), %rsi
movl $0xfffffff7, %edx       # imm = 0xFFFFFFF7
callq 0x42a320
movq -0x28(%rbp), %rdi
callq 0x430ae0
addl $0x1, %eax
movl %eax, -0x50(%rbp)
movq -0x28(%rbp), %rdi
movl -0x50(%rbp), %edx
movl -0x40(%rbp), %ecx
movl -0x50(%rbp), %r8d
movl $0x10, %esi
callq 0x410130
jmp 0x458c2e
movq -0x28(%rbp), %rdi
movl -0x40(%rbp), %ecx
movl $0xb, %esi
xorl %edx, %edx
callq 0x410100
cmpl $0x0, -0x54(%rbp)
je 0x458c40
movq -0x28(%rbp), %rdi
movl -0x54(%rbp), %esi
callq 0x429a70
jmp 0x458c42
jmp 0x458c44
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl -0x4c(%rbp), %edx
movq -0x8(%rbp), %rax
movl 0x20(%rax), %r8d
xorl %ecx, %ecx
callq 0x458dc0
movq -0x28(%rbp), %rdi
movl -0x40(%rbp), %esi
callq 0x42dc90
movq -0x28(%rbp), %rdi
movl -0x4c(%rbp), %edx
movl -0x48(%rbp), %ecx
movl $0x5, %esi
callq 0x410100
movq -0x28(%rbp), %rdi
movl -0x48(%rbp), %esi
subl $0x1, %esi
callq 0x429a70
movq -0x28(%rbp), %rdi
movl -0x48(%rbp), %esi
addl $0x1, %esi
callq 0x429a70
movq -0x18(%rbp), %rdi
movl -0x34(%rbp), %esi
callq 0x42e560
movq -0x18(%rbp), %rdi
movl -0x2c(%rbp), %esi
callq 0x42e560
cmpl $0x0, -0x3c(%rbp)
je 0x458cd8
movq -0x18(%rbp), %rdi
movl -0x38(%rbp), %esi
movl -0x3c(%rbp), %edx
callq 0x42d0c0
movq -0x18(%rbp), %rdi
movl -0x30(%rbp), %esi
movl -0x3c(%rbp), %edx
callq 0x42d0c0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x457ba0
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax)