// File: /workspace/github_c_makefile_star2_O1/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, 0x1c(%rsp)
movl %edx, 0x18(%rsp)
movq %rsi, %rbx
movq %rdi, 0x8(%rsp)
callq 0x44e8aa
movq %rax, %r12
movq %rbx, 0x10(%rsp)
testq %rbx, %rbx
je 0x46d6ec
movq 0x10(%rsp), %r14
movq 0x40(%r14), %r15
movq 0x38(%r15), %rax
leaq 0xe2bb7(%rip), %rcx     # 0x54ff52
cmpq %rcx, %rax
setne %cl
leaq 0xe2bb4(%rip), %rdx     # 0x54ff5c
cmpq %rdx, %rax
setne %dl
testb %dl, %cl
jne 0x46d3de
movl 0x54(%r14), %ebp
movq %r12, %rdi
callq 0x450901
movl %eax, %ebx
movq 0x8(%rsp), %rcx
movb 0x1f(%rcx), %al
testb %al, %al
je 0x46d44b
decb %al
movb %al, 0x1f(%rcx)
movzbl %al, %eax
movl 0xc4(%rcx,%rax,4), %r13d
jmp 0x46d456
leaq 0xe2b83(%rip), %rcx     # 0x54ff68
cmpq %rcx, %rax
setne %cl
leaq 0xe2b7b(%rip), %rdx     # 0x54ff6d
cmpq %rdx, %rax
setne %al
testb %al, %cl
jne 0x46d6df
movq 0x60(%r14), %rax
movq 0x20(%rax), %rax
movl (%rax), %ebx
movq 0x10(%rsp), %rax
movl 0x48(%rax), %ebp
movl 0x54(%r14), %eax
movl %eax, 0x20(%rsp)
movq %r12, %rdi
callq 0x450901
movl %eax, 0x24(%rsp)
movq 0x8(%rsp), %rcx
movb 0x1f(%rcx), %al
testb %al, %al
je 0x46d559
decb %al
movb %al, 0x1f(%rcx)
movzbl %al, %eax
movl 0xc4(%rcx,%rax,4), %r13d
jmp 0x46d564
movl 0x38(%rcx), %r13d
incl %r13d
movl %r13d, 0x38(%rcx)
movl 0x50(%r14), %ecx
movq %r12, %rdi
movl $0x49, %esi
xorl %edx, %edx
xorl %r8d, %r8d
callq 0x43bae0
leaq 0xe2adf(%rip), %rax     # 0x54ff52
cmpq %rax, 0x38(%r15)
je 0x46d493
movq %r12, %rdi
movl $0x46, %esi
movl $0x1, %edx
movl %r13d, %ecx
xorl %r8d, %r8d
callq 0x43bae0
jmp 0x46d4c3
movq 0x10(%rsp), %rax
movl 0x48(%rax), %edx
movl 0x6c(%r14), %ecx
incl %ecx
movq %r12, %rdi
movl $0x5a, %esi
movl %r13d, %r8d
callq 0x43bae0
movq 0x8(%rsp), %rdi
movl %r13d, %esi
movl $0x2, %edx
callq 0x46cb09
movl 0x58(%r14), %ecx
movq %r12, %rdi
movl $0x60, %esi
movl %r13d, %edx
movl %r13d, %r8d
callq 0x43bae0
movl 0x58(%r14), %edx
incl %edx
movq %r12, %rdi
movl $0x36, %esi
movl %ebx, %ecx
movl %r13d, %r8d
callq 0x43bae0
movq %r12, %rdi
movl $0x1e, %esi
movl %ebp, %edx
xorl %ecx, %ecx
movl %r13d, %r8d
callq 0x43bae0
movl 0x50(%r14), %r8d
movl 0x6c(%r14), %ecx
movq %r12, %rdi
movl $0x5a, %esi
movl %ebp, %edx
callq 0x43bae0
movq 0x18(%r12), %rax
movq 0x50(%rax), %rax
testq %rax, %rax
je 0x46d53b
notl %ebx
movl 0xb8(%r12), %ecx
movslq %ebx, %rdx
movl %ecx, (%rax,%rdx,4)
testl %r13d, %r13d
je 0x46d6df
movq 0x8(%rsp), %rax
movb 0x1f(%rax), %al
cmpb $0x8, %al
jb 0x46d6c9
jmp 0x46d6df
movl 0x38(%rcx), %r13d
incl %r13d
movl %r13d, 0x38(%rcx)
cmpl $0x2, %ebx
jg 0x46d57c
movl 0x50(%r14), %ecx
movq %r12, %rdi
movl $0x49, %esi
xorl %edx, %edx
xorl %r8d, %r8d
jmp 0x46d591
movl 0x50(%r14), %r8d
movl 0x6c(%r14), %ecx
addl $0x2, %ecx
movq %r12, %rdi
movl $0x5a, %esi
movl %ebp, %edx
callq 0x43bae0
movq %r12, %rdi
movl $0x81, %esi
movl %ebp, %edx
movl %r13d, %ecx
xorl %r8d, %r8d
callq 0x43bae0
movq 0x38(%r15), %rax
cmpl $0x1, %ebx
jg 0x46d5df
xorl %ecx, %ecx
leaq 0xe29ab(%rip), %rdx     # 0x54ff68
cmpq %rdx, %rax
sete %cl
leal -0x1(%rcx,%rcx), %ecx
movq %r12, %rdi
movl $0x53, %esi
movl %r13d, %edx
xorl %r8d, %r8d
callq 0x43bae0
jmp 0x46d667
movl %ebp, %edx
xorl %ebx, %ebx
leaq 0xe297e(%rip), %rcx     # 0x54ff68
cmpq %rcx, %rax
sete %al
movq 0x8(%rsp), %rsi
movb 0x1f(%rsi), %cl
testb %cl, %cl
je 0x46d60d
decb %cl
movb %cl, 0x1f(%rsi)
movzbl %cl, %ecx
movl 0xc4(%rsi,%rcx,4), %ebp
jmp 0x46d615
movl 0x38(%rsi), %ebp
incl %ebp
movl %ebp, 0x38(%rsi)
movb %al, %bl
xorl $0x61, %ebx
movl 0x6c(%r14), %ecx
incl %ecx
movq %r12, %rdi
movl $0x5a, %esi
movl %ebp, %r8d
callq 0x43bae0
movq %r12, %rdi
movl %ebx, %esi
movl %ebp, %edx
movl %r13d, %ecx
movl %r13d, %r8d
callq 0x43bae0
testl %ebp, %ebp
je 0x46d667
movq 0x8(%rsp), %rax
movzbl 0x1f(%rax), %eax
cmpq $0x7, %rax
ja 0x46d667
leal 0x1(%rax), %ecx
movq 0x8(%rsp), %rdx
movb %cl, 0x1f(%rdx)
movl %ebp, 0xc4(%rdx,%rax,4)
movq %r12, %rdi
movl $0x1e, %esi
movl 0x20(%rsp), %ebp
movl %ebp, %edx
movl 0x24(%rsp), %ebx
movl %ebx, %ecx
movl %r13d, %r8d
callq 0x43bae0
movl 0x50(%r14), %r8d
movl 0x6c(%r14), %ecx
movq %r12, %rdi
movl $0x5a, %esi
movl %ebp, %edx
callq 0x43bae0
movq 0x18(%r12), %rax
movq 0x50(%rax), %rax
testq %rax, %rax
je 0x46d6b8
notl %ebx
movl 0xb8(%r12), %ecx
movslq %ebx, %rdx
movl %ecx, (%rax,%rdx,4)
testl %r13d, %r13d
je 0x46d6df
movq 0x8(%rsp), %rax
movb 0x1f(%rax), %al
cmpb $0x7, %al
ja 0x46d6df
leal 0x1(%rax), %ecx
movq 0x8(%rsp), %rdx
movb %cl, 0x1f(%rdx)
movzbl %al, %eax
movl %r13d, 0xc4(%rdx,%rax,4)
movq 0x30(%r14), %r14
testq %r14, %r14
jne 0x46d38c
movq %r12, %rdi
movl $0xc, %esi
movl 0x18(%rsp), %edx
movl 0x1c(%rsp), %ecx
xorl %r8d, %r8d
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x43bae0