// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
cmpb $0x0, 0x200(%rax)
je 0x70180
jmp 0x70478
movq -0x8(%rbp), %rax
movzbl 0x1c(%rax), %eax
cmpl $0x0, %eax
jne 0x701a1
cmpq $0x0, -0x20(%rbp)
je 0x701a1
movq -0x30(%rbp), %rax
movzbl 0x50(%rax), %eax
cmpl $0x0, %eax
je 0x701a6
jmp 0x70478
movq -0x8(%rbp), %rax
movb $0x1, 0x1c(%rax)
movq -0x30(%rbp), %rax
movl 0x2c(%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x34(%rbp)
movq -0x30(%rbp), %rax
movl 0x2c(%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x38(%rbp)
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rax
movl (%rax), %esi
callq 0x4bf60
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x70467
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x24(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0x70229
jmp 0x70459
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x24(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
cmpq $0x0, 0x8(%rax)
je 0x7027c
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x24(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x20(%rbp), %rdi
movl -0x24(%rbp), %esi
movq -0x48(%rbp), %rcx
xorl %edx, %edx
movq $-0x1, %r8
callq 0x4c030
jmp 0x70457
movq -0x40(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x98, %eax
je 0x7029c
movq -0x40(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x9a, %eax
jne 0x70409
cmpq $0x0, -0x10(%rbp)
je 0x70409
movq -0x40(%rbp), %rax
movswl 0x30(%rax), %eax
movl %eax, -0x5c(%rbp)
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
movq -0x10(%rbp), %rcx
movzbl (%rcx), %ecx
cmpl %ecx, %eax
jge 0x702f5
movq -0x10(%rbp), %rax
addq $0x8, %rax
movslq -0x28(%rbp), %rcx
imulq $0x68, %rcx, %rcx
addq %rcx, %rax
movl 0x3c(%rax), %eax
movq -0x40(%rbp), %rcx
cmpl 0x2c(%rcx), %eax
jne 0x702e8
jmp 0x702f5
jmp 0x702ea
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x702b9
movq -0x10(%rbp), %rax
addq $0x8, %rax
movslq -0x28(%rbp), %rcx
imulq $0x68, %rcx, %rcx
addq %rcx, %rax
movq 0x20(%rax), %rax
movq %rax, -0x50(%rbp)
cmpl $0x0, -0x5c(%rbp)
jge 0x70321
movq -0x50(%rbp), %rax
movswl 0x40(%rax), %eax
movl %eax, -0x5c(%rbp)
cmpl $0x0, -0x5c(%rbp)
jge 0x70334
leaq 0x3e742(%rip), %rax     # 0xaea70
movq %rax, -0x58(%rbp)
jmp 0x7034e
movq -0x50(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x5c(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, -0x58(%rbp)
cmpl $0x0, -0x38(%rbp)
jne 0x703a2
cmpl $0x0, -0x34(%rbp)
jne 0x703a2
movq -0x20(%rbp), %rax
movq %rax, -0x78(%rbp)
movl -0x24(%rbp), %eax
movl %eax, -0x6c(%rbp)
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x24(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rsi
callq 0x11720
movq -0x78(%rbp), %rdi
movl -0x6c(%rbp), %esi
movq %rax, %rcx
xorl %edx, %edx
leaq -0x66a0b(%rip), %r8     # 0x9990
callq 0x4c030
jmp 0x70407
cmpl $0x0, -0x34(%rbp)
je 0x703ec
movq $0x0, -0x68(%rbp)
movq -0x30(%rbp), %rdi
movq -0x50(%rbp), %rax
movq (%rax), %rdx
movq -0x58(%rbp), %rcx
leaq 0x3f144(%rip), %rsi     # 0xaf50a
movb $0x0, %al
callq 0x137f0
movq %rax, -0x68(%rbp)
movq -0x20(%rbp), %rdi
movl -0x24(%rbp), %esi
movq -0x68(%rbp), %rcx
xorl %edx, %edx
leaq -0x66a55(%rip), %r8     # 0x9990
callq 0x4c030
jmp 0x70405
movq -0x20(%rbp), %rdi
movl -0x24(%rbp), %esi
movq -0x58(%rbp), %rcx
xorl %edx, %edx
movq $-0x1, %r8
callq 0x4c030
jmp 0x70407
jmp 0x70455
movq -0x20(%rbp), %rax
movq %rax, -0x88(%rbp)
movl -0x24(%rbp), %eax
movl %eax, -0x7c(%rbp)
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x24(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rsi
callq 0x11720
movq -0x88(%rbp), %rdi
movl -0x7c(%rbp), %esi
movq %rax, %rcx
xorl %edx, %edx
leaq -0x66ac0(%rip), %r8     # 0x9990
callq 0x4c030
jmp 0x70457
jmp 0x70459
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x701f4
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x7c430
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)