// File: /workspace/github_c_makefile_star2_O1/ukontainer[P]sqlite-bench/sqlite3.c
// Function: sqlite3WindowUpdate
SQLITE_PRIVATE void sqlite3WindowUpdate(
  Parse *pParse, 
  Window *pList,                  /* List of named windows for this SELECT */
  Window *pWin,                   /* Window frame to update */
  FuncDef *pFunc                  /* Window function definition */
){
  if( pWin->zName && pWin->eType==0 ){
    Window *p;
    for(p=pList; p; p=p->pNextWin){
      if( sqlite3StrICmp(p->zName, pWin->zName)==0 ) break;
    }
    if( p==0 ){
      sqlite3ErrorMsg(pParse, "no such window: %s", pWin->zName);
      return;
    }
    pWin->pPartition = sqlite3ExprListDup(pParse->db, p->pPartition, 0);
    pWin->pOrderBy = sqlite3ExprListDup(pParse->db, p->pOrderBy, 0);
    pWin->pStart = sqlite3ExprDup(pParse->db, p->pStart, 0);
    pWin->pEnd = sqlite3ExprDup(pParse->db, p->pEnd, 0);
    pWin->eStart = p->eStart;
    pWin->eEnd = p->eEnd;
    pWin->eType = p->eType;
  }
  if( pFunc->funcFlags & SQLITE_FUNC_WINDOW ){
    sqlite3 *db = pParse->db;
    if( pWin->pFilter ){
      sqlite3ErrorMsg(pParse, 
          "FILTER clause may only be used with aggregate window functions"
      );
    }else
    if( pFunc->zName==row_numberName || pFunc->zName==ntileName ){
      sqlite3ExprDelete(db, pWin->pStart);
      sqlite3ExprDelete(db, pWin->pEnd);
      pWin->pStart = pWin->pEnd = 0;
      pWin->eType = TK_ROWS;
      pWin->eStart = TK_UNBOUNDED;
      pWin->eEnd = TK_CURRENT;
    }else

    if( pFunc->zName==dense_rankName || pFunc->zName==rankName
     || pFunc->zName==percent_rankName || pFunc->zName==cume_distName
    ){
      sqlite3ExprDelete(db, pWin->pStart);
      sqlite3ExprDelete(db, pWin->pEnd);
      pWin->pStart = pWin->pEnd = 0;
      pWin->eType = TK_RANGE;
      pWin->eStart = TK_UNBOUNDED;
      pWin->eEnd = TK_CURRENT;
    }
  }
  pWin->pFunc = pFunc;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rdi, %r15
movq (%rdx), %r13
testq %r13, %r13
je 0x456dbf
cmpb $0x0, 0x18(%r14)
jne 0x456dbf
movq %rsi, %r12
testq %r12, %r12
sete %bpl
je 0x456d21
movq (%r12), %rdi
movq %r13, %rsi
callq 0x407729
testl %eax, %eax
je 0x456d1c
movq 0x30(%r12), %r12
jmp 0x456cfc
testb %bpl, %bpl
je 0x456d37
leaq 0xfba6a(%rip), %rsi     # 0x552792
movq %r15, %rdi
movq %r13, %rdx
xorl %eax, %eax
callq 0x40e237
jmp 0x456db6
movq (%r15), %rdi
movq 0x8(%r12), %rsi
xorl %r13d, %r13d
xorl %edx, %edx
callq 0x453664
movq %rax, 0x8(%r14)
movq (%r15), %rdi
movq 0x10(%r12), %rsi
xorl %edx, %edx
callq 0x453664
movq %rax, 0x10(%r14)
movq 0x20(%r12), %rsi
testq %rsi, %rsi
je 0x456d79
movq (%r15), %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x453111
movq %rax, %r13
movq %r13, 0x20(%r14)
movq 0x28(%r12), %rsi
testq %rsi, %rsi
je 0x456d95
movq (%r15), %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x453111
jmp 0x456d97
xorl %eax, %eax
movq %rax, 0x28(%r14)
movb 0x19(%r12), %al
movb %al, 0x19(%r14)
movb 0x1a(%r12), %al
movb %al, 0x1a(%r14)
movb 0x18(%r12), %al
movb %al, 0x18(%r14)
testb %bpl, %bpl
jne 0x456eb0
testb $0x1, 0x6(%rbx)
je 0x456eac
cmpq $0x0, 0x38(%r14)
je 0x456de6
leaq 0xfb9ce(%rip), %rsi     # 0x5527a5
movq %r15, %rdi
xorl %eax, %eax
callq 0x40e237
jmp 0x456eac
movq (%r15), %r15
movq 0x38(%rbx), %rax
leaq 0xf9126(%rip), %rcx     # 0x54ff1a
cmpq %rcx, %rax
setne %cl
leaq 0xf9124(%rip), %rdx     # 0x54ff25
cmpq %rdx, %rax
setne %dl
testb %dl, %cl
jne 0x456e42
movq 0x20(%r14), %rsi
testq %rsi, %rsi
je 0x456e1c
movq %r15, %rdi
callq 0x439685
leaq 0x20(%r14), %r12
movq 0x28(%r14), %rsi
testq %rsi, %rsi
je 0x456e31
movq %r15, %rdi
callq 0x439685
xorps %xmm0, %xmm0
movups %xmm0, (%r12)
movw $0x574c, 0x18(%r14)     # imm = 0x574C
jmp 0x456ea7
leaq 0xf90ff(%rip), %rcx     # 0x54ff48
cmpq %rcx, %rax
je 0x456e72
leaq 0xf90e6(%rip), %rcx     # 0x54ff3b
cmpq %rcx, %rax
je 0x456e72
leaq 0xf90ca(%rip), %rcx     # 0x54ff2b
cmpq %rcx, %rax
je 0x456e72
leaq 0xf90c9(%rip), %rcx     # 0x54ff36
cmpq %rcx, %rax
jne 0x456eac
movq 0x20(%r14), %rsi
testq %rsi, %rsi
je 0x456e83
movq %r15, %rdi
callq 0x439685
leaq 0x20(%r14), %r12
movq 0x28(%r14), %rsi
testq %rsi, %rsi
je 0x456e98
movq %r15, %rdi
callq 0x439685
xorps %xmm0, %xmm0
movups %xmm0, (%r12)
movw $0x5756, 0x18(%r14)     # imm = 0x5756
movb $0x52, 0x1a(%r14)
movq %rbx, 0x40(%r14)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq