// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movb $0x43, -0x15(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x8(%rbp), %rax
cmpb $0x0, (%rax)
je 0x42c165
movl -0x14(%rbp), %eax
shll $0x8, %eax
movq -0x8(%rbp), %rcx
movsbl (%rcx), %ecx
andl $0xff, %ecx
movslq %ecx, %rdx
leaq 0x17a9f3(%rip), %rcx    # 0x5a6a60
movzbl (%rcx,%rdx), %ecx
addl %ecx, %eax
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
cmpl $0x63686172, -0x14(%rbp) # imm = 0x63686172
jne 0x42c09c
movb $0x42, -0x15(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x42c160
cmpl $0x636c6f62, -0x14(%rbp) # imm = 0x636C6F62
jne 0x42c0ae
movb $0x42, -0x15(%rbp)
jmp 0x42c15e
cmpl $0x74657874, -0x14(%rbp) # imm = 0x74657874
jne 0x42c0c0
movb $0x42, -0x15(%rbp)
jmp 0x42c15c
cmpl $0x626c6f62, -0x14(%rbp) # imm = 0x626C6F62
jne 0x42c0f5
movsbl -0x15(%rbp), %eax
cmpl $0x43, %eax
je 0x42c0db
movsbl -0x15(%rbp), %eax
cmpl $0x45, %eax
jne 0x42c0f5
movb $0x41, -0x15(%rbp)
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x28, %eax
jne 0x42c0f3
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x42c15a
cmpl $0x7265616c, -0x14(%rbp) # imm = 0x7265616C
jne 0x42c10d
movsbl -0x15(%rbp), %eax
cmpl $0x43, %eax
jne 0x42c10d
movb $0x45, -0x15(%rbp)
jmp 0x42c158
cmpl $0x666c6f61, -0x14(%rbp) # imm = 0x666C6F61
jne 0x42c125
movsbl -0x15(%rbp), %eax
cmpl $0x43, %eax
jne 0x42c125
movb $0x45, -0x15(%rbp)
jmp 0x42c156
cmpl $0x646f7562, -0x14(%rbp) # imm = 0x646F7562
jne 0x42c13d
movsbl -0x15(%rbp), %eax
cmpl $0x43, %eax
jne 0x42c13d
movb $0x45, -0x15(%rbp)
jmp 0x42c154
movl -0x14(%rbp), %eax
andl $0xffffff, %eax         # imm = 0xFFFFFF
cmpl $0x696e74, %eax         # imm = 0x696E74
jne 0x42c152
movb $0x44, -0x15(%rbp)
jmp 0x42c165
jmp 0x42c154
jmp 0x42c156
jmp 0x42c158
jmp 0x42c15a
jmp 0x42c15c
jmp 0x42c15e
jmp 0x42c160
jmp 0x42c043
cmpq $0x0, -0x10(%rbp)
je 0x42c203
movl $0x0, -0x24(%rbp)
movsbl -0x15(%rbp), %eax
cmpl $0x43, %eax
jge 0x42c1d6
cmpq $0x0, -0x20(%rbp)
je 0x42c1cd
jmp 0x42c189
movq -0x20(%rbp), %rax
cmpb $0x0, (%rax)
je 0x42c1cb
movq -0x20(%rbp), %rax
movzbl (%rax), %eax
movl %eax, %ecx
leaq 0x17aa2e(%rip), %rax    # 0x5a6bd0
movzbl (%rax,%rcx), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x42c1bd
movq -0x20(%rbp), %rdi
leaq -0x24(%rbp), %rsi
callq 0x40c300
jmp 0x42c1cb
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x42c189
jmp 0x42c1d4
movl $0x10, -0x24(%rbp)
jmp 0x42c1d6
movl -0x24(%rbp), %eax
movl $0x4, %ecx
cltd
idivl %ecx
addl $0x1, %eax
movl %eax, -0x24(%rbp)
cmpl $0xff, -0x24(%rbp)
jle 0x42c1f7
movl $0xff, -0x24(%rbp)
movl -0x24(%rbp), %eax
movb %al, %cl
movq -0x10(%rbp), %rax
movb %cl, 0x1a(%rax)
movb -0x15(%rbp), %al
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)