// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: pagerStress
static int pagerStress(void *p, PgHdr *pPg){
  Pager *pPager = (Pager *)p;
  int rc = SQLITE_OK;

  assert( pPg->pPager==pPager );
  assert( pPg->flags&PGHDR_DIRTY );

  /* The doNotSpill NOSYNC bit is set during times when doing a sync of
  ** journal (and adding a new header) is not allowed.  This occurs
  ** during calls to sqlite3PagerWrite() while trying to journal multiple
  ** pages belonging to the same sector.
  **
  ** The doNotSpill ROLLBACK and OFF bits inhibits all cache spilling
  ** regardless of whether or not a sync is required.  This is set during
  ** a rollback or by user request, respectively.
  **
  ** Spilling is also prohibited when in an error state since that could
  ** lead to database corruption.   In the current implementation it
  ** is impossible for sqlite3PcacheFetch() to be called with createFlag==3
  ** while in the error state, hence it is impossible for this routine to
  ** be called in the error state.  Nevertheless, we include a NEVER()
  ** test for the error state as a safeguard against future changes.
  */
  if( NEVER(pPager->errCode) ) return SQLITE_OK;
  testcase( pPager->doNotSpill & SPILLFLAG_ROLLBACK );
  testcase( pPager->doNotSpill & SPILLFLAG_OFF );
  testcase( pPager->doNotSpill & SPILLFLAG_NOSYNC );
  if( pPager->doNotSpill
   && ((pPager->doNotSpill & (SPILLFLAG_ROLLBACK|SPILLFLAG_OFF))!=0
      || (pPg->flags & PGHDR_NEED_SYNC)!=0)
  ){
    return SQLITE_OK;
  }

  pPager->aStat[PAGER_STAT_SPILL]++;
  pPg->pDirty = 0;
  if( pagerUseWal(pPager) ){
    /* Write a single frame for this page to the log. */
    rc = subjournalPageIfRequired(pPg);
    if( rc==SQLITE_OK ){
      rc = pagerWalFrames(pPager, pPg, 0, 0);
    }
  }else{

#ifdef SQLITE_ENABLE_BATCH_ATOMIC_WRITE
    if( pPager->tempFile==0 ){
      rc = sqlite3JournalCreate(pPager->jfd);
      if( rc!=SQLITE_OK ) return pager_error(pPager, rc);
    }
#endif

    /* Sync the journal file if required. */
    if( pPg->flags&PGHDR_NEED_SYNC
     || pPager->eState==PAGER_WRITER_CACHEMOD
    ){
      rc = syncJournal(pPager, 1);
    }

    /* Write the contents of the page out to the database file. */
    if( rc==SQLITE_OK ){
      assert( (pPg->flags&PGHDR_NEED_SYNC)==0 );
      rc = pager_write_pagelist(pPager, pPg);
    }
  }

  /* Mark the page as clean. */
  if( rc==SQLITE_OK ){
    PAGERTRACE(("STRESS %d page %d\n", PAGERID(pPager), pPg->pgno));
    sqlite3PcacheMakeClean(pPg);
  }

  return pager_error(pPager, rc);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
xorl %ebp, %ebp
cmpl $0x0, 0x2c(%rdi)
je 0x28f89d
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
movq %rsi, %r14
movq %rdi, %rbx
movb 0x18(%rdi), %al
testb %al, %al
je 0x28f8b5
testb $0x3, %al
jne 0x28f896
testb $0x8, 0x34(%r14)
jne 0x28f896
incl 0xfc(%rbx)
movq $0x0, 0x20(%r14)
cmpq $0x0, 0x120(%rbx)
je 0x28f8ec
movq %r14, %rdi
callq 0x28f9fe
movl %eax, %ebp
testl %eax, %eax
jne 0x28f91b
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x28fb6a
jmp 0x28f919
testb $0x8, 0x34(%r14)
jne 0x28f8fb
xorl %ebp, %ebp
cmpb $0x3, 0x14(%rbx)
jne 0x28f90a
movq %rbx, %rdi
movl $0x1, %esi
callq 0x2903a8
movl %eax, %ebp
testl %ebp, %ebp
jne 0x28f91b
movq %rbx, %rdi
movq %r14, %rsi
callq 0x290586
movl %eax, %ebp
testl %ebp, %ebp
jne 0x28f927
movq %r14, %rdi
callq 0x2906d5
cmpb $0xd, %bpl
je 0x28f93a
movzbl %bpl, %eax
cmpl $0xa, %eax
jne 0x28f896
movl %ebp, 0x2c(%rbx)
movb $0x6, 0x14(%rbx)
testl %ebp, %ebp
je 0x28f94e
leaq 0x3269(%rip), %rax      # 0x292bb5
jmp 0x28f964
cmpb $0x0, 0x1a(%rbx)
je 0x28f95d
leaq 0x3265(%rip), %rax      # 0x292bc0
jmp 0x28f964
leaq 0x34a8(%rip), %rax      # 0x292e0c
movq %rax, 0x108(%rbx)
jmp 0x28f896