
/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* WARNING: Unknown calling convention */

void lengthFunc(sqlite3_context *context,int argc,sqlite3_value **argv)

{
  bool bVar1;
  int iVar2;
  byte *pbVar3;
  byte bVar4;
  byte *pbVar5;
  
  iVar2 = sqlite3_value_type(*argv);
  if (iVar2 == 3) {
    pbVar3 = sqlite3_value_text(*argv);
    if (pbVar3 != (byte *)0x0) {
      pbVar5 = pbVar3;
      bVar4 = *pbVar3;
      while (bVar4 != 0) {
        pbVar3 = pbVar3 + 1;
        bVar1 = 0xbf < bVar4;
        bVar4 = *pbVar3;
        if (bVar1) {
          while ((bVar4 & 0xc0) == 0x80) {
            pbVar3 = pbVar3 + 1;
            pbVar5 = pbVar5 + 1;
            bVar4 = *pbVar3;
          }
        }
      }
      sqlite3_result_int(context,(int)pbVar3 - (int)pbVar5);
      return;
    }
  }
  else {
    if (iVar2 < 4) {
      if (iVar2 < 1) {
LAB_0003ff75:
        sqlite3_result_null(context);
        return;
      }
    }
    else if (iVar2 != 4) goto LAB_0003ff75;
    iVar2 = sqlite3_value_bytes(*argv);
    sqlite3_result_int(context,iVar2);
  }
  return;
}



/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */

void FUN_0003ff20(undefined4 param_1,undefined4 param_2,undefined4 *param_3)

{
  bool bVar1;
  int iVar2;
  undefined4 uVar3;
  byte *pbVar4;
  byte bVar5;
  byte *pbVar6;
  
  iVar2 = sqlite3_value_type(*param_3);
  if (iVar2 == 3) {
    pbVar4 = (byte *)sqlite3_value_text(*param_3);
    if (pbVar4 != (byte *)0x0) {
      pbVar6 = pbVar4;
      bVar5 = *pbVar4;
      while (bVar5 != 0) {
        pbVar4 = pbVar4 + 1;
        bVar1 = 0xbf < bVar5;
        bVar5 = *pbVar4;
        if (bVar1) {
          while ((bVar5 & 0xc0) == 0x80) {
            pbVar4 = pbVar4 + 1;
            pbVar6 = pbVar6 + 1;
            bVar5 = *pbVar4;
          }
        }
      }
      sqlite3_result_int(param_1,(int)pbVar4 - (int)pbVar6);
      return;
    }
  }
  else {
    if (iVar2 < 4) {
      if (iVar2 < 1) {
LAB_0003ff75:
        sqlite3_result_null(param_1);
        return;
      }
    }
    else if (iVar2 != 4) goto LAB_0003ff75;
    uVar3 = sqlite3_value_bytes(*param_3);
    sqlite3_result_int(param_1,uVar3);
  }
  return;
}


