// File: /workspace/github_c_makefile_star2_O3/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, %r14
movq %rdx, %rbx
movq %rdi, %rbp
movq 0x50(%rsp), %rcx
movq (%rdi), %r15
testq %rsi, %rsi
je 0x2b17c9
movq %r8, 0x8(%rsp)
movq %rbp, %rdi
jmp 0x2b1808
movq %rcx, %rax
orq 0x58(%rsp), %rax
je 0x2b17fe
testq %rcx, %rcx
leaq 0x12686b(%rip), %rax    # 0x3d8048
leaq 0x127497(%rip), %rdx    # 0x3d8c7b
cmovneq %rax, %rdx
leaq 0x127468(%rip), %rsi    # 0x3d8c57
movq %rbp, %rdi
xorl %eax, %eax
callq 0x27b48d
jmp 0x2b188f
movq %r8, 0x8(%rsp)
movq %rbp, %rdi
xorl %esi, %esi
movq %rbx, %rdx
movq %r14, %rcx
callq 0x2b1dc0
movq %rax, %r12
testq %rax, %rax
je 0x2b188f
movq %r13, 0x10(%rsp)
movslq (%r12), %rax
imulq $0x70, %rax, %rax
leaq (%rax,%r12), %r13
addq $-0x68, %r13
cmpb $0x2, 0x11c(%rbp)
jb 0x2b185b
movq 0x10(%r13), %rsi
testq %rsi, %rsi
je 0x2b185b
testq %r14, %r14
je 0x2b184d
cmpq $0x0, (%r14)
jne 0x2b1850
movq %rbx, %r14
movq %rbp, %rdi
movq %r14, %rdx
callq 0x2b1eb3
movq 0x8(%rsp), %rsi
cmpl $0x0, 0x8(%rsi)
je 0x2b1872
movq %r15, %rdi
callq 0x2b1f02
movq %rax, 0x18(%r13)
movq 0x10(%rsp), %rax
movq %rax, 0x28(%r13)
movq 0x50(%rsp), %rax
movq %rax, 0x48(%r13)
movq 0x58(%rsp), %rax
movq %rax, 0x50(%r13)
jmp 0x2b18c6
movq 0x50(%rsp), %rsi
testq %rsi, %rsi
je 0x2b18a1
movq %r15, %rdi
callq 0x2a6164
movq %r15, %rdi
movq 0x58(%rsp), %rsi
callq 0x2a6536
testq %r13, %r13
je 0x2b18c3
movq %r15, %rdi
movq %r13, %rsi
movl $0x1, %edx
callq 0x2a62e6
xorl %r12d, %r12d
movq %r12, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq