// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movb %cl, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movb %al, -0x19(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpb $0x0, 0x61(%rax)
je 0x43b5a6
jmp 0x43b75b
leaq -0x60(%rbp), %rdi
xorl %esi, %esi
movl $0x38, %edx
callq 0x19360
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
addq $0x8, %rax
movq %rax, -0x88(%rbp)
movl $0x0, -0x74(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x68(%rbp)
movl -0x74(%rbp), %eax
movq -0x10(%rbp), %rcx
movswl 0x46(%rcx), %ecx
cmpl %ecx, %eax
jge 0x43b751
movq -0x88(%rbp), %rax
movslq -0x74(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rsi
leaq -0x60(%rbp), %rdi
callq 0x43b770
movq %rax, -0x90(%rbp)
movq -0x80(%rbp), %rdi
callq 0x42f230
movb %al, %cl
movq -0x68(%rbp), %rax
movb %cl, 0x19(%rax)
cmpq $0x0, -0x90(%rbp)
je 0x43b6e0
movq -0x90(%rbp), %rdi
callq 0x3c3400
movl %eax, -0x98(%rbp)
movq -0x68(%rbp), %rax
movq (%rax), %rdi
callq 0x3c3400
movl %eax, -0x94(%rbp)
movq -0x28(%rbp), %rdi
movq -0x68(%rbp), %rax
movq (%rax), %rsi
movl -0x94(%rbp), %eax
addl -0x98(%rbp), %eax
addl $0x2, %eax
movslq %eax, %rdx
callq 0x3ee240
movq %rax, %rcx
movq -0x68(%rbp), %rax
movq %rcx, (%rax)
movq -0x68(%rbp), %rax
cmpq $0x0, (%rax)
je 0x43b6de
movq -0x68(%rbp), %rax
movq (%rax), %rdi
movl -0x94(%rbp), %eax
addl $0x1, %eax
cltq
addq %rax, %rdi
movq -0x90(%rbp), %rsi
movl -0x98(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rdx
callq 0x19610
movq -0x68(%rbp), %rax
movzwl 0x1c(%rax), %ecx
orl $0x4, %ecx
movw %cx, 0x1c(%rax)
jmp 0x43b6e0
movq -0x68(%rbp), %rax
movsbl 0x19(%rax), %eax
cmpl $0x40, %eax
jg 0x43b6f7
movb -0x19(%rbp), %cl
movq -0x68(%rbp), %rax
movb %cl, 0x19(%rax)
movq -0x8(%rbp), %rdi
movq -0x80(%rbp), %rsi
callq 0x4124c0
movq %rax, -0x70(%rbp)
cmpq $0x0, -0x70(%rbp)
je 0x43b735
movq -0x68(%rbp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x43b735
movq -0x28(%rbp), %rdi
movq -0x70(%rbp), %rax
movq (%rax), %rsi
callq 0x3c91a0
movq %rax, %rcx
movq -0x68(%rbp), %rax
movq %rcx, 0x10(%rax)
jmp 0x43b737
movl -0x74(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x74(%rbp)
movq -0x68(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x68(%rbp)
jmp 0x43b5e8
movq -0x10(%rbp), %rax
movw $0x1, 0x4c(%rax)
addq $0xa0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)