
void charset_emit(void *ctx,wchar_t output)

{
  undefined1 *puVar1;
  int iVar2;
  undefined1 *puVar3;
  undefined1 *puVar4;
  undefined1 *puVar5;
  
  if (output == L'\xffff') {
    iVar2 = *(int *)((int)ctx + 0xc);
    if (iVar2 <= *(int *)((int)ctx + 4)) {
      if (iVar2 < 1) {
        return;
      }
      puVar1 = *(undefined1 **)((int)ctx + 8);
      puVar4 = puVar1;
      do {
                    /* WARNING: Load size is inaccurate */
        puVar3 = *ctx;
        puVar5 = puVar4 + 1;
        *(undefined1 **)ctx = puVar3 + 1;
        *puVar3 = *puVar4;
        *(int *)((int)ctx + 4) = *(int *)((int)ctx + 4) + -1;
        puVar4 = puVar5;
      } while (puVar5 != puVar1 + iVar2);
      return;
    }
  }
  else if (0 < *(int *)((int)ctx + 4)) {
                    /* WARNING: Load size is inaccurate */
    puVar1 = *ctx;
    *(undefined1 **)ctx = puVar1 + 1;
    *puVar1 = (char)output;
    *(int *)((int)ctx + 4) = *(int *)((int)ctx + 4) + -1;
    return;
  }
  *(undefined4 *)((int)ctx + 0x10) = 1;
  return;
}



void FUN_0001a680(int *param_1,int param_2)

{
  undefined1 *puVar1;
  int iVar2;
  undefined1 *puVar3;
  undefined1 *puVar4;
  undefined1 *puVar5;
  
  if (param_2 == 0xffff) {
    iVar2 = param_1[3];
    if (iVar2 <= param_1[1]) {
      if (iVar2 < 1) {
        return;
      }
      puVar1 = (undefined1 *)param_1[2];
      puVar4 = puVar1;
      do {
        puVar3 = (undefined1 *)*param_1;
        puVar5 = puVar4 + 1;
        *param_1 = (int)(puVar3 + 1);
        *puVar3 = *puVar4;
        param_1[1] = param_1[1] + -1;
        puVar4 = puVar5;
      } while (puVar5 != puVar1 + iVar2);
      return;
    }
  }
  else if (0 < param_1[1]) {
    puVar1 = (undefined1 *)*param_1;
    *param_1 = (int)(puVar1 + 1);
    *puVar1 = (char)param_2;
    param_1[1] = param_1[1] + -1;
    return;
  }
  param_1[4] = 1;
  return;
}


