// File: /workspace/github_c_makefile_star2_O0/ukontainer[P]sqlite-bench/sqlite3.c
// Function: windowReturnOneRow
static void windowReturnOneRow(
  Parse *pParse,
  Window *pMWin,
  int regGosub,
  int addrGosub
){
  Vdbe *v = sqlite3GetVdbe(pParse);
  Window *pWin;
  for(pWin=pMWin; pWin; pWin=pWin->pNextWin){
    FuncDef *pFunc = pWin->pFunc;
    if( pFunc->zName==nth_valueName
     || pFunc->zName==first_valueName
    ){
      int csr = pWin->csrApp;
      int lbl = sqlite3VdbeMakeLabel(v);
      int tmpReg = sqlite3GetTempReg(pParse);
      sqlite3VdbeAddOp2(v, OP_Null, 0, pWin->regResult);

      if( pFunc->zName==nth_valueName ){
        sqlite3VdbeAddOp3(v, OP_Column, pMWin->iEphCsr, pWin->iArgCol+1,tmpReg);
        windowCheckIntValue(pParse, tmpReg, 2);
      }else{
        sqlite3VdbeAddOp2(v, OP_Integer, 1, tmpReg);
      }
      sqlite3VdbeAddOp3(v, OP_Add, tmpReg, pWin->regApp, tmpReg);
      sqlite3VdbeAddOp3(v, OP_Gt, pWin->regApp+1, lbl, tmpReg);
      VdbeCoverageNeverNull(v);
      sqlite3VdbeAddOp3(v, OP_SeekRowid, csr, 0, tmpReg);
      VdbeCoverageNeverTaken(v);
      sqlite3VdbeAddOp3(v, OP_Column, csr, pWin->iArgCol, pWin->regResult);
      sqlite3VdbeResolveLabel(v, lbl);
      sqlite3ReleaseTempReg(pParse, tmpReg);
    }
    else if( pFunc->zName==leadName || pFunc->zName==lagName ){
      int nArg = pWin->pOwner->x.pList->nExpr;
      int iEph = pMWin->iEphCsr;
      int csr = pWin->csrApp;
      int lbl = sqlite3VdbeMakeLabel(v);
      int tmpReg = sqlite3GetTempReg(pParse);

      if( nArg<3 ){
        sqlite3VdbeAddOp2(v, OP_Null, 0, pWin->regResult);
      }else{
        sqlite3VdbeAddOp3(v, OP_Column, iEph, pWin->iArgCol+2, pWin->regResult);
      }
      sqlite3VdbeAddOp2(v, OP_Rowid, iEph, tmpReg);
      if( nArg<2 ){
        int val = (pFunc->zName==leadName ? 1 : -1);
        sqlite3VdbeAddOp2(v, OP_AddImm, tmpReg, val);
      }else{
        int op = (pFunc->zName==leadName ? OP_Add : OP_Subtract);
        int tmpReg2 = sqlite3GetTempReg(pParse);
        sqlite3VdbeAddOp3(v, OP_Column, iEph, pWin->iArgCol+1, tmpReg2);
        sqlite3VdbeAddOp3(v, op, tmpReg2, tmpReg, tmpReg);
        sqlite3ReleaseTempReg(pParse, tmpReg2);
      }

      sqlite3VdbeAddOp3(v, OP_SeekRowid, csr, lbl, tmpReg);
      VdbeCoverage(v);
      sqlite3VdbeAddOp3(v, OP_Column, csr, pWin->iArgCol, pWin->regResult);
      sqlite3VdbeResolveLabel(v, lbl);
      sqlite3ReleaseTempReg(pParse, tmpReg);
    }
  }
  sqlite3VdbeAddOp2(v, OP_Gosub, regGosub, addrGosub);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x46bb00
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x495fd8
movq -0x28(%rbp), %rax
movq 0x40(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
leaq 0xe7fe3(%rip), %rcx     # 0x57dcb0
cmpq %rcx, 0x38(%rax)
je 0x495ce8
movq -0x30(%rbp), %rax
leaq 0xe7fdc(%rip), %rcx     # 0x57dcba
cmpq %rcx, 0x38(%rax)
jne 0x495e0d
movq -0x28(%rbp), %rax
movl 0x54(%rax), %eax
movl %eax, -0x34(%rbp)
movq -0x20(%rbp), %rdi
callq 0x46e490
movl %eax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
callq 0x470ad0
movl %eax, -0x3c(%rbp)
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rax
movl 0x50(%rax), %ecx
movl $0x49, %esi
xorl %edx, %edx
callq 0x453790
movq -0x30(%rbp), %rax
leaq 0xe7f84(%rip), %rcx     # 0x57dcb0
cmpq %rcx, 0x38(%rax)
jne 0x495d68
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x48(%rax), %edx
movq -0x28(%rbp), %rax
movl 0x6c(%rax), %ecx
addl $0x1, %ecx
movl -0x3c(%rbp), %r8d
movl $0x5a, %esi
callq 0x4537c0
movq -0x8(%rbp), %rdi
movl -0x3c(%rbp), %esi
movl $0x2, %edx
callq 0x495470
jmp 0x495d7e
movq -0x20(%rbp), %rdi
movl -0x3c(%rbp), %ecx
movl $0x46, %esi
movl $0x1, %edx
callq 0x453790
movq -0x20(%rbp), %rdi
movl -0x3c(%rbp), %edx
movq -0x28(%rbp), %rax
movl 0x58(%rax), %ecx
movl -0x3c(%rbp), %r8d
movl $0x60, %esi
callq 0x4537c0
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rax
movl 0x58(%rax), %edx
addl $0x1, %edx
movl -0x38(%rbp), %ecx
movl -0x3c(%rbp), %r8d
movl $0x36, %esi
callq 0x4537c0
movq -0x20(%rbp), %rdi
movl -0x34(%rbp), %edx
movl -0x3c(%rbp), %r8d
movl $0x1e, %esi
xorl %ecx, %ecx
callq 0x4537c0
movq -0x20(%rbp), %rdi
movl -0x34(%rbp), %edx
movq -0x28(%rbp), %rax
movl 0x6c(%rax), %ecx
movq -0x28(%rbp), %rax
movl 0x50(%rax), %r8d
movl $0x5a, %esi
callq 0x4537c0
movq -0x20(%rbp), %rdi
movl -0x38(%rbp), %esi
callq 0x46e530
movq -0x8(%rbp), %rdi
movl -0x3c(%rbp), %esi
callq 0x470060
jmp 0x495fc5
movq -0x30(%rbp), %rax
leaq 0xe7eae(%rip), %rcx     # 0x57dcc6
cmpq %rcx, 0x38(%rax)
je 0x495e33
movq -0x30(%rbp), %rax
leaq 0xe7ea2(%rip), %rcx     # 0x57dccb
cmpq %rcx, 0x38(%rax)
jne 0x495fc3
movq -0x28(%rbp), %rax
movq 0x60(%rax), %rax
movq 0x20(%rax), %rax
movl (%rax), %eax
movl %eax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movl 0x48(%rax), %eax
movl %eax, -0x44(%rbp)
movq -0x28(%rbp), %rax
movl 0x54(%rax), %eax
movl %eax, -0x48(%rbp)
movq -0x20(%rbp), %rdi
callq 0x46e490
movl %eax, -0x4c(%rbp)
movq -0x8(%rbp), %rdi
callq 0x470ad0
movl %eax, -0x50(%rbp)
cmpl $0x3, -0x40(%rbp)
jge 0x495e8f
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rax
movl 0x50(%rax), %ecx
movl $0x49, %esi
xorl %edx, %edx
callq 0x453790
jmp 0x495eb2
movq -0x20(%rbp), %rdi
movl -0x44(%rbp), %edx
movq -0x28(%rbp), %rax
movl 0x6c(%rax), %ecx
addl $0x2, %ecx
movq -0x28(%rbp), %rax
movl 0x50(%rax), %r8d
movl $0x5a, %esi
callq 0x4537c0
movq -0x20(%rbp), %rdi
movl -0x44(%rbp), %edx
movl -0x50(%rbp), %ecx
movl $0x81, %esi
callq 0x453790
cmpl $0x2, -0x40(%rbp)
jge 0x495f04
movq -0x30(%rbp), %rax
movq 0x38(%rax), %rdx
leaq 0xe7deb(%rip), %rsi     # 0x57dcc6
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl $0x1, %ecx
cmpq %rsi, %rdx
cmovel %ecx, %eax
movl %eax, -0x54(%rbp)
movq -0x20(%rbp), %rdi
movl -0x50(%rbp), %edx
movl -0x54(%rbp), %ecx
movl $0x53, %esi
callq 0x453790
jmp 0x495f73
movq -0x30(%rbp), %rax
movq 0x38(%rax), %rdx
leaq 0xe7db3(%rip), %rsi     # 0x57dcc6
movl $0x61, %eax
movl $0x60, %ecx
cmpq %rsi, %rdx
cmovel %ecx, %eax
movl %eax, -0x58(%rbp)
movq -0x8(%rbp), %rdi
callq 0x470ad0
movl %eax, -0x5c(%rbp)
movq -0x20(%rbp), %rdi
movl -0x44(%rbp), %edx
movq -0x28(%rbp), %rax
movl 0x6c(%rax), %ecx
addl $0x1, %ecx
movl -0x5c(%rbp), %r8d
movl $0x5a, %esi
callq 0x4537c0
movq -0x20(%rbp), %rdi
movl -0x58(%rbp), %esi
movl -0x5c(%rbp), %edx
movl -0x50(%rbp), %ecx
movl -0x50(%rbp), %r8d
callq 0x4537c0
movq -0x8(%rbp), %rdi
movl -0x5c(%rbp), %esi
callq 0x470060
movq -0x20(%rbp), %rdi
movl -0x48(%rbp), %edx
movl -0x4c(%rbp), %ecx
movl -0x50(%rbp), %r8d
movl $0x1e, %esi
callq 0x4537c0
movq -0x20(%rbp), %rdi
movl -0x48(%rbp), %edx
movq -0x28(%rbp), %rax
movl 0x6c(%rax), %ecx
movq -0x28(%rbp), %rax
movl 0x50(%rax), %r8d
movl $0x5a, %esi
callq 0x4537c0
movq -0x20(%rbp), %rdi
movl -0x4c(%rbp), %esi
callq 0x46e530
movq -0x8(%rbp), %rdi
movl -0x50(%rbp), %esi
callq 0x470060
jmp 0x495fc5
jmp 0x495fc7
movq -0x28(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x495cab
movq -0x20(%rbp), %rdi
movl -0x14(%rbp), %edx
movl -0x18(%rbp), %ecx
movl $0xc, %esi
callq 0x453790
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)