// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: statPush
static void statPush(
  sqlite3_context *context,
  int argc,
  sqlite3_value **argv
){
  int i;

  /* The three function arguments */
  StatAccum *p = (StatAccum*)sqlite3_value_blob(argv[0]);
  int iChng = sqlite3_value_int(argv[1]);

  UNUSED_PARAMETER( argc );
  UNUSED_PARAMETER( context );
  assert( p->nCol>0 );
  assert( iChng<p->nCol );

  if( p->nRow==0 ){
    /* This is the first call to this function. Do initialization. */
    for(i=0; i<p->nCol; i++) p->current.anEq[i] = 1;
  }else{
    /* Second and subsequent calls get processed here */
#ifdef SQLITE_ENABLE_STAT4
    if( p->mxSample ) samplePushPrevious(p, iChng);
#endif

    /* Update anDLt[], anLt[] and anEq[] to reflect the values that apply
    ** to the current row of the index. */
    for(i=0; i<iChng; i++){
      p->current.anEq[i]++;
    }
    for(i=iChng; i<p->nCol; i++){
      p->current.anDLt[i]++;
#ifdef SQLITE_ENABLE_STAT4
      if( p->mxSample ) p->current.anLt[i] += p->current.anEq[i];
#endif
      p->current.anEq[i] = 1;
    }
  }

  p->nRow++;
#ifdef SQLITE_ENABLE_STAT4
  if( p->mxSample ){
    tRowcnt nLt;
    if( sqlite3_value_type(argv[2])==SQLITE_INTEGER ){
      sampleSetRowidInt64(p->db, &p->current, sqlite3_value_int64(argv[2]));
    }else{
      sampleSetRowid(p->db, &p->current, sqlite3_value_bytes(argv[2]),
                                         sqlite3_value_blob(argv[2]));
    }
    p->current.iHash = p->iPrn = p->iPrn*1103515245 + 12345;

    nLt = p->current.anLt[p->nCol-1];
    /* Check if this is to be a periodic sample. If so, add it. */
    if( (nLt/p->nPSample)!=(nLt+1)/p->nPSample ){
      p->current.isPSample = 1;
      p->current.iCol = 0;
      sampleInsert(p, &p->current, p->nCol-1);
      p->current.isPSample = 0;
    }

    /* Update the aBest[] array. */
    for(i=0; i<(p->nCol-1); i++){
      p->current.iCol = i;
      if( i>=iChng || sampleIsBetterPost(p, &p->current, &p->aBest[i]) ){
        sampleCopy(p, &p->aBest[i], &p->current);
      }
    }
  }else
#endif
  if( p->nLimit && p->nRow>(tRowcnt)p->nLimit*(p->nSkipAhead+1) ){
    p->nSkipAhead++;
    sqlite3_result_int(context, p->current.anDLt[0]>0);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r15
movq %rdi, %rbx
movq (%rdx), %rdi
callq 0x281b13
movq %rax, %r14
movq 0x8(%r15), %rdi
callq 0x281c1d
cmpl $0x0, 0xc(%r14)
je 0x2f300a
testl %eax, %eax
jle 0x2f2fe2
movq 0x20(%r14), %rcx
movl %eax, %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
xorl %esi, %esi
incl (%rcx,%rsi,4)
incq %rsi
cmpq %rsi, %rdx
jne 0x2f2fd7
cmpl %eax, 0x14(%r14)
jle 0x2f302a
movq 0x20(%r14), %rcx
movq 0x28(%r14), %rdx
cltq
incl (%rdx,%rax,4)
movl $0x1, (%rcx,%rax,4)
incq %rax
movslq 0x14(%r14), %rsi
cmpq %rsi, %rax
jl 0x2f2ff2
jmp 0x2f302a
cmpl $0x0, 0x14(%r14)
jle 0x2f302a
movq 0x20(%r14), %rax
xorl %ecx, %ecx
movl $0x1, (%rax,%rcx,4)
incq %rcx
movslq 0x14(%r14), %rdx
cmpq %rdx, %rcx
jl 0x2f3017
movl 0xc(%r14), %eax
movl 0x10(%r14), %ecx
incl %eax
movl %eax, 0xc(%r14)
testl %ecx, %ecx
je 0x2f307a
movzbl 0x1c(%r14), %edx
leal 0x1(%rdx), %esi
imull %ecx, %esi
cmpl %esi, %eax
jbe 0x2f307a
incb %dl
movb %dl, 0x1c(%r14)
movq 0x28(%r14), %rax
xorl %esi, %esi
cmpl $0x0, (%rax)
setne %sil
movq (%rbx), %rdi
testb $0x24, 0x9(%rdi)
je 0x2f3071
popq %rbx
popq %r14
popq %r15
jmp 0x29c706
movq %rsi, (%rdi)
movw $0x4, 0x8(%rdi)
popq %rbx
popq %r14
popq %r15
retq