// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: sqlite3SelectAddColumnTypeAndCollation
SQLITE_PRIVATE void sqlite3SelectAddColumnTypeAndCollation(
  Parse *pParse,        /* Parsing contexts */
  Table *pTab,          /* Add column type information to this table */
  Select *pSelect,      /* SELECT used to determine types and collations */
  char aff              /* Default affinity for columns */
){
  sqlite3 *db = pParse->db;
  NameContext sNC;
  Column *pCol;
  CollSeq *pColl;
  int i;
  Expr *p;
  struct ExprList_item *a;

  assert( pSelect!=0 );
  assert( (pSelect->selFlags & SF_Resolved)!=0 );
  assert( pTab->nCol==pSelect->pEList->nExpr || db->mallocFailed );
  if( db->mallocFailed ) return;
  memset(&sNC, 0, sizeof(sNC));
  sNC.pSrcList = pSelect->pSrc;
  a = pSelect->pEList->a;
  for(i=0, pCol=pTab->aCol; i<pTab->nCol; i++, pCol++){
    const char *zType;
    int n, m;
    p = a[i].pExpr;
    zType = columnType(&sNC, p, 0, 0, 0);
    /* pCol->szEst = ... // Column size est for SELECT tables never used */
    pCol->affinity = sqlite3ExprAffinity(p);
    if( zType ){
      m = sqlite3Strlen30(zType);
      n = sqlite3Strlen30(pCol->zName);
      pCol->zName = sqlite3DbReallocOrFree(db, pCol->zName, n+m+2);
      if( pCol->zName ){
        memcpy(&pCol->zName[n+1], zType, m+1);
        pCol->colFlags |= COLFLAG_HASTYPE;
      }
    }
    if( pCol->affinity<=SQLITE_AFF_NONE ) pCol->affinity = aff;
    pColl = sqlite3ExprCollSeq(pParse, p);
    if( pColl && pCol->zColl==0 ){
      pCol->zColl = sqlite3DbStrDup(db, pColl->zName);
    }
  }
  pTab->szTabRow = 1; /* Any non-zero value works */
}

// Assembly:
movq (%rdi), %rax
cmpb $0x0, 0x61(%rax)
je 0x26ee09
retq
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %r14
movq %rdi, %r12
movq %rax, 0x8(%rsp)
movl %ecx, 0x4(%rsp)
xorps %xmm0, %xmm0
leaq 0x30(%rsp), %rcx
movaps %xmm0, 0x20(%rcx)
movaps %xmm0, 0x10(%rcx)
andq $0x0, 0x30(%rcx)
movaps %xmm0, (%rcx)
movq 0x28(%rdx), %rax
movq %rax, 0x8(%rcx)
movq 0x20(%rdx), %r13
addq $0x8, %r13
movq 0x8(%rsi), %r15
addq $0x1c, %r15
xorl %ecx, %ecx
movq %rsi, 0x18(%rsp)
movq %rdi, 0x10(%rsp)
movswq 0x46(%r14), %rax
cmpq %rax, %rcx
jge 0x26ef4e
movq %rcx, 0x28(%rsp)
movq (%r13), %rbp
leaq 0x30(%rsp), %rdi
movq %rbp, %rsi
callq 0x26ef64
movq %rax, %rbx
movq %rbp, %rdi
callq 0x267d81
movb %al, -0x3(%r15)
testq %rbx, %rbx
je 0x26ef05
movq %r13, 0x20(%rsp)
movq %rbx, %rdi
callq 0x2211ac
movl %eax, %r13d
movq -0x1c(%r15), %r14
movq %r14, %rdi
callq 0x2211ac
movl %eax, %r12d
leal (%r12,%r13), %edx
addl $0x2, %edx
movq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x23a149
movq %rax, -0x1c(%r15)
testq %rax, %rax
je 0x26eef2
movl %r12d, %ecx
leaq (%rax,%rcx), %rdi
incq %rdi
incl %r13d
movq %rbx, %rsi
movq %r13, %rdx
callq 0x17630
orb $0x4, (%r15)
movb -0x3(%r15), %al
movq 0x18(%rsp), %r14
movq 0x10(%rsp), %r12
movq 0x20(%rsp), %r13
cmpb $0x40, %al
jg 0x26ef11
movl 0x4(%rsp), %eax
movb %al, -0x3(%r15)
movq %r12, %rdi
movq %rbp, %rsi
callq 0x24e541
testq %rax, %rax
je 0x26ef39
cmpq $0x0, -0xc(%r15)
jne 0x26ef39
movq (%rax), %rsi
movq 0x8(%rsp), %rdi
callq 0x22572a
movq %rax, -0xc(%r15)
movq 0x28(%rsp), %rcx
incq %rcx
addq $0x18, %r13
addq $0x20, %r15
jmp 0x26ee62
movw $0x1, 0x4c(%r14)
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq