// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: generateColumnNames
static void generateColumnNames(
  Parse *pParse,      /* Parser context */
  SrcList *pTabList,  /* List of tables */
  ExprList *pEList    /* Expressions defining the result set */
){
  Vdbe *v = pParse->pVdbe;
  int i, j;
  sqlite3 *db = pParse->db;
  int fullNames, shortNames;

#ifndef SQLITE_OMIT_EXPLAIN
  /* If this is an EXPLAIN, skip this step */
  if( pParse->explain ){
    return;
  }
#endif

  if( pParse->colNamesSet || NEVER(v==0) || db->mallocFailed ) return;
  pParse->colNamesSet = 1;
  fullNames = (db->flags & SQLITE_FullColNames)!=0;
  shortNames = (db->flags & SQLITE_ShortColNames)!=0;
  sqlite3VdbeSetNumCols(v, pEList->nExpr);
  for(i=0; i<pEList->nExpr; i++){
    Expr *p;
    p = pEList->a[i].pExpr;
    if( NEVER(p==0) ) continue;
    if( pEList->a[i].zName ){
      char *zName = pEList->a[i].zName;
      sqlite3VdbeSetColName(v, i, COLNAME_NAME, zName, SQLITE_TRANSIENT);
    }else if( (p->op==TK_COLUMN || p->op==TK_AGG_COLUMN) && pTabList ){
      Table *pTab;
      char *zCol;
      int iCol = p->iColumn;
      for(j=0; ALWAYS(j<pTabList->nSrc); j++){
        if( pTabList->a[j].iCursor==p->iTable ) break;
      }
      assert( j<pTabList->nSrc );
      pTab = pTabList->a[j].pTab;
      if( iCol<0 ) iCol = pTab->iPKey;
      assert( iCol==-1 || (iCol>=0 && iCol<pTab->nCol) );
      if( iCol<0 ){
        zCol = "rowid";
      }else{
        zCol = pTab->aCol[iCol].zName;
      }
      if( !shortNames && !fullNames ){
        sqlite3VdbeSetColName(v, i, COLNAME_NAME, 
            sqlite3DbStrDup(db, pEList->a[i].zSpan), SQLITE_DYNAMIC);
      }else if( fullNames ){
        char *zName = 0;
        zName = sqlite3MPrintf(db, "%s.%s", pTab->zName, zCol);
        sqlite3VdbeSetColName(v, i, COLNAME_NAME, zName, SQLITE_DYNAMIC);
      }else{
        sqlite3VdbeSetColName(v, i, COLNAME_NAME, zCol, SQLITE_TRANSIENT);
      }
    }else{
      sqlite3VdbeSetColName(v, i, COLNAME_NAME, 
          sqlite3DbStrDup(db, pEList->a[i].zSpan), SQLITE_DYNAMIC);
    }
  }
  generateColumnTypes(pParse, pTabList, pEList);
}

// Assembly:
cmpb $0x0, 0x200(%rdi)
je 0x55e12
retq
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdi, %r14
movq 0x10(%rdi), %r12
cmpb $0x0, 0x1c(%rdi)
setne %al
testq %r12, %r12
sete %cl
orb %al, %cl
jne 0x56072
movq (%r14), %r13
cmpb $0x0, 0x50(%r13)
jne 0x56072
movq %rdx, %rbx
movq %rsi, %r15
movb $0x1, 0x1c(%r14)
movl 0x2c(%r13), %eax
movl %eax, -0x34(%rbp)
movl (%rdx), %esi
movq %r12, %rdi
callq 0x36e69
cmpl $0x0, (%rbx)
jle 0x55ff7
movq %r13, -0x30(%rbp)
leaq 0x8(%r15), %rax
movq %rax, -0x48(%rbp)
leaq 0x44(%r15), %rax
movq %rax, -0x40(%rbp)
xorl %r13d, %r13d
movq 0x8(%rbx), %rax
movq %r13, %rdx
shlq $0x5, %rdx
movq (%rax,%rdx), %rcx
testq %rcx, %rcx
je 0x55fe1
leaq (%rax,%rdx), %rsi
movq 0x8(%rsi), %rsi
testq %rsi, %rsi
je 0x55edb
movq (%r12), %rax
cmpb $0x0, 0x50(%rax)
jne 0x55fe1
imulq $0x38, %r13, %rdi
addq 0x20(%r12), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x1, %ecx
movq $-0x1, %r8
jmp 0x55fdc
movb (%rcx), %sil
cmpb $-0x68, %sil
jne 0x55eee
testq %r15, %r15
jne 0x55f01
jmp 0x55f90
testq %r15, %r15
je 0x55f90
cmpb $-0x66, %sil
jne 0x55f90
movzbl (%r15), %esi
testq %rsi, %rsi
je 0x55f2c
movl 0x2c(%rcx), %r8d
movq -0x40(%rbp), %r9
xorl %edi, %edi
cmpl %r8d, (%r9)
je 0x55f28
incq %rdi
addq $0x68, %r9
cmpq %rdi, %rsi
jne 0x55f14
movq %rsi, %rdi
movl %edi, %esi
jmp 0x55f2e
xorl %esi, %esi
movzwl 0x30(%rcx), %edi
imulq $0x68, %rsi, %rcx
movq -0x48(%rbp), %rsi
movq 0x20(%rsi,%rcx), %rsi
testw %di, %di
jns 0x55f48
movzwl 0x40(%rsi), %edi
leaq 0x24025(%rip), %rcx     # 0x79f74
testw %di, %di
js 0x55f66
movzwl %di, %ecx
movq 0x8(%rsi), %rdi
leaq (%rcx,%rcx,2), %rcx
shll $0x4, %ecx
movq (%rdi,%rcx), %rcx
movl -0x34(%rbp), %edi
testb $0x60, %dil
je 0x55f90
testb $0x20, %dil
jne 0x55fa0
movq (%r12), %rax
cmpb $0x0, 0x50(%rax)
jne 0x55fe1
imulq $0x38, %r13, %rdi
addq 0x20(%r12), %rdi
movq %rcx, %rsi
jmp 0x55ec5
movq 0x10(%rax,%rdx), %rsi
movq -0x30(%rbp), %rdi
callq 0x1010d
jmp 0x55fb5
movq (%rsi), %rdx
movq -0x30(%rbp), %rdi
leaq 0x24a60(%rip), %rsi     # 0x7aa0e
xorl %eax, %eax
callq 0x117e2
movq (%r12), %rcx
cmpb $0x0, 0x50(%rcx)
jne 0x55fe1
imulq $0x38, %r13, %rdi
addq 0x20(%r12), %rdi
movq %rax, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x1, %ecx
leaq -0x4c708(%rip), %r8     # 0x98d4
callq 0xeff4
incq %r13
movslq (%rbx), %rax
cmpq %rax, %r13
jl 0x55e89
testl %eax, %eax
setg %al
jmp 0x55ff9
xorl %eax, %eax
movq 0x10(%r14), %r12
movq %r15, -0x78(%rbp)
movq %r14, -0x80(%rbp)
testb %al, %al
je 0x56072
xorl %r15d, %r15d
xorl %r13d, %r13d
xorl %r14d, %r14d
movq 0x8(%rbx), %rax
movq (%rax,%r15), %rsi
leaq -0x80(%rbp), %rdi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x4adf9
movq (%r12), %rcx
cmpb $0x0, 0x50(%rcx)
jne 0x5605f
movzwl 0x48(%r12), %ecx
imulq $0x38, %rcx, %rdi
addq 0x20(%r12), %rdi
addq %r13, %rdi
movq %rax, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x1, %ecx
movq $-0x1, %r8
callq 0xeff4
incq %r14
movslq (%rbx), %rax
addq $0x38, %r13
addq $0x20, %r15
cmpq %rax, %r14
jl 0x56012
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq