
int mk_wcswidth(uint *pwcs,size_t n)

{
  uint ucs;
  int iVar1;
  int iVar2;
  int iVar3;
  
  ucs = *pwcs;
  if (ucs == 0) {
    iVar2 = 0;
  }
  else {
    iVar3 = n - 1;
    iVar2 = 0;
    if (n != 0) {
      while (iVar1 = mk_wcwidth(ucs), -1 < iVar1) {
        pwcs = pwcs + 1;
        iVar2 = iVar2 + iVar1;
        ucs = *pwcs;
        if (ucs == 0) {
          return iVar2;
        }
        iVar3 = iVar3 + -1;
        if (iVar3 == -1) {
          return iVar2;
        }
      }
      iVar2 = -1;
    }
  }
  return iVar2;
}



undefined8 FUN_00066230(int *param_1,int param_2)

{
  int iVar1;
  int iVar2;
  int iVar3;
  
  if (*param_1 == 0) {
    iVar2 = 0;
  }
  else {
    iVar3 = param_2 + -1;
    iVar2 = 0;
    iVar1 = *param_1;
    if (param_2 != 0) {
      while (param_2 = iVar1, iVar1 = FUN_00066190(), -1 < iVar1) {
        param_1 = param_1 + 1;
        iVar2 = iVar2 + iVar1;
        if ((*param_1 == 0) || (iVar3 = iVar3 + -1, iVar1 = *param_1, iVar3 == -1))
        goto LAB_00066273;
      }
      iVar2 = -1;
    }
  }
LAB_00066273:
  return CONCAT44(param_2,iVar2);
}


