// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
movl $0x0, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movq -0x18(%rbp), %rax
movb $0x1, (%rax)
movl $0x0, -0x24(%rbp)
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x38(%rbp)
movl -0x24(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x38(%rcx), %eax
jge 0x482a5f
movl $0x0, -0x48(%rbp)
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq 0x20(%rax), %rax
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x58(%rbp)
je 0x4828c9
movq -0x58(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x44(%rbp)
movq -0x8(%rbp), %rdi
movl -0x44(%rbp), %esi
callq 0x46e5b0
movl %eax, -0x4c(%rbp)
movq -0x8(%rbp), %rdi
movq -0x58(%rbp), %rsi
movl -0x4c(%rbp), %edx
xorl %ecx, %ecx
movl $0x1, %r8d
callq 0x46e640
jmp 0x4828d7
movl $0x0, -0x44(%rbp)
movl $0x0, -0x4c(%rbp)
movq -0x38(%rbp), %rax
cmpl $0x0, 0x14(%rax)
jl 0x482909
movq -0x20(%rbp), %rdi
callq 0x46e490
movl %eax, -0x48(%rbp)
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rax
movl 0x14(%rax), %esi
movl -0x48(%rbp), %edx
movl -0x4c(%rbp), %r8d
movl $0x1, %ecx
callq 0x496170
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
movl 0x4(%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x4829df
movq $0x0, -0x60(%rbp)
movl $0x0, -0x6c(%rbp)
movq -0x58(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x68(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x60(%rbp)
movb %al, -0x6d(%rbp)
jne 0x482953
movl -0x6c(%rbp), %eax
cmpl -0x44(%rbp), %eax
setl %al
movb %al, -0x6d(%rbp)
movb -0x6d(%rbp), %al
testb $0x1, %al
jne 0x48295c
jmp 0x482987
movq -0x8(%rbp), %rdi
movq -0x68(%rbp), %rax
movq (%rax), %rsi
callq 0x456110
movq %rax, -0x60(%rbp)
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
movq -0x68(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x68(%rbp)
jmp 0x48293b
cmpq $0x0, -0x60(%rbp)
jne 0x48299d
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movq %rax, -0x60(%rbp)
cmpl $0x0, -0x28(%rbp)
jne 0x4829bd
movq -0x18(%rbp), %rax
cmpl $0x0, 0x2c(%rax)
je 0x4829bd
movq -0x8(%rbp), %rcx
movl 0x38(%rcx), %eax
addl $0x1, %eax
movl %eax, 0x38(%rcx)
movl %eax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
movl -0x28(%rbp), %edx
movq -0x60(%rbp), %r9
movl $0x52, %esi
xorl %r8d, %r8d
movl %r8d, %ecx
movl $0xfffffffe, (%rsp)     # imm = 0xFFFFFFFE
callq 0x46bbd0
movq -0x20(%rbp), %rdi
movl -0x4c(%rbp), %ecx
movq -0x38(%rbp), %rax
movl 0x10(%rax), %r8d
movl $0x9b, %esi
xorl %edx, %edx
callq 0x4537c0
movq -0x20(%rbp), %rdi
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rsi
movl $0xfffffff8, %edx       # imm = 0xFFFFFFF8
callq 0x46c440
movq -0x20(%rbp), %rdi
movl -0x44(%rbp), %eax
movzbl %al, %eax
movzwl %ax, %esi
callq 0x411430
movq -0x8(%rbp), %rdi
movl -0x4c(%rbp), %esi
movl -0x44(%rbp), %edx
callq 0x46ea10
cmpl $0x0, -0x48(%rbp)
je 0x482a43
movq -0x20(%rbp), %rdi
movl -0x48(%rbp), %esi
callq 0x46e530
jmp 0x482a45
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movq -0x38(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x38(%rbp)
jmp 0x48286a
cmpl $0x0, -0x28(%rbp)
jne 0x482a75
movq -0x18(%rbp), %rax
cmpl $0x0, 0x2c(%rax)
je 0x482a75
movl -0xc(%rbp), %eax
movl %eax, -0x28(%rbp)
cmpl $0x0, -0x28(%rbp)
je 0x482a8f
movq -0x20(%rbp), %rdi
movl -0x28(%rbp), %edx
movl $0x12, %esi
callq 0x46e2d0
movl %eax, -0x2c(%rbp)
movl $0x0, -0x24(%rbp)
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x40(%rbp)
movl -0x24(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x2c(%rcx), %eax
jge 0x482add
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rax
movq 0x18(%rax), %rsi
movq -0x40(%rbp), %rax
movl 0x14(%rax), %edx
callq 0x46be40
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movq -0x40(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x40(%rbp)
jmp 0x482aa2
movq -0x18(%rbp), %rax
movb $0x0, (%rax)
cmpl $0x0, -0x2c(%rbp)
je 0x482af6
movq -0x20(%rbp), %rdi
movl -0x2c(%rbp), %esi
callq 0x46bba0
addq $0x80, %rsp
popq %rbp
retq
nop