// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r14
movq %rdi, %r15
movq (%rdx), %r13
testq %r13, %r13
je 0x456014
cmpb $0x0, 0x18(%r14)
je 0x45603b
testb $0x1, 0x6(%rbx)
je 0x456141
cmpq $0x0, 0x38(%r14)
je 0x45607b
leaq 0xfc7fd(%rip), %rsi     # 0x552829
movq %r15, %rdi
xorl %eax, %eax
callq 0x40e48a
jmp 0x456141
movq %rsi, %r12
testq %r12, %r12
je 0x45605e
movq (%r12), %rdi
movq %r13, %rsi
callq 0x4079b2
testl %eax, %eax
je 0x45614f
movq 0x30(%r12), %r12
jmp 0x45603e
leaq 0xfc7b1(%rip), %rsi     # 0x552816
movq %r15, %rdi
movq %r13, %rdx
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x40e48a
movq (%r15), %r15
movq 0x38(%rbx), %rax
leaq 0xf9e61(%rip), %rcx     # 0x54feea
cmpq %rcx, %rax
setne %cl
leaq 0xf9e5f(%rip), %rdx     # 0x54fef5
cmpq %rdx, %rax
setne %dl
testb %dl, %cl
jne 0x4560d7
movq 0x20(%r14), %rsi
testq %rsi, %rsi
je 0x4560b1
movq %r15, %rdi
callq 0x4381eb
leaq 0x20(%r14), %r12
movq 0x28(%r14), %rsi
testq %rsi, %rsi
je 0x4560c6
movq %r15, %rdi
callq 0x4381eb
xorps %xmm0, %xmm0
movups %xmm0, (%r12)
movw $0x574c, 0x18(%r14)     # imm = 0x574C
jmp 0x45613c
leaq 0xf9e3a(%rip), %rcx     # 0x54ff18
cmpq %rcx, %rax
je 0x456107
leaq 0xf9e21(%rip), %rcx     # 0x54ff0b
cmpq %rcx, %rax
je 0x456107
leaq 0xf9e05(%rip), %rcx     # 0x54fefb
cmpq %rcx, %rax
je 0x456107
leaq 0xf9e04(%rip), %rcx     # 0x54ff06
cmpq %rcx, %rax
jne 0x456141
movq 0x20(%r14), %rsi
testq %rsi, %rsi
je 0x456118
movq %r15, %rdi
callq 0x4381eb
leaq 0x20(%r14), %r12
movq 0x28(%r14), %rsi
testq %rsi, %rsi
je 0x45612d
movq %r15, %rdi
callq 0x4381eb
xorps %xmm0, %xmm0
movups %xmm0, (%r12)
movw $0x5756, 0x18(%r14)     # imm = 0x5756
movb $0x52, 0x1a(%r14)
movq %rbx, 0x40(%r14)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq (%r15), %rdi
movq 0x8(%r12), %rsi
xorl %r13d, %r13d
xorl %edx, %edx
callq 0x4528d0
movq %rax, 0x8(%r14)
movq (%r15), %rdi
movq 0x10(%r12), %rsi
xorl %edx, %edx
callq 0x4528d0
movq %rax, 0x10(%r14)
movq 0x20(%r12), %rsi
testq %rsi, %rsi
je 0x456191
movq (%r15), %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x452376
movq %rax, %r13
movq %r13, 0x20(%r14)
movq 0x28(%r12), %rsi
testq %rsi, %rsi
je 0x4561ad
movq (%r15), %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x452376
jmp 0x4561af
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)
jmp 0x456014