PUSH ESI
PUSH EBX
MOV EAX,dword ptr [ESP + 0xc]
MOV EDX,dword ptr [ESP + 0x10]
MOV ECX,dword ptr [EAX + 0x4]
CMP EDX,0xffff
JZ 0x0001a6c0
TEST ECX,ECX
JG 0x0001a6a8
MOV dword ptr [EAX + 0x10],0x1
POP EBX
POP ESI
RET
MOV ECX,dword ptr [EAX]
LEA EBX,[ECX + 0x1]
MOV dword ptr [EAX],EBX
MOV byte ptr [ECX],DL
SUB dword ptr [EAX + 0x4],0x1
POP EBX
POP ESI
RET
MOV ESI,dword ptr [EAX + 0xc]
CMP ESI,ECX
JG 0x0001a699
TEST ESI,ESI
JLE 0x0001a6a0
MOV EDX,dword ptr [EAX + 0x8]
ADD ESI,EDX
MOV ECX,dword ptr [EAX]
ADD EDX,0x1
LEA EBX,[ECX + 0x1]
MOV dword ptr [EAX],EBX
MOVZX EBX,byte ptr [EDX + -0x1]
MOV byte ptr [ECX],BL
SUB dword ptr [EAX + 0x4],0x1
CMP EDX,ESI
JNZ 0x0001a6d0
POP EBX
POP ESI
RET
(translation_unit "void FUN_0001a680(int *param_1,int param_2)\n\n{\n  undefined1 *puVar1;\n  int iVar2;\n  undefined1 *puVar3;\n  undefined1 *puVar4;\n  undefined1 *puVar5;\n  \n  if (param_2 == 0xffff) {\n    iVar2 = param_1[3];\n    if (iVar2 <= param_1[1]) {\n      if (iVar2 < 1) {\n        return;\n      }\n      puVar1 = (undefined1 *)param_1[2];\n      puVar4 = puVar1;\n      do {\n        puVar3 = (undefined1 *)*param_1;\n        puVar5 = puVar4 + 1;\n        *param_1 = (int)(puVar3 + 1);\n        *puVar3 = *puVar4;\n        param_1[1] = param_1[1] + -1;\n        puVar4 = puVar5;\n      } while (puVar5 != puVar1 + iVar2);\n      return;\n    }\n  }\n  else if (0 < param_1[1]) {\n    puVar1 = (undefined1 *)*param_1;\n    *param_1 = (int)(puVar1 + 1);\n    *puVar1 = (char)param_2;\n    param_1[1] = param_1[1] + -1;\n    return;\n  }\n  param_1[4] = 1;\n  return;\n}\n\n" (function_definition "void FUN_0001a680(int *param_1,int param_2)\n\n{\n  undefined1 *puVar1;\n  int iVar2;\n  undefined1 *puVar3;\n  undefined1 *puVar4;\n  undefined1 *puVar5;\n  \n  if (param_2 == 0xffff) {\n    iVar2 = param_1[3];\n    if (iVar2 <= param_1[1]) {\n      if (iVar2 < 1) {\n        return;\n      }\n      puVar1 = (undefined1 *)param_1[2];\n      puVar4 = puVar1;\n      do {\n        puVar3 = (undefined1 *)*param_1;\n        puVar5 = puVar4 + 1;\n        *param_1 = (int)(puVar3 + 1);\n        *puVar3 = *puVar4;\n        param_1[1] = param_1[1] + -1;\n        puVar4 = puVar5;\n      } while (puVar5 != puVar1 + iVar2);\n      return;\n    }\n  }\n  else if (0 < param_1[1]) {\n    puVar1 = (undefined1 *)*param_1;\n    *param_1 = (int)(puVar1 + 1);\n    *puVar1 = (char)param_2;\n    param_1[1] = param_1[1] + -1;\n    return;\n  }\n  param_1[4] = 1;\n  return;\n}" primitive_type (function_declarator "FUN_0001a680(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  undefined1 *puVar1;\n  int iVar2;\n  undefined1 *puVar3;\n  undefined1 *puVar4;\n  undefined1 *puVar5;\n  \n  if (param_2 == 0xffff) {\n    iVar2 = param_1[3];\n    if (iVar2 <= param_1[1]) {\n      if (iVar2 < 1) {\n        return;\n      }\n      puVar1 = (undefined1 *)param_1[2];\n      puVar4 = puVar1;\n      do {\n        puVar3 = (undefined1 *)*param_1;\n        puVar5 = puVar4 + 1;\n        *param_1 = (int)(puVar3 + 1);\n        *puVar3 = *puVar4;\n        param_1[1] = param_1[1] + -1;\n        puVar4 = puVar5;\n      } while (puVar5 != puVar1 + iVar2);\n      return;\n    }\n  }\n  else if (0 < param_1[1]) {\n    puVar1 = (undefined1 *)*param_1;\n    *param_1 = (int)(puVar1 + 1);\n    *puVar1 = (char)param_2;\n    param_1[1] = param_1[1] + -1;\n    return;\n  }\n  param_1[4] = 1;\n  return;\n}" { (declaration "undefined1 *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "undefined1 *puVar3;" type_identifier (pointer_declarator "*puVar3" * identifier) ;) (declaration "undefined1 *puVar4;" type_identifier (pointer_declarator "*puVar4" * identifier) ;) (declaration "undefined1 *puVar5;" type_identifier (pointer_declarator "*puVar5" * identifier) ;) (if_statement "if (param_2 == 0xffff) {\n    iVar2 = param_1[3];\n    if (iVar2 <= param_1[1]) {\n      if (iVar2 < 1) {\n        return;\n      }\n      puVar1 = (undefined1 *)param_1[2];\n      puVar4 = puVar1;\n      do {\n        puVar3 = (undefined1 *)*param_1;\n        puVar5 = puVar4 + 1;\n        *param_1 = (int)(puVar3 + 1);\n        *puVar3 = *puVar4;\n        param_1[1] = param_1[1] + -1;\n        puVar4 = puVar5;\n      } while (puVar5 != puVar1 + iVar2);\n      return;\n    }\n  }\n  else if (0 < param_1[1]) {\n    puVar1 = (undefined1 *)*param_1;\n    *param_1 = (int)(puVar1 + 1);\n    *puVar1 = (char)param_2;\n    param_1[1] = param_1[1] + -1;\n    return;\n  }" if (parenthesized_expression "(param_2 == 0xffff)" ( (binary_expression "param_2 == 0xffff" identifier == number_literal) )) (compound_statement "{\n    iVar2 = param_1[3];\n    if (iVar2 <= param_1[1]) {\n      if (iVar2 < 1) {\n        return;\n      }\n      puVar1 = (undefined1 *)param_1[2];\n      puVar4 = puVar1;\n      do {\n        puVar3 = (undefined1 *)*param_1;\n        puVar5 = puVar4 + 1;\n        *param_1 = (int)(puVar3 + 1);\n        *puVar3 = *puVar4;\n        param_1[1] = param_1[1] + -1;\n        puVar4 = puVar5;\n      } while (puVar5 != puVar1 + iVar2);\n      return;\n    }\n  }" { (expression_statement "iVar2 = param_1[3];" (assignment_expression "iVar2 = param_1[3]" identifier = (subscript_expression "param_1[3]" identifier [ number_literal ])) ;) (if_statement "if (iVar2 <= param_1[1]) {\n      if (iVar2 < 1) {\n        return;\n      }\n      puVar1 = (undefined1 *)param_1[2];\n      puVar4 = puVar1;\n      do {\n        puVar3 = (undefined1 *)*param_1;\n        puVar5 = puVar4 + 1;\n        *param_1 = (int)(puVar3 + 1);\n        *puVar3 = *puVar4;\n        param_1[1] = param_1[1] + -1;\n        puVar4 = puVar5;\n      } while (puVar5 != puVar1 + iVar2);\n      return;\n    }" if (parenthesized_expression "(iVar2 <= param_1[1])" ( (binary_expression "iVar2 <= param_1[1]" identifier <= (subscript_expression "param_1[1]" identifier [ number_literal ])) )) (compound_statement "{\n      if (iVar2 < 1) {\n        return;\n      }\n      puVar1 = (undefined1 *)param_1[2];\n      puVar4 = puVar1;\n      do {\n        puVar3 = (undefined1 *)*param_1;\n        puVar5 = puVar4 + 1;\n        *param_1 = (int)(puVar3 + 1);\n        *puVar3 = *puVar4;\n        param_1[1] = param_1[1] + -1;\n        puVar4 = puVar5;\n      } while (puVar5 != puVar1 + iVar2);\n      return;\n    }" { (if_statement "if (iVar2 < 1) {\n        return;\n      }" if (parenthesized_expression "(iVar2 < 1)" ( (binary_expression "iVar2 < 1" identifier < number_literal) )) (compound_statement "{\n        return;\n      }" { (return_statement "return;" return ;) })) (expression_statement "puVar1 = (undefined1 *)param_1[2];" (assignment_expression "puVar1 = (undefined1 *)param_1[2]" identifier = (cast_expression "(undefined1 *)param_1[2]" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (subscript_expression "param_1[2]" identifier [ number_literal ]))) ;) (expression_statement "puVar4 = puVar1;" (assignment_expression "puVar4 = puVar1" identifier = identifier) ;) (do_statement "do {\n        puVar3 = (undefined1 *)*param_1;\n        puVar5 = puVar4 + 1;\n        *param_1 = (int)(puVar3 + 1);\n        *puVar3 = *puVar4;\n        param_1[1] = param_1[1] + -1;\n        puVar4 = puVar5;\n      } while (puVar5 != puVar1 + iVar2);" do (compound_statement "{\n        puVar3 = (undefined1 *)*param_1;\n        puVar5 = puVar4 + 1;\n        *param_1 = (int)(puVar3 + 1);\n        *puVar3 = *puVar4;\n        param_1[1] = param_1[1] + -1;\n        puVar4 = puVar5;\n      }" { (expression_statement "puVar3 = (undefined1 *)*param_1;" (assignment_expression "puVar3 = (undefined1 *)*param_1" identifier = (cast_expression "(undefined1 *)*param_1" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) (expression_statement "puVar5 = puVar4 + 1;" (assignment_expression "puVar5 = puVar4 + 1" identifier = (binary_expression "puVar4 + 1" identifier + number_literal)) ;) (expression_statement "*param_1 = (int)(puVar3 + 1);" (assignment_expression "*param_1 = (int)(puVar3 + 1)" (pointer_expression "*param_1" * identifier) = (cast_expression "(int)(puVar3 + 1)" ( (type_descriptor "int" primitive_type) ) (parenthesized_expression "(puVar3 + 1)" ( (binary_expression "puVar3 + 1" identifier + number_literal) )))) ;) (expression_statement "*puVar3 = *puVar4;" (assignment_expression "*puVar3 = *puVar4" (pointer_expression "*puVar3" * identifier) = (pointer_expression "*puVar4" * identifier)) ;) (expression_statement "param_1[1] = param_1[1] + -1;" (assignment_expression "param_1[1] = param_1[1] + -1" (subscript_expression "param_1[1]" identifier [ number_literal ]) = (binary_expression "param_1[1] + -1" (subscript_expression "param_1[1]" identifier [ number_literal ]) + number_literal)) ;) (expression_statement "puVar4 = puVar5;" (assignment_expression "puVar4 = puVar5" identifier = identifier) ;) }) while (parenthesized_expression "(puVar5 != puVar1 + iVar2)" ( (binary_expression "puVar5 != puVar1 + iVar2" identifier != (binary_expression "puVar1 + iVar2" identifier + identifier)) )) ;) (return_statement "return;" return ;) })) }) (else_clause "else if (0 < param_1[1]) {\n    puVar1 = (undefined1 *)*param_1;\n    *param_1 = (int)(puVar1 + 1);\n    *puVar1 = (char)param_2;\n    param_1[1] = param_1[1] + -1;\n    return;\n  }" else (if_statement "if (0 < param_1[1]) {\n    puVar1 = (undefined1 *)*param_1;\n    *param_1 = (int)(puVar1 + 1);\n    *puVar1 = (char)param_2;\n    param_1[1] = param_1[1] + -1;\n    return;\n  }" if (parenthesized_expression "(0 < param_1[1])" ( (binary_expression "0 < param_1[1]" number_literal < (subscript_expression "param_1[1]" identifier [ number_literal ])) )) (compound_statement "{\n    puVar1 = (undefined1 *)*param_1;\n    *param_1 = (int)(puVar1 + 1);\n    *puVar1 = (char)param_2;\n    param_1[1] = param_1[1] + -1;\n    return;\n  }" { (expression_statement "puVar1 = (undefined1 *)*param_1;" (assignment_expression "puVar1 = (undefined1 *)*param_1" identifier = (cast_expression "(undefined1 *)*param_1" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) (expression_statement "*param_1 = (int)(puVar1 + 1);" (assignment_expression "*param_1 = (int)(puVar1 + 1)" (pointer_expression "*param_1" * identifier) = (cast_expression "(int)(puVar1 + 1)" ( (type_descriptor "int" primitive_type) ) (parenthesized_expression "(puVar1 + 1)" ( (binary_expression "puVar1 + 1" identifier + number_literal) )))) ;) (expression_statement "*puVar1 = (char)param_2;" (assignment_expression "*puVar1 = (char)param_2" (pointer_expression "*puVar1" * identifier) = (cast_expression "(char)param_2" ( (type_descriptor "char" primitive_type) ) identifier)) ;) (expression_statement "param_1[1] = param_1[1] + -1;" (assignment_expression "param_1[1] = param_1[1] + -1" (subscript_expression "param_1[1]" identifier [ number_literal ]) = (binary_expression "param_1[1] + -1" (subscript_expression "param_1[1]" identifier [ number_literal ]) + number_literal)) ;) (return_statement "return;" return ;) })))) (expression_statement "param_1[4] = 1;" (assignment_expression "param_1[4] = 1" (subscript_expression "param_1[4]" identifier [ number_literal ]) = number_literal) ;) (return_statement "return;" return ;) })))
(translation_unit "void charset_emit(void *ctx,wchar_t output)\n\n{\n  undefined1 *puVar1;\n  int iVar2;\n  undefined1 *puVar3;\n  undefined1 *puVar4;\n  undefined1 *puVar5;\n  \n  if (output == L'\xffff') {\n    iVar2 = *(int *)((int)ctx + 0xc);\n    if (iVar2 <= *(int *)((int)ctx + 4)) {\n      if (iVar2 < 1) {\n        return;\n      }\n      puVar1 = *(undefined1 **)((int)ctx + 8);\n      puVar4 = puVar1;\n      do {\n                    /* WARNING: Load size is inaccurate */\n        puVar3 = *ctx;\n        puVar5 = puVar4 + 1;\n        *(undefined1 **)ctx = puVar3 + 1;\n        *puVar3 = *puVar4;\n        *(int *)((int)ctx + 4) = *(int *)((int)ctx + 4) + -1;\n        puVar4 = puVar5;\n      } while (puVar5 != puVar1 + iVar2);\n      return;\n    }\n  }\n  else if (0 < *(int *)((int)ctx + 4)) {\n                    /* WARNING: Load size is inaccurate */\n    puVar1 = *ctx;\n    *(undefined1 **)ctx = puVar1 + 1;\n    *puVar1 = (char)output;\n    *(int *)((int)ctx + 4) = *(int *)((int)ctx + 4) + -1;\n    return;\n  }\n  *(undefined4 *)((int)ctx + 0x10) = 1;\n  return;\n}\n\n" (function_definition "void charset_emit(void *ctx,wchar_t output)\n\n{\n  undefined1 *puVar1;\n  int iVar2;\n  undefined1 *puVar3;\n  undefined1 *puVar4;\n  undefined1 *puVar5;\n  \n  if (output == L'\xffff') {\n    iVar2 = *(int *)((int)ctx + 0xc);\n    if (iVar2 <= *(int *)((int)ctx + 4)) {\n      if (iVar2 < 1) {\n        return;\n      }\n      puVar1 = *(undefined1 **)((int)ctx + 8);\n      puVar4 = puVar1;\n      do {\n                    /* WARNING: Load size is inaccurate */\n        puVar3 = *ctx;\n        puVar5 = puVar4 + 1;\n        *(undefined1 **)ctx = puVar3 + 1;\n        *puVar3 = *puVar4;\n        *(int *)((int)ctx + 4) = *(int *)((int)ctx + 4) + -1;\n        puVar4 = puVar5;\n      } while (puVar5 != puVar1 + iVar2);\n      return;\n    }\n  }\n  else if (0 < *(int *)((int)ctx + 4)) {\n                    /* WARNING: Load size is inaccurate */\n    puVar1 = *ctx;\n    *(undefined1 **)ctx = puVar1 + 1;\n    *puVar1 = (char)output;\n    *(int *)((int)ctx + 4) = *(int *)((int)ctx + 4) + -1;\n    return;\n  }\n  *(undefined4 *)((int)ctx + 0x10) = 1;\n  return;\n}" primitive_type (function_declarator "charset_emit(void *ctx,wchar_t output)" identifier (parameter_list "(void *ctx,wchar_t output)" ( (parameter_declaration "void *ctx" primitive_type (pointer_declarator "*ctx" * identifier)) , (parameter_declaration "wchar_t output" type_identifier identifier) ))) (compound_statement "{\n  undefined1 *puVar1;\n  int iVar2;\n  undefined1 *puVar3;\n  undefined1 *puVar4;\n  undefined1 *puVar5;\n  \n  if (output == L'\xffff') {\n    iVar2 = *(int *)((int)ctx + 0xc);\n    if (iVar2 <= *(int *)((int)ctx + 4)) {\n      if (iVar2 < 1) {\n        return;\n      }\n      puVar1 = *(undefined1 **)((int)ctx + 8);\n      puVar4 = puVar1;\n      do {\n                    /* WARNING: Load size is inaccurate */\n        puVar3 = *ctx;\n        puVar5 = puVar4 + 1;\n        *(undefined1 **)ctx = puVar3 + 1;\n        *puVar3 = *puVar4;\n        *(int *)((int)ctx + 4) = *(int *)((int)ctx + 4) + -1;\n        puVar4 = puVar5;\n      } while (puVar5 != puVar1 + iVar2);\n      return;\n    }\n  }\n  else if (0 < *(int *)((int)ctx + 4)) {\n                    /* WARNING: Load size is inaccurate */\n    puVar1 = *ctx;\n    *(undefined1 **)ctx = puVar1 + 1;\n    *puVar1 = (char)output;\n    *(int *)((int)ctx + 4) = *(int *)((int)ctx + 4) + -1;\n    return;\n  }\n  *(undefined4 *)((int)ctx + 0x10) = 1;\n  return;\n}" { (declaration "undefined1 *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "undefined1 *puVar3;" type_identifier (pointer_declarator "*puVar3" * identifier) ;) (declaration "undefined1 *puVar4;" type_identifier (pointer_declarator "*puVar4" * identifier) ;) (declaration "undefined1 *puVar5;" type_identifier (pointer_declarator "*puVar5" * identifier) ;) (if_statement "if (output == L'\xffff') {\n    iVar2 = *(int *)((int)ctx + 0xc);\n    if (iVar2 <= *(int *)((int)ctx + 4)) {\n      if (iVar2 < 1) {\n        return;\n      }\n      puVar1 = *(undefined1 **)((int)ctx + 8);\n      puVar4 = puVar1;\n      do {\n                    /* WARNING: Load size is inaccurate */\n        puVar3 = *ctx;\n        puVar5 = puVar4 + 1;\n        *(undefined1 **)ctx = puVar3 + 1;\n        *puVar3 = *puVar4;\n        *(int *)((int)ctx + 4) = *(int *)((int)ctx + 4) + -1;\n        puVar4 = puVar5;\n      } while (puVar5 != puVar1 + iVar2);\n      return;\n    }\n  }\n  else if (0 < *(int *)((int)ctx + 4)) {\n                    /* WARNING: Load size is inaccurate */\n    puVar1 = *ctx;\n    *(undefined1 **)ctx = puVar1 + 1;\n    *puVar1 = (char)output;\n    *(int *)((int)ctx + 4) = *(int *)((int)ctx + 4) + -1;\n    return;\n  }" if (parenthesized_expression "(output == L'\xffff')" ( (binary_expression "output == L'\xffff'" identifier == (char_literal "L'\xffff'" L' escape_sequence ')) )) (compound_statement "{\n    iVar2 = *(int *)((int)ctx + 0xc);\n    if (iVar2 <= *(int *)((int)ctx + 4)) {\n      if (iVar2 < 1) {\n        return;\n      }\n      puVar1 = *(undefined1 **)((int)ctx + 8);\n      puVar4 = puVar1;\n      do {\n                    /* WARNING: Load size is inaccurate */\n        puVar3 = *ctx;\n        puVar5 = puVar4 + 1;\n        *(undefined1 **)ctx = puVar3 + 1;\n        *puVar3 = *puVar4;\n        *(int *)((int)ctx + 4) = *(int *)((int)ctx + 4) + -1;\n        puVar4 = puVar5;\n      } while (puVar5 != puVar1 + iVar2);\n      return;\n    }\n  }" { (expression_statement "iVar2 = *(int *)((int)ctx + 0xc);" (assignment_expression "iVar2 = *(int *)((int)ctx + 0xc)" identifier = (pointer_expression "*(int *)((int)ctx + 0xc)" * (cast_expression "(int *)((int)ctx + 0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)ctx + 0xc)" ( (binary_expression "(int)ctx + 0xc" (cast_expression "(int)ctx" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) ))))) ;) (if_statement "if (iVar2 <= *(int *)((int)ctx + 4)) {\n      if (iVar2 < 1) {\n        return;\n      }\n      puVar1 = *(undefined1 **)((int)ctx + 8);\n      puVar4 = puVar1;\n      do {\n                    /* WARNING: Load size is inaccurate */\n        puVar3 = *ctx;\n        puVar5 = puVar4 + 1;\n        *(undefined1 **)ctx = puVar3 + 1;\n        *puVar3 = *puVar4;\n        *(int *)((int)ctx + 4) = *(int *)((int)ctx + 4) + -1;\n        puVar4 = puVar5;\n      } while (puVar5 != puVar1 + iVar2);\n      return;\n    }" if (parenthesized_expression "(iVar2 <= *(int *)((int)ctx + 4))" ( (binary_expression "iVar2 <= *(int *)((int)ctx + 4)" identifier <= (pointer_expression "*(int *)((int)ctx + 4)" * (cast_expression "(int *)((int)ctx + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)ctx + 4)" ( (binary_expression "(int)ctx + 4" (cast_expression "(int)ctx" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) ))))) )) (compound_statement "{\n      if (iVar2 < 1) {\n        return;\n      }\n      puVar1 = *(undefined1 **)((int)ctx + 8);\n      puVar4 = puVar1;\n      do {\n                    /* WARNING: Load size is inaccurate */\n        puVar3 = *ctx;\n        puVar5 = puVar4 + 1;\n        *(undefined1 **)ctx = puVar3 + 1;\n        *puVar3 = *puVar4;\n        *(int *)((int)ctx + 4) = *(int *)((int)ctx + 4) + -1;\n        puVar4 = puVar5;\n      } while (puVar5 != puVar1 + iVar2);\n      return;\n    }" { (if_statement "if (iVar2 < 1) {\n        return;\n      }" if (parenthesized_expression "(iVar2 < 1)" ( (binary_expression "iVar2 < 1" identifier < number_literal) )) (compound_statement "{\n        return;\n      }" { (return_statement "return;" return ;) })) (expression_statement "puVar1 = *(undefined1 **)((int)ctx + 8);" (assignment_expression "puVar1 = *(undefined1 **)((int)ctx + 8)" identifier = (pointer_expression "*(undefined1 **)((int)ctx + 8)" * (cast_expression "(undefined1 **)((int)ctx + 8)" ( (type_descriptor "undefined1 **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "((int)ctx + 8)" ( (binary_expression "(int)ctx + 8" (cast_expression "(int)ctx" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) ))))) ;) (expression_statement "puVar4 = puVar1;" (assignment_expression "puVar4 = puVar1" identifier = identifier) ;) (do_statement "do {\n                    /* WARNING: Load size is inaccurate */\n        puVar3 = *ctx;\n        puVar5 = puVar4 + 1;\n        *(undefined1 **)ctx = puVar3 + 1;\n        *puVar3 = *puVar4;\n        *(int *)((int)ctx + 4) = *(int *)((int)ctx + 4) + -1;\n        puVar4 = puVar5;\n      } while (puVar5 != puVar1 + iVar2);" do (compound_statement "{\n                    /* WARNING: Load size is inaccurate */\n        puVar3 = *ctx;\n        puVar5 = puVar4 + 1;\n        *(undefined1 **)ctx = puVar3 + 1;\n        *puVar3 = *puVar4;\n        *(int *)((int)ctx + 4) = *(int *)((int)ctx + 4) + -1;\n        puVar4 = puVar5;\n      }" { comment (expression_statement "puVar3 = *ctx;" (assignment_expression "puVar3 = *ctx" identifier = (pointer_expression "*ctx" * identifier)) ;) (expression_statement "puVar5 = puVar4 + 1;" (assignment_expression "puVar5 = puVar4 + 1" identifier = (binary_expression "puVar4 + 1" identifier + number_literal)) ;) (expression_statement "*(undefined1 **)ctx = puVar3 + 1;" (assignment_expression "*(undefined1 **)ctx = puVar3 + 1" (pointer_expression "*(undefined1 **)ctx" * (cast_expression "(undefined1 **)ctx" ( (type_descriptor "undefined1 **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier)) = (binary_expression "puVar3 + 1" identifier + number_literal)) ;) (expression_statement "*puVar3 = *puVar4;" (assignment_expression "*puVar3 = *puVar4" (pointer_expression "*puVar3" * identifier) = (pointer_expression "*puVar4" * identifier)) ;) (expression_statement "*(int *)((int)ctx + 4) = *(int *)((int)ctx + 4) + -1;" (assignment_expression "*(int *)((int)ctx + 4) = *(int *)((int)ctx + 4) + -1" (pointer_expression "*(int *)((int)ctx + 4)" * (cast_expression "(int *)((int)ctx + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)ctx + 4)" ( (binary_expression "(int)ctx + 4" (cast_expression "(int)ctx" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) )))) = (binary_expression "*(int *)((int)ctx + 4) + -1" (pointer_expression "*(int *)((int)ctx + 4)" * (cast_expression "(int *)((int)ctx + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)ctx + 4)" ( (binary_expression "(int)ctx + 4" (cast_expression "(int)ctx" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) )))) + number_literal)) ;) (expression_statement "puVar4 = puVar5;" (assignment_expression "puVar4 = puVar5" identifier = identifier) ;) }) while (parenthesized_expression "(puVar5 != puVar1 + iVar2)" ( (binary_expression "puVar5 != puVar1 + iVar2" identifier != (binary_expression "puVar1 + iVar2" identifier + identifier)) )) ;) (return_statement "return;" return ;) })) }) (else_clause "else if (0 < *(int *)((int)ctx + 4)) {\n                    /* WARNING: Load size is inaccurate */\n    puVar1 = *ctx;\n    *(undefined1 **)ctx = puVar1 + 1;\n    *puVar1 = (char)output;\n    *(int *)((int)ctx + 4) = *(int *)((int)ctx + 4) + -1;\n    return;\n  }" else (if_statement "if (0 < *(int *)((int)ctx + 4)) {\n                    /* WARNING: Load size is inaccurate */\n    puVar1 = *ctx;\n    *(undefined1 **)ctx = puVar1 + 1;\n    *puVar1 = (char)output;\n    *(int *)((int)ctx + 4) = *(int *)((int)ctx + 4) + -1;\n    return;\n  }" if (parenthesized_expression "(0 < *(int *)((int)ctx + 4))" ( (binary_expression "0 < *(int *)((int)ctx + 4)" number_literal < (pointer_expression "*(int *)((int)ctx + 4)" * (cast_expression "(int *)((int)ctx + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)ctx + 4)" ( (binary_expression "(int)ctx + 4" (cast_expression "(int)ctx" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) ))))) )) (compound_statement "{\n                    /* WARNING: Load size is inaccurate */\n    puVar1 = *ctx;\n    *(undefined1 **)ctx = puVar1 + 1;\n    *puVar1 = (char)output;\n    *(int *)((int)ctx + 4) = *(int *)((int)ctx + 4) + -1;\n    return;\n  }" { comment (expression_statement "puVar1 = *ctx;" (assignment_expression "puVar1 = *ctx" identifier = (pointer_expression "*ctx" * identifier)) ;) (expression_statement "*(undefined1 **)ctx = puVar1 + 1;" (assignment_expression "*(undefined1 **)ctx = puVar1 + 1" (pointer_expression "*(undefined1 **)ctx" * (cast_expression "(undefined1 **)ctx" ( (type_descriptor "undefined1 **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier)) = (binary_expression "puVar1 + 1" identifier + number_literal)) ;) (expression_statement "*puVar1 = (char)output;" (assignment_expression "*puVar1 = (char)output" (pointer_expression "*puVar1" * identifier) = (cast_expression "(char)output" ( (type_descriptor "char" primitive_type) ) identifier)) ;) (expression_statement "*(int *)((int)ctx + 4) = *(int *)((int)ctx + 4) + -1;" (assignment_expression "*(int *)((int)ctx + 4) = *(int *)((int)ctx + 4) + -1" (pointer_expression "*(int *)((int)ctx + 4)" * (cast_expression "(int *)((int)ctx + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)ctx + 4)" ( (binary_expression "(int)ctx + 4" (cast_expression "(int)ctx" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) )))) = (binary_expression "*(int *)((int)ctx + 4) + -1" (pointer_expression "*(int *)((int)ctx + 4)" * (cast_expression "(int *)((int)ctx + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)ctx + 4)" ( (binary_expression "(int)ctx + 4" (cast_expression "(int)ctx" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) )))) + number_literal)) ;) (return_statement "return;" return ;) })))) (expression_statement "*(undefined4 *)((int)ctx + 0x10) = 1;" (assignment_expression "*(undefined4 *)((int)ctx + 0x10) = 1" (pointer_expression "*(undefined4 *)((int)ctx + 0x10)" * (cast_expression "(undefined4 *)((int)ctx + 0x10)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)ctx + 0x10)" ( (binary_expression "(int)ctx + 0x10" (cast_expression "(int)ctx" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) )))) = number_literal) ;) (return_statement "return;" return ;) })))
(translation_unit "void FUN_0001a680(int *param_1,int param_2)\n\n{\n  undefined1 *puVar1;\n  int iVar2;\n  undefined1 *puVar3;\n  undefined1 *puVar4;\n  undefined1 *puVar5;\n  \n  if (param_2 == 0xffff) {\n    iVar2 = param_1[3];\n    if (iVar2 <= param_1[1]) {\n      if (iVar2 < 1) {\n        return;\n      }\n      puVar1 = (undefined1 *)param_1[2];\n      puVar4 = puVar1;\n      do {\n        puVar3 = (undefined1 *)*param_1;\n        puVar5 = puVar4 + 1;\n        *param_1 = (int)(puVar3 + 1);\n        *puVar3 = *puVar4;\n        param_1[1] = param_1[1] + -1;\n        puVar4 = puVar5;\n      } while (puVar5 != puVar1 + iVar2);\n      return;\n    }\n  }\n  else if (0 < param_1[1]) {\n    puVar1 = (undefined1 *)*param_1;\n    *param_1 = (int)(puVar1 + 1);\n    *puVar1 = (char)param_2;\n    param_1[1] = param_1[1] + -1;\n    return;\n  }\n  param_1[4] = 1;\n  return;\n}\n\n" (function_definition "void FUN_0001a680(int *param_1,int param_2)\n\n{\n  undefined1 *puVar1;\n  int iVar2;\n  undefined1 *puVar3;\n  undefined1 *puVar4;\n  undefined1 *puVar5;\n  \n  if (param_2 == 0xffff) {\n    iVar2 = param_1[3];\n    if (iVar2 <= param_1[1]) {\n      if (iVar2 < 1) {\n        return;\n      }\n      puVar1 = (undefined1 *)param_1[2];\n      puVar4 = puVar1;\n      do {\n        puVar3 = (undefined1 *)*param_1;\n        puVar5 = puVar4 + 1;\n        *param_1 = (int)(puVar3 + 1);\n        *puVar3 = *puVar4;\n        param_1[1] = param_1[1] + -1;\n        puVar4 = puVar5;\n      } while (puVar5 != puVar1 + iVar2);\n      return;\n    }\n  }\n  else if (0 < param_1[1]) {\n    puVar1 = (undefined1 *)*param_1;\n    *param_1 = (int)(puVar1 + 1);\n    *puVar1 = (char)param_2;\n    param_1[1] = param_1[1] + -1;\n    return;\n  }\n  param_1[4] = 1;\n  return;\n}" primitive_type (function_declarator "FUN_0001a680(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  undefined1 *puVar1;\n  int iVar2;\n  undefined1 *puVar3;\n  undefined1 *puVar4;\n  undefined1 *puVar5;\n  \n  if (param_2 == 0xffff) {\n    iVar2 = param_1[3];\n    if (iVar2 <= param_1[1]) {\n      if (iVar2 < 1) {\n        return;\n      }\n      puVar1 = (undefined1 *)param_1[2];\n      puVar4 = puVar1;\n      do {\n        puVar3 = (undefined1 *)*param_1;\n        puVar5 = puVar4 + 1;\n        *param_1 = (int)(puVar3 + 1);\n        *puVar3 = *puVar4;\n        param_1[1] = param_1[1] + -1;\n        puVar4 = puVar5;\n      } while (puVar5 != puVar1 + iVar2);\n      return;\n    }\n  }\n  else if (0 < param_1[1]) {\n    puVar1 = (undefined1 *)*param_1;\n    *param_1 = (int)(puVar1 + 1);\n    *puVar1 = (char)param_2;\n    param_1[1] = param_1[1] + -1;\n    return;\n  }\n  param_1[4] = 1;\n  return;\n}" { (declaration "undefined1 *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "undefined1 *puVar3;" type_identifier (pointer_declarator "*puVar3" * identifier) ;) (declaration "undefined1 *puVar4;" type_identifier (pointer_declarator "*puVar4" * identifier) ;) (declaration "undefined1 *puVar5;" type_identifier (pointer_declarator "*puVar5" * identifier) ;) (if_statement "if (param_2 == 0xffff) {\n    iVar2 = param_1[3];\n    if (iVar2 <= param_1[1]) {\n      if (iVar2 < 1) {\n        return;\n      }\n      puVar1 = (undefined1 *)param_1[2];\n      puVar4 = puVar1;\n      do {\n        puVar3 = (undefined1 *)*param_1;\n        puVar5 = puVar4 + 1;\n        *param_1 = (int)(puVar3 + 1);\n        *puVar3 = *puVar4;\n        param_1[1] = param_1[1] + -1;\n        puVar4 = puVar5;\n      } while (puVar5 != puVar1 + iVar2);\n      return;\n    }\n  }\n  else if (0 < param_1[1]) {\n    puVar1 = (undefined1 *)*param_1;\n    *param_1 = (int)(puVar1 + 1);\n    *puVar1 = (char)param_2;\n    param_1[1] = param_1[1] + -1;\n    return;\n  }" if (parenthesized_expression "(param_2 == 0xffff)" ( (binary_expression "param_2 == 0xffff" identifier == number_literal) )) (compound_statement "{\n    iVar2 = param_1[3];\n    if (iVar2 <= param_1[1]) {\n      if (iVar2 < 1) {\n        return;\n      }\n      puVar1 = (undefined1 *)param_1[2];\n      puVar4 = puVar1;\n      do {\n        puVar3 = (undefined1 *)*param_1;\n        puVar5 = puVar4 + 1;\n        *param_1 = (int)(puVar3 + 1);\n        *puVar3 = *puVar4;\n        param_1[1] = param_1[1] + -1;\n        puVar4 = puVar5;\n      } while (puVar5 != puVar1 + iVar2);\n      return;\n    }\n  }" { (expression_statement "iVar2 = param_1[3];" (assignment_expression "iVar2 = param_1[3]" identifier = (subscript_expression "param_1[3]" identifier [ number_literal ])) ;) (if_statement "if (iVar2 <= param_1[1]) {\n      if (iVar2 < 1) {\n        return;\n      }\n      puVar1 = (undefined1 *)param_1[2];\n      puVar4 = puVar1;\n      do {\n        puVar3 = (undefined1 *)*param_1;\n        puVar5 = puVar4 + 1;\n        *param_1 = (int)(puVar3 + 1);\n        *puVar3 = *puVar4;\n        param_1[1] = param_1[1] + -1;\n        puVar4 = puVar5;\n      } while (puVar5 != puVar1 + iVar2);\n      return;\n    }" if (parenthesized_expression "(iVar2 <= param_1[1])" ( (binary_expression "iVar2 <= param_1[1]" identifier <= (subscript_expression "param_1[1]" identifier [ number_literal ])) )) (compound_statement "{\n      if (iVar2 < 1) {\n        return;\n      }\n      puVar1 = (undefined1 *)param_1[2];\n      puVar4 = puVar1;\n      do {\n        puVar3 = (undefined1 *)*param_1;\n        puVar5 = puVar4 + 1;\n        *param_1 = (int)(puVar3 + 1);\n        *puVar3 = *puVar4;\n        param_1[1] = param_1[1] + -1;\n        puVar4 = puVar5;\n      } while (puVar5 != puVar1 + iVar2);\n      return;\n    }" { (if_statement "if (iVar2 < 1) {\n        return;\n      }" if (parenthesized_expression "(iVar2 < 1)" ( (binary_expression "iVar2 < 1" identifier < number_literal) )) (compound_statement "{\n        return;\n      }" { (return_statement "return;" return ;) })) (expression_statement "puVar1 = (undefined1 *)param_1[2];" (assignment_expression "puVar1 = (undefined1 *)param_1[2]" identifier = (cast_expression "(undefined1 *)param_1[2]" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (subscript_expression "param_1[2]" identifier [ number_literal ]))) ;) (expression_statement "puVar4 = puVar1;" (assignment_expression "puVar4 = puVar1" identifier = identifier) ;) (do_statement "do {\n        puVar3 = (undefined1 *)*param_1;\n        puVar5 = puVar4 + 1;\n        *param_1 = (int)(puVar3 + 1);\n        *puVar3 = *puVar4;\n        param_1[1] = param_1[1] + -1;\n        puVar4 = puVar5;\n      } while (puVar5 != puVar1 + iVar2);" do (compound_statement "{\n        puVar3 = (undefined1 *)*param_1;\n        puVar5 = puVar4 + 1;\n        *param_1 = (int)(puVar3 + 1);\n        *puVar3 = *puVar4;\n        param_1[1] = param_1[1] + -1;\n        puVar4 = puVar5;\n      }" { (expression_statement "puVar3 = (undefined1 *)*param_1;" (assignment_expression "puVar3 = (undefined1 *)*param_1" identifier = (cast_expression "(undefined1 *)*param_1" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) (expression_statement "puVar5 = puVar4 + 1;" (assignment_expression "puVar5 = puVar4 + 1" identifier = (binary_expression "puVar4 + 1" identifier + number_literal)) ;) (expression_statement "*param_1 = (int)(puVar3 + 1);" (assignment_expression "*param_1 = (int)(puVar3 + 1)" (pointer_expression "*param_1" * identifier) = (cast_expression "(int)(puVar3 + 1)" ( (type_descriptor "int" primitive_type) ) (parenthesized_expression "(puVar3 + 1)" ( (binary_expression "puVar3 + 1" identifier + number_literal) )))) ;) (expression_statement "*puVar3 = *puVar4;" (assignment_expression "*puVar3 = *puVar4" (pointer_expression "*puVar3" * identifier) = (pointer_expression "*puVar4" * identifier)) ;) (expression_statement "param_1[1] = param_1[1] + -1;" (assignment_expression "param_1[1] = param_1[1] + -1" (subscript_expression "param_1[1]" identifier [ number_literal ]) = (binary_expression "param_1[1] + -1" (subscript_expression "param_1[1]" identifier [ number_literal ]) + number_literal)) ;) (expression_statement "puVar4 = puVar5;" (assignment_expression "puVar4 = puVar5" identifier = identifier) ;) }) while (parenthesized_expression "(puVar5 != puVar1 + iVar2)" ( (binary_expression "puVar5 != puVar1 + iVar2" identifier != (binary_expression "puVar1 + iVar2" identifier + identifier)) )) ;) (return_statement "return;" return ;) })) }) (else_clause "else if (0 < param_1[1]) {\n    puVar1 = (undefined1 *)*param_1;\n    *param_1 = (int)(puVar1 + 1);\n    *puVar1 = (char)param_2;\n    param_1[1] = param_1[1] + -1;\n    return;\n  }" else (if_statement "if (0 < param_1[1]) {\n    puVar1 = (undefined1 *)*param_1;\n    *param_1 = (int)(puVar1 + 1);\n    *puVar1 = (char)param_2;\n    param_1[1] = param_1[1] + -1;\n    return;\n  }" if (parenthesized_expression "(0 < param_1[1])" ( (binary_expression "0 < param_1[1]" number_literal < (subscript_expression "param_1[1]" identifier [ number_literal ])) )) (compound_statement "{\n    puVar1 = (undefined1 *)*param_1;\n    *param_1 = (int)(puVar1 + 1);\n    *puVar1 = (char)param_2;\n    param_1[1] = param_1[1] + -1;\n    return;\n  }" { (expression_statement "puVar1 = (undefined1 *)*param_1;" (assignment_expression "puVar1 = (undefined1 *)*param_1" identifier = (cast_expression "(undefined1 *)*param_1" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) (expression_statement "*param_1 = (int)(puVar1 + 1);" (assignment_expression "*param_1 = (int)(puVar1 + 1)" (pointer_expression "*param_1" * identifier) = (cast_expression "(int)(puVar1 + 1)" ( (type_descriptor "int" primitive_type) ) (parenthesized_expression "(puVar1 + 1)" ( (binary_expression "puVar1 + 1" identifier + number_literal) )))) ;) (expression_statement "*puVar1 = (char)param_2;" (assignment_expression "*puVar1 = (char)param_2" (pointer_expression "*puVar1" * identifier) = (cast_expression "(char)param_2" ( (type_descriptor "char" primitive_type) ) identifier)) ;) (expression_statement "param_1[1] = param_1[1] + -1;" (assignment_expression "param_1[1] = param_1[1] + -1" (subscript_expression "param_1[1]" identifier [ number_literal ]) = (binary_expression "param_1[1] + -1" (subscript_expression "param_1[1]" identifier [ number_literal ]) + number_literal)) ;) (return_statement "return;" return ;) })))) (expression_statement "param_1[4] = 1;" (assignment_expression "param_1[4] = 1" (subscript_expression "param_1[4]" identifier [ number_literal ]) = number_literal) ;) (return_statement "return;" return ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT <= (subscript_expression IDENT [ LIT ])) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (return_statement return ;) })) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (subscript_expression IDENT [ LIT ]))) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = (cast_expression ( (type_descriptor TYPE) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = (pointer_expression * IDENT)) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (binary_expression (subscript_expression IDENT [ LIT ]) + LIT)) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) }) while (parenthesized_expression ( (binary_expression IDENT != (binary_expression IDENT + IDENT)) )) ;) (return_statement return ;) })) }) (else_clause else (if_statement if (parenthesized_expression ( (binary_expression LIT < (subscript_expression IDENT [ LIT ])) )) (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = (cast_expression ( (type_descriptor TYPE) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = (cast_expression ( (type_descriptor TYPE) ) IDENT)) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (binary_expression (subscript_expression IDENT [ LIT ]) + LIT)) ;) (return_statement return ;) })))) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = LIT) ;) (return_statement return ;) })))
(function_definition "void FUN_0001a680(int *param_1,int param_2)\n\n{\n  undefined1 *puVar1;\n  int iVar2;\n  undefined1 *puVar3;\n  undefined1 *puVar4;\n  undefined1 *puVar5;\n  \n  if (param_2 == 0xffff) {\n    iVar2 = param_1[3];\n    if (iVar2 <= param_1[1]) {\n      if (iVar2 < 1) {\n        return;\n      }\n      puVar1 = (undefined1 *)param_1[2];\n      puVar4 = puVar1;\n      do {\n        puVar3 = (undefined1 *)*param_1;\n        puVar5 = puVar4 + 1;\n        *param_1 = (int)(puVar3 + 1);\n        *puVar3 = *puVar4;\n        param_1[1] = param_1[1] + -1;\n        puVar4 = puVar5;\n      } while (puVar5 != puVar1 + iVar2);\n      return;\n    }\n  }\n  else if (0 < param_1[1]) {\n    puVar1 = (undefined1 *)*param_1;\n    *param_1 = (int)(puVar1 + 1);\n    *puVar1 = (char)param_2;\n    param_1[1] = param_1[1] + -1;\n    return;\n  }\n  param_1[4] = 1;\n  return;\n}" (primitive_type "void") (function_declarator "FUN_0001a680(int *param_1,int param_2)" (identifier "FUN_0001a680") (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  undefined1 *puVar1;\n  int iVar2;\n  undefined1 *puVar3;\n  undefined1 *puVar4;\n  undefined1 *puVar5;\n  \n  if (param_2 == 0xffff) {\n    iVar2 = param_1[3];\n    if (iVar2 <= param_1[1]) {\n      if (iVar2 < 1) {\n        return;\n      }\n      puVar1 = (undefined1 *)param_1[2];\n      puVar4 = puVar1;\n      do {\n        puVar3 = (undefined1 *)*param_1;\n        puVar5 = puVar4 + 1;\n        *param_1 = (int)(puVar3 + 1);\n        *puVar3 = *puVar4;\n        param_1[1] = param_1[1] + -1;\n        puVar4 = puVar5;\n      } while (puVar5 != puVar1 + iVar2);\n      return;\n    }\n  }\n  else if (0 < param_1[1]) {\n    puVar1 = (undefined1 *)*param_1;\n    *param_1 = (int)(puVar1 + 1);\n    *puVar1 = (char)param_2;\n    param_1[1] = param_1[1] + -1;\n    return;\n  }\n  param_1[4] = 1;\n  return;\n}" ({ "{") (declaration "undefined1 *puVar1;" (type_identifier "undefined1") (pointer_declarator "*puVar1" (* "*") (identifier "puVar1")) (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "undefined1 *puVar3;" (type_identifier "undefined1") (pointer_declarator "*puVar3" (* "*") (identifier "puVar3")) (; ";")) (declaration "undefined1 *puVar4;" (type_identifier "undefined1") (pointer_declarator "*puVar4" (* "*") (identifier "puVar4")) (; ";")) (declaration "undefined1 *puVar5;" (type_identifier "undefined1") (pointer_declarator "*puVar5" (* "*") (identifier "puVar5")) (; ";")) (if_statement "if (param_2 == 0xffff) {\n    iVar2 = param_1[3];\n    if (iVar2 <= param_1[1]) {\n      if (iVar2 < 1) {\n        return;\n      }\n      puVar1 = (undefined1 *)param_1[2];\n      puVar4 = puVar1;\n      do {\n        puVar3 = (undefined1 *)*param_1;\n        puVar5 = puVar4 + 1;\n        *param_1 = (int)(puVar3 + 1);\n        *puVar3 = *puVar4;\n        param_1[1] = param_1[1] + -1;\n        puVar4 = puVar5;\n      } while (puVar5 != puVar1 + iVar2);\n      return;\n    }\n  }\n  else if (0 < param_1[1]) {\n    puVar1 = (undefined1 *)*param_1;\n    *param_1 = (int)(puVar1 + 1);\n    *puVar1 = (char)param_2;\n    param_1[1] = param_1[1] + -1;\n    return;\n  }" (if "if") (parenthesized_expression "(param_2 == 0xffff)" (( "(") (binary_expression "param_2 == 0xffff" (identifier "param_2") (== "==") (number_literal "0xffff")) () ")")) (compound_statement "{\n    iVar2 = param_1[3];\n    if (iVar2 <= param_1[1]) {\n      if (iVar2 < 1) {\n        return;\n      }\n      puVar1 = (undefined1 *)param_1[2];\n      puVar4 = puVar1;\n      do {\n        puVar3 = (undefined1 *)*param_1;\n        puVar5 = puVar4 + 1;\n        *param_1 = (int)(puVar3 + 1);\n        *puVar3 = *puVar4;\n        param_1[1] = param_1[1] + -1;\n        puVar4 = puVar5;\n      } while (puVar5 != puVar1 + iVar2);\n      return;\n    }\n  }" ({ "{") (expression_statement "iVar2 = param_1[3];" (assignment_expression "iVar2 = param_1[3]" (identifier "iVar2") (= "=") (subscript_expression "param_1[3]" (identifier "param_1") ([ "[") (number_literal "3") (] "]"))) (; ";")) (if_statement "if (iVar2 <= param_1[1]) {\n      if (iVar2 < 1) {\n        return;\n      }\n      puVar1 = (undefined1 *)param_1[2];\n      puVar4 = puVar1;\n      do {\n        puVar3 = (undefined1 *)*param_1;\n        puVar5 = puVar4 + 1;\n        *param_1 = (int)(puVar3 + 1);\n        *puVar3 = *puVar4;\n        param_1[1] = param_1[1] + -1;\n        puVar4 = puVar5;\n      } while (puVar5 != puVar1 + iVar2);\n      return;\n    }" (if "if") (parenthesized_expression "(iVar2 <= param_1[1])" (( "(") (binary_expression "iVar2 <= param_1[1]" (identifier "iVar2") (<= "<=") (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]"))) () ")")) (compound_statement "{\n      if (iVar2 < 1) {\n        return;\n      }\n      puVar1 = (undefined1 *)param_1[2];\n      puVar4 = puVar1;\n      do {\n        puVar3 = (undefined1 *)*param_1;\n        puVar5 = puVar4 + 1;\n        *param_1 = (int)(puVar3 + 1);\n        *puVar3 = *puVar4;\n        param_1[1] = param_1[1] + -1;\n        puVar4 = puVar5;\n      } while (puVar5 != puVar1 + iVar2);\n      return;\n    }" ({ "{") (if_statement "if (iVar2 < 1) {\n        return;\n      }" (if "if") (parenthesized_expression "(iVar2 < 1)" (( "(") (binary_expression "iVar2 < 1" (identifier "iVar2") (< "<") (number_literal "1")) () ")")) (compound_statement "{\n        return;\n      }" ({ "{") (return_statement "return;" (return "return") (; ";")) (} "}"))) (expression_statement "puVar1 = (undefined1 *)param_1[2];" (assignment_expression "puVar1 = (undefined1 *)param_1[2]" (identifier "puVar1") (= "=") (cast_expression "(undefined1 *)param_1[2]" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]")))) (; ";")) (expression_statement "puVar4 = puVar1;" (assignment_expression "puVar4 = puVar1" (identifier "puVar4") (= "=") (identifier "puVar1")) (; ";")) (do_statement "do {\n        puVar3 = (undefined1 *)*param_1;\n        puVar5 = puVar4 + 1;\n        *param_1 = (int)(puVar3 + 1);\n        *puVar3 = *puVar4;\n        param_1[1] = param_1[1] + -1;\n        puVar4 = puVar5;\n      } while (puVar5 != puVar1 + iVar2);" (do "do") (compound_statement "{\n        puVar3 = (undefined1 *)*param_1;\n        puVar5 = puVar4 + 1;\n        *param_1 = (int)(puVar3 + 1);\n        *puVar3 = *puVar4;\n        param_1[1] = param_1[1] + -1;\n        puVar4 = puVar5;\n      }" ({ "{") (expression_statement "puVar3 = (undefined1 *)*param_1;" (assignment_expression "puVar3 = (undefined1 *)*param_1" (identifier "puVar3") (= "=") (cast_expression "(undefined1 *)*param_1" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (expression_statement "puVar5 = puVar4 + 1;" (assignment_expression "puVar5 = puVar4 + 1" (identifier "puVar5") (= "=") (binary_expression "puVar4 + 1" (identifier "puVar4") (+ "+") (number_literal "1"))) (; ";")) (expression_statement "*param_1 = (int)(puVar3 + 1);" (assignment_expression "*param_1 = (int)(puVar3 + 1)" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (= "=") (cast_expression "(int)(puVar3 + 1)" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (parenthesized_expression "(puVar3 + 1)" (( "(") (binary_expression "puVar3 + 1" (identifier "puVar3") (+ "+") (number_literal "1")) () ")")))) (; ";")) (expression_statement "*puVar3 = *puVar4;" (assignment_expression "*puVar3 = *puVar4" (pointer_expression "*puVar3" (* "*") (identifier "puVar3")) (= "=") (pointer_expression "*puVar4" (* "*") (identifier "puVar4"))) (; ";")) (expression_statement "param_1[1] = param_1[1] + -1;" (assignment_expression "param_1[1] = param_1[1] + -1" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (= "=") (binary_expression "param_1[1] + -1" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (+ "+") (number_literal "-1"))) (; ";")) (expression_statement "puVar4 = puVar5;" (assignment_expression "puVar4 = puVar5" (identifier "puVar4") (= "=") (identifier "puVar5")) (; ";")) (} "}")) (while "while") (parenthesized_expression "(puVar5 != puVar1 + iVar2)" (( "(") (binary_expression "puVar5 != puVar1 + iVar2" (identifier "puVar5") (!= "!=") (binary_expression "puVar1 + iVar2" (identifier "puVar1") (+ "+") (identifier "iVar2"))) () ")")) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}"))) (} "}")) (else_clause "else if (0 < param_1[1]) {\n    puVar1 = (undefined1 *)*param_1;\n    *param_1 = (int)(puVar1 + 1);\n    *puVar1 = (char)param_2;\n    param_1[1] = param_1[1] + -1;\n    return;\n  }" (else "else") (if_statement "if (0 < param_1[1]) {\n    puVar1 = (undefined1 *)*param_1;\n    *param_1 = (int)(puVar1 + 1);\n    *puVar1 = (char)param_2;\n    param_1[1] = param_1[1] + -1;\n    return;\n  }" (if "if") (parenthesized_expression "(0 < param_1[1])" (( "(") (binary_expression "0 < param_1[1]" (number_literal "0") (< "<") (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]"))) () ")")) (compound_statement "{\n    puVar1 = (undefined1 *)*param_1;\n    *param_1 = (int)(puVar1 + 1);\n    *puVar1 = (char)param_2;\n    param_1[1] = param_1[1] + -1;\n    return;\n  }" ({ "{") (expression_statement "puVar1 = (undefined1 *)*param_1;" (assignment_expression "puVar1 = (undefined1 *)*param_1" (identifier "puVar1") (= "=") (cast_expression "(undefined1 *)*param_1" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (expression_statement "*param_1 = (int)(puVar1 + 1);" (assignment_expression "*param_1 = (int)(puVar1 + 1)" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (= "=") (cast_expression "(int)(puVar1 + 1)" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (parenthesized_expression "(puVar1 + 1)" (( "(") (binary_expression "puVar1 + 1" (identifier "puVar1") (+ "+") (number_literal "1")) () ")")))) (; ";")) (expression_statement "*puVar1 = (char)param_2;" (assignment_expression "*puVar1 = (char)param_2" (pointer_expression "*puVar1" (* "*") (identifier "puVar1")) (= "=") (cast_expression "(char)param_2" (( "(") (type_descriptor "char" (primitive_type "char")) () ")") (identifier "param_2"))) (; ";")) (expression_statement "param_1[1] = param_1[1] + -1;" (assignment_expression "param_1[1] = param_1[1] + -1" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (= "=") (binary_expression "param_1[1] + -1" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (+ "+") (number_literal "-1"))) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}"))))) (expression_statement "param_1[4] = 1;" (assignment_expression "param_1[4] = 1" (subscript_expression "param_1[4]" (identifier "param_1") ([ "[") (number_literal "4") (] "]")) (= "=") (number_literal "1")) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}")))

void function_1(void *ctx,type_1 var_1)

{
  type_2 *var_6;
  int var_2;
  type_2 *var_4;
  type_2 *var_3;
  type_2 *var_5;
  
  if (var_1 == L'\xffff') {
    var_2 = *(int *)((int)ctx + 0xc);
    if (var_2 <= *(int *)((int)ctx + 4)) {
      if (var_2 < 1) {
        return;
      }
      var_6 = *(type_2 **)((int)ctx + 8);
      var_3 = var_6;
      do {
                    /* WARNING: Load size is inaccurate */
        var_4 = *ctx;
        var_5 = var_3 + 1;
        *(type_2 **)ctx = var_4 + 1;
        *var_4 = *var_3;
        *(int *)((int)ctx + 4) = *(int *)((int)ctx + 4) + -1;
        var_3 = var_5;
      } while (var_5 != var_6 + var_2);
      return;
    }
  }
  else if (0 < *(int *)((int)ctx + 4)) {
                    /* WARNING: Load size is inaccurate */
    var_6 = *ctx;
    *(type_2 **)ctx = var_6 + 1;
    *var_6 = (char)var_1;
    *(int *)((int)ctx + 4) = *(int *)((int)ctx + 4) + -1;
    return;
  }
  *(type_3 *)((int)ctx + 0x10) = 1;
  return;
}


(translation_unit (function_definition type: (primitive_type) 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: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (subscript_expression argument: (identifier) index: (number_literal)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (subscript_expression argument: (identifier) index: (number_literal)))) consequence: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (return_statement))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (subscript_expression argument: (identifier) index: (number_literal))))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (do_statement body: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (pointer_expression argument: (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (cast_expression type: (type_descriptor type: (primitive_type)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal)))))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (pointer_expression argument: (identifier)))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (binary_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (identifier)))) condition: (parenthesized_expression (binary_expression left: (identifier) right: (binary_expression left: (identifier) right: (identifier))))) (return_statement)))) alternative: (else_clause (if_statement condition: (parenthesized_expression (binary_expression left: (number_literal) right: (subscript_expression argument: (identifier) index: (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: (pointer_expression argument: (identifier))))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (cast_expression type: (type_descriptor type: (primitive_type)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal)))))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier)))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (binary_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (number_literal)))) (return_statement))))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (number_literal))) (return_statement))))

void MASKED(int *param_1,int param_2)

{
  undefined1 *puVar1;
  int iVar2;
  undefined1 *puVar3;
  undefined1 *puVar4;
  undefined1 *puVar5;
  
  if (param_2 == 0xffff) {
    iVar2 = param_1[3];
    if (iVar2 <= param_1[1]) {
      if (iVar2 < 1) {
        return;
      }
      puVar1 = (undefined1 *)param_1[2];
      puVar4 = puVar1;
      do {
        puVar3 = (undefined1 *)*param_1;
        puVar5 = puVar4 + 1;
        *param_1 = (int)(puVar3 + 1);
        *puVar3 = *puVar4;
        param_1[1] = param_1[1] + -1;
        puVar4 = puVar5;
      } while (puVar5 != puVar1 + iVar2);
      return;
    }
  }
  else if (0 < param_1[1]) {
    puVar1 = (undefined1 *)*param_1;
    *param_1 = (int)(puVar1 + 1);
    *puVar1 = (char)param_2;
    param_1[1] = param_1[1] + -1;
    return;
  }
  param_1[4] = 1;
  return;
}

