// File: /workspace/github_c_makefile_star2_O3/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 0x44dbe5
movq %rax, %r12
movq %rbx, 0x10(%rsp)
testq %rbx, %rbx
je 0x46cfd9
movq 0x10(%rsp), %r14
movq 0x40(%r14), %r15
movq 0x38(%r15), %rax
leaq 0xe32bb(%rip), %rcx     # 0x54ff22
cmpq %rcx, %rax
setne %cl
leaq 0xe32b8(%rip), %rdx     # 0x54ff2c
cmpq %rdx, %rax
setne %dl
testb %dl, %cl
jne 0x46ccb0
movl 0x54(%r14), %ebp
movq 0x18(%r12), %rdi
callq 0x44fbb5
movl %eax, %ebx
movq 0x8(%rsp), %rcx
movb 0x1f(%rcx), %al
testb %al, %al
je 0x46cd1f
decb %al
movb %al, 0x1f(%rcx)
movzbl %al, %eax
movl 0xc4(%rcx,%rax,4), %r13d
jmp 0x46cd2a
leaq 0xe3281(%rip), %rcx     # 0x54ff38
cmpq %rcx, %rax
setne %cl
leaq 0xe3279(%rip), %rdx     # 0x54ff3d
cmpq %rdx, %rax
setne %al
testb %al, %cl
jne 0x46cfcc
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 0x18(%r12), %rdi
callq 0x44fbb5
movl %eax, 0x24(%rsp)
movq 0x8(%rsp), %rcx
movb 0x1f(%rcx), %al
testb %al, %al
je 0x46ce2d
decb %al
movb %al, 0x1f(%rcx)
movzbl %al, %eax
movl 0xc4(%rcx,%rax,4), %r13d
jmp 0x46ce38
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 0x43a65f
leaq 0xe31db(%rip), %rax     # 0x54ff22
cmpq %rax, 0x38(%r15)
je 0x46cd67
movq %r12, %rdi
movl $0x46, %esi
movl $0x1, %edx
movl %r13d, %ecx
xorl %r8d, %r8d
callq 0x43a65f
jmp 0x46cd97
movq 0x10(%rsp), %rax
movl 0x48(%rax), %edx
movl 0x6c(%r14), %ecx
incl %ecx
movq %r12, %rdi
movl $0x5a, %esi
movl %r13d, %r8d
callq 0x43a65f
movq 0x8(%rsp), %rdi
movl %r13d, %esi
movl $0x2, %edx
callq 0x46c36a
movl 0x58(%r14), %ecx
movq %r12, %rdi
movl $0x60, %esi
movl %r13d, %edx
movl %r13d, %r8d
callq 0x43a65f
movl 0x58(%r14), %edx
incl %edx
movq %r12, %rdi
movl $0x36, %esi
movl %ebx, %ecx
movl %r13d, %r8d
callq 0x43a65f
movq %r12, %rdi
movl $0x1e, %esi
movl %ebp, %edx
xorl %ecx, %ecx
movl %r13d, %r8d
callq 0x43a65f
movl 0x50(%r14), %r8d
movl 0x6c(%r14), %ecx
movq %r12, %rdi
movl $0x5a, %esi
movl %ebp, %edx
callq 0x43a65f
movq 0x18(%r12), %rax
movq 0x50(%rax), %rax
testq %rax, %rax
je 0x46ce0f
notl %ebx
movl 0xb8(%r12), %ecx
movslq %ebx, %rdx
movl %ecx, (%rax,%rdx,4)
testl %r13d, %r13d
je 0x46cfcc
movq 0x8(%rsp), %rax
movb 0x1f(%rax), %al
cmpb $0x8, %al
jb 0x46cfb6
jmp 0x46cfcc
movl 0x38(%rcx), %r13d
incl %r13d
movl %r13d, 0x38(%rcx)
cmpl $0x3, %ebx
jge 0x46ce9c
movl 0x50(%r14), %ecx
movq %r12, %rdi
movl $0x49, %esi
xorl %edx, %edx
xorl %r8d, %r8d
callq 0x43a65f
movq %r12, %rdi
movl $0x81, %esi
movl %ebp, %edx
movl %r13d, %ecx
xorl %r8d, %r8d
callq 0x43a65f
cmpl $0x2, %ebx
je 0x46cecb
xorl %eax, %eax
leaq 0xe30c2(%rip), %rcx     # 0x54ff38
cmpq %rcx, 0x38(%r15)
sete %al
leal -0x1(,%rax,2), %ecx
movq %r12, %rdi
movl $0x53, %esi
movl %r13d, %edx
xorl %r8d, %r8d
callq 0x43a65f
jmp 0x46cf54
movl 0x50(%r14), %r8d
movl 0x6c(%r14), %ecx
addl $0x2, %ecx
movq %r12, %rdi
movl $0x5a, %esi
movl %ebp, %edx
callq 0x43a65f
movq %r12, %rdi
movl $0x81, %esi
movl %ebp, %edx
movl %r13d, %ecx
xorl %r8d, %r8d
callq 0x43a65f
movl %ebp, %edx
xorl %ebx, %ebx
leaq 0xe3062(%rip), %rax     # 0x54ff38
cmpq %rax, 0x38(%r15)
sete %al
movq 0x8(%rsp), %rsi
movb 0x1f(%rsi), %cl
testb %cl, %cl
je 0x46cefa
decb %cl
movb %cl, 0x1f(%rsi)
movzbl %cl, %ecx
movl 0xc4(%rsi,%rcx,4), %ebp
jmp 0x46cf02
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 0x43a65f
movq %r12, %rdi
movl %ebx, %esi
movl %ebp, %edx
movl %r13d, %ecx
movl %r13d, %r8d
callq 0x43a65f
testl %ebp, %ebp
je 0x46cf54
movq 0x8(%rsp), %rax
movzbl 0x1f(%rax), %eax
cmpq $0x7, %rax
ja 0x46cf54
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 0x43a65f
movl 0x50(%r14), %r8d
movl 0x6c(%r14), %ecx
movq %r12, %rdi
movl $0x5a, %esi
movl %ebp, %edx
callq 0x43a65f
movq 0x18(%r12), %rax
movq 0x50(%rax), %rax
testq %rax, %rax
je 0x46cfa5
notl %ebx
movl 0xb8(%r12), %ecx
movslq %ebx, %rdx
movl %ecx, (%rax,%rdx,4)
testl %r13d, %r13d
je 0x46cfcc
movq 0x8(%rsp), %rax
movb 0x1f(%rax), %al
cmpb $0x7, %al
ja 0x46cfcc
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 0x46cc58
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 0x43a65f