// File: /workspace/github_c_makefile_star2_O1/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 %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
testq %rdi, %rdi
je 0x499d4
movq %rsi, %rbx
movq %rdi, %rax
movb (%rdi), %r8b
xorl %ecx, %ecx
testb %r8b, %r8b
je 0x499d9
incq %rax
movb $0x63, %sil
leaq 0x23a7d(%rip), %rdx     # 0x6d390
xorl %edi, %edi
movl %ecx, %r9d
shll $0x8, %r9d
movzbl %r8b, %ecx
movzbl (%rcx,%rdx), %ecx
orl %r9d, %ecx
cmpl $0x636c6f61, %ecx       # imm = 0x636C6F61
jg 0x49947
cmpl $0x626c6f62, %ecx       # imm = 0x626C6F62
je 0x4995c
cmpl $0x63686172, %ecx       # imm = 0x63686172
jne 0x49978
movb $0x61, %bpl
movq %rax, %rdi
jmp 0x499c1
cmpl $0x636c6f62, %ecx       # imm = 0x636C6F62
je 0x49957
cmpl $0x74657874, %ecx       # imm = 0x74657874
jne 0x49978
movb $0x61, %bpl
jmp 0x499c1
cmpb $0x65, %sil
je 0x4996c
movzbl %sil, %r8d
cmpl $0x63, %r8d
jne 0x49978
cmpb $0x28, (%rax)
cmoveq %rax, %rdi
movb $0x62, %bpl
jmp 0x499c1
cmpl $0x7265616c, %ecx       # imm = 0x7265616C
sete %r8b
cmpb $0x63, %sil
sete %r9b
cmpl $0x666c6f61, %ecx       # imm = 0x666C6F61
sete %r10b
orb %r8b, %r10b
cmpl $0x646f7562, %ecx       # imm = 0x646F7562
sete %r8b
orb %r10b, %r8b
movb $0x65, %bpl
testb %r9b, %r8b
jne 0x499c1
movl %ecx, %r8d
andl $0xffffff, %r8d         # imm = 0xFFFFFF
cmpl $0x696e74, %r8d         # imm = 0x696E74
je 0x49a11
movl %esi, %ebp
movb (%rax), %r8b
incq %rax
movl %ebp, %esi
testb %r8b, %r8b
jne 0x49915
jmp 0x499de
movb $0x63, %bpl
jmp 0x49a49
movb $0x63, %bpl
xorl %edi, %edi
testq %rbx, %rbx
je 0x49a49
movb $0x1, (%rbx)
cmpb $0x62, %bpl
jg 0x49a49
testq %rdi, %rdi
je 0x49a0c
movb (%rdi), %al
testb %al, %al
je 0x49a49
movzbl %al, %eax
addq $-0x3a, %rax
cmpq $-0xa, %rax
jae 0x49a16
movb 0x1(%rdi), %al
incq %rdi
jmp 0x499f3
movb $0x5, (%rbx)
jmp 0x49a49
movb $0x64, %bpl
jmp 0x499de
leaq 0xc(%rsp), %r14
movl $0x0, (%r14)
movq %r14, %rsi
callq 0x34d9c
movl (%r14), %eax
leal 0x3(%rax), %ecx
testl %eax, %eax
cmovnsl %eax, %ecx
sarl $0x2, %ecx
movl $0xfe, %eax
cmpl %eax, %ecx
cmovgel %eax, %ecx
incl %ecx
movl %ecx, (%r14)
movb %cl, (%rbx)
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq