// File: /workspace/github_c_makefile_star2_O2/ukontainer[P]sqlite-bench/sqlite3.c
// Function: updateAccumulator
static void updateAccumulator(Parse *pParse, int regAcc, AggInfo *pAggInfo){
  Vdbe *v = pParse->pVdbe;
  int i;
  int regHit = 0;
  int addrHitTest = 0;
  struct AggInfo_func *pF;
  struct AggInfo_col *pC;

  pAggInfo->directMode = 1;
  for(i=0, pF=pAggInfo->aFunc; i<pAggInfo->nFunc; i++, pF++){
    int nArg;
    int addrNext = 0;
    int regAgg;
    ExprList *pList = pF->pExpr->x.pList;
    assert( !ExprHasProperty(pF->pExpr, EP_xIsSelect) );
    if( pList ){
      nArg = pList->nExpr;
      regAgg = sqlite3GetTempRange(pParse, nArg);
      sqlite3ExprCodeExprList(pParse, pList, regAgg, 0, SQLITE_ECEL_DUP);
    }else{
      nArg = 0;
      regAgg = 0;
    }
    if( pF->iDistinct>=0 ){
      addrNext = sqlite3VdbeMakeLabel(v);
      testcase( nArg==0 );  /* Error condition */
      testcase( nArg>1 );   /* Also an error */
      codeDistinct(pParse, pF->iDistinct, addrNext, 1, regAgg);
    }
    if( pF->pFunc->funcFlags & SQLITE_FUNC_NEEDCOLL ){
      CollSeq *pColl = 0;
      struct ExprList_item *pItem;
      int j;
      assert( pList!=0 );  /* pList!=0 if pF->pFunc has NEEDCOLL */
      for(j=0, pItem=pList->a; !pColl && j<nArg; j++, pItem++){
        pColl = sqlite3ExprCollSeq(pParse, pItem->pExpr);
      }
      if( !pColl ){
        pColl = pParse->db->pDfltColl;
      }
      if( regHit==0 && pAggInfo->nAccumulator ) regHit = ++pParse->nMem;
      sqlite3VdbeAddOp4(v, OP_CollSeq, regHit, 0, 0, (char *)pColl, P4_COLLSEQ);
    }
    sqlite3VdbeAddOp3(v, OP_AggStep, 0, regAgg, pF->iMem);
    sqlite3VdbeAppendP4(v, pF->pFunc, P4_FUNCDEF);
    sqlite3VdbeChangeP5(v, (u8)nArg);
    sqlite3ReleaseTempRange(pParse, regAgg, nArg);
    if( addrNext ){
      sqlite3VdbeResolveLabel(v, addrNext);
    }
  }
  if( regHit==0 && pAggInfo->nAccumulator ){
    regHit = regAcc;
  }
  if( regHit ){
    addrHitTest = sqlite3VdbeAddOp1(v, OP_If, regHit); VdbeCoverage(v);
  }
  for(i=0, pC=pAggInfo->aCol; i<pAggInfo->nAccumulator; i++, pC++){
    sqlite3ExprCode(pParse, pC->pExpr, pC->iMem);
  }
  pAggInfo->directMode = 0;
  if( addrHitTest ){
    sqlite3VdbeJumpHere(v, addrHitTest);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %esi, 0x20(%rsp)
movq %rdi, %r15
movq 0x10(%rdi), %rbp
movb $0x1, (%rdx)
movq %rdx, 0x8(%rsp)
movq 0x30(%rdx), %rbx
xorl %r14d, %r14d
xorl %ecx, %ecx
movq %rbp, 0x18(%rsp)
movq 0x8(%rsp), %rax
cmpl 0x38(%rax), %ecx
jge 0x4573a1
movl %ecx, 0x24(%rsp)
movl %r14d, 0x10(%rsp)
movq (%rbx), %rax
movq 0x20(%rax), %r14
movl $0x0, 0x14(%rsp)
movl $0x0, %r13d
movl $0x0, %r12d
testq %r14, %r14
je 0x457271
movl (%r14), %r13d
movq %r15, %rdi
movl %r13d, %esi
callq 0x44a10f
movl %eax, %r12d
movq %r15, %rdi
movq %r14, %rsi
movl %eax, %edx
xorl %ecx, %ecx
pushq $0x1
popq %r8
callq 0x44a137
cmpl $0x0, 0x14(%rbx)
js 0x457296
movq %rbp, %rdi
callq 0x44a0b8
movl 0x14(%rbx), %esi
movq %r15, %rdi
movl %eax, 0x14(%rsp)
movl %eax, %edx
pushq $0x1
popq %rcx
movl %r12d, %r8d
callq 0x45f23b
movq 0x8(%rbx), %rax
testb $0x20, 0x4(%rax)
jne 0x4572a7
movl 0x10(%rsp), %r14d
jmp 0x45731f
addq $0x8, %r14
xorl %eax, %eax
xorl %ebp, %ebp
testq %rax, %rax
jne 0x4572cc
cmpl %r13d, %ebp
jge 0x4572cc
movq (%r14), %rsi
movq %r15, %rdi
callq 0x433a1a
incl %ebp
addq $0x20, %r14
jmp 0x4572af
testq %rax, %rax
jne 0x4572d8
movq (%r15), %rax
movq 0x10(%rax), %rax
movl 0x10(%rsp), %r14d
testl %r14d, %r14d
movq 0x18(%rsp), %rbp
jne 0x457302
movq 0x8(%rsp), %rcx
cmpl $0x0, 0x2c(%rcx)
je 0x4572ff
movl 0x38(%r15), %r14d
incl %r14d
movl %r14d, 0x38(%r15)
jmp 0x457302
xorl %r14d, %r14d
movl $0xfffffffe, (%rsp)     # imm = 0xFFFFFFFE
movq %rbp, %rdi
pushq $0x52
popq %rsi
movl %r14d, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
movq %rax, %r9
callq 0x4485b6
movl 0x10(%rbx), %r8d
movq %rbp, %rdi
movl $0x9b, %esi
xorl %edx, %edx
movl %r12d, %ecx
callq 0x432a44
movq 0x8(%rbx), %rsi
movq %rbp, %rdi
pushq $-0x8
popq %rdx
callq 0x448919
movslq 0xb8(%rbp), %rax
testq %rax, %rax
jle 0x457361
movzbl %r13b, %ecx
movq 0x68(%rbp), %rdx
imulq $0x18, %rax, %rax
movw %cx, -0x16(%rdx,%rax)
movq %r15, %rdi
movl %r12d, %esi
movl %r13d, %edx
callq 0x44a281
movl 0x14(%rsp), %edx
testl %edx, %edx
je 0x457392
movq 0x18(%rbp), %rax
movq 0x50(%rax), %rax
testq %rax, %rax
je 0x457392
notl %edx
movl 0xb8(%rbp), %ecx
movslq %edx, %rdx
movl %ecx, (%rax,%rdx,4)
movl 0x24(%rsp), %ecx
incl %ecx
addq $0x18, %rbx
jmp 0x457216
testl %r14d, %r14d
jne 0x4573bd
xorl %ebp, %ebp
movl 0x20(%rsp), %r14d
testl %r14d, %r14d
je 0x4573cf
movq 0x8(%rsp), %rax
cmpl $0x0, 0x2c(%rax)
je 0x4573cf
pushq $0x12
popq %rsi
movq 0x18(%rsp), %rdi
movl %r14d, %edx
callq 0x449fcc
movl %eax, %ebp
movq 0x8(%rsp), %rax
movq 0x20(%rax), %rbx
addq $0x18, %rbx
xorl %r14d, %r14d
movq 0x8(%rsp), %rax
cmpl 0x2c(%rax), %r14d
jge 0x457401
movq (%rbx), %rsi
movl -0x4(%rbx), %edx
movq %r15, %rdi
callq 0x4485ec
incl %r14d
addq $0x20, %rbx
jmp 0x4573df
movq 0x8(%rsp), %rax
movb $0x0, (%rax)
testl %ebp, %ebp
je 0x457427
movq 0x18(%rsp), %rdi
movl %ebp, %esi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4485a5
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq