// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: sqlite3WithAdd
SQLITE_PRIVATE With *sqlite3WithAdd(
  Parse *pParse,          /* Parsing context */
  With *pWith,            /* Existing WITH clause, or NULL */
  Token *pName,           /* Name of the common-table */
  ExprList *pArglist,     /* Optional column name list for the table */
  Select *pQuery          /* Query used to initialize the table */
){
  sqlite3 *db = pParse->db;
  With *pNew;
  char *zName;

  /* Check that the CTE name is unique within this WITH clause. If
  ** not, store an error in the Parse structure. */
  zName = sqlite3NameFromToken(pParse->db, pName);
  if( zName && pWith ){
    int i;
    for(i=0; i<pWith->nCte; i++){
      if( sqlite3StrICmp(zName, pWith->a[i].zName)==0 ){
        sqlite3ErrorMsg(pParse, "duplicate WITH table name: %s", zName);
      }
    }
  }

  if( pWith ){
    sqlite3_int64 nByte = sizeof(*pWith) + (sizeof(pWith->a[1]) * pWith->nCte);
    pNew = sqlite3DbRealloc(db, pWith, nByte);
  }else{
    pNew = sqlite3DbMallocZero(db, sizeof(*pWith));
  }
  assert( (pNew!=0 && zName!=0) || db->mallocFailed );

  if( db->mallocFailed ){
    sqlite3ExprListDelete(db, pArglist);
    sqlite3SelectDelete(db, pQuery);
    sqlite3DbFree(db, zName);
    pNew = pWith;
  }else{
    pNew->a[pNew->nCte].pSelect = pQuery;
    pNew->a[pNew->nCte].pCols = pArglist;
    pNew->a[pNew->nCte].zName = zName;
    pNew->a[pNew->nCte].zCteErr = 0;
    pNew->nCte++;
  }

  return pNew;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x41db70
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0x4294c4
cmpq $0x0, -0x10(%rbp)
je 0x4294c4
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x4294c2
movq -0x40(%rbp), %rdi
movq -0x10(%rbp), %rax
addq $0x10, %rax
movslq -0x44(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rsi
callq 0x3c3e60
cmpl $0x0, %eax
jne 0x4294b5
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rdx
leaq 0x185ec5(%rip), %rsi    # 0x5af373
movb $0x0, %al
callq 0x3cb660
jmp 0x4294b7
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x429470
jmp 0x4294c4
cmpq $0x0, -0x10(%rbp)
je 0x4294f5
movq -0x10(%rbp), %rax
movslq (%rax), %rax
shlq $0x5, %rax
addq $0x30, %rax
movq %rax, -0x50(%rbp)
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x50(%rbp), %rdx
callq 0x3d61d0
movq %rax, -0x38(%rbp)
jmp 0x429507
movq -0x30(%rbp), %rdi
movl $0x30, %esi
callq 0x3c9520
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rax
cmpb $0x0, 0x61(%rax)
je 0x429545
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x40c6a0
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x40c7e0
movq -0x30(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x3c00a0
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
jmp 0x4295c7
movq -0x28(%rbp), %rcx
movq -0x38(%rbp), %rax
addq $0x10, %rax
movq -0x38(%rbp), %rdx
movslq (%rdx), %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movq %rcx, 0x10(%rax)
movq -0x20(%rbp), %rcx
movq -0x38(%rbp), %rax
addq $0x10, %rax
movq -0x38(%rbp), %rdx
movslq (%rdx), %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
movq -0x40(%rbp), %rcx
movq -0x38(%rbp), %rax
addq $0x10, %rax
movq -0x38(%rbp), %rdx
movslq (%rdx), %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movq %rcx, (%rax)
movq -0x38(%rbp), %rax
addq $0x10, %rax
movq -0x38(%rbp), %rcx
movslq (%rcx), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq $0x0, 0x18(%rax)
movq -0x38(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq -0x38(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)