PUSH ESI
PUSH EBX
CALL 0x0001d810
ADD EBX,0x9e0d9
SUB ESP,0x10
MOV ESI,dword ptr [ESP + 0x24]
PUSH dword ptr [ESI]
CALL 0x00016670
ADD ESP,0x10
CMP EAX,0x3
JZ 0x0003ff90
JG 0x0003ff70
CMP EAX,0x1
JL 0x0003ff75
SUB ESP,0xc
PUSH dword ptr [ESI]
CALL 0x00016a80
POP EDX
POP ECX
PUSH EAX
PUSH dword ptr [ESP + 0x1c]
CALL 0x000165f0
ADD ESP,0x10
ADD ESP,0x4
POP EBX
POP ESI
RET
CMP EAX,0x4
JZ 0x0003ff4a
SUB ESP,0xc
PUSH dword ptr [ESP + 0x1c]
CALL 0x00016660
ADD ESP,0x10
ADD ESP,0x4
POP EBX
POP ESI
RET
SUB ESP,0xc
PUSH dword ptr [ESI]
CALL 0x00016b50
ADD ESP,0x10
TEST EAX,EAX
JZ 0x0003ff63
MOVZX EDX,byte ptr [EAX]
MOV ESI,EAX
JMP 0x0003ffbd
ADD EAX,0x1
MOVZX ECX,byte ptr [EAX]
CMP DL,0xbf
MOV EDX,ECX
JA 0x0003ffe0
TEST DL,DL
JNZ 0x0003ffb0
SUB ESP,0x8
SUB EAX,ESI
PUSH EAX
PUSH dword ptr [ESP + 0x1c]
CALL 0x000165f0
ADD ESP,0x10
ADD ESP,0x4
POP EBX
POP ESI
RET
AND EDX,0xffffffc0
CMP DL,0x80
JNZ 0x00040008
NOP
LEA ESI,[ESI]
ADD EAX,0x1
MOVZX EDX,byte ptr [EAX]
ADD ESI,0x1
MOV ECX,EDX
AND ECX,0xffffffc0
CMP CL,0x80
JZ 0x0003fff0
JMP 0x0003ffbd
MOV EDX,ECX
JMP 0x0003ffbd
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nvoid FUN_0003ff20(undefined4 param_1,undefined4 param_2,undefined4 *param_3)\n\n{\n  bool bVar1;\n  int iVar2;\n  undefined4 uVar3;\n  byte *pbVar4;\n  byte bVar5;\n  byte *pbVar6;\n  \n  iVar2 = sqlite3_value_type(*param_3);\n  if (iVar2 == 3) {\n    pbVar4 = (byte *)sqlite3_value_text(*param_3);\n    if (pbVar4 != (byte *)0x0) {\n      pbVar6 = pbVar4;\n      bVar5 = *pbVar4;\n      while (bVar5 != 0) {\n        pbVar4 = pbVar4 + 1;\n        bVar1 = 0xbf < bVar5;\n        bVar5 = *pbVar4;\n        if (bVar1) {\n          while ((bVar5 & 0xc0) == 0x80) {\n            pbVar4 = pbVar4 + 1;\n            pbVar6 = pbVar6 + 1;\n            bVar5 = *pbVar4;\n          }\n        }\n      }\n      sqlite3_result_int(param_1,(int)pbVar4 - (int)pbVar6);\n      return;\n    }\n  }\n  else {\n    if (iVar2 < 4) {\n      if (iVar2 < 1) {\nLAB_0003ff75:\n        sqlite3_result_null(param_1);\n        return;\n      }\n    }\n    else if (iVar2 != 4) goto LAB_0003ff75;\n    uVar3 = sqlite3_value_bytes(*param_3);\n    sqlite3_result_int(param_1,uVar3);\n  }\n  return;\n}\n\n" comment (function_definition "void FUN_0003ff20(undefined4 param_1,undefined4 param_2,undefined4 *param_3)\n\n{\n  bool bVar1;\n  int iVar2;\n  undefined4 uVar3;\n  byte *pbVar4;\n  byte bVar5;\n  byte *pbVar6;\n  \n  iVar2 = sqlite3_value_type(*param_3);\n  if (iVar2 == 3) {\n    pbVar4 = (byte *)sqlite3_value_text(*param_3);\n    if (pbVar4 != (byte *)0x0) {\n      pbVar6 = pbVar4;\n      bVar5 = *pbVar4;\n      while (bVar5 != 0) {\n        pbVar4 = pbVar4 + 1;\n        bVar1 = 0xbf < bVar5;\n        bVar5 = *pbVar4;\n        if (bVar1) {\n          while ((bVar5 & 0xc0) == 0x80) {\n            pbVar4 = pbVar4 + 1;\n            pbVar6 = pbVar6 + 1;\n            bVar5 = *pbVar4;\n          }\n        }\n      }\n      sqlite3_result_int(param_1,(int)pbVar4 - (int)pbVar6);\n      return;\n    }\n  }\n  else {\n    if (iVar2 < 4) {\n      if (iVar2 < 1) {\nLAB_0003ff75:\n        sqlite3_result_null(param_1);\n        return;\n      }\n    }\n    else if (iVar2 != 4) goto LAB_0003ff75;\n    uVar3 = sqlite3_value_bytes(*param_3);\n    sqlite3_result_int(param_1,uVar3);\n  }\n  return;\n}" primitive_type (function_declarator "FUN_0003ff20(undefined4 param_1,undefined4 param_2,undefined4 *param_3)" identifier (parameter_list "(undefined4 param_1,undefined4 param_2,undefined4 *param_3)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "undefined4 param_2" type_identifier identifier) , (parameter_declaration "undefined4 *param_3" type_identifier (pointer_declarator "*param_3" * identifier)) ))) (compound_statement "{\n  bool bVar1;\n  int iVar2;\n  undefined4 uVar3;\n  byte *pbVar4;\n  byte bVar5;\n  byte *pbVar6;\n  \n  iVar2 = sqlite3_value_type(*param_3);\n  if (iVar2 == 3) {\n    pbVar4 = (byte *)sqlite3_value_text(*param_3);\n    if (pbVar4 != (byte *)0x0) {\n      pbVar6 = pbVar4;\n      bVar5 = *pbVar4;\n      while (bVar5 != 0) {\n        pbVar4 = pbVar4 + 1;\n        bVar1 = 0xbf < bVar5;\n        bVar5 = *pbVar4;\n        if (bVar1) {\n          while ((bVar5 & 0xc0) == 0x80) {\n            pbVar4 = pbVar4 + 1;\n            pbVar6 = pbVar6 + 1;\n            bVar5 = *pbVar4;\n          }\n        }\n      }\n      sqlite3_result_int(param_1,(int)pbVar4 - (int)pbVar6);\n      return;\n    }\n  }\n  else {\n    if (iVar2 < 4) {\n      if (iVar2 < 1) {\nLAB_0003ff75:\n        sqlite3_result_null(param_1);\n        return;\n      }\n    }\n    else if (iVar2 != 4) goto LAB_0003ff75;\n    uVar3 = sqlite3_value_bytes(*param_3);\n    sqlite3_result_int(param_1,uVar3);\n  }\n  return;\n}" { (declaration "bool bVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "undefined4 uVar3;" type_identifier identifier ;) (declaration "byte *pbVar4;" type_identifier (pointer_declarator "*pbVar4" * identifier) ;) (declaration "byte bVar5;" type_identifier identifier ;) (declaration "byte *pbVar6;" type_identifier (pointer_declarator "*pbVar6" * identifier) ;) (expression_statement "iVar2 = sqlite3_value_type(*param_3);" (assignment_expression "iVar2 = sqlite3_value_type(*param_3)" identifier = (call_expression "sqlite3_value_type(*param_3)" identifier (argument_list "(*param_3)" ( (pointer_expression "*param_3" * identifier) )))) ;) (if_statement "if (iVar2 == 3) {\n    pbVar4 = (byte *)sqlite3_value_text(*param_3);\n    if (pbVar4 != (byte *)0x0) {\n      pbVar6 = pbVar4;\n      bVar5 = *pbVar4;\n      while (bVar5 != 0) {\n        pbVar4 = pbVar4 + 1;\n        bVar1 = 0xbf < bVar5;\n        bVar5 = *pbVar4;\n        if (bVar1) {\n          while ((bVar5 & 0xc0) == 0x80) {\n            pbVar4 = pbVar4 + 1;\n            pbVar6 = pbVar6 + 1;\n            bVar5 = *pbVar4;\n          }\n        }\n      }\n      sqlite3_result_int(param_1,(int)pbVar4 - (int)pbVar6);\n      return;\n    }\n  }\n  else {\n    if (iVar2 < 4) {\n      if (iVar2 < 1) {\nLAB_0003ff75:\n        sqlite3_result_null(param_1);\n        return;\n      }\n    }\n    else if (iVar2 != 4) goto LAB_0003ff75;\n    uVar3 = sqlite3_value_bytes(*param_3);\n    sqlite3_result_int(param_1,uVar3);\n  }" if (parenthesized_expression "(iVar2 == 3)" ( (binary_expression "iVar2 == 3" identifier == number_literal) )) (compound_statement "{\n    pbVar4 = (byte *)sqlite3_value_text(*param_3);\n    if (pbVar4 != (byte *)0x0) {\n      pbVar6 = pbVar4;\n      bVar5 = *pbVar4;\n      while (bVar5 != 0) {\n        pbVar4 = pbVar4 + 1;\n        bVar1 = 0xbf < bVar5;\n        bVar5 = *pbVar4;\n        if (bVar1) {\n          while ((bVar5 & 0xc0) == 0x80) {\n            pbVar4 = pbVar4 + 1;\n            pbVar6 = pbVar6 + 1;\n            bVar5 = *pbVar4;\n          }\n        }\n      }\n      sqlite3_result_int(param_1,(int)pbVar4 - (int)pbVar6);\n      return;\n    }\n  }" { (expression_statement "pbVar4 = (byte *)sqlite3_value_text(*param_3);" (assignment_expression "pbVar4 = (byte *)sqlite3_value_text(*param_3)" identifier = (cast_expression "(byte *)sqlite3_value_text(*param_3)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "sqlite3_value_text(*param_3)" identifier (argument_list "(*param_3)" ( (pointer_expression "*param_3" * identifier) ))))) ;) (if_statement "if (pbVar4 != (byte *)0x0) {\n      pbVar6 = pbVar4;\n      bVar5 = *pbVar4;\n      while (bVar5 != 0) {\n        pbVar4 = pbVar4 + 1;\n        bVar1 = 0xbf < bVar5;\n        bVar5 = *pbVar4;\n        if (bVar1) {\n          while ((bVar5 & 0xc0) == 0x80) {\n            pbVar4 = pbVar4 + 1;\n            pbVar6 = pbVar6 + 1;\n            bVar5 = *pbVar4;\n          }\n        }\n      }\n      sqlite3_result_int(param_1,(int)pbVar4 - (int)pbVar6);\n      return;\n    }" if (parenthesized_expression "(pbVar4 != (byte *)0x0)" ( (binary_expression "pbVar4 != (byte *)0x0" identifier != (cast_expression "(byte *)0x0" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      pbVar6 = pbVar4;\n      bVar5 = *pbVar4;\n      while (bVar5 != 0) {\n        pbVar4 = pbVar4 + 1;\n        bVar1 = 0xbf < bVar5;\n        bVar5 = *pbVar4;\n        if (bVar1) {\n          while ((bVar5 & 0xc0) == 0x80) {\n            pbVar4 = pbVar4 + 1;\n            pbVar6 = pbVar6 + 1;\n            bVar5 = *pbVar4;\n          }\n        }\n      }\n      sqlite3_result_int(param_1,(int)pbVar4 - (int)pbVar6);\n      return;\n    }" { (expression_statement "pbVar6 = pbVar4;" (assignment_expression "pbVar6 = pbVar4" identifier = identifier) ;) (expression_statement "bVar5 = *pbVar4;" (assignment_expression "bVar5 = *pbVar4" identifier = (pointer_expression "*pbVar4" * identifier)) ;) (while_statement "while (bVar5 != 0) {\n        pbVar4 = pbVar4 + 1;\n        bVar1 = 0xbf < bVar5;\n        bVar5 = *pbVar4;\n        if (bVar1) {\n          while ((bVar5 & 0xc0) == 0x80) {\n            pbVar4 = pbVar4 + 1;\n            pbVar6 = pbVar6 + 1;\n            bVar5 = *pbVar4;\n          }\n        }\n      }" while (parenthesized_expression "(bVar5 != 0)" ( (binary_expression "bVar5 != 0" identifier != number_literal) )) (compound_statement "{\n        pbVar4 = pbVar4 + 1;\n        bVar1 = 0xbf < bVar5;\n        bVar5 = *pbVar4;\n        if (bVar1) {\n          while ((bVar5 & 0xc0) == 0x80) {\n            pbVar4 = pbVar4 + 1;\n            pbVar6 = pbVar6 + 1;\n            bVar5 = *pbVar4;\n          }\n        }\n      }" { (expression_statement "pbVar4 = pbVar4 + 1;" (assignment_expression "pbVar4 = pbVar4 + 1" identifier = (binary_expression "pbVar4 + 1" identifier + number_literal)) ;) (expression_statement "bVar1 = 0xbf < bVar5;" (assignment_expression "bVar1 = 0xbf < bVar5" identifier = (binary_expression "0xbf < bVar5" number_literal < identifier)) ;) (expression_statement "bVar5 = *pbVar4;" (assignment_expression "bVar5 = *pbVar4" identifier = (pointer_expression "*pbVar4" * identifier)) ;) (if_statement "if (bVar1) {\n          while ((bVar5 & 0xc0) == 0x80) {\n            pbVar4 = pbVar4 + 1;\n            pbVar6 = pbVar6 + 1;\n            bVar5 = *pbVar4;\n          }\n        }" if (parenthesized_expression "(bVar1)" ( identifier )) (compound_statement "{\n          while ((bVar5 & 0xc0) == 0x80) {\n            pbVar4 = pbVar4 + 1;\n            pbVar6 = pbVar6 + 1;\n            bVar5 = *pbVar4;\n          }\n        }" { (while_statement "while ((bVar5 & 0xc0) == 0x80) {\n            pbVar4 = pbVar4 + 1;\n            pbVar6 = pbVar6 + 1;\n            bVar5 = *pbVar4;\n          }" while (parenthesized_expression "((bVar5 & 0xc0) == 0x80)" ( (binary_expression "(bVar5 & 0xc0) == 0x80" (parenthesized_expression "(bVar5 & 0xc0)" ( (binary_expression "bVar5 & 0xc0" identifier & number_literal) )) == number_literal) )) (compound_statement "{\n            pbVar4 = pbVar4 + 1;\n            pbVar6 = pbVar6 + 1;\n            bVar5 = *pbVar4;\n          }" { (expression_statement "pbVar4 = pbVar4 + 1;" (assignment_expression "pbVar4 = pbVar4 + 1" identifier = (binary_expression "pbVar4 + 1" identifier + number_literal)) ;) (expression_statement "pbVar6 = pbVar6 + 1;" (assignment_expression "pbVar6 = pbVar6 + 1" identifier = (binary_expression "pbVar6 + 1" identifier + number_literal)) ;) (expression_statement "bVar5 = *pbVar4;" (assignment_expression "bVar5 = *pbVar4" identifier = (pointer_expression "*pbVar4" * identifier)) ;) })) })) })) (expression_statement "sqlite3_result_int(param_1,(int)pbVar4 - (int)pbVar6);" (call_expression "sqlite3_result_int(param_1,(int)pbVar4 - (int)pbVar6)" identifier (argument_list "(param_1,(int)pbVar4 - (int)pbVar6)" ( identifier , (binary_expression "(int)pbVar4 - (int)pbVar6" (cast_expression "(int)pbVar4" ( (type_descriptor "int" primitive_type) ) identifier) - (cast_expression "(int)pbVar6" ( (type_descriptor "int" primitive_type) ) identifier)) ))) ;) (return_statement "return;" return ;) })) }) (else_clause "else {\n    if (iVar2 < 4) {\n      if (iVar2 < 1) {\nLAB_0003ff75:\n        sqlite3_result_null(param_1);\n        return;\n      }\n    }\n    else if (iVar2 != 4) goto LAB_0003ff75;\n    uVar3 = sqlite3_value_bytes(*param_3);\n    sqlite3_result_int(param_1,uVar3);\n  }" else (compound_statement "{\n    if (iVar2 < 4) {\n      if (iVar2 < 1) {\nLAB_0003ff75:\n        sqlite3_result_null(param_1);\n        return;\n      }\n    }\n    else if (iVar2 != 4) goto LAB_0003ff75;\n    uVar3 = sqlite3_value_bytes(*param_3);\n    sqlite3_result_int(param_1,uVar3);\n  }" { (if_statement "if (iVar2 < 4) {\n      if (iVar2 < 1) {\nLAB_0003ff75:\n        sqlite3_result_null(param_1);\n        return;\n      }\n    }\n    else if (iVar2 != 4) goto LAB_0003ff75;" if (parenthesized_expression "(iVar2 < 4)" ( (binary_expression "iVar2 < 4" identifier < number_literal) )) (compound_statement "{\n      if (iVar2 < 1) {\nLAB_0003ff75:\n        sqlite3_result_null(param_1);\n        return;\n      }\n    }" { (if_statement "if (iVar2 < 1) {\nLAB_0003ff75:\n        sqlite3_result_null(param_1);\n        return;\n      }" if (parenthesized_expression "(iVar2 < 1)" ( (binary_expression "iVar2 < 1" identifier < number_literal) )) (compound_statement "{\nLAB_0003ff75:\n        sqlite3_result_null(param_1);\n        return;\n      }" { (labeled_statement "LAB_0003ff75:\n        sqlite3_result_null(param_1);" statement_identifier : (expression_statement "sqlite3_result_null(param_1);" (call_expression "sqlite3_result_null(param_1)" identifier (argument_list "(param_1)" ( identifier ))) ;)) (return_statement "return;" return ;) })) }) (else_clause "else if (iVar2 != 4) goto LAB_0003ff75;" else (if_statement "if (iVar2 != 4) goto LAB_0003ff75;" if (parenthesized_expression "(iVar2 != 4)" ( (binary_expression "iVar2 != 4" identifier != number_literal) )) (goto_statement "goto LAB_0003ff75;" goto statement_identifier ;)))) (expression_statement "uVar3 = sqlite3_value_bytes(*param_3);" (assignment_expression "uVar3 = sqlite3_value_bytes(*param_3)" identifier = (call_expression "sqlite3_value_bytes(*param_3)" identifier (argument_list "(*param_3)" ( (pointer_expression "*param_3" * identifier) )))) ;) (expression_statement "sqlite3_result_int(param_1,uVar3);" (call_expression "sqlite3_result_int(param_1,uVar3)" identifier (argument_list "(param_1,uVar3)" ( identifier , identifier ))) ;) }))) (return_statement "return;" return ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention */\n\nvoid lengthFunc(sqlite3_context *context,int argc,sqlite3_value **argv)\n\n{\n  bool bVar1;\n  int iVar2;\n  byte *pbVar3;\n  byte bVar4;\n  byte *pbVar5;\n  \n  iVar2 = sqlite3_value_type(*argv);\n  if (iVar2 == 3) {\n    pbVar3 = sqlite3_value_text(*argv);\n    if (pbVar3 != (byte *)0x0) {\n      pbVar5 = pbVar3;\n      bVar4 = *pbVar3;\n      while (bVar4 != 0) {\n        pbVar3 = pbVar3 + 1;\n        bVar1 = 0xbf < bVar4;\n        bVar4 = *pbVar3;\n        if (bVar1) {\n          while ((bVar4 & 0xc0) == 0x80) {\n            pbVar3 = pbVar3 + 1;\n            pbVar5 = pbVar5 + 1;\n            bVar4 = *pbVar3;\n          }\n        }\n      }\n      sqlite3_result_int(context,(int)pbVar3 - (int)pbVar5);\n      return;\n    }\n  }\n  else {\n    if (iVar2 < 4) {\n      if (iVar2 < 1) {\nLAB_0003ff75:\n        sqlite3_result_null(context);\n        return;\n      }\n    }\n    else if (iVar2 != 4) goto LAB_0003ff75;\n    iVar2 = sqlite3_value_bytes(*argv);\n    sqlite3_result_int(context,iVar2);\n  }\n  return;\n}\n\n" comment comment (function_definition "void lengthFunc(sqlite3_context *context,int argc,sqlite3_value **argv)\n\n{\n  bool bVar1;\n  int iVar2;\n  byte *pbVar3;\n  byte bVar4;\n  byte *pbVar5;\n  \n  iVar2 = sqlite3_value_type(*argv);\n  if (iVar2 == 3) {\n    pbVar3 = sqlite3_value_text(*argv);\n    if (pbVar3 != (byte *)0x0) {\n      pbVar5 = pbVar3;\n      bVar4 = *pbVar3;\n      while (bVar4 != 0) {\n        pbVar3 = pbVar3 + 1;\n        bVar1 = 0xbf < bVar4;\n        bVar4 = *pbVar3;\n        if (bVar1) {\n          while ((bVar4 & 0xc0) == 0x80) {\n            pbVar3 = pbVar3 + 1;\n            pbVar5 = pbVar5 + 1;\n            bVar4 = *pbVar3;\n          }\n        }\n      }\n      sqlite3_result_int(context,(int)pbVar3 - (int)pbVar5);\n      return;\n    }\n  }\n  else {\n    if (iVar2 < 4) {\n      if (iVar2 < 1) {\nLAB_0003ff75:\n        sqlite3_result_null(context);\n        return;\n      }\n    }\n    else if (iVar2 != 4) goto LAB_0003ff75;\n    iVar2 = sqlite3_value_bytes(*argv);\n    sqlite3_result_int(context,iVar2);\n  }\n  return;\n}" primitive_type (function_declarator "lengthFunc(sqlite3_context *context,int argc,sqlite3_value **argv)" identifier (parameter_list "(sqlite3_context *context,int argc,sqlite3_value **argv)" ( (parameter_declaration "sqlite3_context *context" type_identifier (pointer_declarator "*context" * identifier)) , (parameter_declaration "int argc" primitive_type identifier) , (parameter_declaration "sqlite3_value **argv" type_identifier (pointer_declarator "**argv" * (pointer_declarator "*argv" * identifier))) ))) (compound_statement "{\n  bool bVar1;\n  int iVar2;\n  byte *pbVar3;\n  byte bVar4;\n  byte *pbVar5;\n  \n  iVar2 = sqlite3_value_type(*argv);\n  if (iVar2 == 3) {\n    pbVar3 = sqlite3_value_text(*argv);\n    if (pbVar3 != (byte *)0x0) {\n      pbVar5 = pbVar3;\n      bVar4 = *pbVar3;\n      while (bVar4 != 0) {\n        pbVar3 = pbVar3 + 1;\n        bVar1 = 0xbf < bVar4;\n        bVar4 = *pbVar3;\n        if (bVar1) {\n          while ((bVar4 & 0xc0) == 0x80) {\n            pbVar3 = pbVar3 + 1;\n            pbVar5 = pbVar5 + 1;\n            bVar4 = *pbVar3;\n          }\n        }\n      }\n      sqlite3_result_int(context,(int)pbVar3 - (int)pbVar5);\n      return;\n    }\n  }\n  else {\n    if (iVar2 < 4) {\n      if (iVar2 < 1) {\nLAB_0003ff75:\n        sqlite3_result_null(context);\n        return;\n      }\n    }\n    else if (iVar2 != 4) goto LAB_0003ff75;\n    iVar2 = sqlite3_value_bytes(*argv);\n    sqlite3_result_int(context,iVar2);\n  }\n  return;\n}" { (declaration "bool bVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "byte *pbVar3;" type_identifier (pointer_declarator "*pbVar3" * identifier) ;) (declaration "byte bVar4;" type_identifier identifier ;) (declaration "byte *pbVar5;" type_identifier (pointer_declarator "*pbVar5" * identifier) ;) (expression_statement "iVar2 = sqlite3_value_type(*argv);" (assignment_expression "iVar2 = sqlite3_value_type(*argv)" identifier = (call_expression "sqlite3_value_type(*argv)" identifier (argument_list "(*argv)" ( (pointer_expression "*argv" * identifier) )))) ;) (if_statement "if (iVar2 == 3) {\n    pbVar3 = sqlite3_value_text(*argv);\n    if (pbVar3 != (byte *)0x0) {\n      pbVar5 = pbVar3;\n      bVar4 = *pbVar3;\n      while (bVar4 != 0) {\n        pbVar3 = pbVar3 + 1;\n        bVar1 = 0xbf < bVar4;\n        bVar4 = *pbVar3;\n        if (bVar1) {\n          while ((bVar4 & 0xc0) == 0x80) {\n            pbVar3 = pbVar3 + 1;\n            pbVar5 = pbVar5 + 1;\n            bVar4 = *pbVar3;\n          }\n        }\n      }\n      sqlite3_result_int(context,(int)pbVar3 - (int)pbVar5);\n      return;\n    }\n  }\n  else {\n    if (iVar2 < 4) {\n      if (iVar2 < 1) {\nLAB_0003ff75:\n        sqlite3_result_null(context);\n        return;\n      }\n    }\n    else if (iVar2 != 4) goto LAB_0003ff75;\n    iVar2 = sqlite3_value_bytes(*argv);\n    sqlite3_result_int(context,iVar2);\n  }" if (parenthesized_expression "(iVar2 == 3)" ( (binary_expression "iVar2 == 3" identifier == number_literal) )) (compound_statement "{\n    pbVar3 = sqlite3_value_text(*argv);\n    if (pbVar3 != (byte *)0x0) {\n      pbVar5 = pbVar3;\n      bVar4 = *pbVar3;\n      while (bVar4 != 0) {\n        pbVar3 = pbVar3 + 1;\n        bVar1 = 0xbf < bVar4;\n        bVar4 = *pbVar3;\n        if (bVar1) {\n          while ((bVar4 & 0xc0) == 0x80) {\n            pbVar3 = pbVar3 + 1;\n            pbVar5 = pbVar5 + 1;\n            bVar4 = *pbVar3;\n          }\n        }\n      }\n      sqlite3_result_int(context,(int)pbVar3 - (int)pbVar5);\n      return;\n    }\n  }" { (expression_statement "pbVar3 = sqlite3_value_text(*argv);" (assignment_expression "pbVar3 = sqlite3_value_text(*argv)" identifier = (call_expression "sqlite3_value_text(*argv)" identifier (argument_list "(*argv)" ( (pointer_expression "*argv" * identifier) )))) ;) (if_statement "if (pbVar3 != (byte *)0x0) {\n      pbVar5 = pbVar3;\n      bVar4 = *pbVar3;\n      while (bVar4 != 0) {\n        pbVar3 = pbVar3 + 1;\n        bVar1 = 0xbf < bVar4;\n        bVar4 = *pbVar3;\n        if (bVar1) {\n          while ((bVar4 & 0xc0) == 0x80) {\n            pbVar3 = pbVar3 + 1;\n            pbVar5 = pbVar5 + 1;\n            bVar4 = *pbVar3;\n          }\n        }\n      }\n      sqlite3_result_int(context,(int)pbVar3 - (int)pbVar5);\n      return;\n    }" if (parenthesized_expression "(pbVar3 != (byte *)0x0)" ( (binary_expression "pbVar3 != (byte *)0x0" identifier != (cast_expression "(byte *)0x0" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      pbVar5 = pbVar3;\n      bVar4 = *pbVar3;\n      while (bVar4 != 0) {\n        pbVar3 = pbVar3 + 1;\n        bVar1 = 0xbf < bVar4;\n        bVar4 = *pbVar3;\n        if (bVar1) {\n          while ((bVar4 & 0xc0) == 0x80) {\n            pbVar3 = pbVar3 + 1;\n            pbVar5 = pbVar5 + 1;\n            bVar4 = *pbVar3;\n          }\n        }\n      }\n      sqlite3_result_int(context,(int)pbVar3 - (int)pbVar5);\n      return;\n    }" { (expression_statement "pbVar5 = pbVar3;" (assignment_expression "pbVar5 = pbVar3" identifier = identifier) ;) (expression_statement "bVar4 = *pbVar3;" (assignment_expression "bVar4 = *pbVar3" identifier = (pointer_expression "*pbVar3" * identifier)) ;) (while_statement "while (bVar4 != 0) {\n        pbVar3 = pbVar3 + 1;\n        bVar1 = 0xbf < bVar4;\n        bVar4 = *pbVar3;\n        if (bVar1) {\n          while ((bVar4 & 0xc0) == 0x80) {\n            pbVar3 = pbVar3 + 1;\n            pbVar5 = pbVar5 + 1;\n            bVar4 = *pbVar3;\n          }\n        }\n      }" while (parenthesized_expression "(bVar4 != 0)" ( (binary_expression "bVar4 != 0" identifier != number_literal) )) (compound_statement "{\n        pbVar3 = pbVar3 + 1;\n        bVar1 = 0xbf < bVar4;\n        bVar4 = *pbVar3;\n        if (bVar1) {\n          while ((bVar4 & 0xc0) == 0x80) {\n            pbVar3 = pbVar3 + 1;\n            pbVar5 = pbVar5 + 1;\n            bVar4 = *pbVar3;\n          }\n        }\n      }" { (expression_statement "pbVar3 = pbVar3 + 1;" (assignment_expression "pbVar3 = pbVar3 + 1" identifier = (binary_expression "pbVar3 + 1" identifier + number_literal)) ;) (expression_statement "bVar1 = 0xbf < bVar4;" (assignment_expression "bVar1 = 0xbf < bVar4" identifier = (binary_expression "0xbf < bVar4" number_literal < identifier)) ;) (expression_statement "bVar4 = *pbVar3;" (assignment_expression "bVar4 = *pbVar3" identifier = (pointer_expression "*pbVar3" * identifier)) ;) (if_statement "if (bVar1) {\n          while ((bVar4 & 0xc0) == 0x80) {\n            pbVar3 = pbVar3 + 1;\n            pbVar5 = pbVar5 + 1;\n            bVar4 = *pbVar3;\n          }\n        }" if (parenthesized_expression "(bVar1)" ( identifier )) (compound_statement "{\n          while ((bVar4 & 0xc0) == 0x80) {\n            pbVar3 = pbVar3 + 1;\n            pbVar5 = pbVar5 + 1;\n            bVar4 = *pbVar3;\n          }\n        }" { (while_statement "while ((bVar4 & 0xc0) == 0x80) {\n            pbVar3 = pbVar3 + 1;\n            pbVar5 = pbVar5 + 1;\n            bVar4 = *pbVar3;\n          }" while (parenthesized_expression "((bVar4 & 0xc0) == 0x80)" ( (binary_expression "(bVar4 & 0xc0) == 0x80" (parenthesized_expression "(bVar4 & 0xc0)" ( (binary_expression "bVar4 & 0xc0" identifier & number_literal) )) == number_literal) )) (compound_statement "{\n            pbVar3 = pbVar3 + 1;\n            pbVar5 = pbVar5 + 1;\n            bVar4 = *pbVar3;\n          }" { (expression_statement "pbVar3 = pbVar3 + 1;" (assignment_expression "pbVar3 = pbVar3 + 1" identifier = (binary_expression "pbVar3 + 1" identifier + number_literal)) ;) (expression_statement "pbVar5 = pbVar5 + 1;" (assignment_expression "pbVar5 = pbVar5 + 1" identifier = (binary_expression "pbVar5 + 1" identifier + number_literal)) ;) (expression_statement "bVar4 = *pbVar3;" (assignment_expression "bVar4 = *pbVar3" identifier = (pointer_expression "*pbVar3" * identifier)) ;) })) })) })) (expression_statement "sqlite3_result_int(context,(int)pbVar3 - (int)pbVar5);" (call_expression "sqlite3_result_int(context,(int)pbVar3 - (int)pbVar5)" identifier (argument_list "(context,(int)pbVar3 - (int)pbVar5)" ( identifier , (binary_expression "(int)pbVar3 - (int)pbVar5" (cast_expression "(int)pbVar3" ( (type_descriptor "int" primitive_type) ) identifier) - (cast_expression "(int)pbVar5" ( (type_descriptor "int" primitive_type) ) identifier)) ))) ;) (return_statement "return;" return ;) })) }) (else_clause "else {\n    if (iVar2 < 4) {\n      if (iVar2 < 1) {\nLAB_0003ff75:\n        sqlite3_result_null(context);\n        return;\n      }\n    }\n    else if (iVar2 != 4) goto LAB_0003ff75;\n    iVar2 = sqlite3_value_bytes(*argv);\n    sqlite3_result_int(context,iVar2);\n  }" else (compound_statement "{\n    if (iVar2 < 4) {\n      if (iVar2 < 1) {\nLAB_0003ff75:\n        sqlite3_result_null(context);\n        return;\n      }\n    }\n    else if (iVar2 != 4) goto LAB_0003ff75;\n    iVar2 = sqlite3_value_bytes(*argv);\n    sqlite3_result_int(context,iVar2);\n  }" { (if_statement "if (iVar2 < 4) {\n      if (iVar2 < 1) {\nLAB_0003ff75:\n        sqlite3_result_null(context);\n        return;\n      }\n    }\n    else if (iVar2 != 4) goto LAB_0003ff75;" if (parenthesized_expression "(iVar2 < 4)" ( (binary_expression "iVar2 < 4" identifier < number_literal) )) (compound_statement "{\n      if (iVar2 < 1) {\nLAB_0003ff75:\n        sqlite3_result_null(context);\n        return;\n      }\n    }" { (if_statement "if (iVar2 < 1) {\nLAB_0003ff75:\n        sqlite3_result_null(context);\n        return;\n      }" if (parenthesized_expression "(iVar2 < 1)" ( (binary_expression "iVar2 < 1" identifier < number_literal) )) (compound_statement "{\nLAB_0003ff75:\n        sqlite3_result_null(context);\n        return;\n      }" { (labeled_statement "LAB_0003ff75:\n        sqlite3_result_null(context);" statement_identifier : (expression_statement "sqlite3_result_null(context);" (call_expression "sqlite3_result_null(context)" identifier (argument_list "(context)" ( identifier ))) ;)) (return_statement "return;" return ;) })) }) (else_clause "else if (iVar2 != 4) goto LAB_0003ff75;" else (if_statement "if (iVar2 != 4) goto LAB_0003ff75;" if (parenthesized_expression "(iVar2 != 4)" ( (binary_expression "iVar2 != 4" identifier != number_literal) )) (goto_statement "goto LAB_0003ff75;" goto statement_identifier ;)))) (expression_statement "iVar2 = sqlite3_value_bytes(*argv);" (assignment_expression "iVar2 = sqlite3_value_bytes(*argv)" identifier = (call_expression "sqlite3_value_bytes(*argv)" identifier (argument_list "(*argv)" ( (pointer_expression "*argv" * identifier) )))) ;) (expression_statement "sqlite3_result_int(context,iVar2);" (call_expression "sqlite3_result_int(context,iVar2)" identifier (argument_list "(context,iVar2)" ( identifier , identifier ))) ;) }))) (return_statement "return;" return ;) })))
(translation_unit "void FUN_0003ff20(undefined4 param_1,undefined4 param_2,undefined4 *param_3)\n\n{\n  bool bVar1;\n  int iVar2;\n  undefined4 uVar3;\n  byte *pbVar4;\n  byte bVar5;\n  byte *pbVar6;\n  \n  iVar2 = sqlite3_value_type(*param_3);\n  if (iVar2 == 3) {\n    pbVar4 = (byte *)sqlite3_value_text(*param_3);\n    if (pbVar4 != (byte *)0x0) {\n      pbVar6 = pbVar4;\n      bVar5 = *pbVar4;\n      while (bVar5 != 0) {\n        pbVar4 = pbVar4 + 1;\n        bVar1 = 0xbf < bVar5;\n        bVar5 = *pbVar4;\n        if (bVar1) {\n          while ((bVar5 & 0xc0) == 0x80) {\n            pbVar4 = pbVar4 + 1;\n            pbVar6 = pbVar6 + 1;\n            bVar5 = *pbVar4;\n          }\n        }\n      }\n      sqlite3_result_int(param_1,(int)pbVar4 - (int)pbVar6);\n      return;\n    }\n  }\n  else {\n    if (iVar2 < 4) {\n      if (iVar2 < 1) {\nLAB_0003ff75:\n        sqlite3_result_null(param_1);\n        return;\n      }\n    }\n    else if (iVar2 != 4) goto LAB_0003ff75;\n    uVar3 = sqlite3_value_bytes(*param_3);\n    sqlite3_result_int(param_1,uVar3);\n  }\n  return;\n}\n\n" (function_definition "void FUN_0003ff20(undefined4 param_1,undefined4 param_2,undefined4 *param_3)\n\n{\n  bool bVar1;\n  int iVar2;\n  undefined4 uVar3;\n  byte *pbVar4;\n  byte bVar5;\n  byte *pbVar6;\n  \n  iVar2 = sqlite3_value_type(*param_3);\n  if (iVar2 == 3) {\n    pbVar4 = (byte *)sqlite3_value_text(*param_3);\n    if (pbVar4 != (byte *)0x0) {\n      pbVar6 = pbVar4;\n      bVar5 = *pbVar4;\n      while (bVar5 != 0) {\n        pbVar4 = pbVar4 + 1;\n        bVar1 = 0xbf < bVar5;\n        bVar5 = *pbVar4;\n        if (bVar1) {\n          while ((bVar5 & 0xc0) == 0x80) {\n            pbVar4 = pbVar4 + 1;\n            pbVar6 = pbVar6 + 1;\n            bVar5 = *pbVar4;\n          }\n        }\n      }\n      sqlite3_result_int(param_1,(int)pbVar4 - (int)pbVar6);\n      return;\n    }\n  }\n  else {\n    if (iVar2 < 4) {\n      if (iVar2 < 1) {\nLAB_0003ff75:\n        sqlite3_result_null(param_1);\n        return;\n      }\n    }\n    else if (iVar2 != 4) goto LAB_0003ff75;\n    uVar3 = sqlite3_value_bytes(*param_3);\n    sqlite3_result_int(param_1,uVar3);\n  }\n  return;\n}" primitive_type (function_declarator "FUN_0003ff20(undefined4 param_1,undefined4 param_2,undefined4 *param_3)" identifier (parameter_list "(undefined4 param_1,undefined4 param_2,undefined4 *param_3)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "undefined4 param_2" type_identifier identifier) , (parameter_declaration "undefined4 *param_3" type_identifier (pointer_declarator "*param_3" * identifier)) ))) (compound_statement "{\n  bool bVar1;\n  int iVar2;\n  undefined4 uVar3;\n  byte *pbVar4;\n  byte bVar5;\n  byte *pbVar6;\n  \n  iVar2 = sqlite3_value_type(*param_3);\n  if (iVar2 == 3) {\n    pbVar4 = (byte *)sqlite3_value_text(*param_3);\n    if (pbVar4 != (byte *)0x0) {\n      pbVar6 = pbVar4;\n      bVar5 = *pbVar4;\n      while (bVar5 != 0) {\n        pbVar4 = pbVar4 + 1;\n        bVar1 = 0xbf < bVar5;\n        bVar5 = *pbVar4;\n        if (bVar1) {\n          while ((bVar5 & 0xc0) == 0x80) {\n            pbVar4 = pbVar4 + 1;\n            pbVar6 = pbVar6 + 1;\n            bVar5 = *pbVar4;\n          }\n        }\n      }\n      sqlite3_result_int(param_1,(int)pbVar4 - (int)pbVar6);\n      return;\n    }\n  }\n  else {\n    if (iVar2 < 4) {\n      if (iVar2 < 1) {\nLAB_0003ff75:\n        sqlite3_result_null(param_1);\n        return;\n      }\n    }\n    else if (iVar2 != 4) goto LAB_0003ff75;\n    uVar3 = sqlite3_value_bytes(*param_3);\n    sqlite3_result_int(param_1,uVar3);\n  }\n  return;\n}" { (declaration "bool bVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "undefined4 uVar3;" type_identifier identifier ;) (declaration "byte *pbVar4;" type_identifier (pointer_declarator "*pbVar4" * identifier) ;) (declaration "byte bVar5;" type_identifier identifier ;) (declaration "byte *pbVar6;" type_identifier (pointer_declarator "*pbVar6" * identifier) ;) (expression_statement "iVar2 = sqlite3_value_type(*param_3);" (assignment_expression "iVar2 = sqlite3_value_type(*param_3)" identifier = (call_expression "sqlite3_value_type(*param_3)" identifier (argument_list "(*param_3)" ( (pointer_expression "*param_3" * identifier) )))) ;) (if_statement "if (iVar2 == 3) {\n    pbVar4 = (byte *)sqlite3_value_text(*param_3);\n    if (pbVar4 != (byte *)0x0) {\n      pbVar6 = pbVar4;\n      bVar5 = *pbVar4;\n      while (bVar5 != 0) {\n        pbVar4 = pbVar4 + 1;\n        bVar1 = 0xbf < bVar5;\n        bVar5 = *pbVar4;\n        if (bVar1) {\n          while ((bVar5 & 0xc0) == 0x80) {\n            pbVar4 = pbVar4 + 1;\n            pbVar6 = pbVar6 + 1;\n            bVar5 = *pbVar4;\n          }\n        }\n      }\n      sqlite3_result_int(param_1,(int)pbVar4 - (int)pbVar6);\n      return;\n    }\n  }\n  else {\n    if (iVar2 < 4) {\n      if (iVar2 < 1) {\nLAB_0003ff75:\n        sqlite3_result_null(param_1);\n        return;\n      }\n    }\n    else if (iVar2 != 4) goto LAB_0003ff75;\n    uVar3 = sqlite3_value_bytes(*param_3);\n    sqlite3_result_int(param_1,uVar3);\n  }" if (parenthesized_expression "(iVar2 == 3)" ( (binary_expression "iVar2 == 3" identifier == number_literal) )) (compound_statement "{\n    pbVar4 = (byte *)sqlite3_value_text(*param_3);\n    if (pbVar4 != (byte *)0x0) {\n      pbVar6 = pbVar4;\n      bVar5 = *pbVar4;\n      while (bVar5 != 0) {\n        pbVar4 = pbVar4 + 1;\n        bVar1 = 0xbf < bVar5;\n        bVar5 = *pbVar4;\n        if (bVar1) {\n          while ((bVar5 & 0xc0) == 0x80) {\n            pbVar4 = pbVar4 + 1;\n            pbVar6 = pbVar6 + 1;\n            bVar5 = *pbVar4;\n          }\n        }\n      }\n      sqlite3_result_int(param_1,(int)pbVar4 - (int)pbVar6);\n      return;\n    }\n  }" { (expression_statement "pbVar4 = (byte *)sqlite3_value_text(*param_3);" (assignment_expression "pbVar4 = (byte *)sqlite3_value_text(*param_3)" identifier = (cast_expression "(byte *)sqlite3_value_text(*param_3)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "sqlite3_value_text(*param_3)" identifier (argument_list "(*param_3)" ( (pointer_expression "*param_3" * identifier) ))))) ;) (if_statement "if (pbVar4 != (byte *)0x0) {\n      pbVar6 = pbVar4;\n      bVar5 = *pbVar4;\n      while (bVar5 != 0) {\n        pbVar4 = pbVar4 + 1;\n        bVar1 = 0xbf < bVar5;\n        bVar5 = *pbVar4;\n        if (bVar1) {\n          while ((bVar5 & 0xc0) == 0x80) {\n            pbVar4 = pbVar4 + 1;\n            pbVar6 = pbVar6 + 1;\n            bVar5 = *pbVar4;\n          }\n        }\n      }\n      sqlite3_result_int(param_1,(int)pbVar4 - (int)pbVar6);\n      return;\n    }" if (parenthesized_expression "(pbVar4 != (byte *)0x0)" ( (binary_expression "pbVar4 != (byte *)0x0" identifier != (cast_expression "(byte *)0x0" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      pbVar6 = pbVar4;\n      bVar5 = *pbVar4;\n      while (bVar5 != 0) {\n        pbVar4 = pbVar4 + 1;\n        bVar1 = 0xbf < bVar5;\n        bVar5 = *pbVar4;\n        if (bVar1) {\n          while ((bVar5 & 0xc0) == 0x80) {\n            pbVar4 = pbVar4 + 1;\n            pbVar6 = pbVar6 + 1;\n            bVar5 = *pbVar4;\n          }\n        }\n      }\n      sqlite3_result_int(param_1,(int)pbVar4 - (int)pbVar6);\n      return;\n    }" { (expression_statement "pbVar6 = pbVar4;" (assignment_expression "pbVar6 = pbVar4" identifier = identifier) ;) (expression_statement "bVar5 = *pbVar4;" (assignment_expression "bVar5 = *pbVar4" identifier = (pointer_expression "*pbVar4" * identifier)) ;) (while_statement "while (bVar5 != 0) {\n        pbVar4 = pbVar4 + 1;\n        bVar1 = 0xbf < bVar5;\n        bVar5 = *pbVar4;\n        if (bVar1) {\n          while ((bVar5 & 0xc0) == 0x80) {\n            pbVar4 = pbVar4 + 1;\n            pbVar6 = pbVar6 + 1;\n            bVar5 = *pbVar4;\n          }\n        }\n      }" while (parenthesized_expression "(bVar5 != 0)" ( (binary_expression "bVar5 != 0" identifier != number_literal) )) (compound_statement "{\n        pbVar4 = pbVar4 + 1;\n        bVar1 = 0xbf < bVar5;\n        bVar5 = *pbVar4;\n        if (bVar1) {\n          while ((bVar5 & 0xc0) == 0x80) {\n            pbVar4 = pbVar4 + 1;\n            pbVar6 = pbVar6 + 1;\n            bVar5 = *pbVar4;\n          }\n        }\n      }" { (expression_statement "pbVar4 = pbVar4 + 1;" (assignment_expression "pbVar4 = pbVar4 + 1" identifier = (binary_expression "pbVar4 + 1" identifier + number_literal)) ;) (expression_statement "bVar1 = 0xbf < bVar5;" (assignment_expression "bVar1 = 0xbf < bVar5" identifier = (binary_expression "0xbf < bVar5" number_literal < identifier)) ;) (expression_statement "bVar5 = *pbVar4;" (assignment_expression "bVar5 = *pbVar4" identifier = (pointer_expression "*pbVar4" * identifier)) ;) (if_statement "if (bVar1) {\n          while ((bVar5 & 0xc0) == 0x80) {\n            pbVar4 = pbVar4 + 1;\n            pbVar6 = pbVar6 + 1;\n            bVar5 = *pbVar4;\n          }\n        }" if (parenthesized_expression "(bVar1)" ( identifier )) (compound_statement "{\n          while ((bVar5 & 0xc0) == 0x80) {\n            pbVar4 = pbVar4 + 1;\n            pbVar6 = pbVar6 + 1;\n            bVar5 = *pbVar4;\n          }\n        }" { (while_statement "while ((bVar5 & 0xc0) == 0x80) {\n            pbVar4 = pbVar4 + 1;\n            pbVar6 = pbVar6 + 1;\n            bVar5 = *pbVar4;\n          }" while (parenthesized_expression "((bVar5 & 0xc0) == 0x80)" ( (binary_expression "(bVar5 & 0xc0) == 0x80" (parenthesized_expression "(bVar5 & 0xc0)" ( (binary_expression "bVar5 & 0xc0" identifier & number_literal) )) == number_literal) )) (compound_statement "{\n            pbVar4 = pbVar4 + 1;\n            pbVar6 = pbVar6 + 1;\n            bVar5 = *pbVar4;\n          }" { (expression_statement "pbVar4 = pbVar4 + 1;" (assignment_expression "pbVar4 = pbVar4 + 1" identifier = (binary_expression "pbVar4 + 1" identifier + number_literal)) ;) (expression_statement "pbVar6 = pbVar6 + 1;" (assignment_expression "pbVar6 = pbVar6 + 1" identifier = (binary_expression "pbVar6 + 1" identifier + number_literal)) ;) (expression_statement "bVar5 = *pbVar4;" (assignment_expression "bVar5 = *pbVar4" identifier = (pointer_expression "*pbVar4" * identifier)) ;) })) })) })) (expression_statement "sqlite3_result_int(param_1,(int)pbVar4 - (int)pbVar6);" (call_expression "sqlite3_result_int(param_1,(int)pbVar4 - (int)pbVar6)" identifier (argument_list "(param_1,(int)pbVar4 - (int)pbVar6)" ( identifier , (binary_expression "(int)pbVar4 - (int)pbVar6" (cast_expression "(int)pbVar4" ( (type_descriptor "int" primitive_type) ) identifier) - (cast_expression "(int)pbVar6" ( (type_descriptor "int" primitive_type) ) identifier)) ))) ;) (return_statement "return;" return ;) })) }) (else_clause "else {\n    if (iVar2 < 4) {\n      if (iVar2 < 1) {\nLAB_0003ff75:\n        sqlite3_result_null(param_1);\n        return;\n      }\n    }\n    else if (iVar2 != 4) goto LAB_0003ff75;\n    uVar3 = sqlite3_value_bytes(*param_3);\n    sqlite3_result_int(param_1,uVar3);\n  }" else (compound_statement "{\n    if (iVar2 < 4) {\n      if (iVar2 < 1) {\nLAB_0003ff75:\n        sqlite3_result_null(param_1);\n        return;\n      }\n    }\n    else if (iVar2 != 4) goto LAB_0003ff75;\n    uVar3 = sqlite3_value_bytes(*param_3);\n    sqlite3_result_int(param_1,uVar3);\n  }" { (if_statement "if (iVar2 < 4) {\n      if (iVar2 < 1) {\nLAB_0003ff75:\n        sqlite3_result_null(param_1);\n        return;\n      }\n    }\n    else if (iVar2 != 4) goto LAB_0003ff75;" if (parenthesized_expression "(iVar2 < 4)" ( (binary_expression "iVar2 < 4" identifier < number_literal) )) (compound_statement "{\n      if (iVar2 < 1) {\nLAB_0003ff75:\n        sqlite3_result_null(param_1);\n        return;\n      }\n    }" { (if_statement "if (iVar2 < 1) {\nLAB_0003ff75:\n        sqlite3_result_null(param_1);\n        return;\n      }" if (parenthesized_expression "(iVar2 < 1)" ( (binary_expression "iVar2 < 1" identifier < number_literal) )) (compound_statement "{\nLAB_0003ff75:\n        sqlite3_result_null(param_1);\n        return;\n      }" { (labeled_statement "LAB_0003ff75:\n        sqlite3_result_null(param_1);" statement_identifier : (expression_statement "sqlite3_result_null(param_1);" (call_expression "sqlite3_result_null(param_1)" identifier (argument_list "(param_1)" ( identifier ))) ;)) (return_statement "return;" return ;) })) }) (else_clause "else if (iVar2 != 4) goto LAB_0003ff75;" else (if_statement "if (iVar2 != 4) goto LAB_0003ff75;" if (parenthesized_expression "(iVar2 != 4)" ( (binary_expression "iVar2 != 4" identifier != number_literal) )) (goto_statement "goto LAB_0003ff75;" goto statement_identifier ;)))) (expression_statement "uVar3 = sqlite3_value_bytes(*param_3);" (assignment_expression "uVar3 = sqlite3_value_bytes(*param_3)" identifier = (call_expression "sqlite3_value_bytes(*param_3)" identifier (argument_list "(*param_3)" ( (pointer_expression "*param_3" * identifier) )))) ;) (expression_statement "sqlite3_result_int(param_1,uVar3);" (call_expression "sqlite3_result_int(param_1,uVar3)" identifier (argument_list "(param_1,uVar3)" ( identifier , identifier ))) ;) }))) (return_statement "return;" return ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE (pointer_declarator * IDENT)) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (pointer_expression * IDENT) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( (pointer_expression * IDENT) ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (while_statement while (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression LIT < IDENT)) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (if_statement if (parenthesized_expression ( IDENT )) (compound_statement { (while_statement while (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT & LIT) )) == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) })) })) })) (expression_statement (call_expression IDENT (argument_list ( IDENT , (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) - (cast_expression ( (type_descriptor TYPE) ) IDENT)) ))) ;) (return_statement return ;) })) }) (else_clause else (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (labeled_statement statement_identifier : (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;)) (return_statement return ;) })) }) (else_clause else (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (goto_statement goto statement_identifier ;)))) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (pointer_expression * IDENT) )))) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT ))) ;) }))) (return_statement return ;) })))
(function_definition "void FUN_0003ff20(undefined4 param_1,undefined4 param_2,undefined4 *param_3)\n\n{\n  bool bVar1;\n  int iVar2;\n  undefined4 uVar3;\n  byte *pbVar4;\n  byte bVar5;\n  byte *pbVar6;\n  \n  iVar2 = sqlite3_value_type(*param_3);\n  if (iVar2 == 3) {\n    pbVar4 = (byte *)sqlite3_value_text(*param_3);\n    if (pbVar4 != (byte *)0x0) {\n      pbVar6 = pbVar4;\n      bVar5 = *pbVar4;\n      while (bVar5 != 0) {\n        pbVar4 = pbVar4 + 1;\n        bVar1 = 0xbf < bVar5;\n        bVar5 = *pbVar4;\n        if (bVar1) {\n          while ((bVar5 & 0xc0) == 0x80) {\n            pbVar4 = pbVar4 + 1;\n            pbVar6 = pbVar6 + 1;\n            bVar5 = *pbVar4;\n          }\n        }\n      }\n      sqlite3_result_int(param_1,(int)pbVar4 - (int)pbVar6);\n      return;\n    }\n  }\n  else {\n    if (iVar2 < 4) {\n      if (iVar2 < 1) {\nLAB_0003ff75:\n        sqlite3_result_null(param_1);\n        return;\n      }\n    }\n    else if (iVar2 != 4) goto LAB_0003ff75;\n    uVar3 = sqlite3_value_bytes(*param_3);\n    sqlite3_result_int(param_1,uVar3);\n  }\n  return;\n}" (primitive_type "void") (function_declarator "FUN_0003ff20(undefined4 param_1,undefined4 param_2,undefined4 *param_3)" (identifier "FUN_0003ff20") (parameter_list "(undefined4 param_1,undefined4 param_2,undefined4 *param_3)" (( "(") (parameter_declaration "undefined4 param_1" (type_identifier "undefined4") (identifier "param_1")) (, ",") (parameter_declaration "undefined4 param_2" (type_identifier "undefined4") (identifier "param_2")) (, ",") (parameter_declaration "undefined4 *param_3" (type_identifier "undefined4") (pointer_declarator "*param_3" (* "*") (identifier "param_3"))) () ")"))) (compound_statement "{\n  bool bVar1;\n  int iVar2;\n  undefined4 uVar3;\n  byte *pbVar4;\n  byte bVar5;\n  byte *pbVar6;\n  \n  iVar2 = sqlite3_value_type(*param_3);\n  if (iVar2 == 3) {\n    pbVar4 = (byte *)sqlite3_value_text(*param_3);\n    if (pbVar4 != (byte *)0x0) {\n      pbVar6 = pbVar4;\n      bVar5 = *pbVar4;\n      while (bVar5 != 0) {\n        pbVar4 = pbVar4 + 1;\n        bVar1 = 0xbf < bVar5;\n        bVar5 = *pbVar4;\n        if (bVar1) {\n          while ((bVar5 & 0xc0) == 0x80) {\n            pbVar4 = pbVar4 + 1;\n            pbVar6 = pbVar6 + 1;\n            bVar5 = *pbVar4;\n          }\n        }\n      }\n      sqlite3_result_int(param_1,(int)pbVar4 - (int)pbVar6);\n      return;\n    }\n  }\n  else {\n    if (iVar2 < 4) {\n      if (iVar2 < 1) {\nLAB_0003ff75:\n        sqlite3_result_null(param_1);\n        return;\n      }\n    }\n    else if (iVar2 != 4) goto LAB_0003ff75;\n    uVar3 = sqlite3_value_bytes(*param_3);\n    sqlite3_result_int(param_1,uVar3);\n  }\n  return;\n}" ({ "{") (declaration "bool bVar1;" (primitive_type "bool") (identifier "bVar1") (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "undefined4 uVar3;" (type_identifier "undefined4") (identifier "uVar3") (; ";")) (declaration "byte *pbVar4;" (type_identifier "byte") (pointer_declarator "*pbVar4" (* "*") (identifier "pbVar4")) (; ";")) (declaration "byte bVar5;" (type_identifier "byte") (identifier "bVar5") (; ";")) (declaration "byte *pbVar6;" (type_identifier "byte") (pointer_declarator "*pbVar6" (* "*") (identifier "pbVar6")) (; ";")) (expression_statement "iVar2 = sqlite3_value_type(*param_3);" (assignment_expression "iVar2 = sqlite3_value_type(*param_3)" (identifier "iVar2") (= "=") (call_expression "sqlite3_value_type(*param_3)" (identifier "sqlite3_value_type") (argument_list "(*param_3)" (( "(") (pointer_expression "*param_3" (* "*") (identifier "param_3")) () ")")))) (; ";")) (if_statement "if (iVar2 == 3) {\n    pbVar4 = (byte *)sqlite3_value_text(*param_3);\n    if (pbVar4 != (byte *)0x0) {\n      pbVar6 = pbVar4;\n      bVar5 = *pbVar4;\n      while (bVar5 != 0) {\n        pbVar4 = pbVar4 + 1;\n        bVar1 = 0xbf < bVar5;\n        bVar5 = *pbVar4;\n        if (bVar1) {\n          while ((bVar5 & 0xc0) == 0x80) {\n            pbVar4 = pbVar4 + 1;\n            pbVar6 = pbVar6 + 1;\n            bVar5 = *pbVar4;\n          }\n        }\n      }\n      sqlite3_result_int(param_1,(int)pbVar4 - (int)pbVar6);\n      return;\n    }\n  }\n  else {\n    if (iVar2 < 4) {\n      if (iVar2 < 1) {\nLAB_0003ff75:\n        sqlite3_result_null(param_1);\n        return;\n      }\n    }\n    else if (iVar2 != 4) goto LAB_0003ff75;\n    uVar3 = sqlite3_value_bytes(*param_3);\n    sqlite3_result_int(param_1,uVar3);\n  }" (if "if") (parenthesized_expression "(iVar2 == 3)" (( "(") (binary_expression "iVar2 == 3" (identifier "iVar2") (== "==") (number_literal "3")) () ")")) (compound_statement "{\n    pbVar4 = (byte *)sqlite3_value_text(*param_3);\n    if (pbVar4 != (byte *)0x0) {\n      pbVar6 = pbVar4;\n      bVar5 = *pbVar4;\n      while (bVar5 != 0) {\n        pbVar4 = pbVar4 + 1;\n        bVar1 = 0xbf < bVar5;\n        bVar5 = *pbVar4;\n        if (bVar1) {\n          while ((bVar5 & 0xc0) == 0x80) {\n            pbVar4 = pbVar4 + 1;\n            pbVar6 = pbVar6 + 1;\n            bVar5 = *pbVar4;\n          }\n        }\n      }\n      sqlite3_result_int(param_1,(int)pbVar4 - (int)pbVar6);\n      return;\n    }\n  }" ({ "{") (expression_statement "pbVar4 = (byte *)sqlite3_value_text(*param_3);" (assignment_expression "pbVar4 = (byte *)sqlite3_value_text(*param_3)" (identifier "pbVar4") (= "=") (cast_expression "(byte *)sqlite3_value_text(*param_3)" (( "(") (type_descriptor "byte *" (type_identifier "byte") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "sqlite3_value_text(*param_3)" (identifier "sqlite3_value_text") (argument_list "(*param_3)" (( "(") (pointer_expression "*param_3" (* "*") (identifier "param_3")) () ")"))))) (; ";")) (if_statement "if (pbVar4 != (byte *)0x0) {\n      pbVar6 = pbVar4;\n      bVar5 = *pbVar4;\n      while (bVar5 != 0) {\n        pbVar4 = pbVar4 + 1;\n        bVar1 = 0xbf < bVar5;\n        bVar5 = *pbVar4;\n        if (bVar1) {\n          while ((bVar5 & 0xc0) == 0x80) {\n            pbVar4 = pbVar4 + 1;\n            pbVar6 = pbVar6 + 1;\n            bVar5 = *pbVar4;\n          }\n        }\n      }\n      sqlite3_result_int(param_1,(int)pbVar4 - (int)pbVar6);\n      return;\n    }" (if "if") (parenthesized_expression "(pbVar4 != (byte *)0x0)" (( "(") (binary_expression "pbVar4 != (byte *)0x0" (identifier "pbVar4") (!= "!=") (cast_expression "(byte *)0x0" (( "(") (type_descriptor "byte *" (type_identifier "byte") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n      pbVar6 = pbVar4;\n      bVar5 = *pbVar4;\n      while (bVar5 != 0) {\n        pbVar4 = pbVar4 + 1;\n        bVar1 = 0xbf < bVar5;\n        bVar5 = *pbVar4;\n        if (bVar1) {\n          while ((bVar5 & 0xc0) == 0x80) {\n            pbVar4 = pbVar4 + 1;\n            pbVar6 = pbVar6 + 1;\n            bVar5 = *pbVar4;\n          }\n        }\n      }\n      sqlite3_result_int(param_1,(int)pbVar4 - (int)pbVar6);\n      return;\n    }" ({ "{") (expression_statement "pbVar6 = pbVar4;" (assignment_expression "pbVar6 = pbVar4" (identifier "pbVar6") (= "=") (identifier "pbVar4")) (; ";")) (expression_statement "bVar5 = *pbVar4;" (assignment_expression "bVar5 = *pbVar4" (identifier "bVar5") (= "=") (pointer_expression "*pbVar4" (* "*") (identifier "pbVar4"))) (; ";")) (while_statement "while (bVar5 != 0) {\n        pbVar4 = pbVar4 + 1;\n        bVar1 = 0xbf < bVar5;\n        bVar5 = *pbVar4;\n        if (bVar1) {\n          while ((bVar5 & 0xc0) == 0x80) {\n            pbVar4 = pbVar4 + 1;\n            pbVar6 = pbVar6 + 1;\n            bVar5 = *pbVar4;\n          }\n        }\n      }" (while "while") (parenthesized_expression "(bVar5 != 0)" (( "(") (binary_expression "bVar5 != 0" (identifier "bVar5") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n        pbVar4 = pbVar4 + 1;\n        bVar1 = 0xbf < bVar5;\n        bVar5 = *pbVar4;\n        if (bVar1) {\n          while ((bVar5 & 0xc0) == 0x80) {\n            pbVar4 = pbVar4 + 1;\n            pbVar6 = pbVar6 + 1;\n            bVar5 = *pbVar4;\n          }\n        }\n      }" ({ "{") (expression_statement "pbVar4 = pbVar4 + 1;" (assignment_expression "pbVar4 = pbVar4 + 1" (identifier "pbVar4") (= "=") (binary_expression "pbVar4 + 1" (identifier "pbVar4") (+ "+") (number_literal "1"))) (; ";")) (expression_statement "bVar1 = 0xbf < bVar5;" (assignment_expression "bVar1 = 0xbf < bVar5" (identifier "bVar1") (= "=") (binary_expression "0xbf < bVar5" (number_literal "0xbf") (< "<") (identifier "bVar5"))) (; ";")) (expression_statement "bVar5 = *pbVar4;" (assignment_expression "bVar5 = *pbVar4" (identifier "bVar5") (= "=") (pointer_expression "*pbVar4" (* "*") (identifier "pbVar4"))) (; ";")) (if_statement "if (bVar1) {\n          while ((bVar5 & 0xc0) == 0x80) {\n            pbVar4 = pbVar4 + 1;\n            pbVar6 = pbVar6 + 1;\n            bVar5 = *pbVar4;\n          }\n        }" (if "if") (parenthesized_expression "(bVar1)" (( "(") (identifier "bVar1") () ")")) (compound_statement "{\n          while ((bVar5 & 0xc0) == 0x80) {\n            pbVar4 = pbVar4 + 1;\n            pbVar6 = pbVar6 + 1;\n            bVar5 = *pbVar4;\n          }\n        }" ({ "{") (while_statement "while ((bVar5 & 0xc0) == 0x80) {\n            pbVar4 = pbVar4 + 1;\n            pbVar6 = pbVar6 + 1;\n            bVar5 = *pbVar4;\n          }" (while "while") (parenthesized_expression "((bVar5 & 0xc0) == 0x80)" (( "(") (binary_expression "(bVar5 & 0xc0) == 0x80" (parenthesized_expression "(bVar5 & 0xc0)" (( "(") (binary_expression "bVar5 & 0xc0" (identifier "bVar5") (& "&") (number_literal "0xc0")) () ")")) (== "==") (number_literal "0x80")) () ")")) (compound_statement "{\n            pbVar4 = pbVar4 + 1;\n            pbVar6 = pbVar6 + 1;\n            bVar5 = *pbVar4;\n          }" ({ "{") (expression_statement "pbVar4 = pbVar4 + 1;" (assignment_expression "pbVar4 = pbVar4 + 1" (identifier "pbVar4") (= "=") (binary_expression "pbVar4 + 1" (identifier "pbVar4") (+ "+") (number_literal "1"))) (; ";")) (expression_statement "pbVar6 = pbVar6 + 1;" (assignment_expression "pbVar6 = pbVar6 + 1" (identifier "pbVar6") (= "=") (binary_expression "pbVar6 + 1" (identifier "pbVar6") (+ "+") (number_literal "1"))) (; ";")) (expression_statement "bVar5 = *pbVar4;" (assignment_expression "bVar5 = *pbVar4" (identifier "bVar5") (= "=") (pointer_expression "*pbVar4" (* "*") (identifier "pbVar4"))) (; ";")) (} "}"))) (} "}"))) (} "}"))) (expression_statement "sqlite3_result_int(param_1,(int)pbVar4 - (int)pbVar6);" (call_expression "sqlite3_result_int(param_1,(int)pbVar4 - (int)pbVar6)" (identifier "sqlite3_result_int") (argument_list "(param_1,(int)pbVar4 - (int)pbVar6)" (( "(") (identifier "param_1") (, ",") (binary_expression "(int)pbVar4 - (int)pbVar6" (cast_expression "(int)pbVar4" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "pbVar4")) (- "-") (cast_expression "(int)pbVar6" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "pbVar6"))) () ")"))) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}"))) (} "}")) (else_clause "else {\n    if (iVar2 < 4) {\n      if (iVar2 < 1) {\nLAB_0003ff75:\n        sqlite3_result_null(param_1);\n        return;\n      }\n    }\n    else if (iVar2 != 4) goto LAB_0003ff75;\n    uVar3 = sqlite3_value_bytes(*param_3);\n    sqlite3_result_int(param_1,uVar3);\n  }" (else "else") (compound_statement "{\n    if (iVar2 < 4) {\n      if (iVar2 < 1) {\nLAB_0003ff75:\n        sqlite3_result_null(param_1);\n        return;\n      }\n    }\n    else if (iVar2 != 4) goto LAB_0003ff75;\n    uVar3 = sqlite3_value_bytes(*param_3);\n    sqlite3_result_int(param_1,uVar3);\n  }" ({ "{") (if_statement "if (iVar2 < 4) {\n      if (iVar2 < 1) {\nLAB_0003ff75:\n        sqlite3_result_null(param_1);\n        return;\n      }\n    }\n    else if (iVar2 != 4) goto LAB_0003ff75;" (if "if") (parenthesized_expression "(iVar2 < 4)" (( "(") (binary_expression "iVar2 < 4" (identifier "iVar2") (< "<") (number_literal "4")) () ")")) (compound_statement "{\n      if (iVar2 < 1) {\nLAB_0003ff75:\n        sqlite3_result_null(param_1);\n        return;\n      }\n    }" ({ "{") (if_statement "if (iVar2 < 1) {\nLAB_0003ff75:\n        sqlite3_result_null(param_1);\n        return;\n      }" (if "if") (parenthesized_expression "(iVar2 < 1)" (( "(") (binary_expression "iVar2 < 1" (identifier "iVar2") (< "<") (number_literal "1")) () ")")) (compound_statement "{\nLAB_0003ff75:\n        sqlite3_result_null(param_1);\n        return;\n      }" ({ "{") (labeled_statement "LAB_0003ff75:\n        sqlite3_result_null(param_1);" (statement_identifier "LAB_0003ff75") (: ":") (expression_statement "sqlite3_result_null(param_1);" (call_expression "sqlite3_result_null(param_1)" (identifier "sqlite3_result_null") (argument_list "(param_1)" (( "(") (identifier "param_1") () ")"))) (; ";"))) (return_statement "return;" (return "return") (; ";")) (} "}"))) (} "}")) (else_clause "else if (iVar2 != 4) goto LAB_0003ff75;" (else "else") (if_statement "if (iVar2 != 4) goto LAB_0003ff75;" (if "if") (parenthesized_expression "(iVar2 != 4)" (( "(") (binary_expression "iVar2 != 4" (identifier "iVar2") (!= "!=") (number_literal "4")) () ")")) (goto_statement "goto LAB_0003ff75;" (goto "goto") (statement_identifier "LAB_0003ff75") (; ";"))))) (expression_statement "uVar3 = sqlite3_value_bytes(*param_3);" (assignment_expression "uVar3 = sqlite3_value_bytes(*param_3)" (identifier "uVar3") (= "=") (call_expression "sqlite3_value_bytes(*param_3)" (identifier "sqlite3_value_bytes") (argument_list "(*param_3)" (( "(") (pointer_expression "*param_3" (* "*") (identifier "param_3")) () ")")))) (; ";")) (expression_statement "sqlite3_result_int(param_1,uVar3);" (call_expression "sqlite3_result_int(param_1,uVar3)" (identifier "sqlite3_result_int") (argument_list "(param_1,uVar3)" (( "(") (identifier "param_1") (, ",") (identifier "uVar3") () ")"))) (; ";")) (} "}")))) (return_statement "return;" (return "return") (; ";")) (} "}")))

/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* WARNING: Unknown calling convention */

void function_1(type_1 *context,int argc,type_2 **argv)

{
  bool bVar1;
  int var_2;
  type_3 *var_4;
  type_3 var_5;
  type_3 *var_6;
  
  var_2 = var_1(*argv);
  if (var_2 == 3) {
    var_4 = var_3(*argv);
    if (var_4 != (type_3 *)0x0) {
      var_6 = var_4;
      var_5 = *var_4;
      while (var_5 != 0) {
        var_4 = var_4 + 1;
        bVar1 = 0xbf < var_5;
        var_5 = *var_4;
        if (bVar1) {
          while ((var_5 & 0xc0) == 0x80) {
            var_4 = var_4 + 1;
            var_6 = var_6 + 1;
            var_5 = *var_4;
          }
        }
      }
      var_7(context,(int)var_4 - (int)var_6);
      return;
    }
  }
  else {
    if (var_2 < 4) {
      if (var_2 < 1) {
LAB_0003ff75:
        var_8(context);
        return;
      }
    }
    else if (var_2 != 4) goto LAB_0003ff75;
    var_2 = var_9(*argv);
    var_7(context,var_2);
  }
  return;
}


(translation_unit (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (type_identifier) declarator: (identifier)) (parameter_declaration type: (type_identifier) declarator: (identifier)) (parameter_declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))))) body: (compound_statement (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (pointer_expression argument: (identifier)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (call_expression function: (identifier) arguments: (argument_list (pointer_expression argument: (identifier))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (number_literal)))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier)))) (while_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) body: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (number_literal) right: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier)))) (if_statement condition: (parenthesized_expression (identifier)) consequence: (compound_statement (while_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) right: (number_literal))) body: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier)))))))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (binary_expression left: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier)) right: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier)))))) (return_statement)))) alternative: (else_clause (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (labeled_statement label: (statement_identifier) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier))))) (return_statement)))) alternative: (else_clause (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (goto_statement label: (statement_identifier))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (pointer_expression argument: (identifier)))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier))))))) (return_statement))))

