// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: sqlite3AffinityType
SQLITE_PRIVATE char sqlite3AffinityType(const char *zIn, Column *pCol){
  u32 h = 0;
  char aff = SQLITE_AFF_NUMERIC;
  const char *zChar = 0;

  assert( zIn!=0 );
  while( zIn[0] ){
    h = (h<<8) + sqlite3UpperToLower[(*zIn)&0xff];
    zIn++;
    if( h==(('c'<<24)+('h'<<16)+('a'<<8)+'r') ){             /* CHAR */
      aff = SQLITE_AFF_TEXT;
      zChar = zIn;
    }else if( h==(('c'<<24)+('l'<<16)+('o'<<8)+'b') ){       /* CLOB */
      aff = SQLITE_AFF_TEXT;
    }else if( h==(('t'<<24)+('e'<<16)+('x'<<8)+'t') ){       /* TEXT */
      aff = SQLITE_AFF_TEXT;
    }else if( h==(('b'<<24)+('l'<<16)+('o'<<8)+'b')          /* BLOB */
        && (aff==SQLITE_AFF_NUMERIC || aff==SQLITE_AFF_REAL) ){
      aff = SQLITE_AFF_BLOB;
      if( zIn[0]=='(' ) zChar = zIn;
#ifndef SQLITE_OMIT_FLOATING_POINT
    }else if( h==(('r'<<24)+('e'<<16)+('a'<<8)+'l')          /* REAL */
        && aff==SQLITE_AFF_NUMERIC ){
      aff = SQLITE_AFF_REAL;
    }else if( h==(('f'<<24)+('l'<<16)+('o'<<8)+'a')          /* FLOA */
        && aff==SQLITE_AFF_NUMERIC ){
      aff = SQLITE_AFF_REAL;
    }else if( h==(('d'<<24)+('o'<<16)+('u'<<8)+'b')          /* DOUB */
        && aff==SQLITE_AFF_NUMERIC ){
      aff = SQLITE_AFF_REAL;
#endif
    }else if( (h&0x00FFFFFF)==(('i'<<16)+('n'<<8)+'t') ){    /* INT */
      aff = SQLITE_AFF_INTEGER;
      break;
    }
  }

  /* If pCol is not NULL, store an estimate of the field size.  The
  ** estimate is scaled so that the size of an integer is 1.  */
  if( pCol ){
    int v = 0;   /* default size is approx 4 bytes */
    if( aff<SQLITE_AFF_NUMERIC ){
      if( zChar ){
        while( zChar[0] ){
          if( sqlite3Isdigit(zChar[0]) ){
            /* BLOB(k), VARCHAR(k), CHAR(k) -> r=(k/4+1) */
            sqlite3GetInt32(zChar, &v);
            break;
          }
          zChar++;
        }
      }else{
        v = 16;   /* BLOB, TEXT, CLOB -> r=5  (approx 20 bytes)*/
      }
    }
#ifdef SQLITE_ENABLE_SORTER_REFERENCES
    if( v>=sqlite3GlobalConfig.szSorterRef ){
      pCol->colFlags |= COLFLAG_SORTERREF;
    }
#endif
    v = v/4 + 1;
    if( v>255 ) v = 255;
    pCol->szEst = v;
  }
  return aff;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %rax
movb $0x43, %bpl
xorl %ecx, %ecx
leaq 0x10b674(%rip), %rdx    # 0x3716f0
xorl %edi, %edi
incq %rax
movzbl %bpl, %esi
movzbl -0x1(%rax), %r8d
testq %r8, %r8
je 0x26614a
movl %ecx, %r9d
shll $0x8, %r9d
movzbl (%r8,%rdx), %ecx
orl %r9d, %ecx
cmpl $0x626c6f62, %ecx       # imm = 0x626C6F62
je 0x2660c8
cmpl $0x63686172, %ecx       # imm = 0x63686172
je 0x26613f
cmpl $0x74657874, %ecx       # imm = 0x74657874
je 0x266120
cmpl $0x636c6f62, %ecx       # imm = 0x636C6F62
jne 0x2660d3
jmp 0x266120
cmpb $0x45, %bpl
je 0x266130
cmpl $0x43, %esi
je 0x266130
cmpb $0x43, %bpl
sete %r8b
cmpl $0x7265616c, %ecx       # imm = 0x7265616C
sete %r9b
cmpl $0x666c6f61, %ecx       # imm = 0x666C6F61
sete %r10b
orb %r9b, %r10b
cmpl $0x646f7562, %ecx       # imm = 0x646F7562
sete %r9b
orb %r10b, %r9b
testb %r8b, %r9b
jne 0x266128
movl %ecx, %r8d
andl $0xffffff, %r8d         # imm = 0xFFFFFF
incq %rax
cmpl $0x696e74, %r8d         # imm = 0x696E74
jne 0x266085
jmp 0x266178
movb $0x42, %bpl
jmp 0x26607e
movb $0x45, %bpl
jmp 0x26607e
cmpb $0x28, (%rax)
cmoveq %rax, %rdi
movb $0x41, %bpl
jmp 0x26607e
movb $0x42, %bpl
movq %rax, %rdi
jmp 0x26607e
testq %rbx, %rbx
je 0x266191
andl $0x0, 0xc(%rsp)
xorl %eax, %eax
cmpb $0x42, %bpl
ja 0x266182
testq %rdi, %rdi
je 0x26619c
movzbl (%rdi), %ecx
testq %rcx, %rcx
je 0x266182
addq $-0x3a, %rcx
cmpq $-0xa, %rcx
jae 0x2661a1
incq %rdi
jmp 0x266161
movb $0x44, %bpl
testq %rbx, %rbx
je 0x266191
xorl %eax, %eax
movl $0xfe, %ecx
cmpl %ecx, %eax
cmovll %eax, %ecx
incb %cl
movb %cl, 0x1a(%rbx)
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
pushq $0x4
popq %rax
jmp 0x266182
leaq 0xc(%rsp), %r14
movq %r14, %rsi
callq 0x24b4cc
movl (%r14), %eax
pushq $0x4
popq %rcx
cltd
idivl %ecx
jmp 0x266182