
int utf8_mbsnlen(char *src,size_t srclen,int maxlen)

{
  byte bVar1;
  int iVar2;
  int iVar3;
  long lVar4;
  
  bVar1 = *src;
  if ((-1 < maxlen) && (bVar1 != 0)) {
    lVar4 = 1;
    iVar2 = 0;
    do {
      iVar2 = iVar2 + (uint)((bVar1 & 0xc0) != 0x80);
      bVar1 = src[lVar4];
      iVar3 = (int)lVar4;
      lVar4 = lVar4 + 1;
    } while (iVar3 <= maxlen && bVar1 != 0);
    return iVar2;
  }
  return 0;
}



int utf8_mbsnlen(byte *param_1,undefined8 param_2,int param_3)

{
  byte bVar1;
  int iVar2;
  int iVar3;
  long lVar4;
  
  bVar1 = *param_1;
  if ((-1 < param_3) && (bVar1 != 0)) {
    lVar4 = 1;
    iVar2 = 0;
    do {
      iVar2 = iVar2 + (uint)((bVar1 & 0xc0) != 0x80);
      bVar1 = param_1[lVar4];
      iVar3 = (int)lVar4;
      lVar4 = lVar4 + 1;
    } while (iVar3 <= param_3 && bVar1 != 0);
    return iVar2;
  }
  return 0;
}


