// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movb $0x63, -0x1d(%rbp)
movq $0x0, -0x28(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x65e35
movb -0x1d(%rbp), %al
movb %al, -0x1(%rbp)
jmp 0x66009
jmp 0x65e37
movq -0x10(%rbp), %rax
cmpb $0x0, (%rax)
je 0x65f59
movl -0x1c(%rbp), %eax
shll $0x8, %eax
movq -0x10(%rbp), %rcx
movsbl (%rcx), %ecx
andl $0xff, %ecx
movslq %ecx, %rdx
leaq 0x2ffdf(%rip), %rcx     # 0x95e40
movzbl (%rcx,%rdx), %ecx
addl %ecx, %eax
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
cmpl $0x63686172, -0x1c(%rbp) # imm = 0x63686172
jne 0x65e90
movb $0x61, -0x1d(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
jmp 0x65f54
cmpl $0x636c6f62, -0x1c(%rbp) # imm = 0x636C6F62
jne 0x65ea2
movb $0x61, -0x1d(%rbp)
jmp 0x65f52
cmpl $0x74657874, -0x1c(%rbp) # imm = 0x74657874
jne 0x65eb4
movb $0x61, -0x1d(%rbp)
jmp 0x65f50
cmpl $0x626c6f62, -0x1c(%rbp) # imm = 0x626C6F62
jne 0x65ee9
movsbl -0x1d(%rbp), %eax
cmpl $0x63, %eax
je 0x65ecf
movsbl -0x1d(%rbp), %eax
cmpl $0x65, %eax
jne 0x65ee9
movb $0x62, -0x1d(%rbp)
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x28, %eax
jne 0x65ee7
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
jmp 0x65f4e
cmpl $0x7265616c, -0x1c(%rbp) # imm = 0x7265616C
jne 0x65f01
movsbl -0x1d(%rbp), %eax
cmpl $0x63, %eax
jne 0x65f01
movb $0x65, -0x1d(%rbp)
jmp 0x65f4c
cmpl $0x666c6f61, -0x1c(%rbp) # imm = 0x666C6F61
jne 0x65f19
movsbl -0x1d(%rbp), %eax
cmpl $0x63, %eax
jne 0x65f19
movb $0x65, -0x1d(%rbp)
jmp 0x65f4a
cmpl $0x646f7562, -0x1c(%rbp) # imm = 0x646F7562
jne 0x65f31
movsbl -0x1d(%rbp), %eax
cmpl $0x63, %eax
jne 0x65f31
movb $0x65, -0x1d(%rbp)
jmp 0x65f48
movl -0x1c(%rbp), %eax
andl $0xffffff, %eax         # imm = 0xFFFFFF
cmpl $0x696e74, %eax         # imm = 0x696E74
jne 0x65f46
movb $0x64, -0x1d(%rbp)
jmp 0x65f59
jmp 0x65f48
jmp 0x65f4a
jmp 0x65f4c
jmp 0x65f4e
jmp 0x65f50
jmp 0x65f52
jmp 0x65f54
jmp 0x65e37
cmpq $0x0, -0x18(%rbp)
je 0x66003
movq -0x18(%rbp), %rax
movb $0x1, (%rax)
movsbl -0x1d(%rbp), %eax
cmpl $0x62, %eax
jg 0x66001
cmpq $0x0, -0x28(%rbp)
je 0x65ff8
jmp 0x65f81
movq -0x28(%rbp), %rax
cmpb $0x0, (%rax)
je 0x65ff6
movq -0x28(%rbp), %rax
movzbl (%rax), %eax
movl %eax, %ecx
leaq 0x2fda6(%rip), %rax     # 0x95d40
movzbl (%rax,%rcx), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x65fe8
movl $0x0, -0x2c(%rbp)
movq -0x28(%rbp), %rdi
leaq -0x2c(%rbp), %rsi
callq 0x4aae0
movl -0x2c(%rbp), %eax
movl $0x4, %ecx
cltd
idivl %ecx
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
cmpl $0xff, -0x2c(%rbp)
jle 0x65fdb
movl $0xff, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movb %al, %cl
movq -0x18(%rbp), %rax
movb %cl, (%rax)
jmp 0x65ff6
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x65f81
jmp 0x65fff
movq -0x18(%rbp), %rax
movb $0x5, (%rax)
jmp 0x66001
jmp 0x66003
movb -0x1d(%rbp), %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)