// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/sqlite-3.33.0/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==SQLITE_TOOBIG);
    testcase(p->accError==SQLITE_NOMEM);
    return 0;
  }
  if( p->mxAlloc==0 ){
    setStrAccumError(p, SQLITE_TOOBIG);
    return p->nAlloc - p->nChar - 1;
  }else{
    char *zOld = isMalloced(p) ? p->zText : 0;
    i64 szNew = p->nChar;
    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 ){
      sqlite3_str_reset(p);
      setStrAccumError(p, SQLITE_TOOBIG);
      return 0;
    }else{
      p->nAlloc = (int)szNew;
    }
    if( p->db ){
      zNew = sqlite3DbRealloc(p->db, zOld, p->nAlloc);
    }else{
      zNew = sqlite3Realloc(zOld, p->nAlloc);
    }
    if( zNew ){
      assert( p->zText!=0 || p->nChar==0 );
      if( !isMalloced(p) && p->nChar>0 ) memcpy(zNew, p->zText, p->nChar);
      p->zText = zNew;
      p->nAlloc = sqlite3DbMallocSize(p->db, zNew);
      p->printfFlags |= SQLITE_PRINTF_MALLOCED;
    }else{
      sqlite3_str_reset(p);
      setStrAccumError(p, SQLITE_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, 0x1c(%rax)
je 0x3c31d5
movl $0x0, -0x4(%rbp)
jmp 0x3c338f
movq -0x10(%rbp), %rax
cmpl $0x0, 0x14(%rax)
jne 0x3c3206
movq -0x10(%rbp), %rdi
movl $0x12, %esi
callq 0x3d6120
movq -0x10(%rbp), %rax
movl 0x10(%rax), %eax
movq -0x10(%rbp), %rcx
subl 0x18(%rcx), %eax
subl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x3c338f
movq -0x10(%rbp), %rax
movzbl 0x1d(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x3c3224
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x38(%rbp)
jmp 0x3c322c
xorl %eax, %eax
movq %rax, -0x38(%rbp)
jmp 0x3c322c
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 0x14(%rcx), %ecx
cmpq %rcx, %rax
jg 0x3c3278
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 0x14(%rcx), %ecx
cmpq %rcx, %rax
jle 0x3c32ab
movq -0x10(%rbp), %rdi
callq 0x3c35b0
movq -0x10(%rbp), %rdi
movl $0x12, %esi
callq 0x3d6120
movl $0x0, -0x4(%rbp)
jmp 0x3c338f
movq -0x30(%rbp), %rax
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
je 0x3c32e1
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x28(%rbp), %rsi
movq -0x10(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, %edx
callq 0x3d61d0
movq %rax, -0x20(%rbp)
jmp 0x3c32f7
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, %esi
callq 0x3c0910
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x3c3367
movq -0x10(%rbp), %rax
movzbl 0x1d(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
jne 0x3c3332
movq -0x10(%rbp), %rax
cmpl $0x0, 0x18(%rax)
jbe 0x3c3332
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x10(%rbp), %rax
movl 0x18(%rax), %eax
movl %eax, %edx
callq 0x19610
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x3c30e0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x10(%rbp), %rax
movzbl 0x1d(%rax), %ecx
orl $0x4, %ecx
movb %cl, 0x1d(%rax)
jmp 0x3c3387
movq -0x10(%rbp), %rdi
callq 0x3c35b0
movq -0x10(%rbp), %rdi
movl $0x7, %esi
callq 0x3d6120
movl $0x0, -0x4(%rbp)
jmp 0x3c338f
jmp 0x3c3389
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)