MOVZX ECX,byte ptr [RDI]
TEST EDX,EDX
JS 0x001ae12f
TEST CL,CL
JZ 0x001ae12f
MOV ESI,0x1
MOV EAX,0x0
AND ECX,0xc0
CMP ECX,0x80
SETNZ CL
MOVZX ECX,CL
ADD EAX,ECX
MOVZX ECX,byte ptr [RDI + RSI*0x1]
CMP EDX,ESI
SETGE R9B
TEST CL,CL
SETNZ R8B
ADD RSI,0x1
TEST R9B,R8B
JNZ 0x001ae101
RET
MOV EAX,0x0
RET
(translation_unit "int utf8_mbsnlen(byte *param_1,undefined8 param_2,int param_3)\n\n{\n  byte bVar1;\n  int iVar2;\n  int iVar3;\n  long lVar4;\n  \n  bVar1 = *param_1;\n  if ((-1 < param_3) && (bVar1 != 0)) {\n    lVar4 = 1;\n    iVar2 = 0;\n    do {\n      iVar2 = iVar2 + (uint)((bVar1 & 0xc0) != 0x80);\n      bVar1 = param_1[lVar4];\n      iVar3 = (int)lVar4;\n      lVar4 = lVar4 + 1;\n    } while (iVar3 <= param_3 && bVar1 != 0);\n    return iVar2;\n  }\n  return 0;\n}\n\n" (function_definition "int utf8_mbsnlen(byte *param_1,undefined8 param_2,int param_3)\n\n{\n  byte bVar1;\n  int iVar2;\n  int iVar3;\n  long lVar4;\n  \n  bVar1 = *param_1;\n  if ((-1 < param_3) && (bVar1 != 0)) {\n    lVar4 = 1;\n    iVar2 = 0;\n    do {\n      iVar2 = iVar2 + (uint)((bVar1 & 0xc0) != 0x80);\n      bVar1 = param_1[lVar4];\n      iVar3 = (int)lVar4;\n      lVar4 = lVar4 + 1;\n    } while (iVar3 <= param_3 && bVar1 != 0);\n    return iVar2;\n  }\n  return 0;\n}" primitive_type (function_declarator "utf8_mbsnlen(byte *param_1,undefined8 param_2,int param_3)" identifier (parameter_list "(byte *param_1,undefined8 param_2,int param_3)" ( (parameter_declaration "byte *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "undefined8 param_2" type_identifier identifier) , (parameter_declaration "int param_3" primitive_type identifier) ))) (compound_statement "{\n  byte bVar1;\n  int iVar2;\n  int iVar3;\n  long lVar4;\n  \n  bVar1 = *param_1;\n  if ((-1 < param_3) && (bVar1 != 0)) {\n    lVar4 = 1;\n    iVar2 = 0;\n    do {\n      iVar2 = iVar2 + (uint)((bVar1 & 0xc0) != 0x80);\n      bVar1 = param_1[lVar4];\n      iVar3 = (int)lVar4;\n      lVar4 = lVar4 + 1;\n    } while (iVar3 <= param_3 && bVar1 != 0);\n    return iVar2;\n  }\n  return 0;\n}" { (declaration "byte bVar1;" type_identifier identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "long lVar4;" (sized_type_specifier "long" long) identifier ;) (expression_statement "bVar1 = *param_1;" (assignment_expression "bVar1 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (if_statement "if ((-1 < param_3) && (bVar1 != 0)) {\n    lVar4 = 1;\n    iVar2 = 0;\n    do {\n      iVar2 = iVar2 + (uint)((bVar1 & 0xc0) != 0x80);\n      bVar1 = param_1[lVar4];\n      iVar3 = (int)lVar4;\n      lVar4 = lVar4 + 1;\n    } while (iVar3 <= param_3 && bVar1 != 0);\n    return iVar2;\n  }" if (parenthesized_expression "((-1 < param_3) && (bVar1 != 0))" ( (binary_expression "(-1 < param_3) && (bVar1 != 0)" (parenthesized_expression "(-1 < param_3)" ( (binary_expression "-1 < param_3" number_literal < identifier) )) && (parenthesized_expression "(bVar1 != 0)" ( (binary_expression "bVar1 != 0" identifier != number_literal) ))) )) (compound_statement "{\n    lVar4 = 1;\n    iVar2 = 0;\n    do {\n      iVar2 = iVar2 + (uint)((bVar1 & 0xc0) != 0x80);\n      bVar1 = param_1[lVar4];\n      iVar3 = (int)lVar4;\n      lVar4 = lVar4 + 1;\n    } while (iVar3 <= param_3 && bVar1 != 0);\n    return iVar2;\n  }" { (expression_statement "lVar4 = 1;" (assignment_expression "lVar4 = 1" identifier = number_literal) ;) (expression_statement "iVar2 = 0;" (assignment_expression "iVar2 = 0" identifier = number_literal) ;) (do_statement "do {\n      iVar2 = iVar2 + (uint)((bVar1 & 0xc0) != 0x80);\n      bVar1 = param_1[lVar4];\n      iVar3 = (int)lVar4;\n      lVar4 = lVar4 + 1;\n    } while (iVar3 <= param_3 && bVar1 != 0);" do (compound_statement "{\n      iVar2 = iVar2 + (uint)((bVar1 & 0xc0) != 0x80);\n      bVar1 = param_1[lVar4];\n      iVar3 = (int)lVar4;\n      lVar4 = lVar4 + 1;\n    }" { (expression_statement "iVar2 = iVar2 + (uint)((bVar1 & 0xc0) != 0x80);" (assignment_expression "iVar2 = iVar2 + (uint)((bVar1 & 0xc0) != 0x80)" identifier = (binary_expression "iVar2 + (uint)((bVar1 & 0xc0) != 0x80)" identifier + (call_expression "(uint)((bVar1 & 0xc0) != 0x80)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "((bVar1 & 0xc0) != 0x80)" ( (binary_expression "(bVar1 & 0xc0) != 0x80" (parenthesized_expression "(bVar1 & 0xc0)" ( (binary_expression "bVar1 & 0xc0" identifier & number_literal) )) != number_literal) ))))) ;) (expression_statement "bVar1 = param_1[lVar4];" (assignment_expression "bVar1 = param_1[lVar4]" identifier = (subscript_expression "param_1[lVar4]" identifier [ identifier ])) ;) (expression_statement "iVar3 = (int)lVar4;" (assignment_expression "iVar3 = (int)lVar4" identifier = (cast_expression "(int)lVar4" ( (type_descriptor "int" primitive_type) ) identifier)) ;) (expression_statement "lVar4 = lVar4 + 1;" (assignment_expression "lVar4 = lVar4 + 1" identifier = (binary_expression "lVar4 + 1" identifier + number_literal)) ;) }) while (parenthesized_expression "(iVar3 <= param_3 && bVar1 != 0)" ( (binary_expression "iVar3 <= param_3 && bVar1 != 0" (binary_expression "iVar3 <= param_3" identifier <= identifier) && (binary_expression "bVar1 != 0" identifier != number_literal)) )) ;) (return_statement "return iVar2;" return identifier ;) })) (return_statement "return 0;" return number_literal ;) })))
(translation_unit "int utf8_mbsnlen(char *src,size_t srclen,int maxlen)\n\n{\n  byte bVar1;\n  int iVar2;\n  int iVar3;\n  long lVar4;\n  \n  bVar1 = *src;\n  if ((-1 < maxlen) && (bVar1 != 0)) {\n    lVar4 = 1;\n    iVar2 = 0;\n    do {\n      iVar2 = iVar2 + (uint)((bVar1 & 0xc0) != 0x80);\n      bVar1 = src[lVar4];\n      iVar3 = (int)lVar4;\n      lVar4 = lVar4 + 1;\n    } while (iVar3 <= maxlen && bVar1 != 0);\n    return iVar2;\n  }\n  return 0;\n}\n\n" (function_definition "int utf8_mbsnlen(char *src,size_t srclen,int maxlen)\n\n{\n  byte bVar1;\n  int iVar2;\n  int iVar3;\n  long lVar4;\n  \n  bVar1 = *src;\n  if ((-1 < maxlen) && (bVar1 != 0)) {\n    lVar4 = 1;\n    iVar2 = 0;\n    do {\n      iVar2 = iVar2 + (uint)((bVar1 & 0xc0) != 0x80);\n      bVar1 = src[lVar4];\n      iVar3 = (int)lVar4;\n      lVar4 = lVar4 + 1;\n    } while (iVar3 <= maxlen && bVar1 != 0);\n    return iVar2;\n  }\n  return 0;\n}" primitive_type (function_declarator "utf8_mbsnlen(char *src,size_t srclen,int maxlen)" identifier (parameter_list "(char *src,size_t srclen,int maxlen)" ( (parameter_declaration "char *src" primitive_type (pointer_declarator "*src" * identifier)) , (parameter_declaration "size_t srclen" primitive_type identifier) , (parameter_declaration "int maxlen" primitive_type identifier) ))) (compound_statement "{\n  byte bVar1;\n  int iVar2;\n  int iVar3;\n  long lVar4;\n  \n  bVar1 = *src;\n  if ((-1 < maxlen) && (bVar1 != 0)) {\n    lVar4 = 1;\n    iVar2 = 0;\n    do {\n      iVar2 = iVar2 + (uint)((bVar1 & 0xc0) != 0x80);\n      bVar1 = src[lVar4];\n      iVar3 = (int)lVar4;\n      lVar4 = lVar4 + 1;\n    } while (iVar3 <= maxlen && bVar1 != 0);\n    return iVar2;\n  }\n  return 0;\n}" { (declaration "byte bVar1;" type_identifier identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "long lVar4;" (sized_type_specifier "long" long) identifier ;) (expression_statement "bVar1 = *src;" (assignment_expression "bVar1 = *src" identifier = (pointer_expression "*src" * identifier)) ;) (if_statement "if ((-1 < maxlen) && (bVar1 != 0)) {\n    lVar4 = 1;\n    iVar2 = 0;\n    do {\n      iVar2 = iVar2 + (uint)((bVar1 & 0xc0) != 0x80);\n      bVar1 = src[lVar4];\n      iVar3 = (int)lVar4;\n      lVar4 = lVar4 + 1;\n    } while (iVar3 <= maxlen && bVar1 != 0);\n    return iVar2;\n  }" if (parenthesized_expression "((-1 < maxlen) && (bVar1 != 0))" ( (binary_expression "(-1 < maxlen) && (bVar1 != 0)" (parenthesized_expression "(-1 < maxlen)" ( (binary_expression "-1 < maxlen" number_literal < identifier) )) && (parenthesized_expression "(bVar1 != 0)" ( (binary_expression "bVar1 != 0" identifier != number_literal) ))) )) (compound_statement "{\n    lVar4 = 1;\n    iVar2 = 0;\n    do {\n      iVar2 = iVar2 + (uint)((bVar1 & 0xc0) != 0x80);\n      bVar1 = src[lVar4];\n      iVar3 = (int)lVar4;\n      lVar4 = lVar4 + 1;\n    } while (iVar3 <= maxlen && bVar1 != 0);\n    return iVar2;\n  }" { (expression_statement "lVar4 = 1;" (assignment_expression "lVar4 = 1" identifier = number_literal) ;) (expression_statement "iVar2 = 0;" (assignment_expression "iVar2 = 0" identifier = number_literal) ;) (do_statement "do {\n      iVar2 = iVar2 + (uint)((bVar1 & 0xc0) != 0x80);\n      bVar1 = src[lVar4];\n      iVar3 = (int)lVar4;\n      lVar4 = lVar4 + 1;\n    } while (iVar3 <= maxlen && bVar1 != 0);" do (compound_statement "{\n      iVar2 = iVar2 + (uint)((bVar1 & 0xc0) != 0x80);\n      bVar1 = src[lVar4];\n      iVar3 = (int)lVar4;\n      lVar4 = lVar4 + 1;\n    }" { (expression_statement "iVar2 = iVar2 + (uint)((bVar1 & 0xc0) != 0x80);" (assignment_expression "iVar2 = iVar2 + (uint)((bVar1 & 0xc0) != 0x80)" identifier = (binary_expression "iVar2 + (uint)((bVar1 & 0xc0) != 0x80)" identifier + (call_expression "(uint)((bVar1 & 0xc0) != 0x80)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "((bVar1 & 0xc0) != 0x80)" ( (binary_expression "(bVar1 & 0xc0) != 0x80" (parenthesized_expression "(bVar1 & 0xc0)" ( (binary_expression "bVar1 & 0xc0" identifier & number_literal) )) != number_literal) ))))) ;) (expression_statement "bVar1 = src[lVar4];" (assignment_expression "bVar1 = src[lVar4]" identifier = (subscript_expression "src[lVar4]" identifier [ identifier ])) ;) (expression_statement "iVar3 = (int)lVar4;" (assignment_expression "iVar3 = (int)lVar4" identifier = (cast_expression "(int)lVar4" ( (type_descriptor "int" primitive_type) ) identifier)) ;) (expression_statement "lVar4 = lVar4 + 1;" (assignment_expression "lVar4 = lVar4 + 1" identifier = (binary_expression "lVar4 + 1" identifier + number_literal)) ;) }) while (parenthesized_expression "(iVar3 <= maxlen && bVar1 != 0)" ( (binary_expression "iVar3 <= maxlen && bVar1 != 0" (binary_expression "iVar3 <= maxlen" identifier <= identifier) && (binary_expression "bVar1 != 0" identifier != number_literal)) )) ;) (return_statement "return iVar2;" return identifier ;) })) (return_statement "return 0;" return number_literal ;) })))
(translation_unit "int utf8_mbsnlen(byte *param_1,undefined8 param_2,int param_3)\n\n{\n  byte bVar1;\n  int iVar2;\n  int iVar3;\n  long lVar4;\n  \n  bVar1 = *param_1;\n  if ((-1 < param_3) && (bVar1 != 0)) {\n    lVar4 = 1;\n    iVar2 = 0;\n    do {\n      iVar2 = iVar2 + (uint)((bVar1 & 0xc0) != 0x80);\n      bVar1 = param_1[lVar4];\n      iVar3 = (int)lVar4;\n      lVar4 = lVar4 + 1;\n    } while (iVar3 <= param_3 && bVar1 != 0);\n    return iVar2;\n  }\n  return 0;\n}\n\n" (function_definition "int utf8_mbsnlen(byte *param_1,undefined8 param_2,int param_3)\n\n{\n  byte bVar1;\n  int iVar2;\n  int iVar3;\n  long lVar4;\n  \n  bVar1 = *param_1;\n  if ((-1 < param_3) && (bVar1 != 0)) {\n    lVar4 = 1;\n    iVar2 = 0;\n    do {\n      iVar2 = iVar2 + (uint)((bVar1 & 0xc0) != 0x80);\n      bVar1 = param_1[lVar4];\n      iVar3 = (int)lVar4;\n      lVar4 = lVar4 + 1;\n    } while (iVar3 <= param_3 && bVar1 != 0);\n    return iVar2;\n  }\n  return 0;\n}" primitive_type (function_declarator "utf8_mbsnlen(byte *param_1,undefined8 param_2,int param_3)" identifier (parameter_list "(byte *param_1,undefined8 param_2,int param_3)" ( (parameter_declaration "byte *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "undefined8 param_2" type_identifier identifier) , (parameter_declaration "int param_3" primitive_type identifier) ))) (compound_statement "{\n  byte bVar1;\n  int iVar2;\n  int iVar3;\n  long lVar4;\n  \n  bVar1 = *param_1;\n  if ((-1 < param_3) && (bVar1 != 0)) {\n    lVar4 = 1;\n    iVar2 = 0;\n    do {\n      iVar2 = iVar2 + (uint)((bVar1 & 0xc0) != 0x80);\n      bVar1 = param_1[lVar4];\n      iVar3 = (int)lVar4;\n      lVar4 = lVar4 + 1;\n    } while (iVar3 <= param_3 && bVar1 != 0);\n    return iVar2;\n  }\n  return 0;\n}" { (declaration "byte bVar1;" type_identifier identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "long lVar4;" (sized_type_specifier "long" long) identifier ;) (expression_statement "bVar1 = *param_1;" (assignment_expression "bVar1 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (if_statement "if ((-1 < param_3) && (bVar1 != 0)) {\n    lVar4 = 1;\n    iVar2 = 0;\n    do {\n      iVar2 = iVar2 + (uint)((bVar1 & 0xc0) != 0x80);\n      bVar1 = param_1[lVar4];\n      iVar3 = (int)lVar4;\n      lVar4 = lVar4 + 1;\n    } while (iVar3 <= param_3 && bVar1 != 0);\n    return iVar2;\n  }" if (parenthesized_expression "((-1 < param_3) && (bVar1 != 0))" ( (binary_expression "(-1 < param_3) && (bVar1 != 0)" (parenthesized_expression "(-1 < param_3)" ( (binary_expression "-1 < param_3" number_literal < identifier) )) && (parenthesized_expression "(bVar1 != 0)" ( (binary_expression "bVar1 != 0" identifier != number_literal) ))) )) (compound_statement "{\n    lVar4 = 1;\n    iVar2 = 0;\n    do {\n      iVar2 = iVar2 + (uint)((bVar1 & 0xc0) != 0x80);\n      bVar1 = param_1[lVar4];\n      iVar3 = (int)lVar4;\n      lVar4 = lVar4 + 1;\n    } while (iVar3 <= param_3 && bVar1 != 0);\n    return iVar2;\n  }" { (expression_statement "lVar4 = 1;" (assignment_expression "lVar4 = 1" identifier = number_literal) ;) (expression_statement "iVar2 = 0;" (assignment_expression "iVar2 = 0" identifier = number_literal) ;) (do_statement "do {\n      iVar2 = iVar2 + (uint)((bVar1 & 0xc0) != 0x80);\n      bVar1 = param_1[lVar4];\n      iVar3 = (int)lVar4;\n      lVar4 = lVar4 + 1;\n    } while (iVar3 <= param_3 && bVar1 != 0);" do (compound_statement "{\n      iVar2 = iVar2 + (uint)((bVar1 & 0xc0) != 0x80);\n      bVar1 = param_1[lVar4];\n      iVar3 = (int)lVar4;\n      lVar4 = lVar4 + 1;\n    }" { (expression_statement "iVar2 = iVar2 + (uint)((bVar1 & 0xc0) != 0x80);" (assignment_expression "iVar2 = iVar2 + (uint)((bVar1 & 0xc0) != 0x80)" identifier = (binary_expression "iVar2 + (uint)((bVar1 & 0xc0) != 0x80)" identifier + (call_expression "(uint)((bVar1 & 0xc0) != 0x80)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "((bVar1 & 0xc0) != 0x80)" ( (binary_expression "(bVar1 & 0xc0) != 0x80" (parenthesized_expression "(bVar1 & 0xc0)" ( (binary_expression "bVar1 & 0xc0" identifier & number_literal) )) != number_literal) ))))) ;) (expression_statement "bVar1 = param_1[lVar4];" (assignment_expression "bVar1 = param_1[lVar4]" identifier = (subscript_expression "param_1[lVar4]" identifier [ identifier ])) ;) (expression_statement "iVar3 = (int)lVar4;" (assignment_expression "iVar3 = (int)lVar4" identifier = (cast_expression "(int)lVar4" ( (type_descriptor "int" primitive_type) ) identifier)) ;) (expression_statement "lVar4 = lVar4 + 1;" (assignment_expression "lVar4 = lVar4 + 1" identifier = (binary_expression "lVar4 + 1" identifier + number_literal)) ;) }) while (parenthesized_expression "(iVar3 <= param_3 && bVar1 != 0)" ( (binary_expression "iVar3 <= param_3 && bVar1 != 0" (binary_expression "iVar3 <= param_3" identifier <= identifier) && (binary_expression "bVar1 != 0" identifier != number_literal)) )) ;) (return_statement "return iVar2;" return identifier ;) })) (return_statement "return 0;" return number_literal ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration (sized_type_specifier long) IDENT ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression LIT < IDENT) )) && (parenthesized_expression ( (binary_expression IDENT != LIT) ))) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT + (call_expression (parenthesized_expression ( IDENT )) (argument_list ( (binary_expression (parenthesized_expression ( (binary_expression IDENT & LIT) )) != LIT) ))))) ;) (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ IDENT ])) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE) ) IDENT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) }) while (parenthesized_expression ( (binary_expression (binary_expression IDENT <= IDENT) && (binary_expression IDENT != LIT)) )) ;) (return_statement return IDENT ;) })) (return_statement return LIT ;) })))
(function_definition "int utf8_mbsnlen(byte *param_1,undefined8 param_2,int param_3)\n\n{\n  byte bVar1;\n  int iVar2;\n  int iVar3;\n  long lVar4;\n  \n  bVar1 = *param_1;\n  if ((-1 < param_3) && (bVar1 != 0)) {\n    lVar4 = 1;\n    iVar2 = 0;\n    do {\n      iVar2 = iVar2 + (uint)((bVar1 & 0xc0) != 0x80);\n      bVar1 = param_1[lVar4];\n      iVar3 = (int)lVar4;\n      lVar4 = lVar4 + 1;\n    } while (iVar3 <= param_3 && bVar1 != 0);\n    return iVar2;\n  }\n  return 0;\n}" (primitive_type "int") (function_declarator "utf8_mbsnlen(byte *param_1,undefined8 param_2,int param_3)" (identifier "utf8_mbsnlen") (parameter_list "(byte *param_1,undefined8 param_2,int param_3)" (( "(") (parameter_declaration "byte *param_1" (type_identifier "byte") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "undefined8 param_2" (type_identifier "undefined8") (identifier "param_2")) (, ",") (parameter_declaration "int param_3" (primitive_type "int") (identifier "param_3")) () ")"))) (compound_statement "{\n  byte bVar1;\n  int iVar2;\n  int iVar3;\n  long lVar4;\n  \n  bVar1 = *param_1;\n  if ((-1 < param_3) && (bVar1 != 0)) {\n    lVar4 = 1;\n    iVar2 = 0;\n    do {\n      iVar2 = iVar2 + (uint)((bVar1 & 0xc0) != 0x80);\n      bVar1 = param_1[lVar4];\n      iVar3 = (int)lVar4;\n      lVar4 = lVar4 + 1;\n    } while (iVar3 <= param_3 && bVar1 != 0);\n    return iVar2;\n  }\n  return 0;\n}" ({ "{") (declaration "byte bVar1;" (type_identifier "byte") (identifier "bVar1") (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "int iVar3;" (primitive_type "int") (identifier "iVar3") (; ";")) (declaration "long lVar4;" (sized_type_specifier "long" (long "long")) (identifier "lVar4") (; ";")) (expression_statement "bVar1 = *param_1;" (assignment_expression "bVar1 = *param_1" (identifier "bVar1") (= "=") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) (; ";")) (if_statement "if ((-1 < param_3) && (bVar1 != 0)) {\n    lVar4 = 1;\n    iVar2 = 0;\n    do {\n      iVar2 = iVar2 + (uint)((bVar1 & 0xc0) != 0x80);\n      bVar1 = param_1[lVar4];\n      iVar3 = (int)lVar4;\n      lVar4 = lVar4 + 1;\n    } while (iVar3 <= param_3 && bVar1 != 0);\n    return iVar2;\n  }" (if "if") (parenthesized_expression "((-1 < param_3) && (bVar1 != 0))" (( "(") (binary_expression "(-1 < param_3) && (bVar1 != 0)" (parenthesized_expression "(-1 < param_3)" (( "(") (binary_expression "-1 < param_3" (number_literal "-1") (< "<") (identifier "param_3")) () ")")) (&& "&&") (parenthesized_expression "(bVar1 != 0)" (( "(") (binary_expression "bVar1 != 0" (identifier "bVar1") (!= "!=") (number_literal "0")) () ")"))) () ")")) (compound_statement "{\n    lVar4 = 1;\n    iVar2 = 0;\n    do {\n      iVar2 = iVar2 + (uint)((bVar1 & 0xc0) != 0x80);\n      bVar1 = param_1[lVar4];\n      iVar3 = (int)lVar4;\n      lVar4 = lVar4 + 1;\n    } while (iVar3 <= param_3 && bVar1 != 0);\n    return iVar2;\n  }" ({ "{") (expression_statement "lVar4 = 1;" (assignment_expression "lVar4 = 1" (identifier "lVar4") (= "=") (number_literal "1")) (; ";")) (expression_statement "iVar2 = 0;" (assignment_expression "iVar2 = 0" (identifier "iVar2") (= "=") (number_literal "0")) (; ";")) (do_statement "do {\n      iVar2 = iVar2 + (uint)((bVar1 & 0xc0) != 0x80);\n      bVar1 = param_1[lVar4];\n      iVar3 = (int)lVar4;\n      lVar4 = lVar4 + 1;\n    } while (iVar3 <= param_3 && bVar1 != 0);" (do "do") (compound_statement "{\n      iVar2 = iVar2 + (uint)((bVar1 & 0xc0) != 0x80);\n      bVar1 = param_1[lVar4];\n      iVar3 = (int)lVar4;\n      lVar4 = lVar4 + 1;\n    }" ({ "{") (expression_statement "iVar2 = iVar2 + (uint)((bVar1 & 0xc0) != 0x80);" (assignment_expression "iVar2 = iVar2 + (uint)((bVar1 & 0xc0) != 0x80)" (identifier "iVar2") (= "=") (binary_expression "iVar2 + (uint)((bVar1 & 0xc0) != 0x80)" (identifier "iVar2") (+ "+") (call_expression "(uint)((bVar1 & 0xc0) != 0x80)" (parenthesized_expression "(uint)" (( "(") (identifier "uint") () ")")) (argument_list "((bVar1 & 0xc0) != 0x80)" (( "(") (binary_expression "(bVar1 & 0xc0) != 0x80" (parenthesized_expression "(bVar1 & 0xc0)" (( "(") (binary_expression "bVar1 & 0xc0" (identifier "bVar1") (& "&") (number_literal "0xc0")) () ")")) (!= "!=") (number_literal "0x80")) () ")"))))) (; ";")) (expression_statement "bVar1 = param_1[lVar4];" (assignment_expression "bVar1 = param_1[lVar4]" (identifier "bVar1") (= "=") (subscript_expression "param_1[lVar4]" (identifier "param_1") ([ "[") (identifier "lVar4") (] "]"))) (; ";")) (expression_statement "iVar3 = (int)lVar4;" (assignment_expression "iVar3 = (int)lVar4" (identifier "iVar3") (= "=") (cast_expression "(int)lVar4" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "lVar4"))) (; ";")) (expression_statement "lVar4 = lVar4 + 1;" (assignment_expression "lVar4 = lVar4 + 1" (identifier "lVar4") (= "=") (binary_expression "lVar4 + 1" (identifier "lVar4") (+ "+") (number_literal "1"))) (; ";")) (} "}")) (while "while") (parenthesized_expression "(iVar3 <= param_3 && bVar1 != 0)" (( "(") (binary_expression "iVar3 <= param_3 && bVar1 != 0" (binary_expression "iVar3 <= param_3" (identifier "iVar3") (<= "<=") (identifier "param_3")) (&& "&&") (binary_expression "bVar1 != 0" (identifier "bVar1") (!= "!=") (number_literal "0"))) () ")")) (; ";")) (return_statement "return iVar2;" (return "return") (identifier "iVar2") (; ";")) (} "}"))) (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}")))

int function_1(char *src,size_t srclen,int var_1)

{
  type_1 var_2;
  int var_3;
  int var_5;
  long var_4;
  
  var_2 = *src;
  if ((-1 < var_1) && (var_2 != 0)) {
    var_4 = 1;
    var_3 = 0;
    do {
      var_3 = var_3 + (uint)((var_2 & 0xc0) != 0x80);
      var_2 = src[var_4];
      var_5 = (int)var_4;
      var_4 = var_4 + 1;
    } while (var_5 <= var_1 && var_2 != 0);
    return var_3;
  }
  return 0;
}


(translation_unit (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (type_identifier) declarator: (identifier)) (parameter_declaration type: (primitive_type) declarator: (identifier)))) body: (compound_statement (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (sized_type_specifier) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (number_literal) right: (identifier))) right: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (do_statement body: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (call_expression function: (parenthesized_expression (identifier)) arguments: (argument_list (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) right: (number_literal))))))) (expression_statement (assignment_expression left: (identifier) right: (subscript_expression argument: (identifier) index: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal))))) condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (binary_expression left: (identifier) right: (number_literal))))) (return_statement (identifier)))) (return_statement (number_literal)))))

int MASKED(byte *param_1,undefined8 param_2,int param_3)

{
  byte bVar1;
  int iVar2;
  int iVar3;
  long lVar4;
  
  bVar1 = *param_1;
  if ((-1 < param_3) && (bVar1 != 0)) {
    lVar4 = 1;
    iVar2 = 0;
    do {
      iVar2 = iVar2 + (uint)((bVar1 & 0xc0) != 0x80);
      bVar1 = param_1[lVar4];
      iVar3 = (int)lVar4;
      lVar4 = lVar4 + 1;
    } while (iVar3 <= param_3 && bVar1 != 0);
    return iVar2;
  }
  return 0;
}