PUSH EDI
PUSH ESI
PUSH EBX
MOV EBX,dword ptr [ESP + 0x10]
MOV EDX,dword ptr [ESP + 0x14]
MOV EAX,dword ptr [EBX]
TEST EAX,EAX
JZ 0x00066279
LEA EDI,[EDX + -0x1]
XOR ESI,ESI
TEST EDX,EDX
JNZ 0x00066263
JMP 0x00066273
ADD EBX,0x4
ADD ESI,EAX
MOV EAX,dword ptr [EBX]
TEST EAX,EAX
JZ 0x00066273
SUB EDI,0x1
CMP EDI,-0x1
JZ 0x00066273
PUSH EAX
CALL 0x00066190
POP EDX
TEST EAX,EAX
JNS 0x00066250
MOV ESI,0xffffffff
MOV EAX,ESI
POP EBX
POP ESI
POP EDI
RET
XOR ESI,ESI
JMP 0x00066273
(translation_unit "undefined8 FUN_00066230(int *param_1,int param_2)\n\n{\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  \n  if (*param_1 == 0) {\n    iVar2 = 0;\n  }\n  else {\n    iVar3 = param_2 + -1;\n    iVar2 = 0;\n    iVar1 = *param_1;\n    if (param_2 != 0) {\n      while (param_2 = iVar1, iVar1 = FUN_00066190(), -1 < iVar1) {\n        param_1 = param_1 + 1;\n        iVar2 = iVar2 + iVar1;\n        if ((*param_1 == 0) || (iVar3 = iVar3 + -1, iVar1 = *param_1, iVar3 == -1))\n        goto LAB_00066273;\n      }\n      iVar2 = -1;\n    }\n  }\nLAB_00066273:\n  return CONCAT44(param_2,iVar2);\n}\n\n" (function_definition "undefined8 FUN_00066230(int *param_1,int param_2)\n\n{\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  \n  if (*param_1 == 0) {\n    iVar2 = 0;\n  }\n  else {\n    iVar3 = param_2 + -1;\n    iVar2 = 0;\n    iVar1 = *param_1;\n    if (param_2 != 0) {\n      while (param_2 = iVar1, iVar1 = FUN_00066190(), -1 < iVar1) {\n        param_1 = param_1 + 1;\n        iVar2 = iVar2 + iVar1;\n        if ((*param_1 == 0) || (iVar3 = iVar3 + -1, iVar1 = *param_1, iVar3 == -1))\n        goto LAB_00066273;\n      }\n      iVar2 = -1;\n    }\n  }\nLAB_00066273:\n  return CONCAT44(param_2,iVar2);\n}" type_identifier (function_declarator "FUN_00066230(int *param_1,int param_2)" identifier (parameter_list "(int *param_1,int param_2)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int param_2" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  \n  if (*param_1 == 0) {\n    iVar2 = 0;\n  }\n  else {\n    iVar3 = param_2 + -1;\n    iVar2 = 0;\n    iVar1 = *param_1;\n    if (param_2 != 0) {\n      while (param_2 = iVar1, iVar1 = FUN_00066190(), -1 < iVar1) {\n        param_1 = param_1 + 1;\n        iVar2 = iVar2 + iVar1;\n        if ((*param_1 == 0) || (iVar3 = iVar3 + -1, iVar1 = *param_1, iVar3 == -1))\n        goto LAB_00066273;\n      }\n      iVar2 = -1;\n    }\n  }\nLAB_00066273:\n  return CONCAT44(param_2,iVar2);\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (if_statement "if (*param_1 == 0) {\n    iVar2 = 0;\n  }\n  else {\n    iVar3 = param_2 + -1;\n    iVar2 = 0;\n    iVar1 = *param_1;\n    if (param_2 != 0) {\n      while (param_2 = iVar1, iVar1 = FUN_00066190(), -1 < iVar1) {\n        param_1 = param_1 + 1;\n        iVar2 = iVar2 + iVar1;\n        if ((*param_1 == 0) || (iVar3 = iVar3 + -1, iVar1 = *param_1, iVar3 == -1))\n        goto LAB_00066273;\n      }\n      iVar2 = -1;\n    }\n  }" if (parenthesized_expression "(*param_1 == 0)" ( (binary_expression "*param_1 == 0" (pointer_expression "*param_1" * identifier) == number_literal) )) (compound_statement "{\n    iVar2 = 0;\n  }" { (expression_statement "iVar2 = 0;" (assignment_expression "iVar2 = 0" identifier = number_literal) ;) }) (else_clause "else {\n    iVar3 = param_2 + -1;\n    iVar2 = 0;\n    iVar1 = *param_1;\n    if (param_2 != 0) {\n      while (param_2 = iVar1, iVar1 = FUN_00066190(), -1 < iVar1) {\n        param_1 = param_1 + 1;\n        iVar2 = iVar2 + iVar1;\n        if ((*param_1 == 0) || (iVar3 = iVar3 + -1, iVar1 = *param_1, iVar3 == -1))\n        goto LAB_00066273;\n      }\n      iVar2 = -1;\n    }\n  }" else (compound_statement "{\n    iVar3 = param_2 + -1;\n    iVar2 = 0;\n    iVar1 = *param_1;\n    if (param_2 != 0) {\n      while (param_2 = iVar1, iVar1 = FUN_00066190(), -1 < iVar1) {\n        param_1 = param_1 + 1;\n        iVar2 = iVar2 + iVar1;\n        if ((*param_1 == 0) || (iVar3 = iVar3 + -1, iVar1 = *param_1, iVar3 == -1))\n        goto LAB_00066273;\n      }\n      iVar2 = -1;\n    }\n  }" { (expression_statement "iVar3 = param_2 + -1;" (assignment_expression "iVar3 = param_2 + -1" identifier = (binary_expression "param_2 + -1" identifier + number_literal)) ;) (expression_statement "iVar2 = 0;" (assignment_expression "iVar2 = 0" identifier = number_literal) ;) (expression_statement "iVar1 = *param_1;" (assignment_expression "iVar1 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (if_statement "if (param_2 != 0) {\n      while (param_2 = iVar1, iVar1 = FUN_00066190(), -1 < iVar1) {\n        param_1 = param_1 + 1;\n        iVar2 = iVar2 + iVar1;\n        if ((*param_1 == 0) || (iVar3 = iVar3 + -1, iVar1 = *param_1, iVar3 == -1))\n        goto LAB_00066273;\n      }\n      iVar2 = -1;\n    }" if (parenthesized_expression "(param_2 != 0)" ( (binary_expression "param_2 != 0" identifier != number_literal) )) (compound_statement "{\n      while (param_2 = iVar1, iVar1 = FUN_00066190(), -1 < iVar1) {\n        param_1 = param_1 + 1;\n        iVar2 = iVar2 + iVar1;\n        if ((*param_1 == 0) || (iVar3 = iVar3 + -1, iVar1 = *param_1, iVar3 == -1))\n        goto LAB_00066273;\n      }\n      iVar2 = -1;\n    }" { (while_statement "while (param_2 = iVar1, iVar1 = FUN_00066190(), -1 < iVar1) {\n        param_1 = param_1 + 1;\n        iVar2 = iVar2 + iVar1;\n        if ((*param_1 == 0) || (iVar3 = iVar3 + -1, iVar1 = *param_1, iVar3 == -1))\n        goto LAB_00066273;\n      }" while (parenthesized_expression "(param_2 = iVar1, iVar1 = FUN_00066190(), -1 < iVar1)" ( (comma_expression "param_2 = iVar1, iVar1 = FUN_00066190(), -1 < iVar1" (assignment_expression "param_2 = iVar1" identifier = identifier) , (comma_expression "iVar1 = FUN_00066190(), -1 < iVar1" (assignment_expression "iVar1 = FUN_00066190()" identifier = (call_expression "FUN_00066190()" identifier (argument_list "()" ( )))) , (binary_expression "-1 < iVar1" number_literal < identifier))) )) (compound_statement "{\n        param_1 = param_1 + 1;\n        iVar2 = iVar2 + iVar1;\n        if ((*param_1 == 0) || (iVar3 = iVar3 + -1, iVar1 = *param_1, iVar3 == -1))\n        goto LAB_00066273;\n      }" { (expression_statement "param_1 = param_1 + 1;" (assignment_expression "param_1 = param_1 + 1" identifier = (binary_expression "param_1 + 1" identifier + number_literal)) ;) (expression_statement "iVar2 = iVar2 + iVar1;" (assignment_expression "iVar2 = iVar2 + iVar1" identifier = (binary_expression "iVar2 + iVar1" identifier + identifier)) ;) (if_statement "if ((*param_1 == 0) || (iVar3 = iVar3 + -1, iVar1 = *param_1, iVar3 == -1))\n        goto LAB_00066273;" if (parenthesized_expression "((*param_1 == 0) || (iVar3 = iVar3 + -1, iVar1 = *param_1, iVar3 == -1))" ( (binary_expression "(*param_1 == 0) || (iVar3 = iVar3 + -1, iVar1 = *param_1, iVar3 == -1)" (parenthesized_expression "(*param_1 == 0)" ( (binary_expression "*param_1 == 0" (pointer_expression "*param_1" * identifier) == number_literal) )) || (parenthesized_expression "(iVar3 = iVar3 + -1, iVar1 = *param_1, iVar3 == -1)" ( (comma_expression "iVar3 = iVar3 + -1, iVar1 = *param_1, iVar3 == -1" (assignment_expression "iVar3 = iVar3 + -1" identifier = (binary_expression "iVar3 + -1" identifier + number_literal)) , (comma_expression "iVar1 = *param_1, iVar3 == -1" (assignment_expression "iVar1 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) , (binary_expression "iVar3 == -1" identifier == number_literal))) ))) )) (goto_statement "goto LAB_00066273;" goto statement_identifier ;)) })) (expression_statement "iVar2 = -1;" (assignment_expression "iVar2 = -1" identifier = number_literal) ;) })) }))) (labeled_statement "LAB_00066273:\n  return CONCAT44(param_2,iVar2);" statement_identifier : (return_statement "return CONCAT44(param_2,iVar2);" return (call_expression "CONCAT44(param_2,iVar2)" identifier (argument_list "(param_2,iVar2)" ( identifier , identifier ))) ;)) })))
(translation_unit "int mk_wcswidth(uint *pwcs,size_t n)\n\n{\n  uint ucs;\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  \n  ucs = *pwcs;\n  if (ucs == 0) {\n    iVar2 = 0;\n  }\n  else {\n    iVar3 = n - 1;\n    iVar2 = 0;\n    if (n != 0) {\n      while (iVar1 = mk_wcwidth(ucs), -1 < iVar1) {\n        pwcs = pwcs + 1;\n        iVar2 = iVar2 + iVar1;\n        ucs = *pwcs;\n        if (ucs == 0) {\n          return iVar2;\n        }\n        iVar3 = iVar3 + -1;\n        if (iVar3 == -1) {\n          return iVar2;\n        }\n      }\n      iVar2 = -1;\n    }\n  }\n  return iVar2;\n}\n\n" (function_definition "int mk_wcswidth(uint *pwcs,size_t n)\n\n{\n  uint ucs;\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  \n  ucs = *pwcs;\n  if (ucs == 0) {\n    iVar2 = 0;\n  }\n  else {\n    iVar3 = n - 1;\n    iVar2 = 0;\n    if (n != 0) {\n      while (iVar1 = mk_wcwidth(ucs), -1 < iVar1) {\n        pwcs = pwcs + 1;\n        iVar2 = iVar2 + iVar1;\n        ucs = *pwcs;\n        if (ucs == 0) {\n          return iVar2;\n        }\n        iVar3 = iVar3 + -1;\n        if (iVar3 == -1) {\n          return iVar2;\n        }\n      }\n      iVar2 = -1;\n    }\n  }\n  return iVar2;\n}" primitive_type (function_declarator "mk_wcswidth(uint *pwcs,size_t n)" identifier (parameter_list "(uint *pwcs,size_t n)" ( (parameter_declaration "uint *pwcs" type_identifier (pointer_declarator "*pwcs" * identifier)) , (parameter_declaration "size_t n" primitive_type identifier) ))) (compound_statement "{\n  uint ucs;\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  \n  ucs = *pwcs;\n  if (ucs == 0) {\n    iVar2 = 0;\n  }\n  else {\n    iVar3 = n - 1;\n    iVar2 = 0;\n    if (n != 0) {\n      while (iVar1 = mk_wcwidth(ucs), -1 < iVar1) {\n        pwcs = pwcs + 1;\n        iVar2 = iVar2 + iVar1;\n        ucs = *pwcs;\n        if (ucs == 0) {\n          return iVar2;\n        }\n        iVar3 = iVar3 + -1;\n        if (iVar3 == -1) {\n          return iVar2;\n        }\n      }\n      iVar2 = -1;\n    }\n  }\n  return iVar2;\n}" { (declaration "uint ucs;" type_identifier identifier ;) (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (expression_statement "ucs = *pwcs;" (assignment_expression "ucs = *pwcs" identifier = (pointer_expression "*pwcs" * identifier)) ;) (if_statement "if (ucs == 0) {\n    iVar2 = 0;\n  }\n  else {\n    iVar3 = n - 1;\n    iVar2 = 0;\n    if (n != 0) {\n      while (iVar1 = mk_wcwidth(ucs), -1 < iVar1) {\n        pwcs = pwcs + 1;\n        iVar2 = iVar2 + iVar1;\n        ucs = *pwcs;\n        if (ucs == 0) {\n          return iVar2;\n        }\n        iVar3 = iVar3 + -1;\n        if (iVar3 == -1) {\n          return iVar2;\n        }\n      }\n      iVar2 = -1;\n    }\n  }" if (parenthesized_expression "(ucs == 0)" ( (binary_expression "ucs == 0" identifier == number_literal) )) (compound_statement "{\n    iVar2 = 0;\n  }" { (expression_statement "iVar2 = 0;" (assignment_expression "iVar2 = 0" identifier = number_literal) ;) }) (else_clause "else {\n    iVar3 = n - 1;\n    iVar2 = 0;\n    if (n != 0) {\n      while (iVar1 = mk_wcwidth(ucs), -1 < iVar1) {\n        pwcs = pwcs + 1;\n        iVar2 = iVar2 + iVar1;\n        ucs = *pwcs;\n        if (ucs == 0) {\n          return iVar2;\n        }\n        iVar3 = iVar3 + -1;\n        if (iVar3 == -1) {\n          return iVar2;\n        }\n      }\n      iVar2 = -1;\n    }\n  }" else (compound_statement "{\n    iVar3 = n - 1;\n    iVar2 = 0;\n    if (n != 0) {\n      while (iVar1 = mk_wcwidth(ucs), -1 < iVar1) {\n        pwcs = pwcs + 1;\n        iVar2 = iVar2 + iVar1;\n        ucs = *pwcs;\n        if (ucs == 0) {\n          return iVar2;\n        }\n        iVar3 = iVar3 + -1;\n        if (iVar3 == -1) {\n          return iVar2;\n        }\n      }\n      iVar2 = -1;\n    }\n  }" { (expression_statement "iVar3 = n - 1;" (assignment_expression "iVar3 = n - 1" identifier = (binary_expression "n - 1" identifier - number_literal)) ;) (expression_statement "iVar2 = 0;" (assignment_expression "iVar2 = 0" identifier = number_literal) ;) (if_statement "if (n != 0) {\n      while (iVar1 = mk_wcwidth(ucs), -1 < iVar1) {\n        pwcs = pwcs + 1;\n        iVar2 = iVar2 + iVar1;\n        ucs = *pwcs;\n        if (ucs == 0) {\n          return iVar2;\n        }\n        iVar3 = iVar3 + -1;\n        if (iVar3 == -1) {\n          return iVar2;\n        }\n      }\n      iVar2 = -1;\n    }" if (parenthesized_expression "(n != 0)" ( (binary_expression "n != 0" identifier != number_literal) )) (compound_statement "{\n      while (iVar1 = mk_wcwidth(ucs), -1 < iVar1) {\n        pwcs = pwcs + 1;\n        iVar2 = iVar2 + iVar1;\n        ucs = *pwcs;\n        if (ucs == 0) {\n          return iVar2;\n        }\n        iVar3 = iVar3 + -1;\n        if (iVar3 == -1) {\n          return iVar2;\n        }\n      }\n      iVar2 = -1;\n    }" { (while_statement "while (iVar1 = mk_wcwidth(ucs), -1 < iVar1) {\n        pwcs = pwcs + 1;\n        iVar2 = iVar2 + iVar1;\n        ucs = *pwcs;\n        if (ucs == 0) {\n          return iVar2;\n        }\n        iVar3 = iVar3 + -1;\n        if (iVar3 == -1) {\n          return iVar2;\n        }\n      }" while (parenthesized_expression "(iVar1 = mk_wcwidth(ucs), -1 < iVar1)" ( (comma_expression "iVar1 = mk_wcwidth(ucs), -1 < iVar1" (assignment_expression "iVar1 = mk_wcwidth(ucs)" identifier = (call_expression "mk_wcwidth(ucs)" identifier (argument_list "(ucs)" ( identifier )))) , (binary_expression "-1 < iVar1" number_literal < identifier)) )) (compound_statement "{\n        pwcs = pwcs + 1;\n        iVar2 = iVar2 + iVar1;\n        ucs = *pwcs;\n        if (ucs == 0) {\n          return iVar2;\n        }\n        iVar3 = iVar3 + -1;\n        if (iVar3 == -1) {\n          return iVar2;\n        }\n      }" { (expression_statement "pwcs = pwcs + 1;" (assignment_expression "pwcs = pwcs + 1" identifier = (binary_expression "pwcs + 1" identifier + number_literal)) ;) (expression_statement "iVar2 = iVar2 + iVar1;" (assignment_expression "iVar2 = iVar2 + iVar1" identifier = (binary_expression "iVar2 + iVar1" identifier + identifier)) ;) (expression_statement "ucs = *pwcs;" (assignment_expression "ucs = *pwcs" identifier = (pointer_expression "*pwcs" * identifier)) ;) (if_statement "if (ucs == 0) {\n          return iVar2;\n        }" if (parenthesized_expression "(ucs == 0)" ( (binary_expression "ucs == 0" identifier == number_literal) )) (compound_statement "{\n          return iVar2;\n        }" { (return_statement "return iVar2;" return identifier ;) })) (expression_statement "iVar3 = iVar3 + -1;" (assignment_expression "iVar3 = iVar3 + -1" identifier = (binary_expression "iVar3 + -1" identifier + number_literal)) ;) (if_statement "if (iVar3 == -1) {\n          return iVar2;\n        }" if (parenthesized_expression "(iVar3 == -1)" ( (binary_expression "iVar3 == -1" identifier == number_literal) )) (compound_statement "{\n          return iVar2;\n        }" { (return_statement "return iVar2;" return identifier ;) })) })) (expression_statement "iVar2 = -1;" (assignment_expression "iVar2 = -1" identifier = number_literal) ;) })) }))) (return_statement "return iVar2;" return identifier ;) })))
(translation_unit "undefined8 FUN_00066230(int *param_1,int param_2)\n\n{\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  \n  if (*param_1 == 0) {\n    iVar2 = 0;\n  }\n  else {\n    iVar3 = param_2 + -1;\n    iVar2 = 0;\n    iVar1 = *param_1;\n    if (param_2 != 0) {\n      while (param_2 = iVar1, iVar1 = FUN_00066190(), -1 < iVar1) {\n        param_1 = param_1 + 1;\n        iVar2 = iVar2 + iVar1;\n        if ((*param_1 == 0) || (iVar3 = iVar3 + -1, iVar1 = *param_1, iVar3 == -1))\n        goto LAB_00066273;\n      }\n      iVar2 = -1;\n    }\n  }\nLAB_00066273:\n  return CONCAT44(param_2,iVar2);\n}\n\n" (function_definition "undefined8 FUN_00066230(int *param_1,int param_2)\n\n{\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  \n  if (*param_1 == 0) {\n    iVar2 = 0;\n  }\n  else {\n    iVar3 = param_2 + -1;\n    iVar2 = 0;\n    iVar1 = *param_1;\n    if (param_2 != 0) {\n      while (param_2 = iVar1, iVar1 = FUN_00066190(), -1 < iVar1) {\n        param_1 = param_1 + 1;\n        iVar2 = iVar2 + iVar1;\n        if ((*param_1 == 0) || (iVar3 = iVar3 + -1, iVar1 = *param_1, iVar3 == -1))\n        goto LAB_00066273;\n      }\n      iVar2 = -1;\n    }\n  }\nLAB_00066273:\n  return CONCAT44(param_2,iVar2);\n}" type_identifier (function_declarator "FUN_00066230(int *param_1,int param_2)" identifier (parameter_list "(int *param_1,int param_2)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int param_2" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  \n  if (*param_1 == 0) {\n    iVar2 = 0;\n  }\n  else {\n    iVar3 = param_2 + -1;\n    iVar2 = 0;\n    iVar1 = *param_1;\n    if (param_2 != 0) {\n      while (param_2 = iVar1, iVar1 = FUN_00066190(), -1 < iVar1) {\n        param_1 = param_1 + 1;\n        iVar2 = iVar2 + iVar1;\n        if ((*param_1 == 0) || (iVar3 = iVar3 + -1, iVar1 = *param_1, iVar3 == -1))\n        goto LAB_00066273;\n      }\n      iVar2 = -1;\n    }\n  }\nLAB_00066273:\n  return CONCAT44(param_2,iVar2);\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (if_statement "if (*param_1 == 0) {\n    iVar2 = 0;\n  }\n  else {\n    iVar3 = param_2 + -1;\n    iVar2 = 0;\n    iVar1 = *param_1;\n    if (param_2 != 0) {\n      while (param_2 = iVar1, iVar1 = FUN_00066190(), -1 < iVar1) {\n        param_1 = param_1 + 1;\n        iVar2 = iVar2 + iVar1;\n        if ((*param_1 == 0) || (iVar3 = iVar3 + -1, iVar1 = *param_1, iVar3 == -1))\n        goto LAB_00066273;\n      }\n      iVar2 = -1;\n    }\n  }" if (parenthesized_expression "(*param_1 == 0)" ( (binary_expression "*param_1 == 0" (pointer_expression "*param_1" * identifier) == number_literal) )) (compound_statement "{\n    iVar2 = 0;\n  }" { (expression_statement "iVar2 = 0;" (assignment_expression "iVar2 = 0" identifier = number_literal) ;) }) (else_clause "else {\n    iVar3 = param_2 + -1;\n    iVar2 = 0;\n    iVar1 = *param_1;\n    if (param_2 != 0) {\n      while (param_2 = iVar1, iVar1 = FUN_00066190(), -1 < iVar1) {\n        param_1 = param_1 + 1;\n        iVar2 = iVar2 + iVar1;\n        if ((*param_1 == 0) || (iVar3 = iVar3 + -1, iVar1 = *param_1, iVar3 == -1))\n        goto LAB_00066273;\n      }\n      iVar2 = -1;\n    }\n  }" else (compound_statement "{\n    iVar3 = param_2 + -1;\n    iVar2 = 0;\n    iVar1 = *param_1;\n    if (param_2 != 0) {\n      while (param_2 = iVar1, iVar1 = FUN_00066190(), -1 < iVar1) {\n        param_1 = param_1 + 1;\n        iVar2 = iVar2 + iVar1;\n        if ((*param_1 == 0) || (iVar3 = iVar3 + -1, iVar1 = *param_1, iVar3 == -1))\n        goto LAB_00066273;\n      }\n      iVar2 = -1;\n    }\n  }" { (expression_statement "iVar3 = param_2 + -1;" (assignment_expression "iVar3 = param_2 + -1" identifier = (binary_expression "param_2 + -1" identifier + number_literal)) ;) (expression_statement "iVar2 = 0;" (assignment_expression "iVar2 = 0" identifier = number_literal) ;) (expression_statement "iVar1 = *param_1;" (assignment_expression "iVar1 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (if_statement "if (param_2 != 0) {\n      while (param_2 = iVar1, iVar1 = FUN_00066190(), -1 < iVar1) {\n        param_1 = param_1 + 1;\n        iVar2 = iVar2 + iVar1;\n        if ((*param_1 == 0) || (iVar3 = iVar3 + -1, iVar1 = *param_1, iVar3 == -1))\n        goto LAB_00066273;\n      }\n      iVar2 = -1;\n    }" if (parenthesized_expression "(param_2 != 0)" ( (binary_expression "param_2 != 0" identifier != number_literal) )) (compound_statement "{\n      while (param_2 = iVar1, iVar1 = FUN_00066190(), -1 < iVar1) {\n        param_1 = param_1 + 1;\n        iVar2 = iVar2 + iVar1;\n        if ((*param_1 == 0) || (iVar3 = iVar3 + -1, iVar1 = *param_1, iVar3 == -1))\n        goto LAB_00066273;\n      }\n      iVar2 = -1;\n    }" { (while_statement "while (param_2 = iVar1, iVar1 = FUN_00066190(), -1 < iVar1) {\n        param_1 = param_1 + 1;\n        iVar2 = iVar2 + iVar1;\n        if ((*param_1 == 0) || (iVar3 = iVar3 + -1, iVar1 = *param_1, iVar3 == -1))\n        goto LAB_00066273;\n      }" while (parenthesized_expression "(param_2 = iVar1, iVar1 = FUN_00066190(), -1 < iVar1)" ( (comma_expression "param_2 = iVar1, iVar1 = FUN_00066190(), -1 < iVar1" (assignment_expression "param_2 = iVar1" identifier = identifier) , (comma_expression "iVar1 = FUN_00066190(), -1 < iVar1" (assignment_expression "iVar1 = FUN_00066190()" identifier = (call_expression "FUN_00066190()" identifier (argument_list "()" ( )))) , (binary_expression "-1 < iVar1" number_literal < identifier))) )) (compound_statement "{\n        param_1 = param_1 + 1;\n        iVar2 = iVar2 + iVar1;\n        if ((*param_1 == 0) || (iVar3 = iVar3 + -1, iVar1 = *param_1, iVar3 == -1))\n        goto LAB_00066273;\n      }" { (expression_statement "param_1 = param_1 + 1;" (assignment_expression "param_1 = param_1 + 1" identifier = (binary_expression "param_1 + 1" identifier + number_literal)) ;) (expression_statement "iVar2 = iVar2 + iVar1;" (assignment_expression "iVar2 = iVar2 + iVar1" identifier = (binary_expression "iVar2 + iVar1" identifier + identifier)) ;) (if_statement "if ((*param_1 == 0) || (iVar3 = iVar3 + -1, iVar1 = *param_1, iVar3 == -1))\n        goto LAB_00066273;" if (parenthesized_expression "((*param_1 == 0) || (iVar3 = iVar3 + -1, iVar1 = *param_1, iVar3 == -1))" ( (binary_expression "(*param_1 == 0) || (iVar3 = iVar3 + -1, iVar1 = *param_1, iVar3 == -1)" (parenthesized_expression "(*param_1 == 0)" ( (binary_expression "*param_1 == 0" (pointer_expression "*param_1" * identifier) == number_literal) )) || (parenthesized_expression "(iVar3 = iVar3 + -1, iVar1 = *param_1, iVar3 == -1)" ( (comma_expression "iVar3 = iVar3 + -1, iVar1 = *param_1, iVar3 == -1" (assignment_expression "iVar3 = iVar3 + -1" identifier = (binary_expression "iVar3 + -1" identifier + number_literal)) , (comma_expression "iVar1 = *param_1, iVar3 == -1" (assignment_expression "iVar1 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) , (binary_expression "iVar3 == -1" identifier == number_literal))) ))) )) (goto_statement "goto LAB_00066273;" goto statement_identifier ;)) })) (expression_statement "iVar2 = -1;" (assignment_expression "iVar2 = -1" identifier = number_literal) ;) })) }))) (labeled_statement "LAB_00066273:\n  return CONCAT44(param_2,iVar2);" statement_identifier : (return_statement "return CONCAT44(param_2,iVar2);" return (call_expression "CONCAT44(param_2,iVar2)" identifier (argument_list "(param_2,iVar2)" ( identifier , identifier ))) ;)) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (while_statement while (parenthesized_expression ( (comma_expression (assignment_expression IDENT = IDENT) , (comma_expression (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) , (binary_expression LIT < IDENT))) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) == LIT) )) || (parenthesized_expression ( (comma_expression (assignment_expression IDENT = (binary_expression IDENT + LIT)) , (comma_expression (assignment_expression IDENT = (pointer_expression * IDENT)) , (binary_expression IDENT == LIT))) ))) )) (goto_statement goto statement_identifier ;)) })) (expression_statement (assignment_expression IDENT = LIT) ;) })) }))) (labeled_statement statement_identifier : (return_statement return (call_expression IDENT (argument_list ( IDENT , IDENT ))) ;)) })))
(function_definition "undefined8 FUN_00066230(int *param_1,int param_2)\n\n{\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  \n  if (*param_1 == 0) {\n    iVar2 = 0;\n  }\n  else {\n    iVar3 = param_2 + -1;\n    iVar2 = 0;\n    iVar1 = *param_1;\n    if (param_2 != 0) {\n      while (param_2 = iVar1, iVar1 = FUN_00066190(), -1 < iVar1) {\n        param_1 = param_1 + 1;\n        iVar2 = iVar2 + iVar1;\n        if ((*param_1 == 0) || (iVar3 = iVar3 + -1, iVar1 = *param_1, iVar3 == -1))\n        goto LAB_00066273;\n      }\n      iVar2 = -1;\n    }\n  }\nLAB_00066273:\n  return CONCAT44(param_2,iVar2);\n}" (type_identifier "undefined8") (function_declarator "FUN_00066230(int *param_1,int param_2)" (identifier "FUN_00066230") (parameter_list "(int *param_1,int param_2)" (( "(") (parameter_declaration "int *param_1" (primitive_type "int") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "int param_2" (primitive_type "int") (identifier "param_2")) () ")"))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  int iVar3;\n  \n  if (*param_1 == 0) {\n    iVar2 = 0;\n  }\n  else {\n    iVar3 = param_2 + -1;\n    iVar2 = 0;\n    iVar1 = *param_1;\n    if (param_2 != 0) {\n      while (param_2 = iVar1, iVar1 = FUN_00066190(), -1 < iVar1) {\n        param_1 = param_1 + 1;\n        iVar2 = iVar2 + iVar1;\n        if ((*param_1 == 0) || (iVar3 = iVar3 + -1, iVar1 = *param_1, iVar3 == -1))\n        goto LAB_00066273;\n      }\n      iVar2 = -1;\n    }\n  }\nLAB_00066273:\n  return CONCAT44(param_2,iVar2);\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "int iVar3;" (primitive_type "int") (identifier "iVar3") (; ";")) (if_statement "if (*param_1 == 0) {\n    iVar2 = 0;\n  }\n  else {\n    iVar3 = param_2 + -1;\n    iVar2 = 0;\n    iVar1 = *param_1;\n    if (param_2 != 0) {\n      while (param_2 = iVar1, iVar1 = FUN_00066190(), -1 < iVar1) {\n        param_1 = param_1 + 1;\n        iVar2 = iVar2 + iVar1;\n        if ((*param_1 == 0) || (iVar3 = iVar3 + -1, iVar1 = *param_1, iVar3 == -1))\n        goto LAB_00066273;\n      }\n      iVar2 = -1;\n    }\n  }" (if "if") (parenthesized_expression "(*param_1 == 0)" (( "(") (binary_expression "*param_1 == 0" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    iVar2 = 0;\n  }" ({ "{") (expression_statement "iVar2 = 0;" (assignment_expression "iVar2 = 0" (identifier "iVar2") (= "=") (number_literal "0")) (; ";")) (} "}")) (else_clause "else {\n    iVar3 = param_2 + -1;\n    iVar2 = 0;\n    iVar1 = *param_1;\n    if (param_2 != 0) {\n      while (param_2 = iVar1, iVar1 = FUN_00066190(), -1 < iVar1) {\n        param_1 = param_1 + 1;\n        iVar2 = iVar2 + iVar1;\n        if ((*param_1 == 0) || (iVar3 = iVar3 + -1, iVar1 = *param_1, iVar3 == -1))\n        goto LAB_00066273;\n      }\n      iVar2 = -1;\n    }\n  }" (else "else") (compound_statement "{\n    iVar3 = param_2 + -1;\n    iVar2 = 0;\n    iVar1 = *param_1;\n    if (param_2 != 0) {\n      while (param_2 = iVar1, iVar1 = FUN_00066190(), -1 < iVar1) {\n        param_1 = param_1 + 1;\n        iVar2 = iVar2 + iVar1;\n        if ((*param_1 == 0) || (iVar3 = iVar3 + -1, iVar1 = *param_1, iVar3 == -1))\n        goto LAB_00066273;\n      }\n      iVar2 = -1;\n    }\n  }" ({ "{") (expression_statement "iVar3 = param_2 + -1;" (assignment_expression "iVar3 = param_2 + -1" (identifier "iVar3") (= "=") (binary_expression "param_2 + -1" (identifier "param_2") (+ "+") (number_literal "-1"))) (; ";")) (expression_statement "iVar2 = 0;" (assignment_expression "iVar2 = 0" (identifier "iVar2") (= "=") (number_literal "0")) (; ";")) (expression_statement "iVar1 = *param_1;" (assignment_expression "iVar1 = *param_1" (identifier "iVar1") (= "=") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) (; ";")) (if_statement "if (param_2 != 0) {\n      while (param_2 = iVar1, iVar1 = FUN_00066190(), -1 < iVar1) {\n        param_1 = param_1 + 1;\n        iVar2 = iVar2 + iVar1;\n        if ((*param_1 == 0) || (iVar3 = iVar3 + -1, iVar1 = *param_1, iVar3 == -1))\n        goto LAB_00066273;\n      }\n      iVar2 = -1;\n    }" (if "if") (parenthesized_expression "(param_2 != 0)" (( "(") (binary_expression "param_2 != 0" (identifier "param_2") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n      while (param_2 = iVar1, iVar1 = FUN_00066190(), -1 < iVar1) {\n        param_1 = param_1 + 1;\n        iVar2 = iVar2 + iVar1;\n        if ((*param_1 == 0) || (iVar3 = iVar3 + -1, iVar1 = *param_1, iVar3 == -1))\n        goto LAB_00066273;\n      }\n      iVar2 = -1;\n    }" ({ "{") (while_statement "while (param_2 = iVar1, iVar1 = FUN_00066190(), -1 < iVar1) {\n        param_1 = param_1 + 1;\n        iVar2 = iVar2 + iVar1;\n        if ((*param_1 == 0) || (iVar3 = iVar3 + -1, iVar1 = *param_1, iVar3 == -1))\n        goto LAB_00066273;\n      }" (while "while") (parenthesized_expression "(param_2 = iVar1, iVar1 = FUN_00066190(), -1 < iVar1)" (( "(") (comma_expression "param_2 = iVar1, iVar1 = FUN_00066190(), -1 < iVar1" (assignment_expression "param_2 = iVar1" (identifier "param_2") (= "=") (identifier "iVar1")) (, ",") (comma_expression "iVar1 = FUN_00066190(), -1 < iVar1" (assignment_expression "iVar1 = FUN_00066190()" (identifier "iVar1") (= "=") (call_expression "FUN_00066190()" (identifier "FUN_00066190") (argument_list "()" (( "(") () ")")))) (, ",") (binary_expression "-1 < iVar1" (number_literal "-1") (< "<") (identifier "iVar1")))) () ")")) (compound_statement "{\n        param_1 = param_1 + 1;\n        iVar2 = iVar2 + iVar1;\n        if ((*param_1 == 0) || (iVar3 = iVar3 + -1, iVar1 = *param_1, iVar3 == -1))\n        goto LAB_00066273;\n      }" ({ "{") (expression_statement "param_1 = param_1 + 1;" (assignment_expression "param_1 = param_1 + 1" (identifier "param_1") (= "=") (binary_expression "param_1 + 1" (identifier "param_1") (+ "+") (number_literal "1"))) (; ";")) (expression_statement "iVar2 = iVar2 + iVar1;" (assignment_expression "iVar2 = iVar2 + iVar1" (identifier "iVar2") (= "=") (binary_expression "iVar2 + iVar1" (identifier "iVar2") (+ "+") (identifier "iVar1"))) (; ";")) (if_statement "if ((*param_1 == 0) || (iVar3 = iVar3 + -1, iVar1 = *param_1, iVar3 == -1))\n        goto LAB_00066273;" (if "if") (parenthesized_expression "((*param_1 == 0) || (iVar3 = iVar3 + -1, iVar1 = *param_1, iVar3 == -1))" (( "(") (binary_expression "(*param_1 == 0) || (iVar3 = iVar3 + -1, iVar1 = *param_1, iVar3 == -1)" (parenthesized_expression "(*param_1 == 0)" (( "(") (binary_expression "*param_1 == 0" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (== "==") (number_literal "0")) () ")")) (|| "||") (parenthesized_expression "(iVar3 = iVar3 + -1, iVar1 = *param_1, iVar3 == -1)" (( "(") (comma_expression "iVar3 = iVar3 + -1, iVar1 = *param_1, iVar3 == -1" (assignment_expression "iVar3 = iVar3 + -1" (identifier "iVar3") (= "=") (binary_expression "iVar3 + -1" (identifier "iVar3") (+ "+") (number_literal "-1"))) (, ",") (comma_expression "iVar1 = *param_1, iVar3 == -1" (assignment_expression "iVar1 = *param_1" (identifier "iVar1") (= "=") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) (, ",") (binary_expression "iVar3 == -1" (identifier "iVar3") (== "==") (number_literal "-1")))) () ")"))) () ")")) (goto_statement "goto LAB_00066273;" (goto "goto") (statement_identifier "LAB_00066273") (; ";"))) (} "}"))) (expression_statement "iVar2 = -1;" (assignment_expression "iVar2 = -1" (identifier "iVar2") (= "=") (number_literal "-1")) (; ";")) (} "}"))) (} "}")))) (labeled_statement "LAB_00066273:\n  return CONCAT44(param_2,iVar2);" (statement_identifier "LAB_00066273") (: ":") (return_statement "return CONCAT44(param_2,iVar2);" (return "return") (call_expression "CONCAT44(param_2,iVar2)" (identifier "CONCAT44") (argument_list "(param_2,iVar2)" (( "(") (identifier "param_2") (, ",") (identifier "iVar2") () ")"))) (; ";"))) (} "}")))

int function_1(type_1 *var_5,size_t var_2)

{
  type_1 var_1;
  int var_4;
  int var_6;
  int var_7;
  
  var_1 = *var_5;
  if (var_1 == 0) {
    var_6 = 0;
  }
  else {
    var_7 = var_2 - 1;
    var_6 = 0;
    if (var_2 != 0) {
      while (var_4 = var_3(var_1), -1 < var_4) {
        var_5 = var_5 + 1;
        var_6 = var_6 + var_4;
        var_1 = *var_5;
        if (var_1 == 0) {
          return var_6;
        }
        var_7 = var_7 + -1;
        if (var_7 == -1) {
          return var_6;
        }
      }
      var_6 = -1;
    }
  }
  return var_6;
}


(translation_unit (function_definition type: (type_identifier) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (primitive_type) declarator: (identifier)))) body: (compound_statement (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (if_statement condition: (parenthesized_expression (binary_expression left: (pointer_expression argument: (identifier)) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (number_literal)))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (while_statement condition: (parenthesized_expression (comma_expression left: (assignment_expression left: (identifier) right: (identifier)) right: (comma_expression left: (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list))) right: (binary_expression left: (number_literal) right: (identifier))))) 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: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (pointer_expression argument: (identifier)) right: (number_literal))) right: (parenthesized_expression (comma_expression left: (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal))) right: (comma_expression left: (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier))) right: (binary_expression left: (identifier) right: (number_literal))))))) consequence: (goto_statement label: (statement_identifier))))) (expression_statement (assignment_expression left: (identifier) right: (number_literal)))))))) (labeled_statement label: (statement_identifier) (return_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier))))))))

undefined8 MASKED(int *param_1,int param_2)

{
  int iVar1;
  int iVar2;
  int iVar3;
  
  if (*param_1 == 0) {
    iVar2 = 0;
  }
  else {
    iVar3 = param_2 + -1;
    iVar2 = 0;
    iVar1 = *param_1;
    if (param_2 != 0) {
      while (param_2 = iVar1, iVar1 = FUN_00066190(), -1 < iVar1) {
        param_1 = param_1 + 1;
        iVar2 = iVar2 + iVar1;
        if ((*param_1 == 0) || (iVar3 = iVar3 + -1, iVar1 = *param_1, iVar3 == -1))
        goto LAB_00066273;
      }
      iVar2 = -1;
    }
  }
LAB_00066273:
  return CONCAT44(param_2,iVar2);
}

