// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: sqlite3SrcListAppendFromTerm
SQLITE_PRIVATE SrcList *sqlite3SrcListAppendFromTerm(
  Parse *pParse,          /* Parsing context */
  SrcList *p,             /* The left part of the FROM clause already seen */
  Token *pTable,          /* Name of the table to add to the FROM clause */
  Token *pDatabase,       /* Name of the database containing pTable */
  Token *pAlias,          /* The right-hand side of the AS subexpression */
  Select *pSubquery,      /* A subquery used in place of a table name */
  Expr *pOn,              /* The ON clause of a join */
  IdList *pUsing          /* The USING clause of a join */
){
  struct SrcList_item *pItem;
  sqlite3 *db = pParse->db;
  if( !p && (pOn || pUsing) ){
    sqlite3ErrorMsg(pParse, "a JOIN clause is required before %s",
      (pOn ? "ON" : "USING")
    );
    goto append_from_error;
  }
  p = sqlite3SrcListAppend(pParse, p, pTable, pDatabase);
  if( p==0 ){
    goto append_from_error;
  }
  assert( p->nSrc>0 );
  pItem = &p->a[p->nSrc-1];
  assert( (pTable==0)==(pDatabase==0) );
  assert( pItem->zName==0 || pDatabase!=0 );
  if( IN_RENAME_OBJECT && pItem->zName ){
    Token *pToken = (ALWAYS(pDatabase) && pDatabase->z) ? pDatabase : pTable;
    sqlite3RenameTokenMap(pParse, pItem->zName, pToken);
  }
  assert( pAlias!=0 );
  if( pAlias->n ){
    pItem->zAlias = sqlite3NameFromToken(db, pAlias);
  }
  pItem->pSelect = pSubquery;
  pItem->pOn = pOn;
  pItem->pUsing = pUsing;
  return p;

 append_from_error:
  assert( p==0 );
  sqlite3ExprDelete(db, pOn);
  sqlite3IdListDelete(db, pUsing);
  sqlite3SelectDelete(db, pSubquery);
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, %r13
movq %rcx, %r12
movq %rdx, %rbx
movq %rdi, %r14
movq 0x50(%rsp), %rcx
movq (%rdi), %r15
testq %rsi, %rsi
jne 0x2baf64
movq %rcx, %rax
orq 0x58(%rsp), %rax
je 0x2baf64
testq %rcx, %rcx
leaq 0x12685a(%rip), %rax    # 0x3e179d
leaq 0x127486(%rip), %rdx    # 0x3e23d0
cmovneq %rax, %rdx
leaq 0x127457(%rip), %rsi    # 0x3e23ac
movq %r14, %rdi
xorl %eax, %eax
callq 0x284eb8
jmp 0x2baff4
movq %r8, 0x10(%rsp)
movq %r14, %rdi
movq %rbx, %rdx
movq %r12, %rcx
callq 0x2bb525
testq %rax, %rax
je 0x2baff4
movq %rax, %rbp
movq %r13, 0x8(%rsp)
movslq (%rax), %rax
imulq $0x70, %rax, %rax
leaq (%rax,%rbp), %r13
addq $-0x68, %r13
cmpb $0x2, 0x11c(%r14)
jb 0x2bafc0
movq 0x10(%r13), %rsi
testq %rsi, %rsi
je 0x2bafc0
testq %r12, %r12
je 0x2bafb2
cmpq $0x0, (%r12)
jne 0x2bafb5
movq %rbx, %r12
movq %r14, %rdi
movq %r12, %rdx
callq 0x2bb62e
movq 0x10(%rsp), %rsi
cmpl $0x0, 0x8(%rsi)
je 0x2bafd7
movq %r15, %rdi
callq 0x2bb67d
movq %rax, 0x18(%r13)
movq 0x8(%rsp), %rax
movq %rax, 0x28(%r13)
movq 0x50(%rsp), %rax
movq %rax, 0x48(%r13)
movq 0x58(%rsp), %rax
movq %rax, 0x50(%r13)
jmp 0x2bb02a
movq 0x50(%rsp), %rsi
testq %rsi, %rsi
je 0x2bb006
movq %r15, %rdi
callq 0x2afd54
movq %r15, %rdi
movq 0x58(%rsp), %rsi
callq 0x2b0119
testq %r13, %r13
je 0x2bb028
movq %r15, %rdi
movq %r13, %rsi
movl $0x1, %edx
callq 0x2afecb
xorl %ebp, %ebp
movq %rbp, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq