// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %ecx, 0x18(%rsp)
movl %edx, 0x14(%rsp)
movq %rsi, %r15
movq %rdi, %r14
callq 0x44856b
movq %rax, %r12
leaq 0xdf0f3(%rip), %rsi     # 0x53df22
movq %r15, 0x20(%rsp)
movq %r14, 0x8(%rsp)
testq %r15, %r15
je 0x45f142
movq 0x40(%r15), %rbx
movq 0x38(%rbx), %rax
cmpq %rsi, %rax
setne %cl
leaq 0xdf0d5(%rip), %rdx     # 0x53df2c
cmpq %rdx, %rax
setne %dl
testb %dl, %cl
jne 0x45eeb6
movl 0x54(%r15), %eax
movl %eax, 0x4(%rsp)
movq %r12, %rdi
movq %rsi, %rbp
callq 0x44a0b8
movl %eax, (%rsp)
movq %r14, %rdi
callq 0x44b9b3
movl %eax, %r13d
movl 0x50(%r15), %ecx
movq %r12, %rdi
pushq $0x49
popq %rsi
xorl %edx, %edx
callq 0x432a3f
cmpq %rbp, 0x38(%rbx)
je 0x45ef2b
movq %r12, %rdi
pushq $0x46
popq %rsi
pushq $0x1
popq %rdx
movl %r13d, %ecx
callq 0x432a3f
pushq $0x5a
popq %rbx
jmp 0x45ef57
leaq 0xdf07b(%rip), %rcx     # 0x53df38
cmpq %rcx, %rax
setne %cl
leaq 0xdf073(%rip), %rdx     # 0x53df3d
cmpq %rdx, %rax
setne %al
testb %al, %cl
jne 0x45f139
movq 0x60(%r15), %rax
movq 0x20(%rax), %rax
movl (%rax), %ebp
movq 0x20(%rsp), %rax
movl 0x48(%rax), %eax
movl %eax, (%rsp)
movl 0x54(%r15), %eax
movl %eax, 0x1c(%rsp)
movq %r12, %rdi
callq 0x44a0b8
movl %eax, 0x4(%rsp)
movq %r14, %rdi
callq 0x44b9b3
movl %eax, %r13d
cmpl $0x2, %ebp
jg 0x45eff6
movl 0x50(%r15), %ecx
movq %r12, %rdi
pushq $0x49
popq %rsi
xorl %edx, %edx
callq 0x432a3f
jmp 0x45f00f
movq 0x20(%rsp), %rax
movl 0x48(%rax), %edx
movl 0x6c(%r15), %ecx
incl %ecx
movq %r12, %rdi
pushq $0x5a
popq %rbx
movl %ebx, %esi
movl %r13d, %r8d
callq 0x432a44
movq %r14, %rdi
movl %r13d, %esi
pushq $0x2
popq %rdx
callq 0x45e7d9
movl 0x58(%r15), %ecx
movq %r12, %rdi
pushq $0x60
popq %rsi
movl %r13d, %edx
movl %r13d, %r8d
callq 0x432a44
movl 0x58(%r15), %edx
incl %edx
movq %r12, %rdi
pushq $0x36
popq %rsi
movl (%rsp), %ebp
movl %ebp, %ecx
movl %r13d, %r8d
callq 0x432a44
movq %r12, %rdi
pushq $0x1e
popq %rsi
movl 0x4(%rsp), %r14d
movl %r14d, %edx
xorl %ecx, %ecx
movl %r13d, %r8d
callq 0x432a44
movl 0x50(%r15), %r8d
movl 0x6c(%r15), %ecx
movq %r12, %rdi
movl %ebx, %esi
movl %r14d, %edx
callq 0x432a44
movq 0x18(%r12), %rax
movq 0x50(%rax), %rax
testq %rax, %rax
je 0x45efd0
notl %ebp
movl 0xb8(%r12), %ecx
movslq %ebp, %rdx
movl %ecx, (%rax,%rdx,4)
testl %r13d, %r13d
movq 0x8(%rsp), %r14
leaq 0xdef43(%rip), %rsi     # 0x53df22
je 0x45f139
movb 0x1f(%r14), %al
cmpb $0x8, %al
jb 0x45f127
jmp 0x45f139
movl 0x50(%r15), %r8d
movl 0x6c(%r15), %ecx
addl $0x2, %ecx
movq %r12, %rdi
pushq $0x5a
popq %rsi
movl (%rsp), %edx
callq 0x432a44
movq %r12, %rdi
movl $0x81, %esi
movl (%rsp), %edx
movl %r13d, %ecx
callq 0x432a3f
movq 0x38(%rbx), %rax
cmpl $0x1, %ebp
jg 0x45f052
xorl %ecx, %ecx
leaq 0xdef04(%rip), %rdx     # 0x53df38
cmpq %rdx, %rax
sete %cl
leal -0x1(%rcx,%rcx), %ecx
movq %r12, %rdi
pushq $0x53
popq %rsi
movl %r13d, %edx
callq 0x432a3f
movl 0x4(%rsp), %ebx
jmp 0x45f0c5
xorl %ebp, %ebp
leaq 0xdeedd(%rip), %rcx     # 0x53df38
cmpq %rcx, %rax
sete %bpl
xorl $0x61, %ebp
movq %r14, %rdi
callq 0x44b9b3
movl %eax, %r14d
movl 0x6c(%r15), %ecx
incl %ecx
movq %r12, %rdi
pushq $0x5a
popq %rsi
movl (%rsp), %edx
movl %eax, %r8d
callq 0x432a44
movq %r12, %rdi
movl %ebp, %esi
movl %r14d, %edx
movl %r13d, %ecx
movl %r13d, %r8d
callq 0x432a44
testl %r14d, %r14d
movl 0x4(%rsp), %ebx
je 0x45f0c5
movq 0x8(%rsp), %rax
movzbl 0x1f(%rax), %eax
cmpq $0x7, %rax
ja 0x45f0c5
leal 0x1(%rax), %ecx
movq 0x8(%rsp), %rdx
movb %cl, 0x1f(%rdx)
movl %r14d, 0xc4(%rdx,%rax,4)
movq %r12, %rdi
pushq $0x1e
popq %rsi
movl 0x1c(%rsp), %ebp
movl %ebp, %edx
movl %ebx, %ecx
movl %r13d, %r8d
callq 0x432a44
movl 0x50(%r15), %r8d
movl 0x6c(%r15), %ecx
movq %r12, %rdi
pushq $0x5a
popq %rsi
movl %ebp, %edx
callq 0x432a44
movq 0x18(%r12), %rax
movq 0x50(%rax), %rax
testq %rax, %rax
je 0x45f10e
notl %ebx
movl 0xb8(%r12), %ecx
movslq %ebx, %rdx
movl %ecx, (%rax,%rdx,4)
testl %r13d, %r13d
movq 0x8(%rsp), %r14
leaq 0xdee05(%rip), %rsi     # 0x53df22
je 0x45f139
movb 0x1f(%r14), %al
cmpb $0x7, %al
ja 0x45f139
leal 0x1(%rax), %ecx
movb %cl, 0x1f(%r14)
movzbl %al, %eax
movl %r13d, 0xc4(%r14,%rax,4)
movq 0x30(%r15), %r15
jmp 0x45ee39
pushq $0xc
popq %rsi
movq %r12, %rdi
movl 0x14(%rsp), %edx
movl 0x18(%rsp), %ecx
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x432a3f