// File: /workspace/github_c_makefile_star2_O0/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3StrAccumEnlarge
static int sqlite3StrAccumEnlarge(StrAccum *p, int N){
  char *zNew;
  assert( p->nChar+(i64)N >= p->nAlloc ); /* Only called if really needed */
  if( p->accError ){
    testcase(p->accError==STRACCUM_TOOBIG);
    testcase(p->accError==STRACCUM_NOMEM);
    return 0;
  }
  if( p->mxAlloc==0 ){
    N = p->nAlloc - p->nChar - 1;
    setStrAccumError(p, STRACCUM_TOOBIG);
    return N;
  }else{
    char *zOld = p->bMalloced ? p->zText : 0;
    i64 szNew = p->nChar;
    assert( (p->zText==0 || p->zText==p->zBase)==(p->bMalloced==0) );
    szNew += N + 1;
    if( szNew+p->nChar<=p->mxAlloc ){
      /* Force exponential buffer size growth as long as it does not overflow,
      ** to avoid having to call this routine too often */
      szNew += p->nChar;
    }
    if( szNew > p->mxAlloc ){
      sqlite3StrAccumReset(p);
      setStrAccumError(p, STRACCUM_TOOBIG);
      return 0;
    }else{
      p->nAlloc = (int)szNew;
    }
    if( p->db ){
      zNew = sqlite3DbRealloc(p->db, zOld, p->nAlloc);
    }else{
      zNew = sqlite3_realloc64(zOld, p->nAlloc);
    }
    if( zNew ){
      assert( p->zText!=0 || p->nChar==0 );
      if( !p->bMalloced && p->nChar>0 ) memcpy(zNew, p->zText, p->nChar);
      p->zText = zNew;
      p->nAlloc = sqlite3DbMallocSize(p->db, zNew);
      p->bMalloced = 1;
    }else{
      sqlite3StrAccumReset(p);
      setStrAccumError(p, STRACCUM_NOMEM);
      return 0;
    }
  }
  return N;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rax
cmpb $0x0, 0x24(%rax)
je 0x21bf5
movl $0x0, -0x4(%rbp)
jmp 0x21da6
movq -0x10(%rbp), %rax
cmpl $0x0, 0x20(%rax)
jne 0x21c2c
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %eax
movq -0x10(%rbp), %rcx
subl 0x18(%rcx), %eax
subl $0x1, %eax
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rdi
movl $0x2, %esi
callq 0x21900
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x21da6
movq -0x10(%rbp), %rax
movzbl 0x25(%rax), %eax
cmpl $0x0, %eax
je 0x21c47
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x38(%rbp)
jmp 0x21c4f
xorl %eax, %eax
movq %rax, -0x38(%rbp)
jmp 0x21c4f
movq -0x38(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movl 0x18(%rax), %eax
movq %rax, -0x30(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
cltq
addq -0x30(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq -0x10(%rbp), %rcx
movl 0x18(%rcx), %ecx
addq %rcx, %rax
movq -0x10(%rbp), %rcx
movl 0x20(%rcx), %ecx
cmpq %rcx, %rax
jg 0x21c9b
movq -0x10(%rbp), %rax
movl 0x18(%rax), %eax
addq -0x30(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq -0x10(%rbp), %rcx
movl 0x20(%rcx), %ecx
cmpq %rcx, %rax
jle 0x21cce
movq -0x10(%rbp), %rdi
callq 0x21db0
movq -0x10(%rbp), %rdi
movl $0x2, %esi
callq 0x21900
movl $0x0, -0x4(%rbp)
jmp 0x21da6
movq -0x30(%rbp), %rax
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x1c(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
je 0x21d04
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x28(%rbp), %rsi
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %eax
movl %eax, %edx
callq 0x21e00
movq %rax, -0x20(%rbp)
jmp 0x21d1a
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %eax
movl %eax, %esi
callq 0xb900
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x21d7e
movq -0x10(%rbp), %rax
cmpb $0x0, 0x25(%rax)
jne 0x21d4f
movq -0x10(%rbp), %rax
cmpl $0x0, 0x18(%rax)
jbe 0x21d4f
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x10(%rbp), %rax
movl 0x18(%rax), %eax
movl %eax, %edx
callq 0xb420
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x217d0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x1c(%rax)
movq -0x10(%rbp), %rax
movb $0x1, 0x25(%rax)
jmp 0x21d9e
movq -0x10(%rbp), %rdi
callq 0x21db0
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x21900
movl $0x0, -0x4(%rbp)
jmp 0x21da6
jmp 0x21da0
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nop