
int do_arg(work_stuff *work,char **mangled,string *result)

{
  int iVar1;
  string *psVar2;
  int iVar3;
  char *pcVar4;
  char *start;
  
  iVar1 = work->nrepeats;
  iVar3 = 0x6e;
  pcVar4 = *mangled;
LAB_003179e4:
  result->e = (char *)0x0;
  result->p = (char *)0x0;
  result->b = (char *)0x0;
  start = pcVar4;
  do {
    if (0 < iVar1) {
      psVar2 = work->previous_argument;
      work->nrepeats = iVar1 + -1;
      if (psVar2 == (string *)0x0) {
        return 0;
      }
      string_appends(result,psVar2,(string *)psVar2->p);
      return 1;
    }
    if (**mangled != iVar3) {
      psVar2 = work->previous_argument;
      if (psVar2 == (string *)0x0) {
        psVar2 = (string *)xmalloc(0xc);
        work->previous_argument = psVar2;
      }
      else if (psVar2->b != (char *)0x0) {
        (*(code *)PTR_free_004c5c18)();
        psVar2->p = (char *)0x0;
        psVar2->e = (char *)0x0;
        psVar2->b = (char *)0x0;
        iVar1 = do_type(work,mangled,work->previous_argument);
        goto joined_r0x00317b3c;
      }
      iVar1 = do_type(work,mangled,psVar2);
joined_r0x00317b3c:
      if (iVar1 == 0) {
        return 0;
      }
      string_appends(result,work->previous_argument,(string *)work->previous_argument->p);
      remember_type(work,start,(int)*mangled - (int)start);
      return 1;
    }
    *mangled = *mangled + 1;
    iVar1 = consume_count(mangled);
    work->nrepeats = iVar1;
    if (iVar1 < 1) {
      return 0;
    }
    pcVar4 = *mangled;
    if (iVar1 < 10) goto LAB_003179e4;
    start = pcVar4 + 1;
    if (*pcVar4 != '_') {
      return 0;
    }
    *mangled = start;
    result->e = (char *)0x0;
    result->p = (char *)0x0;
    result->b = (char *)0x0;
  } while( true );
}



undefined4 FUN_0031799c(int param_1,int *param_2,undefined4 *param_3)

{
  int iVar1;
  int *piVar2;
  int iVar3;
  char *pcVar4;
  char *pcVar5;
  
  iVar1 = *(int *)(param_1 + 0x50);
  iVar3 = 0x6e;
  pcVar4 = (char *)*param_2;
LAB_003179e4:
  param_3[2] = 0;
  param_3[1] = 0;
  *param_3 = 0;
  pcVar5 = pcVar4;
  do {
    if (0 < iVar1) {
      iVar3 = *(int *)(param_1 + 0x4c);
      *(int *)(param_1 + 0x50) = iVar1 + -1;
      if (iVar3 == 0) {
        return 0;
      }
      FUN_003127e8(param_3,iVar3,*(undefined4 *)(iVar3 + 4));
      return 1;
    }
    if (*(char *)*param_2 != iVar3) {
      piVar2 = *(int **)(param_1 + 0x4c);
      if (piVar2 == (int *)0x0) {
        piVar2 = (int *)xmalloc(0xc);
        *(int **)(param_1 + 0x4c) = piVar2;
      }
      else if (*piVar2 != 0) {
        (*(code *)PTR_free_004c5c18)();
        piVar2[1] = 0;
        piVar2[2] = 0;
        *piVar2 = 0;
        iVar1 = FUN_0031439c(param_1,param_2,*(undefined4 *)(param_1 + 0x4c));
        goto joined_r0x00317b3c;
      }
      iVar1 = FUN_0031439c(param_1,param_2,piVar2);
joined_r0x00317b3c:
      if (iVar1 == 0) {
        return 0;
      }
      FUN_003127e8(param_3,*(int *)(param_1 + 0x4c),*(undefined4 *)(*(int *)(param_1 + 0x4c) + 4));
      FUN_00312c3c(param_1,pcVar5,*param_2 - (int)pcVar5);
      return 1;
    }
    *param_2 = (int)((char *)*param_2 + 1);
    iVar1 = FUN_00311f28(param_2);
    *(int *)(param_1 + 0x50) = iVar1;
    if (iVar1 < 1) {
      return 0;
    }
    pcVar4 = (char *)*param_2;
    if (iVar1 < 10) goto LAB_003179e4;
    pcVar5 = pcVar4 + 1;
    if (*pcVar4 != '_') {
      return 0;
    }
    *param_2 = (int)pcVar5;
    param_3[2] = 0;
    param_3[1] = 0;
    *param_3 = 0;
  } while( true );
}