/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */

void MASKED(undefined4 param_1,undefined4 param_2,undefined4 *param_3)

{
  bool bVar1;
  int iVar2;
  undefined4 uVar3;
  byte *pbVar4;
  byte bVar5;
  byte *pbVar6;
  
  iVar2 = sqlite3_value_type(*param_3);
  if (iVar2 == 3) {
    pbVar4 = (byte *)sqlite3_value_text(*param_3);
    if (pbVar4 != (byte *)0x0) {
      pbVar6 = pbVar4;
      bVar5 = *pbVar4;
      while (bVar5 != 0) {
        pbVar4 = pbVar4 + 1;
        bVar1 = 0xbf < bVar5;
        bVar5 = *pbVar4;
        if (bVar1) {
          while ((bVar5 & 0xc0) == 0x80) {
            pbVar4 = pbVar4 + 1;
            pbVar6 = pbVar6 + 1;
            bVar5 = *pbVar4;
          }
        }
      }
      sqlite3_result_int(param_1,(int)pbVar4 - (int)pbVar6);
      return;
    }
  }
  else {
    if (iVar2 < 4) {
      if (iVar2 < 1) {
LAB_0003ff75:
        sqlite3_result_null(param_1);
        return;
      }
    }
    else if (iVar2 != 4) goto LAB_0003ff75;
    uVar3 = sqlite3_value_bytes(*param_3);
    sqlite3_result_int(param_1,uVar3);
  }
  return;
}

