// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x0, (%rax)
je 0x4777f3
movq -0x18(%rbp), %rax
movzbl 0x18(%rax), %eax
cmpl $0x0, %eax
jne 0x4777f3
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x477720
movq -0x28(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
callq 0x409750
cmpl $0x0, %eax
jne 0x477710
jmp 0x477720
jmp 0x477712
movq -0x28(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x4776ef
cmpq $0x0, -0x28(%rbp)
jne 0x477745
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rdx
leaq 0x108d54(%rip), %rsi    # 0x58048d
movb $0x0, %al
callq 0x4110b0
jmp 0x477956
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rsi
xorl %edx, %edx
callq 0x472350
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rsi
xorl %edx, %edx
callq 0x472350
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rsi
xorl %edx, %edx
callq 0x4717d0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x28(%rbp), %rax
movq 0x28(%rax), %rsi
xorl %edx, %edx
callq 0x4717d0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x28(%rbp), %rax
movb 0x19(%rax), %cl
movq -0x18(%rbp), %rax
movb %cl, 0x19(%rax)
movq -0x28(%rbp), %rax
movb 0x1a(%rax), %cl
movq -0x18(%rbp), %rax
movb %cl, 0x1a(%rax)
movq -0x28(%rbp), %rax
movb 0x18(%rax), %cl
movq -0x18(%rbp), %rax
movb %cl, 0x18(%rax)
movq -0x20(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x10000, %eax          # imm = 0x10000
cmpl $0x0, %eax
je 0x47794a
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x38(%rax)
je 0x477835
movq -0x8(%rbp), %rdi
leaq 0x108c77(%rip), %rsi    # 0x5804a0
movb $0x0, %al
callq 0x4110b0
jmp 0x477948
movq -0x20(%rbp), %rax
leaq 0x106412(%rip), %rcx    # 0x57dc52
cmpq %rcx, 0x38(%rax)
je 0x477857
movq -0x20(%rbp), %rax
leaq 0x10640c(%rip), %rcx    # 0x57dc5d
cmpq %rcx, 0x38(%rax)
jne 0x4778ae
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rsi
callq 0x44fdb0
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rsi
callq 0x44fdb0
movq -0x18(%rbp), %rax
movq $0x0, 0x28(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x20(%rax)
movq -0x18(%rbp), %rax
movb $0x4c, 0x18(%rax)
movq -0x18(%rbp), %rax
movb $0x57, 0x19(%rax)
movq -0x18(%rbp), %rax
movb $0x52, 0x1a(%rax)
jmp 0x477946
movq -0x20(%rbp), %rax
leaq 0x1063aa(%rip), %rcx    # 0x57dc63
cmpq %rcx, 0x38(%rax)
je 0x4778f2
movq -0x20(%rbp), %rax
leaq 0x1063a4(%rip), %rcx    # 0x57dc6e
cmpq %rcx, 0x38(%rax)
je 0x4778f2
movq -0x20(%rbp), %rax
leaq 0x106398(%rip), %rcx    # 0x57dc73
cmpq %rcx, 0x38(%rax)
je 0x4778f2
movq -0x20(%rbp), %rax
leaq 0x106394(%rip), %rcx    # 0x57dc80
cmpq %rcx, 0x38(%rax)
jne 0x477944
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rsi
callq 0x44fdb0
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rsi
callq 0x44fdb0
movq -0x18(%rbp), %rax
movq $0x0, 0x28(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x20(%rax)
movq -0x18(%rbp), %rax
movb $0x56, 0x18(%rax)
movq -0x18(%rbp), %rax
movb $0x57, 0x19(%rax)
movq -0x18(%rbp), %rax
movb $0x52, 0x1a(%rax)
jmp 0x477946
jmp 0x477948
jmp 0x47794a
movq -0x20(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x40(%rax)
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)