// File: /workspace/github_c_makefile_star2_O2/skeeto[P]flappy/sqlite3.c
// Function: sqlite3AffinityType
SQLITE_PRIVATE char sqlite3AffinityType(const char *zIn, u8 *pszEst){
  u32 h = 0;
  char aff = SQLITE_AFF_NUMERIC;
  const char *zChar = 0;

  if( zIn==0 ) return aff;
  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_NONE;
      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 pszEst is not NULL, store an estimate of the field size.  The
  ** estimate is scaled so that the size of an integer is 1.  */
  if( pszEst ){
    *pszEst = 1;   /* default size is approx 4 bytes */
    if( aff<=SQLITE_AFF_NONE ){
      if( zChar ){
        while( zChar[0] ){
          if( sqlite3Isdigit(zChar[0]) ){
            int v = 0;
            sqlite3GetInt32(zChar, &v);
            v = v/4 + 1;
            if( v>255 ) v = 255;
            *pszEst = v; /* BLOB(k), VARCHAR(k), CHAR(k) -> r=(k/4+1) */
            break;
          }
          zChar++;
        }
      }else{
        *pszEst = 5;   /* BLOB, TEXT, CLOB -> r=5  (approx 20 bytes)*/
      }
    }
  }
  return aff;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
testq %rdi, %rdi
je 0x45771
movq %rsi, %r14
movq %rdi, %rax
movb $0x63, %bl
xorl %ecx, %ecx
leaq 0x1ace6(%rip), %rdx     # 0x60390
xorl %edi, %edi
incq %rax
movzbl %bl, %esi
movzbl -0x1(%rax), %r8d
testq %r8, %r8
je 0x45775
movl %ecx, %r9d
shll $0x8, %r9d
movzbl (%r8,%rdx), %ecx
orl %r9d, %ecx
cmpl $0x626c6f62, %ecx       # imm = 0x626C6F62
je 0x456f5
cmpl $0x63686172, %ecx       # imm = 0x63686172
je 0x45767
cmpl $0x74657874, %ecx       # imm = 0x74657874
je 0x4574b
cmpl $0x636c6f62, %ecx       # imm = 0x636C6F62
jne 0x456ff
jmp 0x4574b
cmpb $0x65, %bl
je 0x45759
cmpl $0x63, %esi
je 0x45759
cmpb $0x63, %bl
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 0x45752
movl %ecx, %r8d
andl $0xffffff, %r8d         # imm = 0xFFFFFF
incq %rax
cmpl $0x696e74, %r8d         # imm = 0x696E74
jne 0x456b2
jmp 0x4579f
movb $0x61, %bl
jmp 0x456ac
movb $0x65, %bl
jmp 0x456ac
cmpb $0x28, (%rax)
cmoveq %rax, %rdi
movb $0x62, %bl
jmp 0x456ac
movb $0x61, %bl
movq %rax, %rdi
jmp 0x456ac
movb $0x63, %bl
jmp 0x457aa
testq %r14, %r14
je 0x457aa
movb $0x1, (%r14)
cmpb $0x62, %bl
ja 0x457aa
testq %rdi, %rdi
je 0x457b6
movzbl (%rdi), %eax
testq %rax, %rax
je 0x457aa
addq $-0x3a, %rax
cmpq $-0xa, %rax
jae 0x457bc
incq %rdi
jmp 0x45788
movb $0x64, %bl
testq %r14, %r14
je 0x457aa
movb $0x1, (%r14)
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
movb $0x5, (%r14)
jmp 0x457aa
leaq 0xc(%rsp), %r15
andl $0x0, (%r15)
movq %r15, %rsi
callq 0x2fc5d
movl (%r15), %eax
pushq $0x4
popq %rcx
cltd
idivl %ecx
movl $0xfe, %ecx
cmpl %ecx, %eax
cmovll %eax, %ecx
incb %cl
movb %cl, (%r14)
jmp 0x457aa