lui gp,0x1b
addiu gp,gp,0x18a4
addu gp,gp,t9
addiu sp,sp,-0x38
lw t9,-0x4268(gp)
lw v0,0x50(a0)
li t5,0x6e
sw s2,0x2c(sp)
addiu t9,t9,0x1f28
sw s3,0x30(sp)
or s3,a0,zero
sw s1,0x28(sp)
or s1,a2,zero
sw s0,0x24(sp)
or s0,a1,zero
sw gp,0x10(sp)
sw ra,0x34(sp)
lw s2,0x0(a1)
or a0,s0,zero
sw zero,0x8(s1)
sw zero,0x4(s1)
bgtz v0,0x00317a58
_sw zero,0x0(s1)
lw v0,0x0(s0)
addiu v1,v0,0x1
lb v0,0x0(v0)
bne v0,t5,0x00317af0
_nop
bal 0x00311f28
_sw v1,0x0(s0)
li a0,0x5f
lw gp,0x10(sp)
slti v1,v0,0xa
blez v0,0x00317ad0
_sw v0,0x50(s3)
bne v1,zero,0x003179e4
_lw s2,0x0(s0)
addiu s2,s2,0x1
lb v1,-0x1(s2)
bne v1,a0,0x00317ad4
_lw ra,0x34(sp)
sw s2,0x0(s0)
or a0,s0,zero
sw zero,0x8(s1)
sw zero,0x4(s1)
blez v0,0x003179f8
_sw zero,0x0(s1)
lw v1,0x4c(s3)
addiu v0,v0,-0x1
beq v1,zero,0x00317ad0
_sw v0,0x50(s3)
lw t9,-0x4268(gp)
or a0,s1,zero
lw a2,0x4(v1)
addiu t9,t9,0x27e8
bal 0x003127e8
_or a1,v1,zero
li v0,0x1
lw ra,0x34(sp)
lw s3,0x30(sp)
lw s2,0x2c(sp)
lw s1,0x28(sp)
lw s0,0x24(sp)
jr ra
_addiu sp,sp,0x38
bal 0x0032e348
_li a0,0xc
lw gp,0x10(sp)
or a2,v0,zero
sw v0,0x4c(s3)
lw t9,-0x4268(gp)
or a1,s0,zero
addiu t9,t9,0x439c
bal 0x0031439c
_or a0,s3,zero
bne v0,zero,0x00317b44
_lw gp,0x10(sp)
lw ra,0x34(sp)
or v0,zero,zero
lw s3,0x30(sp)
lw s2,0x2c(sp)
lw s1,0x28(sp)
lw s0,0x24(sp)
jr ra
_addiu sp,sp,0x38
lw a2,0x4c(s3)
beq a2,zero,0x00317aa0
_lw t9,-0x4220(gp)
lw a0,0x0(a2)
beq a0,zero,0x00317ab4
_lw t9,-0x3628(gp)
jalr t9
_sw a2,0x18(sp)
or a1,s0,zero
lw gp,0x10(sp)
or a0,s3,zero
lw a2,0x18(sp)
lw t9,-0x4268(gp)
sw zero,0x4(a2)
sw zero,0x8(a2)
sw zero,0x0(a2)
addiu t9,t9,0x439c
bal 0x0031439c
_lw a2,0x4c(s3)
beq v0,zero,0x00317ad0
_lw gp,0x10(sp)
lw v0,0x4c(s3)
or a0,s1,zero
lw t9,-0x4268(gp)
or a1,v0,zero
addiu t9,t9,0x27e8
bal 0x003127e8
_lw a2,0x4(v0)
or a1,s2,zero
lw gp,0x10(sp)
or a0,s3,zero
lw a2,0x0(s0)
lw t9,-0x4268(gp)
addiu t9,t9,0x2c3c
bal 0x00312c3c
_subu a2,a2,s2
li v0,0x1
lw ra,0x34(sp)
lw s3,0x30(sp)
lw s2,0x2c(sp)
lw s1,0x28(sp)
lw s0,0x24(sp)
jr ra
_addiu sp,sp,0x38
(translation_unit "undefined4 FUN_0031799c(int param_1,int *param_2,undefined4 *param_3)\n\n{\n  int iVar1;\n  int *piVar2;\n  int iVar3;\n  char *pcVar4;\n  char *pcVar5;\n  \n  iVar1 = *(int *)(param_1 + 0x50);\n  iVar3 = 0x6e;\n  pcVar4 = (char *)*param_2;\nLAB_003179e4:\n  param_3[2] = 0;\n  param_3[1] = 0;\n  *param_3 = 0;\n  pcVar5 = pcVar4;\n  do {\n    if (0 < iVar1) {\n      iVar3 = *(int *)(param_1 + 0x4c);\n      *(int *)(param_1 + 0x50) = iVar1 + -1;\n      if (iVar3 == 0) {\n        return 0;\n      }\n      FUN_003127e8(param_3,iVar3,*(undefined4 *)(iVar3 + 4));\n      return 1;\n    }\n    if (*(char *)*param_2 != iVar3) {\n      piVar2 = *(int **)(param_1 + 0x4c);\n      if (piVar2 == (int *)0x0) {\n        piVar2 = (int *)xmalloc(0xc);\n        *(int **)(param_1 + 0x4c) = piVar2;\n      }\n      else if (*piVar2 != 0) {\n        (*(code *)PTR_free_004c5c18)();\n        piVar2[1] = 0;\n        piVar2[2] = 0;\n        *piVar2 = 0;\n        iVar1 = FUN_0031439c(param_1,param_2,*(undefined4 *)(param_1 + 0x4c));\n        goto joined_r0x00317b3c;\n      }\n      iVar1 = FUN_0031439c(param_1,param_2,piVar2);\njoined_r0x00317b3c:\n      if (iVar1 == 0) {\n        return 0;\n      }\n      FUN_003127e8(param_3,*(int *)(param_1 + 0x4c),*(undefined4 *)(*(int *)(param_1 + 0x4c) + 4));\n      FUN_00312c3c(param_1,pcVar5,*param_2 - (int)pcVar5);\n      return 1;\n    }\n    *param_2 = (int)((char *)*param_2 + 1);\n    iVar1 = FUN_00311f28(param_2);\n    *(int *)(param_1 + 0x50) = iVar1;\n    if (iVar1 < 1) {\n      return 0;\n    }\n    pcVar4 = (char *)*param_2;\n    if (iVar1 < 10) goto LAB_003179e4;\n    pcVar5 = pcVar4 + 1;\n    if (*pcVar4 != '_') {\n      return 0;\n    }\n    *param_2 = (int)pcVar5;\n    param_3[2] = 0;\n    param_3[1] = 0;\n    *param_3 = 0;\n  } while( true );\n}\n\n" (function_definition "undefined4 FUN_0031799c(int param_1,int *param_2,undefined4 *param_3)\n\n{\n  int iVar1;\n  int *piVar2;\n  int iVar3;\n  char *pcVar4;\n  char *pcVar5;\n  \n  iVar1 = *(int *)(param_1 + 0x50);\n  iVar3 = 0x6e;\n  pcVar4 = (char *)*param_2;\nLAB_003179e4:\n  param_3[2] = 0;\n  param_3[1] = 0;\n  *param_3 = 0;\n  pcVar5 = pcVar4;\n  do {\n    if (0 < iVar1) {\n      iVar3 = *(int *)(param_1 + 0x4c);\n      *(int *)(param_1 + 0x50) = iVar1 + -1;\n      if (iVar3 == 0) {\n        return 0;\n      }\n      FUN_003127e8(param_3,iVar3,*(undefined4 *)(iVar3 + 4));\n      return 1;\n    }\n    if (*(char *)*param_2 != iVar3) {\n      piVar2 = *(int **)(param_1 + 0x4c);\n      if (piVar2 == (int *)0x0) {\n        piVar2 = (int *)xmalloc(0xc);\n        *(int **)(param_1 + 0x4c) = piVar2;\n      }\n      else if (*piVar2 != 0) {\n        (*(code *)PTR_free_004c5c18)();\n        piVar2[1] = 0;\n        piVar2[2] = 0;\n        *piVar2 = 0;\n        iVar1 = FUN_0031439c(param_1,param_2,*(undefined4 *)(param_1 + 0x4c));\n        goto joined_r0x00317b3c;\n      }\n      iVar1 = FUN_0031439c(param_1,param_2,piVar2);\njoined_r0x00317b3c:\n      if (iVar1 == 0) {\n        return 0;\n      }\n      FUN_003127e8(param_3,*(int *)(param_1 + 0x4c),*(undefined4 *)(*(int *)(param_1 + 0x4c) + 4));\n      FUN_00312c3c(param_1,pcVar5,*param_2 - (int)pcVar5);\n      return 1;\n    }\n    *param_2 = (int)((char *)*param_2 + 1);\n    iVar1 = FUN_00311f28(param_2);\n    *(int *)(param_1 + 0x50) = iVar1;\n    if (iVar1 < 1) {\n      return 0;\n    }\n    pcVar4 = (char *)*param_2;\n    if (iVar1 < 10) goto LAB_003179e4;\n    pcVar5 = pcVar4 + 1;\n    if (*pcVar4 != '_') {\n      return 0;\n    }\n    *param_2 = (int)pcVar5;\n    param_3[2] = 0;\n    param_3[1] = 0;\n    *param_3 = 0;\n  } while( true );\n}" type_identifier (function_declarator "FUN_0031799c(int param_1,int *param_2,undefined4 *param_3)" identifier (parameter_list "(int param_1,int *param_2,undefined4 *param_3)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "int *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "undefined4 *param_3" type_identifier (pointer_declarator "*param_3" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  int *piVar2;\n  int iVar3;\n  char *pcVar4;\n  char *pcVar5;\n  \n  iVar1 = *(int *)(param_1 + 0x50);\n  iVar3 = 0x6e;\n  pcVar4 = (char *)*param_2;\nLAB_003179e4:\n  param_3[2] = 0;\n  param_3[1] = 0;\n  *param_3 = 0;\n  pcVar5 = pcVar4;\n  do {\n    if (0 < iVar1) {\n      iVar3 = *(int *)(param_1 + 0x4c);\n      *(int *)(param_1 + 0x50) = iVar1 + -1;\n      if (iVar3 == 0) {\n        return 0;\n      }\n      FUN_003127e8(param_3,iVar3,*(undefined4 *)(iVar3 + 4));\n      return 1;\n    }\n    if (*(char *)*param_2 != iVar3) {\n      piVar2 = *(int **)(param_1 + 0x4c);\n      if (piVar2 == (int *)0x0) {\n        piVar2 = (int *)xmalloc(0xc);\n        *(int **)(param_1 + 0x4c) = piVar2;\n      }\n      else if (*piVar2 != 0) {\n        (*(code *)PTR_free_004c5c18)();\n        piVar2[1] = 0;\n        piVar2[2] = 0;\n        *piVar2 = 0;\n        iVar1 = FUN_0031439c(param_1,param_2,*(undefined4 *)(param_1 + 0x4c));\n        goto joined_r0x00317b3c;\n      }\n      iVar1 = FUN_0031439c(param_1,param_2,piVar2);\njoined_r0x00317b3c:\n      if (iVar1 == 0) {\n        return 0;\n      }\n      FUN_003127e8(param_3,*(int *)(param_1 + 0x4c),*(undefined4 *)(*(int *)(param_1 + 0x4c) + 4));\n      FUN_00312c3c(param_1,pcVar5,*param_2 - (int)pcVar5);\n      return 1;\n    }\n    *param_2 = (int)((char *)*param_2 + 1);\n    iVar1 = FUN_00311f28(param_2);\n    *(int *)(param_1 + 0x50) = iVar1;\n    if (iVar1 < 1) {\n      return 0;\n    }\n    pcVar4 = (char *)*param_2;\n    if (iVar1 < 10) goto LAB_003179e4;\n    pcVar5 = pcVar4 + 1;\n    if (*pcVar4 != '_') {\n      return 0;\n    }\n    *param_2 = (int)pcVar5;\n    param_3[2] = 0;\n    param_3[1] = 0;\n    *param_3 = 0;\n  } while( true );\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int *piVar2;" primitive_type (pointer_declarator "*piVar2" * identifier) ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "char *pcVar4;" primitive_type (pointer_declarator "*pcVar4" * identifier) ;) (declaration "char *pcVar5;" primitive_type (pointer_declarator "*pcVar5" * identifier) ;) (expression_statement "iVar1 = *(int *)(param_1 + 0x50);" (assignment_expression "iVar1 = *(int *)(param_1 + 0x50)" identifier = (pointer_expression "*(int *)(param_1 + 0x50)" * (cast_expression "(int *)(param_1 + 0x50)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x50)" ( (binary_expression "param_1 + 0x50" identifier + number_literal) ))))) ;) (expression_statement "iVar3 = 0x6e;" (assignment_expression "iVar3 = 0x6e" identifier = number_literal) ;) (expression_statement "pcVar4 = (char *)*param_2;" (assignment_expression "pcVar4 = (char *)*param_2" identifier = (cast_expression "(char *)*param_2" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_2" * identifier))) ;) (labeled_statement "LAB_003179e4:\n  param_3[2] = 0;" statement_identifier : (expression_statement "param_3[2] = 0;" (assignment_expression "param_3[2] = 0" (subscript_expression "param_3[2]" identifier [ number_literal ]) = number_literal) ;)) (expression_statement "param_3[1] = 0;" (assignment_expression "param_3[1] = 0" (subscript_expression "param_3[1]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "*param_3 = 0;" (assignment_expression "*param_3 = 0" (pointer_expression "*param_3" * identifier) = number_literal) ;) (expression_statement "pcVar5 = pcVar4;" (assignment_expression "pcVar5 = pcVar4" identifier = identifier) ;) (do_statement "do {\n    if (0 < iVar1) {\n      iVar3 = *(int *)(param_1 + 0x4c);\n      *(int *)(param_1 + 0x50) = iVar1 + -1;\n      if (iVar3 == 0) {\n        return 0;\n      }\n      FUN_003127e8(param_3,iVar3,*(undefined4 *)(iVar3 + 4));\n      return 1;\n    }\n    if (*(char *)*param_2 != iVar3) {\n      piVar2 = *(int **)(param_1 + 0x4c);\n      if (piVar2 == (int *)0x0) {\n        piVar2 = (int *)xmalloc(0xc);\n        *(int **)(param_1 + 0x4c) = piVar2;\n      }\n      else if (*piVar2 != 0) {\n        (*(code *)PTR_free_004c5c18)();\n        piVar2[1] = 0;\n        piVar2[2] = 0;\n        *piVar2 = 0;\n        iVar1 = FUN_0031439c(param_1,param_2,*(undefined4 *)(param_1 + 0x4c));\n        goto joined_r0x00317b3c;\n      }\n      iVar1 = FUN_0031439c(param_1,param_2,piVar2);\njoined_r0x00317b3c:\n      if (iVar1 == 0) {\n        return 0;\n      }\n      FUN_003127e8(param_3,*(int *)(param_1 + 0x4c),*(undefined4 *)(*(int *)(param_1 + 0x4c) + 4));\n      FUN_00312c3c(param_1,pcVar5,*param_2 - (int)pcVar5);\n      return 1;\n    }\n    *param_2 = (int)((char *)*param_2 + 1);\n    iVar1 = FUN_00311f28(param_2);\n    *(int *)(param_1 + 0x50) = iVar1;\n    if (iVar1 < 1) {\n      return 0;\n    }\n    pcVar4 = (char *)*param_2;\n    if (iVar1 < 10) goto LAB_003179e4;\n    pcVar5 = pcVar4 + 1;\n    if (*pcVar4 != '_') {\n      return 0;\n    }\n    *param_2 = (int)pcVar5;\n    param_3[2] = 0;\n    param_3[1] = 0;\n    *param_3 = 0;\n  } while( true );" do (compound_statement "{\n    if (0 < iVar1) {\n      iVar3 = *(int *)(param_1 + 0x4c);\n      *(int *)(param_1 + 0x50) = iVar1 + -1;\n      if (iVar3 == 0) {\n        return 0;\n      }\n      FUN_003127e8(param_3,iVar3,*(undefined4 *)(iVar3 + 4));\n      return 1;\n    }\n    if (*(char *)*param_2 != iVar3) {\n      piVar2 = *(int **)(param_1 + 0x4c);\n      if (piVar2 == (int *)0x0) {\n        piVar2 = (int *)xmalloc(0xc);\n        *(int **)(param_1 + 0x4c) = piVar2;\n      }\n      else if (*piVar2 != 0) {\n        (*(code *)PTR_free_004c5c18)();\n        piVar2[1] = 0;\n        piVar2[2] = 0;\n        *piVar2 = 0;\n        iVar1 = FUN_0031439c(param_1,param_2,*(undefined4 *)(param_1 + 0x4c));\n        goto joined_r0x00317b3c;\n      }\n      iVar1 = FUN_0031439c(param_1,param_2,piVar2);\njoined_r0x00317b3c:\n      if (iVar1 == 0) {\n        return 0;\n      }\n      FUN_003127e8(param_3,*(int *)(param_1 + 0x4c),*(undefined4 *)(*(int *)(param_1 + 0x4c) + 4));\n      FUN_00312c3c(param_1,pcVar5,*param_2 - (int)pcVar5);\n      return 1;\n    }\n    *param_2 = (int)((char *)*param_2 + 1);\n    iVar1 = FUN_00311f28(param_2);\n    *(int *)(param_1 + 0x50) = iVar1;\n    if (iVar1 < 1) {\n      return 0;\n    }\n    pcVar4 = (char *)*param_2;\n    if (iVar1 < 10) goto LAB_003179e4;\n    pcVar5 = pcVar4 + 1;\n    if (*pcVar4 != '_') {\n      return 0;\n    }\n    *param_2 = (int)pcVar5;\n    param_3[2] = 0;\n    param_3[1] = 0;\n    *param_3 = 0;\n  }" { (if_statement "if (0 < iVar1) {\n      iVar3 = *(int *)(param_1 + 0x4c);\n      *(int *)(param_1 + 0x50) = iVar1 + -1;\n      if (iVar3 == 0) {\n        return 0;\n      }\n      FUN_003127e8(param_3,iVar3,*(undefined4 *)(iVar3 + 4));\n      return 1;\n    }" if (parenthesized_expression "(0 < iVar1)" ( (binary_expression "0 < iVar1" number_literal < identifier) )) (compound_statement "{\n      iVar3 = *(int *)(param_1 + 0x4c);\n      *(int *)(param_1 + 0x50) = iVar1 + -1;\n      if (iVar3 == 0) {\n        return 0;\n      }\n      FUN_003127e8(param_3,iVar3,*(undefined4 *)(iVar3 + 4));\n      return 1;\n    }" { (expression_statement "iVar3 = *(int *)(param_1 + 0x4c);" (assignment_expression "iVar3 = *(int *)(param_1 + 0x4c)" identifier = (pointer_expression "*(int *)(param_1 + 0x4c)" * (cast_expression "(int *)(param_1 + 0x4c)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x4c)" ( (binary_expression "param_1 + 0x4c" identifier + number_literal) ))))) ;) (expression_statement "*(int *)(param_1 + 0x50) = iVar1 + -1;" (assignment_expression "*(int *)(param_1 + 0x50) = iVar1 + -1" (pointer_expression "*(int *)(param_1 + 0x50)" * (cast_expression "(int *)(param_1 + 0x50)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x50)" ( (binary_expression "param_1 + 0x50" identifier + number_literal) )))) = (binary_expression "iVar1 + -1" identifier + number_literal)) ;) (if_statement "if (iVar3 == 0) {\n        return 0;\n      }" if (parenthesized_expression "(iVar3 == 0)" ( (binary_expression "iVar3 == 0" identifier == number_literal) )) (compound_statement "{\n        return 0;\n      }" { (return_statement "return 0;" return number_literal ;) })) (expression_statement "FUN_003127e8(param_3,iVar3,*(undefined4 *)(iVar3 + 4));" (call_expression "FUN_003127e8(param_3,iVar3,*(undefined4 *)(iVar3 + 4))" identifier (argument_list "(param_3,iVar3,*(undefined4 *)(iVar3 + 4))" ( identifier , identifier , (pointer_expression "*(undefined4 *)(iVar3 + 4)" * (cast_expression "(undefined4 *)(iVar3 + 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar3 + 4)" ( (binary_expression "iVar3 + 4" identifier + number_literal) )))) ))) ;) (return_statement "return 1;" return number_literal ;) })) (if_statement "if (*(char *)*param_2 != iVar3) {\n      piVar2 = *(int **)(param_1 + 0x4c);\n      if (piVar2 == (int *)0x0) {\n        piVar2 = (int *)xmalloc(0xc);\n        *(int **)(param_1 + 0x4c) = piVar2;\n      }\n      else if (*piVar2 != 0) {\n        (*(code *)PTR_free_004c5c18)();\n        piVar2[1] = 0;\n        piVar2[2] = 0;\n        *piVar2 = 0;\n        iVar1 = FUN_0031439c(param_1,param_2,*(undefined4 *)(param_1 + 0x4c));\n        goto joined_r0x00317b3c;\n      }\n      iVar1 = FUN_0031439c(param_1,param_2,piVar2);\njoined_r0x00317b3c:\n      if (iVar1 == 0) {\n        return 0;\n      }\n      FUN_003127e8(param_3,*(int *)(param_1 + 0x4c),*(undefined4 *)(*(int *)(param_1 + 0x4c) + 4));\n      FUN_00312c3c(param_1,pcVar5,*param_2 - (int)pcVar5);\n      return 1;\n    }" if (parenthesized_expression "(*(char *)*param_2 != iVar3)" ( (binary_expression "*(char *)*param_2 != iVar3" (pointer_expression "*(char *)*param_2" * (cast_expression "(char *)*param_2" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_2" * identifier))) != identifier) )) (compound_statement "{\n      piVar2 = *(int **)(param_1 + 0x4c);\n      if (piVar2 == (int *)0x0) {\n        piVar2 = (int *)xmalloc(0xc);\n        *(int **)(param_1 + 0x4c) = piVar2;\n      }\n      else if (*piVar2 != 0) {\n        (*(code *)PTR_free_004c5c18)();\n        piVar2[1] = 0;\n        piVar2[2] = 0;\n        *piVar2 = 0;\n        iVar1 = FUN_0031439c(param_1,param_2,*(undefined4 *)(param_1 + 0x4c));\n        goto joined_r0x00317b3c;\n      }\n      iVar1 = FUN_0031439c(param_1,param_2,piVar2);\njoined_r0x00317b3c:\n      if (iVar1 == 0) {\n        return 0;\n      }\n      FUN_003127e8(param_3,*(int *)(param_1 + 0x4c),*(undefined4 *)(*(int *)(param_1 + 0x4c) + 4));\n      FUN_00312c3c(param_1,pcVar5,*param_2 - (int)pcVar5);\n      return 1;\n    }" { (expression_statement "piVar2 = *(int **)(param_1 + 0x4c);" (assignment_expression "piVar2 = *(int **)(param_1 + 0x4c)" identifier = (pointer_expression "*(int **)(param_1 + 0x4c)" * (cast_expression "(int **)(param_1 + 0x4c)" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0x4c)" ( (binary_expression "param_1 + 0x4c" identifier + number_literal) ))))) ;) (if_statement "if (piVar2 == (int *)0x0) {\n        piVar2 = (int *)xmalloc(0xc);\n        *(int **)(param_1 + 0x4c) = piVar2;\n      }\n      else if (*piVar2 != 0) {\n        (*(code *)PTR_free_004c5c18)();\n        piVar2[1] = 0;\n        piVar2[2] = 0;\n        *piVar2 = 0;\n        iVar1 = FUN_0031439c(param_1,param_2,*(undefined4 *)(param_1 + 0x4c));\n        goto joined_r0x00317b3c;\n      }" if (parenthesized_expression "(piVar2 == (int *)0x0)" ( (binary_expression "piVar2 == (int *)0x0" identifier == (cast_expression "(int *)0x0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n        piVar2 = (int *)xmalloc(0xc);\n        *(int **)(param_1 + 0x4c) = piVar2;\n      }" { (expression_statement "piVar2 = (int *)xmalloc(0xc);" (assignment_expression "piVar2 = (int *)xmalloc(0xc)" identifier = (cast_expression "(int *)xmalloc(0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "xmalloc(0xc)" identifier (argument_list "(0xc)" ( number_literal ))))) ;) (expression_statement "*(int **)(param_1 + 0x4c) = piVar2;" (assignment_expression "*(int **)(param_1 + 0x4c) = piVar2" (pointer_expression "*(int **)(param_1 + 0x4c)" * (cast_expression "(int **)(param_1 + 0x4c)" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0x4c)" ( (binary_expression "param_1 + 0x4c" identifier + number_literal) )))) = identifier) ;) }) (else_clause "else if (*piVar2 != 0) {\n        (*(code *)PTR_free_004c5c18)();\n        piVar2[1] = 0;\n        piVar2[2] = 0;\n        *piVar2 = 0;\n        iVar1 = FUN_0031439c(param_1,param_2,*(undefined4 *)(param_1 + 0x4c));\n        goto joined_r0x00317b3c;\n      }" else (if_statement "if (*piVar2 != 0) {\n        (*(code *)PTR_free_004c5c18)();\n        piVar2[1] = 0;\n        piVar2[2] = 0;\n        *piVar2 = 0;\n        iVar1 = FUN_0031439c(param_1,param_2,*(undefined4 *)(param_1 + 0x4c));\n        goto joined_r0x00317b3c;\n      }" if (parenthesized_expression "(*piVar2 != 0)" ( (binary_expression "*piVar2 != 0" (pointer_expression "*piVar2" * identifier) != number_literal) )) (compound_statement "{\n        (*(code *)PTR_free_004c5c18)();\n        piVar2[1] = 0;\n        piVar2[2] = 0;\n        *piVar2 = 0;\n        iVar1 = FUN_0031439c(param_1,param_2,*(undefined4 *)(param_1 + 0x4c));\n        goto joined_r0x00317b3c;\n      }" { (expression_statement "(*(code *)PTR_free_004c5c18)();" (call_expression "(*(code *)PTR_free_004c5c18)()" (parenthesized_expression "(*(code *)PTR_free_004c5c18)" ( (pointer_expression "*(code *)PTR_free_004c5c18" * (cast_expression "(code *)PTR_free_004c5c18" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))) ;) (expression_statement "piVar2[1] = 0;" (assignment_expression "piVar2[1] = 0" (subscript_expression "piVar2[1]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "piVar2[2] = 0;" (assignment_expression "piVar2[2] = 0" (subscript_expression "piVar2[2]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "*piVar2 = 0;" (assignment_expression "*piVar2 = 0" (pointer_expression "*piVar2" * identifier) = number_literal) ;) (expression_statement "iVar1 = FUN_0031439c(param_1,param_2,*(undefined4 *)(param_1 + 0x4c));" (assignment_expression "iVar1 = FUN_0031439c(param_1,param_2,*(undefined4 *)(param_1 + 0x4c))" identifier = (call_expression "FUN_0031439c(param_1,param_2,*(undefined4 *)(param_1 + 0x4c))" identifier (argument_list "(param_1,param_2,*(undefined4 *)(param_1 + 0x4c))" ( identifier , identifier , (pointer_expression "*(undefined4 *)(param_1 + 0x4c)" * (cast_expression "(undefined4 *)(param_1 + 0x4c)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x4c)" ( (binary_expression "param_1 + 0x4c" identifier + number_literal) )))) )))) ;) (goto_statement "goto joined_r0x00317b3c;" goto statement_identifier ;) })))) (expression_statement "iVar1 = FUN_0031439c(param_1,param_2,piVar2);" (assignment_expression "iVar1 = FUN_0031439c(param_1,param_2,piVar2)" identifier = (call_expression "FUN_0031439c(param_1,param_2,piVar2)" identifier (argument_list "(param_1,param_2,piVar2)" ( identifier , identifier , identifier )))) ;) (labeled_statement "joined_r0x00317b3c:\n      if (iVar1 == 0) {\n        return 0;\n      }" statement_identifier : (if_statement "if (iVar1 == 0) {\n        return 0;\n      }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n        return 0;\n      }" { (return_statement "return 0;" return number_literal ;) }))) (expression_statement "FUN_003127e8(param_3,*(int *)(param_1 + 0x4c),*(undefined4 *)(*(int *)(param_1 + 0x4c) + 4));" (call_expression "FUN_003127e8(param_3,*(int *)(param_1 + 0x4c),*(undefined4 *)(*(int *)(param_1 + 0x4c) + 4))" identifier (argument_list "(param_3,*(int *)(param_1 + 0x4c),*(undefined4 *)(*(int *)(param_1 + 0x4c) + 4))" ( identifier , (pointer_expression "*(int *)(param_1 + 0x4c)" * (cast_expression "(int *)(param_1 + 0x4c)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x4c)" ( (binary_expression "param_1 + 0x4c" identifier + number_literal) )))) , (pointer_expression "*(undefined4 *)(*(int *)(param_1 + 0x4c) + 4)" * (cast_expression "(undefined4 *)(*(int *)(param_1 + 0x4c) + 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*(int *)(param_1 + 0x4c) + 4)" ( (binary_expression "*(int *)(param_1 + 0x4c) + 4" (pointer_expression "*(int *)(param_1 + 0x4c)" * (cast_expression "(int *)(param_1 + 0x4c)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x4c)" ( (binary_expression "param_1 + 0x4c" identifier + number_literal) )))) + number_literal) )))) ))) ;) (expression_statement "FUN_00312c3c(param_1,pcVar5,*param_2 - (int)pcVar5);" (call_expression "FUN_00312c3c(param_1,pcVar5,*param_2 - (int)pcVar5)" identifier (argument_list "(param_1,pcVar5,*param_2 - (int)pcVar5)" ( identifier , identifier , (binary_expression "*param_2 - (int)pcVar5" (pointer_expression "*param_2" * identifier) - (cast_expression "(int)pcVar5" ( (type_descriptor "int" primitive_type) ) identifier)) ))) ;) (return_statement "return 1;" return number_literal ;) })) (expression_statement "*param_2 = (int)((char *)*param_2 + 1);" (assignment_expression "*param_2 = (int)((char *)*param_2 + 1)" (pointer_expression "*param_2" * identifier) = (cast_expression "(int)((char *)*param_2 + 1)" ( (type_descriptor "int" primitive_type) ) (parenthesized_expression "((char *)*param_2 + 1)" ( (binary_expression "(char *)*param_2 + 1" (cast_expression "(char *)*param_2" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_2" * identifier)) + number_literal) )))) ;) (expression_statement "iVar1 = FUN_00311f28(param_2);" (assignment_expression "iVar1 = FUN_00311f28(param_2)" identifier = (call_expression "FUN_00311f28(param_2)" identifier (argument_list "(param_2)" ( identifier )))) ;) (expression_statement "*(int *)(param_1 + 0x50) = iVar1;" (assignment_expression "*(int *)(param_1 + 0x50) = iVar1" (pointer_expression "*(int *)(param_1 + 0x50)" * (cast_expression "(int *)(param_1 + 0x50)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x50)" ( (binary_expression "param_1 + 0x50" identifier + number_literal) )))) = identifier) ;) (if_statement "if (iVar1 < 1) {\n      return 0;\n    }" if (parenthesized_expression "(iVar1 < 1)" ( (binary_expression "iVar1 < 1" identifier < number_literal) )) (compound_statement "{\n      return 0;\n    }" { (return_statement "return 0;" return number_literal ;) })) (expression_statement "pcVar4 = (char *)*param_2;" (assignment_expression "pcVar4 = (char *)*param_2" identifier = (cast_expression "(char *)*param_2" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_2" * identifier))) ;) (if_statement "if (iVar1 < 10) goto LAB_003179e4;" if (parenthesized_expression "(iVar1 < 10)" ( (binary_expression "iVar1 < 10" identifier < number_literal) )) (goto_statement "goto LAB_003179e4;" goto statement_identifier ;)) (expression_statement "pcVar5 = pcVar4 + 1;" (assignment_expression "pcVar5 = pcVar4 + 1" identifier = (binary_expression "pcVar4 + 1" identifier + number_literal)) ;) (if_statement "if (*pcVar4 != '_') {\n      return 0;\n    }" if (parenthesized_expression "(*pcVar4 != '_')" ( (binary_expression "*pcVar4 != '_'" (pointer_expression "*pcVar4" * identifier) != (char_literal "'_'" ' character ')) )) (compound_statement "{\n      return 0;\n    }" { (return_statement "return 0;" return number_literal ;) })) (expression_statement "*param_2 = (int)pcVar5;" (assignment_expression "*param_2 = (int)pcVar5" (pointer_expression "*param_2" * identifier) = (cast_expression "(int)pcVar5" ( (type_descriptor "int" primitive_type) ) identifier)) ;) (expression_statement "param_3[2] = 0;" (assignment_expression "param_3[2] = 0" (subscript_expression "param_3[2]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "param_3[1] = 0;" (assignment_expression "param_3[1] = 0" (subscript_expression "param_3[1]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "*param_3 = 0;" (assignment_expression "*param_3 = 0" (pointer_expression "*param_3" * identifier) = number_literal) ;) }) while (parenthesized_expression "( true )" ( true )) ;) })))
(translation_unit "int do_arg(work_stuff *work,char **mangled,string *result)\n\n{\n  int iVar1;\n  string *psVar2;\n  int iVar3;\n  char *pcVar4;\n  char *start;\n  \n  iVar1 = work->nrepeats;\n  iVar3 = 0x6e;\n  pcVar4 = *mangled;\nLAB_003179e4:\n  result->e = (char *)0x0;\n  result->p = (char *)0x0;\n  result->b = (char *)0x0;\n  start = pcVar4;\n  do {\n    if (0 < iVar1) {\n      psVar2 = work->previous_argument;\n      work->nrepeats = iVar1 + -1;\n      if (psVar2 == (string *)0x0) {\n        return 0;\n      }\n      string_appends(result,psVar2,(string *)psVar2->p);\n      return 1;\n    }\n    if (**mangled != iVar3) {\n      psVar2 = work->previous_argument;\n      if (psVar2 == (string *)0x0) {\n        psVar2 = (string *)xmalloc(0xc);\n        work->previous_argument = psVar2;\n      }\n      else if (psVar2->b != (char *)0x0) {\n        (*(code *)PTR_free_004c5c18)();\n        psVar2->p = (char *)0x0;\n        psVar2->e = (char *)0x0;\n        psVar2->b = (char *)0x0;\n        iVar1 = do_type(work,mangled,work->previous_argument);\n        goto joined_r0x00317b3c;\n      }\n      iVar1 = do_type(work,mangled,psVar2);\njoined_r0x00317b3c:\n      if (iVar1 == 0) {\n        return 0;\n      }\n      string_appends(result,work->previous_argument,(string *)work->previous_argument->p);\n      remember_type(work,start,(int)*mangled - (int)start);\n      return 1;\n    }\n    *mangled = *mangled + 1;\n    iVar1 = consume_count(mangled);\n    work->nrepeats = iVar1;\n    if (iVar1 < 1) {\n      return 0;\n    }\n    pcVar4 = *mangled;\n    if (iVar1 < 10) goto LAB_003179e4;\n    start = pcVar4 + 1;\n    if (*pcVar4 != '_') {\n      return 0;\n    }\n    *mangled = start;\n    result->e = (char *)0x0;\n    result->p = (char *)0x0;\n    result->b = (char *)0x0;\n  } while( true );\n}\n\n" (function_definition "int do_arg(work_stuff *work,char **mangled,string *result)\n\n{\n  int iVar1;\n  string *psVar2;\n  int iVar3;\n  char *pcVar4;\n  char *start;\n  \n  iVar1 = work->nrepeats;\n  iVar3 = 0x6e;\n  pcVar4 = *mangled;\nLAB_003179e4:\n  result->e = (char *)0x0;\n  result->p = (char *)0x0;\n  result->b = (char *)0x0;\n  start = pcVar4;\n  do {\n    if (0 < iVar1) {\n      psVar2 = work->previous_argument;\n      work->nrepeats = iVar1 + -1;\n      if (psVar2 == (string *)0x0) {\n        return 0;\n      }\n      string_appends(result,psVar2,(string *)psVar2->p);\n      return 1;\n    }\n    if (**mangled != iVar3) {\n      psVar2 = work->previous_argument;\n      if (psVar2 == (string *)0x0) {\n        psVar2 = (string *)xmalloc(0xc);\n        work->previous_argument = psVar2;\n      }\n      else if (psVar2->b != (char *)0x0) {\n        (*(code *)PTR_free_004c5c18)();\n        psVar2->p = (char *)0x0;\n        psVar2->e = (char *)0x0;\n        psVar2->b = (char *)0x0;\n        iVar1 = do_type(work,mangled,work->previous_argument);\n        goto joined_r0x00317b3c;\n      }\n      iVar1 = do_type(work,mangled,psVar2);\njoined_r0x00317b3c:\n      if (iVar1 == 0) {\n        return 0;\n      }\n      string_appends(result,work->previous_argument,(string *)work->previous_argument->p);\n      remember_type(work,start,(int)*mangled - (int)start);\n      return 1;\n    }\n    *mangled = *mangled + 1;\n    iVar1 = consume_count(mangled);\n    work->nrepeats = iVar1;\n    if (iVar1 < 1) {\n      return 0;\n    }\n    pcVar4 = *mangled;\n    if (iVar1 < 10) goto LAB_003179e4;\n    start = pcVar4 + 1;\n    if (*pcVar4 != '_') {\n      return 0;\n    }\n    *mangled = start;\n    result->e = (char *)0x0;\n    result->p = (char *)0x0;\n    result->b = (char *)0x0;\n  } while( true );\n}" primitive_type (function_declarator "do_arg(work_stuff *work,char **mangled,string *result)" identifier (parameter_list "(work_stuff *work,char **mangled,string *result)" ( (parameter_declaration "work_stuff *work" type_identifier (pointer_declarator "*work" * identifier)) , (parameter_declaration "char **mangled" primitive_type (pointer_declarator "**mangled" * (pointer_declarator "*mangled" * identifier))) , (parameter_declaration "string *result" type_identifier (pointer_declarator "*result" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  string *psVar2;\n  int iVar3;\n  char *pcVar4;\n  char *start;\n  \n  iVar1 = work->nrepeats;\n  iVar3 = 0x6e;\n  pcVar4 = *mangled;\nLAB_003179e4:\n  result->e = (char *)0x0;\n  result->p = (char *)0x0;\n  result->b = (char *)0x0;\n  start = pcVar4;\n  do {\n    if (0 < iVar1) {\n      psVar2 = work->previous_argument;\n      work->nrepeats = iVar1 + -1;\n      if (psVar2 == (string *)0x0) {\n        return 0;\n      }\n      string_appends(result,psVar2,(string *)psVar2->p);\n      return 1;\n    }\n    if (**mangled != iVar3) {\n      psVar2 = work->previous_argument;\n      if (psVar2 == (string *)0x0) {\n        psVar2 = (string *)xmalloc(0xc);\n        work->previous_argument = psVar2;\n      }\n      else if (psVar2->b != (char *)0x0) {\n        (*(code *)PTR_free_004c5c18)();\n        psVar2->p = (char *)0x0;\n        psVar2->e = (char *)0x0;\n        psVar2->b = (char *)0x0;\n        iVar1 = do_type(work,mangled,work->previous_argument);\n        goto joined_r0x00317b3c;\n      }\n      iVar1 = do_type(work,mangled,psVar2);\njoined_r0x00317b3c:\n      if (iVar1 == 0) {\n        return 0;\n      }\n      string_appends(result,work->previous_argument,(string *)work->previous_argument->p);\n      remember_type(work,start,(int)*mangled - (int)start);\n      return 1;\n    }\n    *mangled = *mangled + 1;\n    iVar1 = consume_count(mangled);\n    work->nrepeats = iVar1;\n    if (iVar1 < 1) {\n      return 0;\n    }\n    pcVar4 = *mangled;\n    if (iVar1 < 10) goto LAB_003179e4;\n    start = pcVar4 + 1;\n    if (*pcVar4 != '_') {\n      return 0;\n    }\n    *mangled = start;\n    result->e = (char *)0x0;\n    result->p = (char *)0x0;\n    result->b = (char *)0x0;\n  } while( true );\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "string *psVar2;" type_identifier (pointer_declarator "*psVar2" * identifier) ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "char *pcVar4;" primitive_type (pointer_declarator "*pcVar4" * identifier) ;) (declaration "char *start;" primitive_type (pointer_declarator "*start" * identifier) ;) (expression_statement "iVar1 = work->nrepeats;" (assignment_expression "iVar1 = work->nrepeats" identifier = (field_expression "work->nrepeats" identifier -> field_identifier)) ;) (expression_statement "iVar3 = 0x6e;" (assignment_expression "iVar3 = 0x6e" identifier = number_literal) ;) (expression_statement "pcVar4 = *mangled;" (assignment_expression "pcVar4 = *mangled" identifier = (pointer_expression "*mangled" * identifier)) ;) (labeled_statement "LAB_003179e4:\n  result->e = (char *)0x0;" statement_identifier : (expression_statement "result->e = (char *)0x0;" (assignment_expression "result->e = (char *)0x0" (field_expression "result->e" identifier -> field_identifier) = (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ;)) (expression_statement "result->p = (char *)0x0;" (assignment_expression "result->p = (char *)0x0" (field_expression "result->p" identifier -> field_identifier) = (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (expression_statement "result->b = (char *)0x0;" (assignment_expression "result->b = (char *)0x0" (field_expression "result->b" identifier -> field_identifier) = (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (expression_statement "start = pcVar4;" (assignment_expression "start = pcVar4" identifier = identifier) ;) (do_statement "do {\n    if (0 < iVar1) {\n      psVar2 = work->previous_argument;\n      work->nrepeats = iVar1 + -1;\n      if (psVar2 == (string *)0x0) {\n        return 0;\n      }\n      string_appends(result,psVar2,(string *)psVar2->p);\n      return 1;\n    }\n    if (**mangled != iVar3) {\n      psVar2 = work->previous_argument;\n      if (psVar2 == (string *)0x0) {\n        psVar2 = (string *)xmalloc(0xc);\n        work->previous_argument = psVar2;\n      }\n      else if (psVar2->b != (char *)0x0) {\n        (*(code *)PTR_free_004c5c18)();\n        psVar2->p = (char *)0x0;\n        psVar2->e = (char *)0x0;\n        psVar2->b = (char *)0x0;\n        iVar1 = do_type(work,mangled,work->previous_argument);\n        goto joined_r0x00317b3c;\n      }\n      iVar1 = do_type(work,mangled,psVar2);\njoined_r0x00317b3c:\n      if (iVar1 == 0) {\n        return 0;\n      }\n      string_appends(result,work->previous_argument,(string *)work->previous_argument->p);\n      remember_type(work,start,(int)*mangled - (int)start);\n      return 1;\n    }\n    *mangled = *mangled + 1;\n    iVar1 = consume_count(mangled);\n    work->nrepeats = iVar1;\n    if (iVar1 < 1) {\n      return 0;\n    }\n    pcVar4 = *mangled;\n    if (iVar1 < 10) goto LAB_003179e4;\n    start = pcVar4 + 1;\n    if (*pcVar4 != '_') {\n      return 0;\n    }\n    *mangled = start;\n    result->e = (char *)0x0;\n    result->p = (char *)0x0;\n    result->b = (char *)0x0;\n  } while( true );" do (compound_statement "{\n    if (0 < iVar1) {\n      psVar2 = work->previous_argument;\n      work->nrepeats = iVar1 + -1;\n      if (psVar2 == (string *)0x0) {\n        return 0;\n      }\n      string_appends(result,psVar2,(string *)psVar2->p);\n      return 1;\n    }\n    if (**mangled != iVar3) {\n      psVar2 = work->previous_argument;\n      if (psVar2 == (string *)0x0) {\n        psVar2 = (string *)xmalloc(0xc);\n        work->previous_argument = psVar2;\n      }\n      else if (psVar2->b != (char *)0x0) {\n        (*(code *)PTR_free_004c5c18)();\n        psVar2->p = (char *)0x0;\n        psVar2->e = (char *)0x0;\n        psVar2->b = (char *)0x0;\n        iVar1 = do_type(work,mangled,work->previous_argument);\n        goto joined_r0x00317b3c;\n      }\n      iVar1 = do_type(work,mangled,psVar2);\njoined_r0x00317b3c:\n      if (iVar1 == 0) {\n        return 0;\n      }\n      string_appends(result,work->previous_argument,(string *)work->previous_argument->p);\n      remember_type(work,start,(int)*mangled - (int)start);\n      return 1;\n    }\n    *mangled = *mangled + 1;\n    iVar1 = consume_count(mangled);\n    work->nrepeats = iVar1;\n    if (iVar1 < 1) {\n      return 0;\n    }\n    pcVar4 = *mangled;\n    if (iVar1 < 10) goto LAB_003179e4;\n    start = pcVar4 + 1;\n    if (*pcVar4 != '_') {\n      return 0;\n    }\n    *mangled = start;\n    result->e = (char *)0x0;\n    result->p = (char *)0x0;\n    result->b = (char *)0x0;\n  }" { (if_statement "if (0 < iVar1) {\n      psVar2 = work->previous_argument;\n      work->nrepeats = iVar1 + -1;\n      if (psVar2 == (string *)0x0) {\n        return 0;\n      }\n      string_appends(result,psVar2,(string *)psVar2->p);\n      return 1;\n    }" if (parenthesized_expression "(0 < iVar1)" ( (binary_expression "0 < iVar1" number_literal < identifier) )) (compound_statement "{\n      psVar2 = work->previous_argument;\n      work->nrepeats = iVar1 + -1;\n      if (psVar2 == (string *)0x0) {\n        return 0;\n      }\n      string_appends(result,psVar2,(string *)psVar2->p);\n      return 1;\n    }" { (expression_statement "psVar2 = work->previous_argument;" (assignment_expression "psVar2 = work->previous_argument" identifier = (field_expression "work->previous_argument" identifier -> field_identifier)) ;) (expression_statement "work->nrepeats = iVar1 + -1;" (assignment_expression "work->nrepeats = iVar1 + -1" (field_expression "work->nrepeats" identifier -> field_identifier) = (binary_expression "iVar1 + -1" identifier + number_literal)) ;) (if_statement "if (psVar2 == (string *)0x0) {\n        return 0;\n      }" if (parenthesized_expression "(psVar2 == (string *)0x0)" ( (binary_expression "psVar2 == (string *)0x0" identifier == (cast_expression "(string *)0x0" ( (type_descriptor "string *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n        return 0;\n      }" { (return_statement "return 0;" return number_literal ;) })) (expression_statement "string_appends(result,psVar2,(string *)psVar2->p);" (call_expression "string_appends(result,psVar2,(string *)psVar2->p)" identifier (argument_list "(result,psVar2,(string *)psVar2->p)" ( identifier , identifier , (cast_expression "(string *)psVar2->p" ( (type_descriptor "string *" type_identifier (abstract_pointer_declarator "*" *)) ) (field_expression "psVar2->p" identifier -> field_identifier)) ))) ;) (return_statement "return 1;" return number_literal ;) })) (if_statement "if (**mangled != iVar3) {\n      psVar2 = work->previous_argument;\n      if (psVar2 == (string *)0x0) {\n        psVar2 = (string *)xmalloc(0xc);\n        work->previous_argument = psVar2;\n      }\n      else if (psVar2->b != (char *)0x0) {\n        (*(code *)PTR_free_004c5c18)();\n        psVar2->p = (char *)0x0;\n        psVar2->e = (char *)0x0;\n        psVar2->b = (char *)0x0;\n        iVar1 = do_type(work,mangled,work->previous_argument);\n        goto joined_r0x00317b3c;\n      }\n      iVar1 = do_type(work,mangled,psVar2);\njoined_r0x00317b3c:\n      if (iVar1 == 0) {\n        return 0;\n      }\n      string_appends(result,work->previous_argument,(string *)work->previous_argument->p);\n      remember_type(work,start,(int)*mangled - (int)start);\n      return 1;\n    }" if (parenthesized_expression "(**mangled != iVar3)" ( (binary_expression "**mangled != iVar3" (pointer_expression "**mangled" * (pointer_expression "*mangled" * identifier)) != identifier) )) (compound_statement "{\n      psVar2 = work->previous_argument;\n      if (psVar2 == (string *)0x0) {\n        psVar2 = (string *)xmalloc(0xc);\n        work->previous_argument = psVar2;\n      }\n      else if (psVar2->b != (char *)0x0) {\n        (*(code *)PTR_free_004c5c18)();\n        psVar2->p = (char *)0x0;\n        psVar2->e = (char *)0x0;\n        psVar2->b = (char *)0x0;\n        iVar1 = do_type(work,mangled,work->previous_argument);\n        goto joined_r0x00317b3c;\n      }\n      iVar1 = do_type(work,mangled,psVar2);\njoined_r0x00317b3c:\n      if (iVar1 == 0) {\n        return 0;\n      }\n      string_appends(result,work->previous_argument,(string *)work->previous_argument->p);\n      remember_type(work,start,(int)*mangled - (int)start);\n      return 1;\n    }" { (expression_statement "psVar2 = work->previous_argument;" (assignment_expression "psVar2 = work->previous_argument" identifier = (field_expression "work->previous_argument" identifier -> field_identifier)) ;) (if_statement "if (psVar2 == (string *)0x0) {\n        psVar2 = (string *)xmalloc(0xc);\n        work->previous_argument = psVar2;\n      }\n      else if (psVar2->b != (char *)0x0) {\n        (*(code *)PTR_free_004c5c18)();\n        psVar2->p = (char *)0x0;\n        psVar2->e = (char *)0x0;\n        psVar2->b = (char *)0x0;\n        iVar1 = do_type(work,mangled,work->previous_argument);\n        goto joined_r0x00317b3c;\n      }" if (parenthesized_expression "(psVar2 == (string *)0x0)" ( (binary_expression "psVar2 == (string *)0x0" identifier == (cast_expression "(string *)0x0" ( (type_descriptor "string *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n        psVar2 = (string *)xmalloc(0xc);\n        work->previous_argument = psVar2;\n      }" { (expression_statement "psVar2 = (string *)xmalloc(0xc);" (assignment_expression "psVar2 = (string *)xmalloc(0xc)" identifier = (cast_expression "(string *)xmalloc(0xc)" ( (type_descriptor "string *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "xmalloc(0xc)" identifier (argument_list "(0xc)" ( number_literal ))))) ;) (expression_statement "work->previous_argument = psVar2;" (assignment_expression "work->previous_argument = psVar2" (field_expression "work->previous_argument" identifier -> field_identifier) = identifier) ;) }) (else_clause "else if (psVar2->b != (char *)0x0) {\n        (*(code *)PTR_free_004c5c18)();\n        psVar2->p = (char *)0x0;\n        psVar2->e = (char *)0x0;\n        psVar2->b = (char *)0x0;\n        iVar1 = do_type(work,mangled,work->previous_argument);\n        goto joined_r0x00317b3c;\n      }" else (if_statement "if (psVar2->b != (char *)0x0) {\n        (*(code *)PTR_free_004c5c18)();\n        psVar2->p = (char *)0x0;\n        psVar2->e = (char *)0x0;\n        psVar2->b = (char *)0x0;\n        iVar1 = do_type(work,mangled,work->previous_argument);\n        goto joined_r0x00317b3c;\n      }" if (parenthesized_expression "(psVar2->b != (char *)0x0)" ( (binary_expression "psVar2->b != (char *)0x0" (field_expression "psVar2->b" identifier -> field_identifier) != (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n        (*(code *)PTR_free_004c5c18)();\n        psVar2->p = (char *)0x0;\n        psVar2->e = (char *)0x0;\n        psVar2->b = (char *)0x0;\n        iVar1 = do_type(work,mangled,work->previous_argument);\n        goto joined_r0x00317b3c;\n      }" { (expression_statement "(*(code *)PTR_free_004c5c18)();" (call_expression "(*(code *)PTR_free_004c5c18)()" (parenthesized_expression "(*(code *)PTR_free_004c5c18)" ( (pointer_expression "*(code *)PTR_free_004c5c18" * (cast_expression "(code *)PTR_free_004c5c18" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))) ;) (expression_statement "psVar2->p = (char *)0x0;" (assignment_expression "psVar2->p = (char *)0x0" (field_expression "psVar2->p" identifier -> field_identifier) = (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (expression_statement "psVar2->e = (char *)0x0;" (assignment_expression "psVar2->e = (char *)0x0" (field_expression "psVar2->e" identifier -> field_identifier) = (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (expression_statement "psVar2->b = (char *)0x0;" (assignment_expression "psVar2->b = (char *)0x0" (field_expression "psVar2->b" identifier -> field_identifier) = (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (expression_statement "iVar1 = do_type(work,mangled,work->previous_argument);" (assignment_expression "iVar1 = do_type(work,mangled,work->previous_argument)" identifier = (call_expression "do_type(work,mangled,work->previous_argument)" identifier (argument_list "(work,mangled,work->previous_argument)" ( identifier , identifier , (field_expression "work->previous_argument" identifier -> field_identifier) )))) ;) (goto_statement "goto joined_r0x00317b3c;" goto statement_identifier ;) })))) (expression_statement "iVar1 = do_type(work,mangled,psVar2);" (assignment_expression "iVar1 = do_type(work,mangled,psVar2)" identifier = (call_expression "do_type(work,mangled,psVar2)" identifier (argument_list "(work,mangled,psVar2)" ( identifier , identifier , identifier )))) ;) (labeled_statement "joined_r0x00317b3c:\n      if (iVar1 == 0) {\n        return 0;\n      }" statement_identifier : (if_statement "if (iVar1 == 0) {\n        return 0;\n      }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n        return 0;\n      }" { (return_statement "return 0;" return number_literal ;) }))) (expression_statement "string_appends(result,work->previous_argument,(string *)work->previous_argument->p);" (call_expression "string_appends(result,work->previous_argument,(string *)work->previous_argument->p)" identifier (argument_list "(result,work->previous_argument,(string *)work->previous_argument->p)" ( identifier , (field_expression "work->previous_argument" identifier -> field_identifier) , (cast_expression "(string *)work->previous_argument->p" ( (type_descriptor "string *" type_identifier (abstract_pointer_declarator "*" *)) ) (field_expression "work->previous_argument->p" (field_expression "work->previous_argument" identifier -> field_identifier) -> field_identifier)) ))) ;) (expression_statement "remember_type(work,start,(int)*mangled - (int)start);" (call_expression "remember_type(work,start,(int)*mangled - (int)start)" identifier (argument_list "(work,start,(int)*mangled - (int)start)" ( identifier , identifier , (binary_expression "(int)*mangled - (int)start" (cast_expression "(int)*mangled" ( (type_descriptor "int" primitive_type) ) (pointer_expression "*mangled" * identifier)) - (cast_expression "(int)start" ( (type_descriptor "int" primitive_type) ) identifier)) ))) ;) (return_statement "return 1;" return number_literal ;) })) (expression_statement "*mangled = *mangled + 1;" (assignment_expression "*mangled = *mangled + 1" (pointer_expression "*mangled" * identifier) = (binary_expression "*mangled + 1" (pointer_expression "*mangled" * identifier) + number_literal)) ;) (expression_statement "iVar1 = consume_count(mangled);" (assignment_expression "iVar1 = consume_count(mangled)" identifier = (call_expression "consume_count(mangled)" identifier (argument_list "(mangled)" ( identifier )))) ;) (expression_statement "work->nrepeats = iVar1;" (assignment_expression "work->nrepeats = iVar1" (field_expression "work->nrepeats" identifier -> field_identifier) = identifier) ;) (if_statement "if (iVar1 < 1) {\n      return 0;\n    }" if (parenthesized_expression "(iVar1 < 1)" ( (binary_expression "iVar1 < 1" identifier < number_literal) )) (compound_statement "{\n      return 0;\n    }" { (return_statement "return 0;" return number_literal ;) })) (expression_statement "pcVar4 = *mangled;" (assignment_expression "pcVar4 = *mangled" identifier = (pointer_expression "*mangled" * identifier)) ;) (if_statement "if (iVar1 < 10) goto LAB_003179e4;" if (parenthesized_expression "(iVar1 < 10)" ( (binary_expression "iVar1 < 10" identifier < number_literal) )) (goto_statement "goto LAB_003179e4;" goto statement_identifier ;)) (expression_statement "start = pcVar4 + 1;" (assignment_expression "start = pcVar4 + 1" identifier = (binary_expression "pcVar4 + 1" identifier + number_literal)) ;) (if_statement "if (*pcVar4 != '_') {\n      return 0;\n    }" if (parenthesized_expression "(*pcVar4 != '_')" ( (binary_expression "*pcVar4 != '_'" (pointer_expression "*pcVar4" * identifier) != (char_literal "'_'" ' character ')) )) (compound_statement "{\n      return 0;\n    }" { (return_statement "return 0;" return number_literal ;) })) (expression_statement "*mangled = start;" (assignment_expression "*mangled = start" (pointer_expression "*mangled" * identifier) = identifier) ;) (expression_statement "result->e = (char *)0x0;" (assignment_expression "result->e = (char *)0x0" (field_expression "result->e" identifier -> field_identifier) = (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (expression_statement "result->p = (char *)0x0;" (assignment_expression "result->p = (char *)0x0" (field_expression "result->p" identifier -> field_identifier) = (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (expression_statement "result->b = (char *)0x0;" (assignment_expression "result->b = (char *)0x0" (field_expression "result->b" identifier -> field_identifier) = (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ;) }) while (parenthesized_expression "( true )" ( true )) ;) })))
(translation_unit "undefined4 FUN_0031799c(int param_1,int *param_2,undefined4 *param_3)\n\n{\n  int iVar1;\n  int *piVar2;\n  int iVar3;\n  char *pcVar4;\n  char *pcVar5;\n  \n  iVar1 = *(int *)(param_1 + 0x50);\n  iVar3 = 0x6e;\n  pcVar4 = (char *)*param_2;\nLAB_003179e4:\n  param_3[2] = 0;\n  param_3[1] = 0;\n  *param_3 = 0;\n  pcVar5 = pcVar4;\n  do {\n    if (0 < iVar1) {\n      iVar3 = *(int *)(param_1 + 0x4c);\n      *(int *)(param_1 + 0x50) = iVar1 + -1;\n      if (iVar3 == 0) {\n        return 0;\n      }\n      FUN_003127e8(param_3,iVar3,*(undefined4 *)(iVar3 + 4));\n      return 1;\n    }\n    if (*(char *)*param_2 != iVar3) {\n      piVar2 = *(int **)(param_1 + 0x4c);\n      if (piVar2 == (int *)0x0) {\n        piVar2 = (int *)xmalloc(0xc);\n        *(int **)(param_1 + 0x4c) = piVar2;\n      }\n      else if (*piVar2 != 0) {\n        (*(code *)PTR_free_004c5c18)();\n        piVar2[1] = 0;\n        piVar2[2] = 0;\n        *piVar2 = 0;\n        iVar1 = FUN_0031439c(param_1,param_2,*(undefined4 *)(param_1 + 0x4c));\n        goto joined_r0x00317b3c;\n      }\n      iVar1 = FUN_0031439c(param_1,param_2,piVar2);\njoined_r0x00317b3c:\n      if (iVar1 == 0) {\n        return 0;\n      }\n      FUN_003127e8(param_3,*(int *)(param_1 + 0x4c),*(undefined4 *)(*(int *)(param_1 + 0x4c) + 4));\n      FUN_00312c3c(param_1,pcVar5,*param_2 - (int)pcVar5);\n      return 1;\n    }\n    *param_2 = (int)((char *)*param_2 + 1);\n    iVar1 = FUN_00311f28(param_2);\n    *(int *)(param_1 + 0x50) = iVar1;\n    if (iVar1 < 1) {\n      return 0;\n    }\n    pcVar4 = (char *)*param_2;\n    if (iVar1 < 10) goto LAB_003179e4;\n    pcVar5 = pcVar4 + 1;\n    if (*pcVar4 != '_') {\n      return 0;\n    }\n    *param_2 = (int)pcVar5;\n    param_3[2] = 0;\n    param_3[1] = 0;\n    *param_3 = 0;\n  } while( true );\n}\n\n" (function_definition "undefined4 FUN_0031799c(int param_1,int *param_2,undefined4 *param_3)\n\n{\n  int iVar1;\n  int *piVar2;\n  int iVar3;\n  char *pcVar4;\n  char *pcVar5;\n  \n  iVar1 = *(int *)(param_1 + 0x50);\n  iVar3 = 0x6e;\n  pcVar4 = (char *)*param_2;\nLAB_003179e4:\n  param_3[2] = 0;\n  param_3[1] = 0;\n  *param_3 = 0;\n  pcVar5 = pcVar4;\n  do {\n    if (0 < iVar1) {\n      iVar3 = *(int *)(param_1 + 0x4c);\n      *(int *)(param_1 + 0x50) = iVar1 + -1;\n      if (iVar3 == 0) {\n        return 0;\n      }\n      FUN_003127e8(param_3,iVar3,*(undefined4 *)(iVar3 + 4));\n      return 1;\n    }\n    if (*(char *)*param_2 != iVar3) {\n      piVar2 = *(int **)(param_1 + 0x4c);\n      if (piVar2 == (int *)0x0) {\n        piVar2 = (int *)xmalloc(0xc);\n        *(int **)(param_1 + 0x4c) = piVar2;\n      }\n      else if (*piVar2 != 0) {\n        (*(code *)PTR_free_004c5c18)();\n        piVar2[1] = 0;\n        piVar2[2] = 0;\n        *piVar2 = 0;\n        iVar1 = FUN_0031439c(param_1,param_2,*(undefined4 *)(param_1 + 0x4c));\n        goto joined_r0x00317b3c;\n      }\n      iVar1 = FUN_0031439c(param_1,param_2,piVar2);\njoined_r0x00317b3c:\n      if (iVar1 == 0) {\n        return 0;\n      }\n      FUN_003127e8(param_3,*(int *)(param_1 + 0x4c),*(undefined4 *)(*(int *)(param_1 + 0x4c) + 4));\n      FUN_00312c3c(param_1,pcVar5,*param_2 - (int)pcVar5);\n      return 1;\n    }\n    *param_2 = (int)((char *)*param_2 + 1);\n    iVar1 = FUN_00311f28(param_2);\n    *(int *)(param_1 + 0x50) = iVar1;\n    if (iVar1 < 1) {\n      return 0;\n    }\n    pcVar4 = (char *)*param_2;\n    if (iVar1 < 10) goto LAB_003179e4;\n    pcVar5 = pcVar4 + 1;\n    if (*pcVar4 != '_') {\n      return 0;\n    }\n    *param_2 = (int)pcVar5;\n    param_3[2] = 0;\n    param_3[1] = 0;\n    *param_3 = 0;\n  } while( true );\n}" type_identifier (function_declarator "FUN_0031799c(int param_1,int *param_2,undefined4 *param_3)" identifier (parameter_list "(int param_1,int *param_2,undefined4 *param_3)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "int *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "undefined4 *param_3" type_identifier (pointer_declarator "*param_3" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  int *piVar2;\n  int iVar3;\n  char *pcVar4;\n  char *pcVar5;\n  \n  iVar1 = *(int *)(param_1 + 0x50);\n  iVar3 = 0x6e;\n  pcVar4 = (char *)*param_2;\nLAB_003179e4:\n  param_3[2] = 0;\n  param_3[1] = 0;\n  *param_3 = 0;\n  pcVar5 = pcVar4;\n  do {\n    if (0 < iVar1) {\n      iVar3 = *(int *)(param_1 + 0x4c);\n      *(int *)(param_1 + 0x50) = iVar1 + -1;\n      if (iVar3 == 0) {\n        return 0;\n      }\n      FUN_003127e8(param_3,iVar3,*(undefined4 *)(iVar3 + 4));\n      return 1;\n    }\n    if (*(char *)*param_2 != iVar3) {\n      piVar2 = *(int **)(param_1 + 0x4c);\n      if (piVar2 == (int *)0x0) {\n        piVar2 = (int *)xmalloc(0xc);\n        *(int **)(param_1 + 0x4c) = piVar2;\n      }\n      else if (*piVar2 != 0) {\n        (*(code *)PTR_free_004c5c18)();\n        piVar2[1] = 0;\n        piVar2[2] = 0;\n        *piVar2 = 0;\n        iVar1 = FUN_0031439c(param_1,param_2,*(undefined4 *)(param_1 + 0x4c));\n        goto joined_r0x00317b3c;\n      }\n      iVar1 = FUN_0031439c(param_1,param_2,piVar2);\njoined_r0x00317b3c:\n      if (iVar1 == 0) {\n        return 0;\n      }\n      FUN_003127e8(param_3,*(int *)(param_1 + 0x4c),*(undefined4 *)(*(int *)(param_1 + 0x4c) + 4));\n      FUN_00312c3c(param_1,pcVar5,*param_2 - (int)pcVar5);\n      return 1;\n    }\n    *param_2 = (int)((char *)*param_2 + 1);\n    iVar1 = FUN_00311f28(param_2);\n    *(int *)(param_1 + 0x50) = iVar1;\n    if (iVar1 < 1) {\n      return 0;\n    }\n    pcVar4 = (char *)*param_2;\n    if (iVar1 < 10) goto LAB_003179e4;\n    pcVar5 = pcVar4 + 1;\n    if (*pcVar4 != '_') {\n      return 0;\n    }\n    *param_2 = (int)pcVar5;\n    param_3[2] = 0;\n    param_3[1] = 0;\n    *param_3 = 0;\n  } while( true );\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int *piVar2;" primitive_type (pointer_declarator "*piVar2" * identifier) ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "char *pcVar4;" primitive_type (pointer_declarator "*pcVar4" * identifier) ;) (declaration "char *pcVar5;" primitive_type (pointer_declarator "*pcVar5" * identifier) ;) (expression_statement "iVar1 = *(int *)(param_1 + 0x50);" (assignment_expression "iVar1 = *(int *)(param_1 + 0x50)" identifier = (pointer_expression "*(int *)(param_1 + 0x50)" * (cast_expression "(int *)(param_1 + 0x50)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x50)" ( (binary_expression "param_1 + 0x50" identifier + number_literal) ))))) ;) (expression_statement "iVar3 = 0x6e;" (assignment_expression "iVar3 = 0x6e" identifier = number_literal) ;) (expression_statement "pcVar4 = (char *)*param_2;" (assignment_expression "pcVar4 = (char *)*param_2" identifier = (cast_expression "(char *)*param_2" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_2" * identifier))) ;) (labeled_statement "LAB_003179e4:\n  param_3[2] = 0;" statement_identifier : (expression_statement "param_3[2] = 0;" (assignment_expression "param_3[2] = 0" (subscript_expression "param_3[2]" identifier [ number_literal ]) = number_literal) ;)) (expression_statement "param_3[1] = 0;" (assignment_expression "param_3[1] = 0" (subscript_expression "param_3[1]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "*param_3 = 0;" (assignment_expression "*param_3 = 0" (pointer_expression "*param_3" * identifier) = number_literal) ;) (expression_statement "pcVar5 = pcVar4;" (assignment_expression "pcVar5 = pcVar4" identifier = identifier) ;) (do_statement "do {\n    if (0 < iVar1) {\n      iVar3 = *(int *)(param_1 + 0x4c);\n      *(int *)(param_1 + 0x50) = iVar1 + -1;\n      if (iVar3 == 0) {\n        return 0;\n      }\n      FUN_003127e8(param_3,iVar3,*(undefined4 *)(iVar3 + 4));\n      return 1;\n    }\n    if (*(char *)*param_2 != iVar3) {\n      piVar2 = *(int **)(param_1 + 0x4c);\n      if (piVar2 == (int *)0x0) {\n        piVar2 = (int *)xmalloc(0xc);\n        *(int **)(param_1 + 0x4c) = piVar2;\n      }\n      else if (*piVar2 != 0) {\n        (*(code *)PTR_free_004c5c18)();\n        piVar2[1] = 0;\n        piVar2[2] = 0;\n        *piVar2 = 0;\n        iVar1 = FUN_0031439c(param_1,param_2,*(undefined4 *)(param_1 + 0x4c));\n        goto joined_r0x00317b3c;\n      }\n      iVar1 = FUN_0031439c(param_1,param_2,piVar2);\njoined_r0x00317b3c:\n      if (iVar1 == 0) {\n        return 0;\n      }\n      FUN_003127e8(param_3,*(int *)(param_1 + 0x4c),*(undefined4 *)(*(int *)(param_1 + 0x4c) + 4));\n      FUN_00312c3c(param_1,pcVar5,*param_2 - (int)pcVar5);\n      return 1;\n    }\n    *param_2 = (int)((char *)*param_2 + 1);\n    iVar1 = FUN_00311f28(param_2);\n    *(int *)(param_1 + 0x50) = iVar1;\n    if (iVar1 < 1) {\n      return 0;\n    }\n    pcVar4 = (char *)*param_2;\n    if (iVar1 < 10) goto LAB_003179e4;\n    pcVar5 = pcVar4 + 1;\n    if (*pcVar4 != '_') {\n      return 0;\n    }\n    *param_2 = (int)pcVar5;\n    param_3[2] = 0;\n    param_3[1] = 0;\n    *param_3 = 0;\n  } while( true );" do (compound_statement "{\n    if (0 < iVar1) {\n      iVar3 = *(int *)(param_1 + 0x4c);\n      *(int *)(param_1 + 0x50) = iVar1 + -1;\n      if (iVar3 == 0) {\n        return 0;\n      }\n      FUN_003127e8(param_3,iVar3,*(undefined4 *)(iVar3 + 4));\n      return 1;\n    }\n    if (*(char *)*param_2 != iVar3) {\n      piVar2 = *(int **)(param_1 + 0x4c);\n      if (piVar2 == (int *)0x0) {\n        piVar2 = (int *)xmalloc(0xc);\n        *(int **)(param_1 + 0x4c) = piVar2;\n      }\n      else if (*piVar2 != 0) {\n        (*(code *)PTR_free_004c5c18)();\n        piVar2[1] = 0;\n        piVar2[2] = 0;\n        *piVar2 = 0;\n        iVar1 = FUN_0031439c(param_1,param_2,*(undefined4 *)(param_1 + 0x4c));\n        goto joined_r0x00317b3c;\n      }\n      iVar1 = FUN_0031439c(param_1,param_2,piVar2);\njoined_r0x00317b3c:\n      if (iVar1 == 0) {\n        return 0;\n      }\n      FUN_003127e8(param_3,*(int *)(param_1 + 0x4c),*(undefined4 *)(*(int *)(param_1 + 0x4c) + 4));\n      FUN_00312c3c(param_1,pcVar5,*param_2 - (int)pcVar5);\n      return 1;\n    }\n    *param_2 = (int)((char *)*param_2 + 1);\n    iVar1 = FUN_00311f28(param_2);\n    *(int *)(param_1 + 0x50) = iVar1;\n    if (iVar1 < 1) {\n      return 0;\n    }\n    pcVar4 = (char *)*param_2;\n    if (iVar1 < 10) goto LAB_003179e4;\n    pcVar5 = pcVar4 + 1;\n    if (*pcVar4 != '_') {\n      return 0;\n    }\n    *param_2 = (int)pcVar5;\n    param_3[2] = 0;\n    param_3[1] = 0;\n    *param_3 = 0;\n  }" { (if_statement "if (0 < iVar1) {\n      iVar3 = *(int *)(param_1 + 0x4c);\n      *(int *)(param_1 + 0x50) = iVar1 + -1;\n      if (iVar3 == 0) {\n        return 0;\n      }\n      FUN_003127e8(param_3,iVar3,*(undefined4 *)(iVar3 + 4));\n      return 1;\n    }" if (parenthesized_expression "(0 < iVar1)" ( (binary_expression "0 < iVar1" number_literal < identifier) )) (compound_statement "{\n      iVar3 = *(int *)(param_1 + 0x4c);\n      *(int *)(param_1 + 0x50) = iVar1 + -1;\n      if (iVar3 == 0) {\n        return 0;\n      }\n      FUN_003127e8(param_3,iVar3,*(undefined4 *)(iVar3 + 4));\n      return 1;\n    }" { (expression_statement "iVar3 = *(int *)(param_1 + 0x4c);" (assignment_expression "iVar3 = *(int *)(param_1 + 0x4c)" identifier = (pointer_expression "*(int *)(param_1 + 0x4c)" * (cast_expression "(int *)(param_1 + 0x4c)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x4c)" ( (binary_expression "param_1 + 0x4c" identifier + number_literal) ))))) ;) (expression_statement "*(int *)(param_1 + 0x50) = iVar1 + -1;" (assignment_expression "*(int *)(param_1 + 0x50) = iVar1 + -1" (pointer_expression "*(int *)(param_1 + 0x50)" * (cast_expression "(int *)(param_1 + 0x50)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x50)" ( (binary_expression "param_1 + 0x50" identifier + number_literal) )))) = (binary_expression "iVar1 + -1" identifier + number_literal)) ;) (if_statement "if (iVar3 == 0) {\n        return 0;\n      }" if (parenthesized_expression "(iVar3 == 0)" ( (binary_expression "iVar3 == 0" identifier == number_literal) )) (compound_statement "{\n        return 0;\n      }" { (return_statement "return 0;" return number_literal ;) })) (expression_statement "FUN_003127e8(param_3,iVar3,*(undefined4 *)(iVar3 + 4));" (call_expression "FUN_003127e8(param_3,iVar3,*(undefined4 *)(iVar3 + 4))" identifier (argument_list "(param_3,iVar3,*(undefined4 *)(iVar3 + 4))" ( identifier , identifier , (pointer_expression "*(undefined4 *)(iVar3 + 4)" * (cast_expression "(undefined4 *)(iVar3 + 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar3 + 4)" ( (binary_expression "iVar3 + 4" identifier + number_literal) )))) ))) ;) (return_statement "return 1;" return number_literal ;) })) (if_statement "if (*(char *)*param_2 != iVar3) {\n      piVar2 = *(int **)(param_1 + 0x4c);\n      if (piVar2 == (int *)0x0) {\n        piVar2 = (int *)xmalloc(0xc);\n        *(int **)(param_1 + 0x4c) = piVar2;\n      }\n      else if (*piVar2 != 0) {\n        (*(code *)PTR_free_004c5c18)();\n        piVar2[1] = 0;\n        piVar2[2] = 0;\n        *piVar2 = 0;\n        iVar1 = FUN_0031439c(param_1,param_2,*(undefined4 *)(param_1 + 0x4c));\n        goto joined_r0x00317b3c;\n      }\n      iVar1 = FUN_0031439c(param_1,param_2,piVar2);\njoined_r0x00317b3c:\n      if (iVar1 == 0) {\n        return 0;\n      }\n      FUN_003127e8(param_3,*(int *)(param_1 + 0x4c),*(undefined4 *)(*(int *)(param_1 + 0x4c) + 4));\n      FUN_00312c3c(param_1,pcVar5,*param_2 - (int)pcVar5);\n      return 1;\n    }" if (parenthesized_expression "(*(char *)*param_2 != iVar3)" ( (binary_expression "*(char *)*param_2 != iVar3" (pointer_expression "*(char *)*param_2" * (cast_expression "(char *)*param_2" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_2" * identifier))) != identifier) )) (compound_statement "{\n      piVar2 = *(int **)(param_1 + 0x4c);\n      if (piVar2 == (int *)0x0) {\n        piVar2 = (int *)xmalloc(0xc);\n        *(int **)(param_1 + 0x4c) = piVar2;\n      }\n      else if (*piVar2 != 0) {\n        (*(code *)PTR_free_004c5c18)();\n        piVar2[1] = 0;\n        piVar2[2] = 0;\n        *piVar2 = 0;\n        iVar1 = FUN_0031439c(param_1,param_2,*(undefined4 *)(param_1 + 0x4c));\n        goto joined_r0x00317b3c;\n      }\n      iVar1 = FUN_0031439c(param_1,param_2,piVar2);\njoined_r0x00317b3c:\n      if (iVar1 == 0) {\n        return 0;\n      }\n      FUN_003127e8(param_3,*(int *)(param_1 + 0x4c),*(undefined4 *)(*(int *)(param_1 + 0x4c) + 4));\n      FUN_00312c3c(param_1,pcVar5,*param_2 - (int)pcVar5);\n      return 1;\n    }" { (expression_statement "piVar2 = *(int **)(param_1 + 0x4c);" (assignment_expression "piVar2 = *(int **)(param_1 + 0x4c)" identifier = (pointer_expression "*(int **)(param_1 + 0x4c)" * (cast_expression "(int **)(param_1 + 0x4c)" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0x4c)" ( (binary_expression "param_1 + 0x4c" identifier + number_literal) ))))) ;) (if_statement "if (piVar2 == (int *)0x0) {\n        piVar2 = (int *)xmalloc(0xc);\n        *(int **)(param_1 + 0x4c) = piVar2;\n      }\n      else if (*piVar2 != 0) {\n        (*(code *)PTR_free_004c5c18)();\n        piVar2[1] = 0;\n        piVar2[2] = 0;\n        *piVar2 = 0;\n        iVar1 = FUN_0031439c(param_1,param_2,*(undefined4 *)(param_1 + 0x4c));\n        goto joined_r0x00317b3c;\n      }" if (parenthesized_expression "(piVar2 == (int *)0x0)" ( (binary_expression "piVar2 == (int *)0x0" identifier == (cast_expression "(int *)0x0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n        piVar2 = (int *)xmalloc(0xc);\n        *(int **)(param_1 + 0x4c) = piVar2;\n      }" { (expression_statement "piVar2 = (int *)xmalloc(0xc);" (assignment_expression "piVar2 = (int *)xmalloc(0xc)" identifier = (cast_expression "(int *)xmalloc(0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "xmalloc(0xc)" identifier (argument_list "(0xc)" ( number_literal ))))) ;) (expression_statement "*(int **)(param_1 + 0x4c) = piVar2;" (assignment_expression "*(int **)(param_1 + 0x4c) = piVar2" (pointer_expression "*(int **)(param_1 + 0x4c)" * (cast_expression "(int **)(param_1 + 0x4c)" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0x4c)" ( (binary_expression "param_1 + 0x4c" identifier + number_literal) )))) = identifier) ;) }) (else_clause "else if (*piVar2 != 0) {\n        (*(code *)PTR_free_004c5c18)();\n        piVar2[1] = 0;\n        piVar2[2] = 0;\n        *piVar2 = 0;\n        iVar1 = FUN_0031439c(param_1,param_2,*(undefined4 *)(param_1 + 0x4c));\n        goto joined_r0x00317b3c;\n      }" else (if_statement "if (*piVar2 != 0) {\n        (*(code *)PTR_free_004c5c18)();\n        piVar2[1] = 0;\n        piVar2[2] = 0;\n        *piVar2 = 0;\n        iVar1 = FUN_0031439c(param_1,param_2,*(undefined4 *)(param_1 + 0x4c));\n        goto joined_r0x00317b3c;\n      }" if (parenthesized_expression "(*piVar2 != 0)" ( (binary_expression "*piVar2 != 0" (pointer_expression "*piVar2" * identifier) != number_literal) )) (compound_statement "{\n        (*(code *)PTR_free_004c5c18)();\n        piVar2[1] = 0;\n        piVar2[2] = 0;\n        *piVar2 = 0;\n        iVar1 = FUN_0031439c(param_1,param_2,*(undefined4 *)(param_1 + 0x4c));\n        goto joined_r0x00317b3c;\n      }" { (expression_statement "(*(code *)PTR_free_004c5c18)();" (call_expression "(*(code *)PTR_free_004c5c18)()" (parenthesized_expression "(*(code *)PTR_free_004c5c18)" ( (pointer_expression "*(code *)PTR_free_004c5c18" * (cast_expression "(code *)PTR_free_004c5c18" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))) ;) (expression_statement "piVar2[1] = 0;" (assignment_expression "piVar2[1] = 0" (subscript_expression "piVar2[1]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "piVar2[2] = 0;" (assignment_expression "piVar2[2] = 0" (subscript_expression "piVar2[2]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "*piVar2 = 0;" (assignment_expression "*piVar2 = 0" (pointer_expression "*piVar2" * identifier) = number_literal) ;) (expression_statement "iVar1 = FUN_0031439c(param_1,param_2,*(undefined4 *)(param_1 + 0x4c));" (assignment_expression "iVar1 = FUN_0031439c(param_1,param_2,*(undefined4 *)(param_1 + 0x4c))" identifier = (call_expression "FUN_0031439c(param_1,param_2,*(undefined4 *)(param_1 + 0x4c))" identifier (argument_list "(param_1,param_2,*(undefined4 *)(param_1 + 0x4c))" ( identifier , identifier , (pointer_expression "*(undefined4 *)(param_1 + 0x4c)" * (cast_expression "(undefined4 *)(param_1 + 0x4c)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x4c)" ( (binary_expression "param_1 + 0x4c" identifier + number_literal) )))) )))) ;) (goto_statement "goto joined_r0x00317b3c;" goto statement_identifier ;) })))) (expression_statement "iVar1 = FUN_0031439c(param_1,param_2,piVar2);" (assignment_expression "iVar1 = FUN_0031439c(param_1,param_2,piVar2)" identifier = (call_expression "FUN_0031439c(param_1,param_2,piVar2)" identifier (argument_list "(param_1,param_2,piVar2)" ( identifier , identifier , identifier )))) ;) (labeled_statement "joined_r0x00317b3c:\n      if (iVar1 == 0) {\n        return 0;\n      }" statement_identifier : (if_statement "if (iVar1 == 0) {\n        return 0;\n      }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n        return 0;\n      }" { (return_statement "return 0;" return number_literal ;) }))) (expression_statement "FUN_003127e8(param_3,*(int *)(param_1 + 0x4c),*(undefined4 *)(*(int *)(param_1 + 0x4c) + 4));" (call_expression "FUN_003127e8(param_3,*(int *)(param_1 + 0x4c),*(undefined4 *)(*(int *)(param_1 + 0x4c) + 4))" identifier (argument_list "(param_3,*(int *)(param_1 + 0x4c),*(undefined4 *)(*(int *)(param_1 + 0x4c) + 4))" ( identifier , (pointer_expression "*(int *)(param_1 + 0x4c)" * (cast_expression "(int *)(param_1 + 0x4c)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x4c)" ( (binary_expression "param_1 + 0x4c" identifier + number_literal) )))) , (pointer_expression "*(undefined4 *)(*(int *)(param_1 + 0x4c) + 4)" * (cast_expression "(undefined4 *)(*(int *)(param_1 + 0x4c) + 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*(int *)(param_1 + 0x4c) + 4)" ( (binary_expression "*(int *)(param_1 + 0x4c) + 4" (pointer_expression "*(int *)(param_1 + 0x4c)" * (cast_expression "(int *)(param_1 + 0x4c)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x4c)" ( (binary_expression "param_1 + 0x4c" identifier + number_literal) )))) + number_literal) )))) ))) ;) (expression_statement "FUN_00312c3c(param_1,pcVar5,*param_2 - (int)pcVar5);" (call_expression "FUN_00312c3c(param_1,pcVar5,*param_2 - (int)pcVar5)" identifier (argument_list "(param_1,pcVar5,*param_2 - (int)pcVar5)" ( identifier , identifier , (binary_expression "*param_2 - (int)pcVar5" (pointer_expression "*param_2" * identifier) - (cast_expression "(int)pcVar5" ( (type_descriptor "int" primitive_type) ) identifier)) ))) ;) (return_statement "return 1;" return number_literal ;) })) (expression_statement "*param_2 = (int)((char *)*param_2 + 1);" (assignment_expression "*param_2 = (int)((char *)*param_2 + 1)" (pointer_expression "*param_2" * identifier) = (cast_expression "(int)((char *)*param_2 + 1)" ( (type_descriptor "int" primitive_type) ) (parenthesized_expression "((char *)*param_2 + 1)" ( (binary_expression "(char *)*param_2 + 1" (cast_expression "(char *)*param_2" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_2" * identifier)) + number_literal) )))) ;) (expression_statement "iVar1 = FUN_00311f28(param_2);" (assignment_expression "iVar1 = FUN_00311f28(param_2)" identifier = (call_expression "FUN_00311f28(param_2)" identifier (argument_list "(param_2)" ( identifier )))) ;) (expression_statement "*(int *)(param_1 + 0x50) = iVar1;" (assignment_expression "*(int *)(param_1 + 0x50) = iVar1" (pointer_expression "*(int *)(param_1 + 0x50)" * (cast_expression "(int *)(param_1 + 0x50)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x50)" ( (binary_expression "param_1 + 0x50" identifier + number_literal) )))) = identifier) ;) (if_statement "if (iVar1 < 1) {\n      return 0;\n    }" if (parenthesized_expression "(iVar1 < 1)" ( (binary_expression "iVar1 < 1" identifier < number_literal) )) (compound_statement "{\n      return 0;\n    }" { (return_statement "return 0;" return number_literal ;) })) (expression_statement "pcVar4 = (char *)*param_2;" (assignment_expression "pcVar4 = (char *)*param_2" identifier = (cast_expression "(char *)*param_2" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_2" * identifier))) ;) (if_statement "if (iVar1 < 10) goto LAB_003179e4;" if (parenthesized_expression "(iVar1 < 10)" ( (binary_expression "iVar1 < 10" identifier < number_literal) )) (goto_statement "goto LAB_003179e4;" goto statement_identifier ;)) (expression_statement "pcVar5 = pcVar4 + 1;" (assignment_expression "pcVar5 = pcVar4 + 1" identifier = (binary_expression "pcVar4 + 1" identifier + number_literal)) ;) (if_statement "if (*pcVar4 != '_') {\n      return 0;\n    }" if (parenthesized_expression "(*pcVar4 != '_')" ( (binary_expression "*pcVar4 != '_'" (pointer_expression "*pcVar4" * identifier) != (char_literal "'_'" ' character ')) )) (compound_statement "{\n      return 0;\n    }" { (return_statement "return 0;" return number_literal ;) })) (expression_statement "*param_2 = (int)pcVar5;" (assignment_expression "*param_2 = (int)pcVar5" (pointer_expression "*param_2" * identifier) = (cast_expression "(int)pcVar5" ( (type_descriptor "int" primitive_type) ) identifier)) ;) (expression_statement "param_3[2] = 0;" (assignment_expression "param_3[2] = 0" (subscript_expression "param_3[2]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "param_3[1] = 0;" (assignment_expression "param_3[1] = 0" (subscript_expression "param_3[1]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "*param_3 = 0;" (assignment_expression "*param_3 = 0" (pointer_expression "*param_3" * identifier) = number_literal) ;) }) while (parenthesized_expression "( true )" ( true )) ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE (pointer_declarator * IDENT)) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) (labeled_statement statement_identifier : (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = LIT) ;)) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = LIT) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (do_statement do (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = (binary_expression IDENT + LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (return_statement return LIT ;) })) (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) ))) ;) (return_statement return LIT ;) })) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) != IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( LIT ))))) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = IDENT) ;) }) (else_clause else (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) != LIT) )) (compound_statement { (expression_statement (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( ))) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = LIT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = LIT) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT , (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) )))) ;) (goto_statement goto statement_identifier ;) })))) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT )))) ;) (labeled_statement statement_identifier : (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (return_statement return LIT ;) }))) (expression_statement (call_expression IDENT (argument_list ( IDENT , (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) , (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) + LIT) )))) ))) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , (binary_expression (pointer_expression * IDENT) - (cast_expression ( (type_descriptor TYPE) ) IDENT)) ))) ;) (return_statement return LIT ;) })) (expression_statement (assignment_expression (pointer_expression * IDENT) = (cast_expression ( (type_descriptor TYPE) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT)) + LIT) )))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (return_statement return LIT ;) })) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (goto_statement goto statement_identifier ;)) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) != (char_literal ' character ')) )) (compound_statement { (return_statement return LIT ;) })) (expression_statement (assignment_expression (pointer_expression * IDENT) = (cast_expression ( (type_descriptor TYPE) ) IDENT)) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = LIT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = LIT) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;) }) while (parenthesized_expression ( BOOL )) ;) })))
(function_definition "undefined4 FUN_0031799c(int param_1,int *param_2,undefined4 *param_3)\n\n{\n  int iVar1;\n  int *piVar2;\n  int iVar3;\n  char *pcVar4;\n  char *pcVar5;\n  \n  iVar1 = *(int *)(param_1 + 0x50);\n  iVar3 = 0x6e;\n  pcVar4 = (char *)*param_2;\nLAB_003179e4:\n  param_3[2] = 0;\n  param_3[1] = 0;\n  *param_3 = 0;\n  pcVar5 = pcVar4;\n  do {\n    if (0 < iVar1) {\n      iVar3 = *(int *)(param_1 + 0x4c);\n      *(int *)(param_1 + 0x50) = iVar1 + -1;\n      if (iVar3 == 0) {\n        return 0;\n      }\n      FUN_003127e8(param_3,iVar3,*(undefined4 *)(iVar3 + 4));\n      return 1;\n    }\n    if (*(char *)*param_2 != iVar3) {\n      piVar2 = *(int **)(param_1 + 0x4c);\n      if (piVar2 == (int *)0x0) {\n        piVar2 = (int *)xmalloc(0xc);\n        *(int **)(param_1 + 0x4c) = piVar2;\n      }\n      else if (*piVar2 != 0) {\n        (*(code *)PTR_free_004c5c18)();\n        piVar2[1] = 0;\n        piVar2[2] = 0;\n        *piVar2 = 0;\n        iVar1 = FUN_0031439c(param_1,param_2,*(undefined4 *)(param_1 + 0x4c));\n        goto joined_r0x00317b3c;\n      }\n      iVar1 = FUN_0031439c(param_1,param_2,piVar2);\njoined_r0x00317b3c:\n      if (iVar1 == 0) {\n        return 0;\n      }\n      FUN_003127e8(param_3,*(int *)(param_1 + 0x4c),*(undefined4 *)(*(int *)(param_1 + 0x4c) + 4));\n      FUN_00312c3c(param_1,pcVar5,*param_2 - (int)pcVar5);\n      return 1;\n    }\n    *param_2 = (int)((char *)*param_2 + 1);\n    iVar1 = FUN_00311f28(param_2);\n    *(int *)(param_1 + 0x50) = iVar1;\n    if (iVar1 < 1) {\n      return 0;\n    }\n    pcVar4 = (char *)*param_2;\n    if (iVar1 < 10) goto LAB_003179e4;\n    pcVar5 = pcVar4 + 1;\n    if (*pcVar4 != '_') {\n      return 0;\n    }\n    *param_2 = (int)pcVar5;\n    param_3[2] = 0;\n    param_3[1] = 0;\n    *param_3 = 0;\n  } while( true );\n}" (type_identifier "undefined4") (function_declarator "FUN_0031799c(int param_1,int *param_2,undefined4 *param_3)" (identifier "FUN_0031799c") (parameter_list "(int param_1,int *param_2,undefined4 *param_3)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) (, ",") (parameter_declaration "int *param_2" (primitive_type "int") (pointer_declarator "*param_2" (* "*") (identifier "param_2"))) (, ",") (parameter_declaration "undefined4 *param_3" (type_identifier "undefined4") (pointer_declarator "*param_3" (* "*") (identifier "param_3"))) () ")"))) (compound_statement "{\n  int iVar1;\n  int *piVar2;\n  int iVar3;\n  char *pcVar4;\n  char *pcVar5;\n  \n  iVar1 = *(int *)(param_1 + 0x50);\n  iVar3 = 0x6e;\n  pcVar4 = (char *)*param_2;\nLAB_003179e4:\n  param_3[2] = 0;\n  param_3[1] = 0;\n  *param_3 = 0;\n  pcVar5 = pcVar4;\n  do {\n    if (0 < iVar1) {\n      iVar3 = *(int *)(param_1 + 0x4c);\n      *(int *)(param_1 + 0x50) = iVar1 + -1;\n      if (iVar3 == 0) {\n        return 0;\n      }\n      FUN_003127e8(param_3,iVar3,*(undefined4 *)(iVar3 + 4));\n      return 1;\n    }\n    if (*(char *)*param_2 != iVar3) {\n      piVar2 = *(int **)(param_1 + 0x4c);\n      if (piVar2 == (int *)0x0) {\n        piVar2 = (int *)xmalloc(0xc);\n        *(int **)(param_1 + 0x4c) = piVar2;\n      }\n      else if (*piVar2 != 0) {\n        (*(code *)PTR_free_004c5c18)();\n        piVar2[1] = 0;\n        piVar2[2] = 0;\n        *piVar2 = 0;\n        iVar1 = FUN_0031439c(param_1,param_2,*(undefined4 *)(param_1 + 0x4c));\n        goto joined_r0x00317b3c;\n      }\n      iVar1 = FUN_0031439c(param_1,param_2,piVar2);\njoined_r0x00317b3c:\n      if (iVar1 == 0) {\n        return 0;\n      }\n      FUN_003127e8(param_3,*(int *)(param_1 + 0x4c),*(undefined4 *)(*(int *)(param_1 + 0x4c) + 4));\n      FUN_00312c3c(param_1,pcVar5,*param_2 - (int)pcVar5);\n      return 1;\n    }\n    *param_2 = (int)((char *)*param_2 + 1);\n    iVar1 = FUN_00311f28(param_2);\n    *(int *)(param_1 + 0x50) = iVar1;\n    if (iVar1 < 1) {\n      return 0;\n    }\n    pcVar4 = (char *)*param_2;\n    if (iVar1 < 10) goto LAB_003179e4;\n    pcVar5 = pcVar4 + 1;\n    if (*pcVar4 != '_') {\n      return 0;\n    }\n    *param_2 = (int)pcVar5;\n    param_3[2] = 0;\n    param_3[1] = 0;\n    *param_3 = 0;\n  } while( true );\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "int *piVar2;" (primitive_type "int") (pointer_declarator "*piVar2" (* "*") (identifier "piVar2")) (; ";")) (declaration "int iVar3;" (primitive_type "int") (identifier "iVar3") (; ";")) (declaration "char *pcVar4;" (primitive_type "char") (pointer_declarator "*pcVar4" (* "*") (identifier "pcVar4")) (; ";")) (declaration "char *pcVar5;" (primitive_type "char") (pointer_declarator "*pcVar5" (* "*") (identifier "pcVar5")) (; ";")) (expression_statement "iVar1 = *(int *)(param_1 + 0x50);" (assignment_expression "iVar1 = *(int *)(param_1 + 0x50)" (identifier "iVar1") (= "=") (pointer_expression "*(int *)(param_1 + 0x50)" (* "*") (cast_expression "(int *)(param_1 + 0x50)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x50)" (( "(") (binary_expression "param_1 + 0x50" (identifier "param_1") (+ "+") (number_literal "0x50")) () ")"))))) (; ";")) (expression_statement "iVar3 = 0x6e;" (assignment_expression "iVar3 = 0x6e" (identifier "iVar3") (= "=") (number_literal "0x6e")) (; ";")) (expression_statement "pcVar4 = (char *)*param_2;" (assignment_expression "pcVar4 = (char *)*param_2" (identifier "pcVar4") (= "=") (cast_expression "(char *)*param_2" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_2" (* "*") (identifier "param_2")))) (; ";")) (labeled_statement "LAB_003179e4:\n  param_3[2] = 0;" (statement_identifier "LAB_003179e4") (: ":") (expression_statement "param_3[2] = 0;" (assignment_expression "param_3[2] = 0" (subscript_expression "param_3[2]" (identifier "param_3") ([ "[") (number_literal "2") (] "]")) (= "=") (number_literal "0")) (; ";"))) (expression_statement "param_3[1] = 0;" (assignment_expression "param_3[1] = 0" (subscript_expression "param_3[1]" (identifier "param_3") ([ "[") (number_literal "1") (] "]")) (= "=") (number_literal "0")) (; ";")) (expression_statement "*param_3 = 0;" (assignment_expression "*param_3 = 0" (pointer_expression "*param_3" (* "*") (identifier "param_3")) (= "=") (number_literal "0")) (; ";")) (expression_statement "pcVar5 = pcVar4;" (assignment_expression "pcVar5 = pcVar4" (identifier "pcVar5") (= "=") (identifier "pcVar4")) (; ";")) (do_statement "do {\n    if (0 < iVar1) {\n      iVar3 = *(int *)(param_1 + 0x4c);\n      *(int *)(param_1 + 0x50) = iVar1 + -1;\n      if (iVar3 == 0) {\n        return 0;\n      }\n      FUN_003127e8(param_3,iVar3,*(undefined4 *)(iVar3 + 4));\n      return 1;\n    }\n    if (*(char *)*param_2 != iVar3) {\n      piVar2 = *(int **)(param_1 + 0x4c);\n      if (piVar2 == (int *)0x0) {\n        piVar2 = (int *)xmalloc(0xc);\n        *(int **)(param_1 + 0x4c) = piVar2;\n      }\n      else if (*piVar2 != 0) {\n        (*(code *)PTR_free_004c5c18)();\n        piVar2[1] = 0;\n        piVar2[2] = 0;\n        *piVar2 = 0;\n        iVar1 = FUN_0031439c(param_1,param_2,*(undefined4 *)(param_1 + 0x4c));\n        goto joined_r0x00317b3c;\n      }\n      iVar1 = FUN_0031439c(param_1,param_2,piVar2);\njoined_r0x00317b3c:\n      if (iVar1 == 0) {\n        return 0;\n      }\n      FUN_003127e8(param_3,*(int *)(param_1 + 0x4c),*(undefined4 *)(*(int *)(param_1 + 0x4c) + 4));\n      FUN_00312c3c(param_1,pcVar5,*param_2 - (int)pcVar5);\n      return 1;\n    }\n    *param_2 = (int)((char *)*param_2 + 1);\n    iVar1 = FUN_00311f28(param_2);\n    *(int *)(param_1 + 0x50) = iVar1;\n    if (iVar1 < 1) {\n      return 0;\n    }\n    pcVar4 = (char *)*param_2;\n    if (iVar1 < 10) goto LAB_003179e4;\n    pcVar5 = pcVar4 + 1;\n    if (*pcVar4 != '_') {\n      return 0;\n    }\n    *param_2 = (int)pcVar5;\n    param_3[2] = 0;\n    param_3[1] = 0;\n    *param_3 = 0;\n  } while( true );" (do "do") (compound_statement "{\n    if (0 < iVar1) {\n      iVar3 = *(int *)(param_1 + 0x4c);\n      *(int *)(param_1 + 0x50) = iVar1 + -1;\n      if (iVar3 == 0) {\n        return 0;\n      }\n      FUN_003127e8(param_3,iVar3,*(undefined4 *)(iVar3 + 4));\n      return 1;\n    }\n    if (*(char *)*param_2 != iVar3) {\n      piVar2 = *(int **)(param_1 + 0x4c);\n      if (piVar2 == (int *)0x0) {\n        piVar2 = (int *)xmalloc(0xc);\n        *(int **)(param_1 + 0x4c) = piVar2;\n      }\n      else if (*piVar2 != 0) {\n        (*(code *)PTR_free_004c5c18)();\n        piVar2[1] = 0;\n        piVar2[2] = 0;\n        *piVar2 = 0;\n        iVar1 = FUN_0031439c(param_1,param_2,*(undefined4 *)(param_1 + 0x4c));\n        goto joined_r0x00317b3c;\n      }\n      iVar1 = FUN_0031439c(param_1,param_2,piVar2);\njoined_r0x00317b3c:\n      if (iVar1 == 0) {\n        return 0;\n      }\n      FUN_003127e8(param_3,*(int *)(param_1 + 0x4c),*(undefined4 *)(*(int *)(param_1 + 0x4c) + 4));\n      FUN_00312c3c(param_1,pcVar5,*param_2 - (int)pcVar5);\n      return 1;\n    }\n    *param_2 = (int)((char *)*param_2 + 1);\n    iVar1 = FUN_00311f28(param_2);\n    *(int *)(param_1 + 0x50) = iVar1;\n    if (iVar1 < 1) {\n      return 0;\n    }\n    pcVar4 = (char *)*param_2;\n    if (iVar1 < 10) goto LAB_003179e4;\n    pcVar5 = pcVar4 + 1;\n    if (*pcVar4 != '_') {\n      return 0;\n    }\n    *param_2 = (int)pcVar5;\n    param_3[2] = 0;\n    param_3[1] = 0;\n    *param_3 = 0;\n  }" ({ "{") (if_statement "if (0 < iVar1) {\n      iVar3 = *(int *)(param_1 + 0x4c);\n      *(int *)(param_1 + 0x50) = iVar1 + -1;\n      if (iVar3 == 0) {\n        return 0;\n      }\n      FUN_003127e8(param_3,iVar3,*(undefined4 *)(iVar3 + 4));\n      return 1;\n    }" (if "if") (parenthesized_expression "(0 < iVar1)" (( "(") (binary_expression "0 < iVar1" (number_literal "0") (< "<") (identifier "iVar1")) () ")")) (compound_statement "{\n      iVar3 = *(int *)(param_1 + 0x4c);\n      *(int *)(param_1 + 0x50) = iVar1 + -1;\n      if (iVar3 == 0) {\n        return 0;\n      }\n      FUN_003127e8(param_3,iVar3,*(undefined4 *)(iVar3 + 4));\n      return 1;\n    }" ({ "{") (expression_statement "iVar3 = *(int *)(param_1 + 0x4c);" (assignment_expression "iVar3 = *(int *)(param_1 + 0x4c)" (identifier "iVar3") (= "=") (pointer_expression "*(int *)(param_1 + 0x4c)" (* "*") (cast_expression "(int *)(param_1 + 0x4c)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x4c)" (( "(") (binary_expression "param_1 + 0x4c" (identifier "param_1") (+ "+") (number_literal "0x4c")) () ")"))))) (; ";")) (expression_statement "*(int *)(param_1 + 0x50) = iVar1 + -1;" (assignment_expression "*(int *)(param_1 + 0x50) = iVar1 + -1" (pointer_expression "*(int *)(param_1 + 0x50)" (* "*") (cast_expression "(int *)(param_1 + 0x50)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x50)" (( "(") (binary_expression "param_1 + 0x50" (identifier "param_1") (+ "+") (number_literal "0x50")) () ")")))) (= "=") (binary_expression "iVar1 + -1" (identifier "iVar1") (+ "+") (number_literal "-1"))) (; ";")) (if_statement "if (iVar3 == 0) {\n        return 0;\n      }" (if "if") (parenthesized_expression "(iVar3 == 0)" (( "(") (binary_expression "iVar3 == 0" (identifier "iVar3") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n        return 0;\n      }" ({ "{") (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}"))) (expression_statement "FUN_003127e8(param_3,iVar3,*(undefined4 *)(iVar3 + 4));" (call_expression "FUN_003127e8(param_3,iVar3,*(undefined4 *)(iVar3 + 4))" (identifier "FUN_003127e8") (argument_list "(param_3,iVar3,*(undefined4 *)(iVar3 + 4))" (( "(") (identifier "param_3") (, ",") (identifier "iVar3") (, ",") (pointer_expression "*(undefined4 *)(iVar3 + 4)" (* "*") (cast_expression "(undefined4 *)(iVar3 + 4)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar3 + 4)" (( "(") (binary_expression "iVar3 + 4" (identifier "iVar3") (+ "+") (number_literal "4")) () ")")))) () ")"))) (; ";")) (return_statement "return 1;" (return "return") (number_literal "1") (; ";")) (} "}"))) (if_statement "if (*(char *)*param_2 != iVar3) {\n      piVar2 = *(int **)(param_1 + 0x4c);\n      if (piVar2 == (int *)0x0) {\n        piVar2 = (int *)xmalloc(0xc);\n        *(int **)(param_1 + 0x4c) = piVar2;\n      }\n      else if (*piVar2 != 0) {\n        (*(code *)PTR_free_004c5c18)();\n        piVar2[1] = 0;\n        piVar2[2] = 0;\n        *piVar2 = 0;\n        iVar1 = FUN_0031439c(param_1,param_2,*(undefined4 *)(param_1 + 0x4c));\n        goto joined_r0x00317b3c;\n      }\n      iVar1 = FUN_0031439c(param_1,param_2,piVar2);\njoined_r0x00317b3c:\n      if (iVar1 == 0) {\n        return 0;\n      }\n      FUN_003127e8(param_3,*(int *)(param_1 + 0x4c),*(undefined4 *)(*(int *)(param_1 + 0x4c) + 4));\n      FUN_00312c3c(param_1,pcVar5,*param_2 - (int)pcVar5);\n      return 1;\n    }" (if "if") (parenthesized_expression "(*(char *)*param_2 != iVar3)" (( "(") (binary_expression "*(char *)*param_2 != iVar3" (pointer_expression "*(char *)*param_2" (* "*") (cast_expression "(char *)*param_2" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_2" (* "*") (identifier "param_2")))) (!= "!=") (identifier "iVar3")) () ")")) (compound_statement "{\n      piVar2 = *(int **)(param_1 + 0x4c);\n      if (piVar2 == (int *)0x0) {\n        piVar2 = (int *)xmalloc(0xc);\n        *(int **)(param_1 + 0x4c) = piVar2;\n      }\n      else if (*piVar2 != 0) {\n        (*(code *)PTR_free_004c5c18)();\n        piVar2[1] = 0;\n        piVar2[2] = 0;\n        *piVar2 = 0;\n        iVar1 = FUN_0031439c(param_1,param_2,*(undefined4 *)(param_1 + 0x4c));\n        goto joined_r0x00317b3c;\n      }\n      iVar1 = FUN_0031439c(param_1,param_2,piVar2);\njoined_r0x00317b3c:\n      if (iVar1 == 0) {\n        return 0;\n      }\n      FUN_003127e8(param_3,*(int *)(param_1 + 0x4c),*(undefined4 *)(*(int *)(param_1 + 0x4c) + 4));\n      FUN_00312c3c(param_1,pcVar5,*param_2 - (int)pcVar5);\n      return 1;\n    }" ({ "{") (expression_statement "piVar2 = *(int **)(param_1 + 0x4c);" (assignment_expression "piVar2 = *(int **)(param_1 + 0x4c)" (identifier "piVar2") (= "=") (pointer_expression "*(int **)(param_1 + 0x4c)" (* "*") (cast_expression "(int **)(param_1 + 0x4c)" (( "(") (type_descriptor "int **" (primitive_type "int") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(param_1 + 0x4c)" (( "(") (binary_expression "param_1 + 0x4c" (identifier "param_1") (+ "+") (number_literal "0x4c")) () ")"))))) (; ";")) (if_statement "if (piVar2 == (int *)0x0) {\n        piVar2 = (int *)xmalloc(0xc);\n        *(int **)(param_1 + 0x4c) = piVar2;\n      }\n      else if (*piVar2 != 0) {\n        (*(code *)PTR_free_004c5c18)();\n        piVar2[1] = 0;\n        piVar2[2] = 0;\n        *piVar2 = 0;\n        iVar1 = FUN_0031439c(param_1,param_2,*(undefined4 *)(param_1 + 0x4c));\n        goto joined_r0x00317b3c;\n      }" (if "if") (parenthesized_expression "(piVar2 == (int *)0x0)" (( "(") (binary_expression "piVar2 == (int *)0x0" (identifier "piVar2") (== "==") (cast_expression "(int *)0x0" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n        piVar2 = (int *)xmalloc(0xc);\n        *(int **)(param_1 + 0x4c) = piVar2;\n      }" ({ "{") (expression_statement "piVar2 = (int *)xmalloc(0xc);" (assignment_expression "piVar2 = (int *)xmalloc(0xc)" (identifier "piVar2") (= "=") (cast_expression "(int *)xmalloc(0xc)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "xmalloc(0xc)" (identifier "xmalloc") (argument_list "(0xc)" (( "(") (number_literal "0xc") () ")"))))) (; ";")) (expression_statement "*(int **)(param_1 + 0x4c) = piVar2;" (assignment_expression "*(int **)(param_1 + 0x4c) = piVar2" (pointer_expression "*(int **)(param_1 + 0x4c)" (* "*") (cast_expression "(int **)(param_1 + 0x4c)" (( "(") (type_descriptor "int **" (primitive_type "int") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(param_1 + 0x4c)" (( "(") (binary_expression "param_1 + 0x4c" (identifier "param_1") (+ "+") (number_literal "0x4c")) () ")")))) (= "=") (identifier "piVar2")) (; ";")) (} "}")) (else_clause "else if (*piVar2 != 0) {\n        (*(code *)PTR_free_004c5c18)();\n        piVar2[1] = 0;\n        piVar2[2] = 0;\n        *piVar2 = 0;\n        iVar1 = FUN_0031439c(param_1,param_2,*(undefined4 *)(param_1 + 0x4c));\n        goto joined_r0x00317b3c;\n      }" (else "else") (if_statement "if (*piVar2 != 0) {\n        (*(code *)PTR_free_004c5c18)();\n        piVar2[1] = 0;\n        piVar2[2] = 0;\n        *piVar2 = 0;\n        iVar1 = FUN_0031439c(param_1,param_2,*(undefined4 *)(param_1 + 0x4c));\n        goto joined_r0x00317b3c;\n      }" (if "if") (parenthesized_expression "(*piVar2 != 0)" (( "(") (binary_expression "*piVar2 != 0" (pointer_expression "*piVar2" (* "*") (identifier "piVar2")) (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n        (*(code *)PTR_free_004c5c18)();\n        piVar2[1] = 0;\n        piVar2[2] = 0;\n        *piVar2 = 0;\n        iVar1 = FUN_0031439c(param_1,param_2,*(undefined4 *)(param_1 + 0x4c));\n        goto joined_r0x00317b3c;\n      }" ({ "{") (expression_statement "(*(code *)PTR_free_004c5c18)();" (call_expression "(*(code *)PTR_free_004c5c18)()" (parenthesized_expression "(*(code *)PTR_free_004c5c18)" (( "(") (pointer_expression "*(code *)PTR_free_004c5c18" (* "*") (cast_expression "(code *)PTR_free_004c5c18" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_free_004c5c18"))) () ")")) (argument_list "()" (( "(") () ")"))) (; ";")) (expression_statement "piVar2[1] = 0;" (assignment_expression "piVar2[1] = 0" (subscript_expression "piVar2[1]" (identifier "piVar2") ([ "[") (number_literal "1") (] "]")) (= "=") (number_literal "0")) (; ";")) (expression_statement "piVar2[2] = 0;" (assignment_expression "piVar2[2] = 0" (subscript_expression "piVar2[2]" (identifier "piVar2") ([ "[") (number_literal "2") (] "]")) (= "=") (number_literal "0")) (; ";")) (expression_statement "*piVar2 = 0;" (assignment_expression "*piVar2 = 0" (pointer_expression "*piVar2" (* "*") (identifier "piVar2")) (= "=") (number_literal "0")) (; ";")) (expression_statement "iVar1 = FUN_0031439c(param_1,param_2,*(undefined4 *)(param_1 + 0x4c));" (assignment_expression "iVar1 = FUN_0031439c(param_1,param_2,*(undefined4 *)(param_1 + 0x4c))" (identifier "iVar1") (= "=") (call_expression "FUN_0031439c(param_1,param_2,*(undefined4 *)(param_1 + 0x4c))" (identifier "FUN_0031439c") (argument_list "(param_1,param_2,*(undefined4 *)(param_1 + 0x4c))" (( "(") (identifier "param_1") (, ",") (identifier "param_2") (, ",") (pointer_expression "*(undefined4 *)(param_1 + 0x4c)" (* "*") (cast_expression "(undefined4 *)(param_1 + 0x4c)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x4c)" (( "(") (binary_expression "param_1 + 0x4c" (identifier "param_1") (+ "+") (number_literal "0x4c")) () ")")))) () ")")))) (; ";")) (goto_statement "goto joined_r0x00317b3c;" (goto "goto") (statement_identifier "joined_r0x00317b3c") (; ";")) (} "}"))))) (expression_statement "iVar1 = FUN_0031439c(param_1,param_2,piVar2);" (assignment_expression "iVar1 = FUN_0031439c(param_1,param_2,piVar2)" (identifier "iVar1") (= "=") (call_expression "FUN_0031439c(param_1,param_2,piVar2)" (identifier "FUN_0031439c") (argument_list "(param_1,param_2,piVar2)" (( "(") (identifier "param_1") (, ",") (identifier "param_2") (, ",") (identifier "piVar2") () ")")))) (; ";")) (labeled_statement "joined_r0x00317b3c:\n      if (iVar1 == 0) {\n        return 0;\n      }" (statement_identifier "joined_r0x00317b3c") (: ":") (if_statement "if (iVar1 == 0) {\n        return 0;\n      }" (if "if") (parenthesized_expression "(iVar1 == 0)" (( "(") (binary_expression "iVar1 == 0" (identifier "iVar1") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n        return 0;\n      }" ({ "{") (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}")))) (expression_statement "FUN_003127e8(param_3,*(int *)(param_1 + 0x4c),*(undefined4 *)(*(int *)(param_1 + 0x4c) + 4));" (call_expression "FUN_003127e8(param_3,*(int *)(param_1 + 0x4c),*(undefined4 *)(*(int *)(param_1 + 0x4c) + 4))" (identifier "FUN_003127e8") (argument_list "(param_3,*(int *)(param_1 + 0x4c),*(undefined4 *)(*(int *)(param_1 + 0x4c) + 4))" (( "(") (identifier "param_3") (, ",") (pointer_expression "*(int *)(param_1 + 0x4c)" (* "*") (cast_expression "(int *)(param_1 + 0x4c)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x4c)" (( "(") (binary_expression "param_1 + 0x4c" (identifier "param_1") (+ "+") (number_literal "0x4c")) () ")")))) (, ",") (pointer_expression "*(undefined4 *)(*(int *)(param_1 + 0x4c) + 4)" (* "*") (cast_expression "(undefined4 *)(*(int *)(param_1 + 0x4c) + 4)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(*(int *)(param_1 + 0x4c) + 4)" (( "(") (binary_expression "*(int *)(param_1 + 0x4c) + 4" (pointer_expression "*(int *)(param_1 + 0x4c)" (* "*") (cast_expression "(int *)(param_1 + 0x4c)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x4c)" (( "(") (binary_expression "param_1 + 0x4c" (identifier "param_1") (+ "+") (number_literal "0x4c")) () ")")))) (+ "+") (number_literal "4")) () ")")))) () ")"))) (; ";")) (expression_statement "FUN_00312c3c(param_1,pcVar5,*param_2 - (int)pcVar5);" (call_expression "FUN_00312c3c(param_1,pcVar5,*param_2 - (int)pcVar5)" (identifier "FUN_00312c3c") (argument_list "(param_1,pcVar5,*param_2 - (int)pcVar5)" (( "(") (identifier "param_1") (, ",") (identifier "pcVar5") (, ",") (binary_expression "*param_2 - (int)pcVar5" (pointer_expression "*param_2" (* "*") (identifier "param_2")) (- "-") (cast_expression "(int)pcVar5" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "pcVar5"))) () ")"))) (; ";")) (return_statement "return 1;" (return "return") (number_literal "1") (; ";")) (} "}"))) (expression_statement "*param_2 = (int)((char *)*param_2 + 1);" (assignment_expression "*param_2 = (int)((char *)*param_2 + 1)" (pointer_expression "*param_2" (* "*") (identifier "param_2")) (= "=") (cast_expression "(int)((char *)*param_2 + 1)" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (parenthesized_expression "((char *)*param_2 + 1)" (( "(") (binary_expression "(char *)*param_2 + 1" (cast_expression "(char *)*param_2" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_2" (* "*") (identifier "param_2"))) (+ "+") (number_literal "1")) () ")")))) (; ";")) (expression_statement "iVar1 = FUN_00311f28(param_2);" (assignment_expression "iVar1 = FUN_00311f28(param_2)" (identifier "iVar1") (= "=") (call_expression "FUN_00311f28(param_2)" (identifier "FUN_00311f28") (argument_list "(param_2)" (( "(") (identifier "param_2") () ")")))) (; ";")) (expression_statement "*(int *)(param_1 + 0x50) = iVar1;" (assignment_expression "*(int *)(param_1 + 0x50) = iVar1" (pointer_expression "*(int *)(param_1 + 0x50)" (* "*") (cast_expression "(int *)(param_1 + 0x50)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x50)" (( "(") (binary_expression "param_1 + 0x50" (identifier "param_1") (+ "+") (number_literal "0x50")) () ")")))) (= "=") (identifier "iVar1")) (; ";")) (if_statement "if (iVar1 < 1) {\n      return 0;\n    }" (if "if") (parenthesized_expression "(iVar1 < 1)" (( "(") (binary_expression "iVar1 < 1" (identifier "iVar1") (< "<") (number_literal "1")) () ")")) (compound_statement "{\n      return 0;\n    }" ({ "{") (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}"))) (expression_statement "pcVar4 = (char *)*param_2;" (assignment_expression "pcVar4 = (char *)*param_2" (identifier "pcVar4") (= "=") (cast_expression "(char *)*param_2" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_2" (* "*") (identifier "param_2")))) (; ";")) (if_statement "if (iVar1 < 10) goto LAB_003179e4;" (if "if") (parenthesized_expression "(iVar1 < 10)" (( "(") (binary_expression "iVar1 < 10" (identifier "iVar1") (< "<") (number_literal "10")) () ")")) (goto_statement "goto LAB_003179e4;" (goto "goto") (statement_identifier "LAB_003179e4") (; ";"))) (expression_statement "pcVar5 = pcVar4 + 1;" (assignment_expression "pcVar5 = pcVar4 + 1" (identifier "pcVar5") (= "=") (binary_expression "pcVar4 + 1" (identifier "pcVar4") (+ "+") (number_literal "1"))) (; ";")) (if_statement "if (*pcVar4 != '_') {\n      return 0;\n    }" (if "if") (parenthesized_expression "(*pcVar4 != '_')" (( "(") (binary_expression "*pcVar4 != '_'" (pointer_expression "*pcVar4" (* "*") (identifier "pcVar4")) (!= "!=") (char_literal "'_'" (' "'") (character "_") (' "'"))) () ")")) (compound_statement "{\n      return 0;\n    }" ({ "{") (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}"))) (expression_statement "*param_2 = (int)pcVar5;" (assignment_expression "*param_2 = (int)pcVar5" (pointer_expression "*param_2" (* "*") (identifier "param_2")) (= "=") (cast_expression "(int)pcVar5" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "pcVar5"))) (; ";")) (expression_statement "param_3[2] = 0;" (assignment_expression "param_3[2] = 0" (subscript_expression "param_3[2]" (identifier "param_3") ([ "[") (number_literal "2") (] "]")) (= "=") (number_literal "0")) (; ";")) (expression_statement "param_3[1] = 0;" (assignment_expression "param_3[1] = 0" (subscript_expression "param_3[1]" (identifier "param_3") ([ "[") (number_literal "1") (] "]")) (= "=") (number_literal "0")) (; ";")) (expression_statement "*param_3 = 0;" (assignment_expression "*param_3 = 0" (pointer_expression "*param_3" (* "*") (identifier "param_3")) (= "=") (number_literal "0")) (; ";")) (} "}")) (while "while") (parenthesized_expression "( true )" (( "(") (true "true") () ")")) (; ";")) (} "}")))
(translation_unit (function_definition type: (type_identifier) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (primitive_type) declarator: (identifier)) (parameter_declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))))) body: (compound_statement (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (pointer_expression argument: (identifier))))) (labeled_statement label: (statement_identifier) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (number_literal)))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (number_literal))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (do_statement body: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (number_literal) right: (identifier))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))) (expression_statement (assignment_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (binary_expression left: (identifier) right: (number_literal)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (return_statement (number_literal)))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal)))))))) (return_statement (number_literal)))) (if_statement condition: (parenthesized_expression (binary_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (pointer_expression argument: (identifier)))) right: (identifier))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator declarator: (abstract_pointer_declarator))) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (number_literal)))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (call_expression function: (identifier) arguments: (argument_list (number_literal)))))) (expression_statement (assignment_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator declarator: (abstract_pointer_declarator))) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (identifier)))) alternative: (else_clause (if_statement condition: (parenthesized_expression (binary_expression left: (pointer_expression argument: (identifier)) right: (number_literal))) consequence: (compound_statement (expression_statement (call_expression function: (parenthesized_expression (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (identifier)))) arguments: (argument_list))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (number_literal))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (number_literal))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))))) (goto_statement label: (statement_identifier)))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (identifier))))) (labeled_statement label: (statement_identifier) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (return_statement (number_literal))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (number_literal)))))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (binary_expression left: (pointer_expression argument: (identifier)) right: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier)))))) (return_statement (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: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (pointer_expression argument: (identifier))) right: (number_literal)))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier))))) (expression_statement (assignment_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (return_statement (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (pointer_expression argument: (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (goto_statement label: (statement_identifier))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (if_statement condition: (parenthesized_expression (binary_expression left: (pointer_expression argument: (identifier)) right: (char_literal (character)))) consequence: (compound_statement (return_statement (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: (number_literal))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (number_literal))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (number_literal)))) condition: (parenthesized_expression (true))))))

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

{
  int iVar1;
  int *piVar2;
  int iVar3;
  char *pcVar4;
  char *pcVar5;
  
  iVar1 = *(int *)(param_1 + 0x50);
  iVar3 = 0x6e;
  pcVar4 = (char *)*param_2;
LAB_003179e4:
  param_3[2] = 0;
  param_3[1] = 0;
  *param_3 = 0;
  pcVar5 = pcVar4;
  do {
    if (0 < iVar1) {
      iVar3 = *(int *)(param_1 + 0x4c);
      *(int *)(param_1 + 0x50) = iVar1 + -1;
      if (iVar3 == 0) {
        return 0;
      }
      FUN_003127e8(param_3,iVar3,*(undefined4 *)(iVar3 + 4));
      return 1;
    }
    if (*(char *)*param_2 != iVar3) {
      piVar2 = *(int **)(param_1 + 0x4c);
      if (piVar2 == (int *)0x0) {
        piVar2 = (int *)xmalloc(0xc);
        *(int **)(param_1 + 0x4c) = piVar2;
      }
      else if (*piVar2 != 0) {
        (*(code *)PTR_free_004c5c18)();
        piVar2[1] = 0;
        piVar2[2] = 0;
        *piVar2 = 0;
        iVar1 = FUN_0031439c(param_1,param_2,*(undefined4 *)(param_1 + 0x4c));
        goto joined_r0x00317b3c;
      }
      iVar1 = FUN_0031439c(param_1,param_2,piVar2);
joined_r0x00317b3c:
      if (iVar1 == 0) {
        return 0;
      }
      FUN_003127e8(param_3,*(int *)(param_1 + 0x4c),*(undefined4 *)(*(int *)(param_1 + 0x4c) + 4));
      FUN_00312c3c(param_1,pcVar5,*param_2 - (int)pcVar5);
      return 1;
    }
    *param_2 = (int)((char *)*param_2 + 1);
    iVar1 = FUN_00311f28(param_2);
    *(int *)(param_1 + 0x50) = iVar1;
    if (iVar1 < 1) {
      return 0;
    }
    pcVar4 = (char *)*param_2;
    if (iVar1 < 10) goto LAB_003179e4;
    pcVar5 = pcVar4 + 1;
    if (*pcVar4 != '_') {
      return 0;
    }
    *param_2 = (int)pcVar5;
    param_3[2] = 0;
    param_3[1] = 0;
    *param_3 = 0;
  } while( true );
}

