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

reg_errcode_t re_string_realloc_buffers(re_string_t *pstr,Idx new_buf_len)

{
  wint_t *pwVar1;
  Idx *pIVar2;
  uchar *puVar3;
  
  if (1 < pstr->mb_cur_max) {
    if (0x3fffffff < (uint)new_buf_len) {
      return _REG_ESPACE;
    }
    pwVar1 = (wint_t *)realloc(pstr->wcs,new_buf_len * 4);
    if (pwVar1 == (wint_t *)0x0) {
      return _REG_ESPACE;
    }
    pstr->wcs = pwVar1;
    if (pstr->offsets != (Idx *)0x0) {
      pIVar2 = (Idx *)realloc(pstr->offsets,new_buf_len * 4);
      if (pIVar2 == (Idx *)0x0) {
        return _REG_ESPACE;
      }
      pstr->offsets = pIVar2;
    }
  }
  if (pstr->mbs_allocated != '\0') {
    puVar3 = (uchar *)realloc(pstr->mbs,new_buf_len);
    if (puVar3 == (uchar *)0x0) {
      return _REG_ESPACE;
    }
    pstr->mbs = puVar3;
  }
  pstr->bufs_len = new_buf_len;
  return _REG_NOERROR;
}



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

undefined4 FUN_0001d850(int param_1,uint param_2)

{
  void *pvVar1;
  
  if (1 < *(int *)(param_1 + 0x50)) {
    if (0x3fffffff < param_2) {
      return 0xc;
    }
    pvVar1 = realloc(*(void **)(param_1 + 8),param_2 * 4);
    if (pvVar1 == (void *)0x0) {
      return 0xc;
    }
    *(void **)(param_1 + 8) = pvVar1;
    if (*(void **)(param_1 + 0xc) != (void *)0x0) {
      pvVar1 = realloc(*(void **)(param_1 + 0xc),param_2 * 4);
      if (pvVar1 == (void *)0x0) {
        return 0xc;
      }
      *(void **)(param_1 + 0xc) = pvVar1;
    }
  }
  if (*(char *)(param_1 + 0x4b) != '\0') {
    pvVar1 = realloc(*(void **)(param_1 + 4),param_2);
    if (pvVar1 == (void *)0x0) {
      return 0xc;
    }
    *(void **)(param_1 + 4) = pvVar1;
  }
  *(uint *)(param_1 + 0x24) = param_2;
  return 0;
}


PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x000150c0
ADD EBX,0x207a7
SUB ESP,0xc
MOV ESI,dword ptr [ESP + 0x20]
MOV EDI,dword ptr [ESP + 0x24]
CMP dword ptr [ESI + 0x50],0x1
JLE 0x0001d8b0
CMP EDI,0x3fffffff
JA 0x0001d8e0
SUB ESP,0x8
LEA EBP,[EDI*0x4 + 0x0]
PUSH EBP
PUSH dword ptr [ESI + 0x8]
CALL 0x00012290
ADD ESP,0x10
TEST EAX,EAX
JZ 0x0001d8e0
MOV dword ptr [ESI + 0x8],EAX
MOV EAX,dword ptr [ESI + 0xc]
TEST EAX,EAX
JZ 0x0001d8b0
SUB ESP,0x8
PUSH EBP
PUSH EAX
CALL 0x00012290
ADD ESP,0x10
TEST EAX,EAX
JZ 0x0001d8e0
MOV dword ptr [ESI + 0xc],EAX
CMP byte ptr [ESI + 0x4b],0x0
JNZ 0x0001d8c8
MOV dword ptr [ESI + 0x24],EDI
ADD ESP,0xc
XOR EAX,EAX
POP EBX
POP ESI
POP EDI
POP EBP
RET
SUB ESP,0x8
PUSH EDI
PUSH dword ptr [ESI + 0x4]
CALL 0x00012290
ADD ESP,0x10
TEST EAX,EAX
JZ 0x0001d8e0
MOV dword ptr [ESI + 0x4],EAX
JMP 0x0001d8b6
ADD ESP,0xc
MOV EAX,0xc
POP EBX
POP ESI
POP EDI
POP EBP
RET
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nundefined4 FUN_0001d850(int param_1,uint param_2)\n\n{\n  void *pvVar1;\n  \n  if (1 < *(int *)(param_1 + 0x50)) {\n    if (0x3fffffff < param_2) {\n      return 0xc;\n    }\n    pvVar1 = realloc(*(void **)(param_1 + 8),param_2 * 4);\n    if (pvVar1 == (void *)0x0) {\n      return 0xc;\n    }\n    *(void **)(param_1 + 8) = pvVar1;\n    if (*(void **)(param_1 + 0xc) != (void *)0x0) {\n      pvVar1 = realloc(*(void **)(param_1 + 0xc),param_2 * 4);\n      if (pvVar1 == (void *)0x0) {\n        return 0xc;\n      }\n      *(void **)(param_1 + 0xc) = pvVar1;\n    }\n  }\n  if (*(char *)(param_1 + 0x4b) != '\0') {\n    pvVar1 = realloc(*(void **)(param_1 + 4),param_2);\n    if (pvVar1 == (void *)0x0) {\n      return 0xc;\n    }\n    *(void **)(param_1 + 4) = pvVar1;\n  }\n  *(uint *)(param_1 + 0x24) = param_2;\n  return 0;\n}\n\n" comment (function_definition "undefined4 FUN_0001d850(int param_1,uint param_2)\n\n{\n  void *pvVar1;\n  \n  if (1 < *(int *)(param_1 + 0x50)) {\n    if (0x3fffffff < param_2) {\n      return 0xc;\n    }\n    pvVar1 = realloc(*(void **)(param_1 + 8),param_2 * 4);\n    if (pvVar1 == (void *)0x0) {\n      return 0xc;\n    }\n    *(void **)(param_1 + 8) = pvVar1;\n    if (*(void **)(param_1 + 0xc) != (void *)0x0) {\n      pvVar1 = realloc(*(void **)(param_1 + 0xc),param_2 * 4);\n      if (pvVar1 == (void *)0x0) {\n        return 0xc;\n      }\n      *(void **)(param_1 + 0xc) = pvVar1;\n    }\n  }\n  if (*(char *)(param_1 + 0x4b) != '\0') {\n    pvVar1 = realloc(*(void **)(param_1 + 4),param_2);\n    if (pvVar1 == (void *)0x0) {\n      return 0xc;\n    }\n    *(void **)(param_1 + 4) = pvVar1;\n  }\n  *(uint *)(param_1 + 0x24) = param_2;\n  return 0;\n}" type_identifier (function_declarator "FUN_0001d850(int param_1,uint param_2)" identifier (parameter_list "(int param_1,uint param_2)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "uint param_2" type_identifier identifier) ))) (compound_statement "{\n  void *pvVar1;\n  \n  if (1 < *(int *)(param_1 + 0x50)) {\n    if (0x3fffffff < param_2) {\n      return 0xc;\n    }\n    pvVar1 = realloc(*(void **)(param_1 + 8),param_2 * 4);\n    if (pvVar1 == (void *)0x0) {\n      return 0xc;\n    }\n    *(void **)(param_1 + 8) = pvVar1;\n    if (*(void **)(param_1 + 0xc) != (void *)0x0) {\n      pvVar1 = realloc(*(void **)(param_1 + 0xc),param_2 * 4);\n      if (pvVar1 == (void *)0x0) {\n        return 0xc;\n      }\n      *(void **)(param_1 + 0xc) = pvVar1;\n    }\n  }\n  if (*(char *)(param_1 + 0x4b) != '\0') {\n    pvVar1 = realloc(*(void **)(param_1 + 4),param_2);\n    if (pvVar1 == (void *)0x0) {\n      return 0xc;\n    }\n    *(void **)(param_1 + 4) = pvVar1;\n  }\n  *(uint *)(param_1 + 0x24) = param_2;\n  return 0;\n}" { (declaration "void *pvVar1;" primitive_type (pointer_declarator "*pvVar1" * identifier) ;) (if_statement "if (1 < *(int *)(param_1 + 0x50)) {\n    if (0x3fffffff < param_2) {\n      return 0xc;\n    }\n    pvVar1 = realloc(*(void **)(param_1 + 8),param_2 * 4);\n    if (pvVar1 == (void *)0x0) {\n      return 0xc;\n    }\n    *(void **)(param_1 + 8) = pvVar1;\n    if (*(void **)(param_1 + 0xc) != (void *)0x0) {\n      pvVar1 = realloc(*(void **)(param_1 + 0xc),param_2 * 4);\n      if (pvVar1 == (void *)0x0) {\n        return 0xc;\n      }\n      *(void **)(param_1 + 0xc) = pvVar1;\n    }\n  }" if (parenthesized_expression "(1 < *(int *)(param_1 + 0x50))" ( (binary_expression "1 < *(int *)(param_1 + 0x50)" number_literal < (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) ))))) )) (compound_statement "{\n    if (0x3fffffff < param_2) {\n      return 0xc;\n    }\n    pvVar1 = realloc(*(void **)(param_1 + 8),param_2 * 4);\n    if (pvVar1 == (void *)0x0) {\n      return 0xc;\n    }\n    *(void **)(param_1 + 8) = pvVar1;\n    if (*(void **)(param_1 + 0xc) != (void *)0x0) {\n      pvVar1 = realloc(*(void **)(param_1 + 0xc),param_2 * 4);\n      if (pvVar1 == (void *)0x0) {\n        return 0xc;\n      }\n      *(void **)(param_1 + 0xc) = pvVar1;\n    }\n  }" { (if_statement "if (0x3fffffff < param_2) {\n      return 0xc;\n    }" if (parenthesized_expression "(0x3fffffff < param_2)" ( (binary_expression "0x3fffffff < param_2" number_literal < identifier) )) (compound_statement "{\n      return 0xc;\n    }" { (return_statement "return 0xc;" return number_literal ;) })) (expression_statement "pvVar1 = realloc(*(void **)(param_1 + 8),param_2 * 4);" (assignment_expression "pvVar1 = realloc(*(void **)(param_1 + 8),param_2 * 4)" identifier = (call_expression "realloc(*(void **)(param_1 + 8),param_2 * 4)" identifier (argument_list "(*(void **)(param_1 + 8),param_2 * 4)" ( (pointer_expression "*(void **)(param_1 + 8)" * (cast_expression "(void **)(param_1 + 8)" ( (type_descriptor "void **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) )))) , (binary_expression "param_2 * 4" identifier * number_literal) )))) ;) (if_statement "if (pvVar1 == (void *)0x0) {\n      return 0xc;\n    }" if (parenthesized_expression "(pvVar1 == (void *)0x0)" ( (binary_expression "pvVar1 == (void *)0x0" identifier == (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      return 0xc;\n    }" { (return_statement "return 0xc;" return number_literal ;) })) (expression_statement "*(void **)(param_1 + 8) = pvVar1;" (assignment_expression "*(void **)(param_1 + 8) = pvVar1" (pointer_expression "*(void **)(param_1 + 8)" * (cast_expression "(void **)(param_1 + 8)" ( (type_descriptor "void **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) )))) = identifier) ;) (if_statement "if (*(void **)(param_1 + 0xc) != (void *)0x0) {\n      pvVar1 = realloc(*(void **)(param_1 + 0xc),param_2 * 4);\n      if (pvVar1 == (void *)0x0) {\n        return 0xc;\n      }\n      *(void **)(param_1 + 0xc) = pvVar1;\n    }" if (parenthesized_expression "(*(void **)(param_1 + 0xc) != (void *)0x0)" ( (binary_expression "*(void **)(param_1 + 0xc) != (void *)0x0" (pointer_expression "*(void **)(param_1 + 0xc)" * (cast_expression "(void **)(param_1 + 0xc)" ( (type_descriptor "void **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0xc)" ( (binary_expression "param_1 + 0xc" identifier + number_literal) )))) != (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      pvVar1 = realloc(*(void **)(param_1 + 0xc),param_2 * 4);\n      if (pvVar1 == (void *)0x0) {\n        return 0xc;\n      }\n      *(void **)(param_1 + 0xc) = pvVar1;\n    }" { (expression_statement "pvVar1 = realloc(*(void **)(param_1 + 0xc),param_2 * 4);" (assignment_expression "pvVar1 = realloc(*(void **)(param_1 + 0xc),param_2 * 4)" identifier = (call_expression "realloc(*(void **)(param_1 + 0xc),param_2 * 4)" identifier (argument_list "(*(void **)(param_1 + 0xc),param_2 * 4)" ( (pointer_expression "*(void **)(param_1 + 0xc)" * (cast_expression "(void **)(param_1 + 0xc)" ( (type_descriptor "void **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0xc)" ( (binary_expression "param_1 + 0xc" identifier + number_literal) )))) , (binary_expression "param_2 * 4" identifier * number_literal) )))) ;) (if_statement "if (pvVar1 == (void *)0x0) {\n        return 0xc;\n      }" if (parenthesized_expression "(pvVar1 == (void *)0x0)" ( (binary_expression "pvVar1 == (void *)0x0" identifier == (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n        return 0xc;\n      }" { (return_statement "return 0xc;" return number_literal ;) })) (expression_statement "*(void **)(param_1 + 0xc) = pvVar1;" (assignment_expression "*(void **)(param_1 + 0xc) = pvVar1" (pointer_expression "*(void **)(param_1 + 0xc)" * (cast_expression "(void **)(param_1 + 0xc)" ( (type_descriptor "void **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0xc)" ( (binary_expression "param_1 + 0xc" identifier + number_literal) )))) = identifier) ;) })) })) (if_statement "if (*(char *)(param_1 + 0x4b) != '\0') {\n    pvVar1 = realloc(*(void **)(param_1 + 4),param_2);\n    if (pvVar1 == (void *)0x0) {\n      return 0xc;\n    }\n    *(void **)(param_1 + 4) = pvVar1;\n  }" if (parenthesized_expression "(*(char *)(param_1 + 0x4b) != '\0')" ( (binary_expression "*(char *)(param_1 + 0x4b) != '\0'" (pointer_expression "*(char *)(param_1 + 0x4b)" * (cast_expression "(char *)(param_1 + 0x4b)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x4b)" ( (binary_expression "param_1 + 0x4b" identifier + number_literal) )))) != (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\n    pvVar1 = realloc(*(void **)(param_1 + 4),param_2);\n    if (pvVar1 == (void *)0x0) {\n      return 0xc;\n    }\n    *(void **)(param_1 + 4) = pvVar1;\n  }" { (expression_statement "pvVar1 = realloc(*(void **)(param_1 + 4),param_2);" (assignment_expression "pvVar1 = realloc(*(void **)(param_1 + 4),param_2)" identifier = (call_expression "realloc(*(void **)(param_1 + 4),param_2)" identifier (argument_list "(*(void **)(param_1 + 4),param_2)" ( (pointer_expression "*(void **)(param_1 + 4)" * (cast_expression "(void **)(param_1 + 4)" ( (type_descriptor "void **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 4)" ( (binary_expression "param_1 + 4" identifier + number_literal) )))) , identifier )))) ;) (if_statement "if (pvVar1 == (void *)0x0) {\n      return 0xc;\n    }" if (parenthesized_expression "(pvVar1 == (void *)0x0)" ( (binary_expression "pvVar1 == (void *)0x0" identifier == (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      return 0xc;\n    }" { (return_statement "return 0xc;" return number_literal ;) })) (expression_statement "*(void **)(param_1 + 4) = pvVar1;" (assignment_expression "*(void **)(param_1 + 4) = pvVar1" (pointer_expression "*(void **)(param_1 + 4)" * (cast_expression "(void **)(param_1 + 4)" ( (type_descriptor "void **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 4)" ( (binary_expression "param_1 + 4" identifier + number_literal) )))) = identifier) ;) })) (expression_statement "*(uint *)(param_1 + 0x24) = param_2;" (assignment_expression "*(uint *)(param_1 + 0x24) = param_2" (pointer_expression "*(uint *)(param_1 + 0x24)" * (cast_expression "(uint *)(param_1 + 0x24)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x24)" ( (binary_expression "param_1 + 0x24" identifier + number_literal) )))) = identifier) ;) (return_statement "return 0;" return number_literal ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention */\n\nreg_errcode_t re_string_realloc_buffers(re_string_t *pstr,Idx new_buf_len)\n\n{\n  wint_t *pwVar1;\n  Idx *pIVar2;\n  uchar *puVar3;\n  \n  if (1 < pstr->mb_cur_max) {\n    if (0x3fffffff < (uint)new_buf_len) {\n      return _REG_ESPACE;\n    }\n    pwVar1 = (wint_t *)realloc(pstr->wcs,new_buf_len * 4);\n    if (pwVar1 == (wint_t *)0x0) {\n      return _REG_ESPACE;\n    }\n    pstr->wcs = pwVar1;\n    if (pstr->offsets != (Idx *)0x0) {\n      pIVar2 = (Idx *)realloc(pstr->offsets,new_buf_len * 4);\n      if (pIVar2 == (Idx *)0x0) {\n        return _REG_ESPACE;\n      }\n      pstr->offsets = pIVar2;\n    }\n  }\n  if (pstr->mbs_allocated != '\0') {\n    puVar3 = (uchar *)realloc(pstr->mbs,new_buf_len);\n    if (puVar3 == (uchar *)0x0) {\n      return _REG_ESPACE;\n    }\n    pstr->mbs = puVar3;\n  }\n  pstr->bufs_len = new_buf_len;\n  return _REG_NOERROR;\n}\n\n" comment comment (function_definition "reg_errcode_t re_string_realloc_buffers(re_string_t *pstr,Idx new_buf_len)\n\n{\n  wint_t *pwVar1;\n  Idx *pIVar2;\n  uchar *puVar3;\n  \n  if (1 < pstr->mb_cur_max) {\n    if (0x3fffffff < (uint)new_buf_len) {\n      return _REG_ESPACE;\n    }\n    pwVar1 = (wint_t *)realloc(pstr->wcs,new_buf_len * 4);\n    if (pwVar1 == (wint_t *)0x0) {\n      return _REG_ESPACE;\n    }\n    pstr->wcs = pwVar1;\n    if (pstr->offsets != (Idx *)0x0) {\n      pIVar2 = (Idx *)realloc(pstr->offsets,new_buf_len * 4);\n      if (pIVar2 == (Idx *)0x0) {\n        return _REG_ESPACE;\n      }\n      pstr->offsets = pIVar2;\n    }\n  }\n  if (pstr->mbs_allocated != '\0') {\n    puVar3 = (uchar *)realloc(pstr->mbs,new_buf_len);\n    if (puVar3 == (uchar *)0x0) {\n      return _REG_ESPACE;\n    }\n    pstr->mbs = puVar3;\n  }\n  pstr->bufs_len = new_buf_len;\n  return _REG_NOERROR;\n}" type_identifier (function_declarator "re_string_realloc_buffers(re_string_t *pstr,Idx new_buf_len)" identifier (parameter_list "(re_string_t *pstr,Idx new_buf_len)" ( (parameter_declaration "re_string_t *pstr" type_identifier (pointer_declarator "*pstr" * identifier)) , (parameter_declaration "Idx new_buf_len" type_identifier identifier) ))) (compound_statement "{\n  wint_t *pwVar1;\n  Idx *pIVar2;\n  uchar *puVar3;\n  \n  if (1 < pstr->mb_cur_max) {\n    if (0x3fffffff < (uint)new_buf_len) {\n      return _REG_ESPACE;\n    }\n    pwVar1 = (wint_t *)realloc(pstr->wcs,new_buf_len * 4);\n    if (pwVar1 == (wint_t *)0x0) {\n      return _REG_ESPACE;\n    }\n    pstr->wcs = pwVar1;\n    if (pstr->offsets != (Idx *)0x0) {\n      pIVar2 = (Idx *)realloc(pstr->offsets,new_buf_len * 4);\n      if (pIVar2 == (Idx *)0x0) {\n        return _REG_ESPACE;\n      }\n      pstr->offsets = pIVar2;\n    }\n  }\n  if (pstr->mbs_allocated != '\0') {\n    puVar3 = (uchar *)realloc(pstr->mbs,new_buf_len);\n    if (puVar3 == (uchar *)0x0) {\n      return _REG_ESPACE;\n    }\n    pstr->mbs = puVar3;\n  }\n  pstr->bufs_len = new_buf_len;\n  return _REG_NOERROR;\n}" { (declaration "wint_t *pwVar1;" type_identifier (pointer_declarator "*pwVar1" * identifier) ;) (declaration "Idx *pIVar2;" type_identifier (pointer_declarator "*pIVar2" * identifier) ;) (declaration "uchar *puVar3;" type_identifier (pointer_declarator "*puVar3" * identifier) ;) (if_statement "if (1 < pstr->mb_cur_max) {\n    if (0x3fffffff < (uint)new_buf_len) {\n      return _REG_ESPACE;\n    }\n    pwVar1 = (wint_t *)realloc(pstr->wcs,new_buf_len * 4);\n    if (pwVar1 == (wint_t *)0x0) {\n      return _REG_ESPACE;\n    }\n    pstr->wcs = pwVar1;\n    if (pstr->offsets != (Idx *)0x0) {\n      pIVar2 = (Idx *)realloc(pstr->offsets,new_buf_len * 4);\n      if (pIVar2 == (Idx *)0x0) {\n        return _REG_ESPACE;\n      }\n      pstr->offsets = pIVar2;\n    }\n  }" if (parenthesized_expression "(1 < pstr->mb_cur_max)" ( (binary_expression "1 < pstr->mb_cur_max" number_literal < (field_expression "pstr->mb_cur_max" identifier -> field_identifier)) )) (compound_statement "{\n    if (0x3fffffff < (uint)new_buf_len) {\n      return _REG_ESPACE;\n    }\n    pwVar1 = (wint_t *)realloc(pstr->wcs,new_buf_len * 4);\n    if (pwVar1 == (wint_t *)0x0) {\n      return _REG_ESPACE;\n    }\n    pstr->wcs = pwVar1;\n    if (pstr->offsets != (Idx *)0x0) {\n      pIVar2 = (Idx *)realloc(pstr->offsets,new_buf_len * 4);\n      if (pIVar2 == (Idx *)0x0) {\n        return _REG_ESPACE;\n      }\n      pstr->offsets = pIVar2;\n    }\n  }" { (if_statement "if (0x3fffffff < (uint)new_buf_len) {\n      return _REG_ESPACE;\n    }" if (parenthesized_expression "(0x3fffffff < (uint)new_buf_len)" ( (binary_expression "0x3fffffff < (uint)new_buf_len" number_literal < (cast_expression "(uint)new_buf_len" ( (type_descriptor "uint" type_identifier) ) identifier)) )) (compound_statement "{\n      return _REG_ESPACE;\n    }" { (return_statement "return _REG_ESPACE;" return identifier ;) })) (expression_statement "pwVar1 = (wint_t *)realloc(pstr->wcs,new_buf_len * 4);" (assignment_expression "pwVar1 = (wint_t *)realloc(pstr->wcs,new_buf_len * 4)" identifier = (cast_expression "(wint_t *)realloc(pstr->wcs,new_buf_len * 4)" ( (type_descriptor "wint_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "realloc(pstr->wcs,new_buf_len * 4)" identifier (argument_list "(pstr->wcs,new_buf_len * 4)" ( (field_expression "pstr->wcs" identifier -> field_identifier) , (binary_expression "new_buf_len * 4" identifier * number_literal) ))))) ;) (if_statement "if (pwVar1 == (wint_t *)0x0) {\n      return _REG_ESPACE;\n    }" if (parenthesized_expression "(pwVar1 == (wint_t *)0x0)" ( (binary_expression "pwVar1 == (wint_t *)0x0" identifier == (cast_expression "(wint_t *)0x0" ( (type_descriptor "wint_t *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      return _REG_ESPACE;\n    }" { (return_statement "return _REG_ESPACE;" return identifier ;) })) (expression_statement "pstr->wcs = pwVar1;" (assignment_expression "pstr->wcs = pwVar1" (field_expression "pstr->wcs" identifier -> field_identifier) = identifier) ;) (if_statement "if (pstr->offsets != (Idx *)0x0) {\n      pIVar2 = (Idx *)realloc(pstr->offsets,new_buf_len * 4);\n      if (pIVar2 == (Idx *)0x0) {\n        return _REG_ESPACE;\n      }\n      pstr->offsets = pIVar2;\n    }" if (parenthesized_expression "(pstr->offsets != (Idx *)0x0)" ( (binary_expression "pstr->offsets != (Idx *)0x0" (field_expression "pstr->offsets" identifier -> field_identifier) != (cast_expression "(Idx *)0x0" ( (type_descriptor "Idx *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      pIVar2 = (Idx *)realloc(pstr->offsets,new_buf_len * 4);\n      if (pIVar2 == (Idx *)0x0) {\n        return _REG_ESPACE;\n      }\n      pstr->offsets = pIVar2;\n    }" { (expression_statement "pIVar2 = (Idx *)realloc(pstr->offsets,new_buf_len * 4);" (assignment_expression "pIVar2 = (Idx *)realloc(pstr->offsets,new_buf_len * 4)" identifier = (cast_expression "(Idx *)realloc(pstr->offsets,new_buf_len * 4)" ( (type_descriptor "Idx *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "realloc(pstr->offsets,new_buf_len * 4)" identifier (argument_list "(pstr->offsets,new_buf_len * 4)" ( (field_expression "pstr->offsets" identifier -> field_identifier) , (binary_expression "new_buf_len * 4" identifier * number_literal) ))))) ;) (if_statement "if (pIVar2 == (Idx *)0x0) {\n        return _REG_ESPACE;\n      }" if (parenthesized_expression "(pIVar2 == (Idx *)0x0)" ( (binary_expression "pIVar2 == (Idx *)0x0" identifier == (cast_expression "(Idx *)0x0" ( (type_descriptor "Idx *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n        return _REG_ESPACE;\n      }" { (return_statement "return _REG_ESPACE;" return identifier ;) })) (expression_statement "pstr->offsets = pIVar2;" (assignment_expression "pstr->offsets = pIVar2" (field_expression "pstr->offsets" identifier -> field_identifier) = identifier) ;) })) })) (if_statement "if (pstr->mbs_allocated != '\0') {\n    puVar3 = (uchar *)realloc(pstr->mbs,new_buf_len);\n    if (puVar3 == (uchar *)0x0) {\n      return _REG_ESPACE;\n    }\n    pstr->mbs = puVar3;\n  }" if (parenthesized_expression "(pstr->mbs_allocated != '\0')" ( (binary_expression "pstr->mbs_allocated != '\0'" (field_expression "pstr->mbs_allocated" identifier -> field_identifier) != (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\n    puVar3 = (uchar *)realloc(pstr->mbs,new_buf_len);\n    if (puVar3 == (uchar *)0x0) {\n      return _REG_ESPACE;\n    }\n    pstr->mbs = puVar3;\n  }" { (expression_statement "puVar3 = (uchar *)realloc(pstr->mbs,new_buf_len);" (assignment_expression "puVar3 = (uchar *)realloc(pstr->mbs,new_buf_len)" identifier = (cast_expression "(uchar *)realloc(pstr->mbs,new_buf_len)" ( (type_descriptor "uchar *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "realloc(pstr->mbs,new_buf_len)" identifier (argument_list "(pstr->mbs,new_buf_len)" ( (field_expression "pstr->mbs" identifier -> field_identifier) , identifier ))))) ;) (if_statement "if (puVar3 == (uchar *)0x0) {\n      return _REG_ESPACE;\n    }" if (parenthesized_expression "(puVar3 == (uchar *)0x0)" ( (binary_expression "puVar3 == (uchar *)0x0" identifier == (cast_expression "(uchar *)0x0" ( (type_descriptor "uchar *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      return _REG_ESPACE;\n    }" { (return_statement "return _REG_ESPACE;" return identifier ;) })) (expression_statement "pstr->mbs = puVar3;" (assignment_expression "pstr->mbs = puVar3" (field_expression "pstr->mbs" identifier -> field_identifier) = identifier) ;) })) (expression_statement "pstr->bufs_len = new_buf_len;" (assignment_expression "pstr->bufs_len = new_buf_len" (field_expression "pstr->bufs_len" identifier -> field_identifier) = identifier) ;) (return_statement "return _REG_NOERROR;" return identifier ;) })))
(translation_unit "undefined4 FUN_0001d850(int param_1,uint param_2)\n\n{\n  void *pvVar1;\n  \n  if (1 < *(int *)(param_1 + 0x50)) {\n    if (0x3fffffff < param_2) {\n      return 0xc;\n    }\n    pvVar1 = realloc(*(void **)(param_1 + 8),param_2 * 4);\n    if (pvVar1 == (void *)0x0) {\n      return 0xc;\n    }\n    *(void **)(param_1 + 8) = pvVar1;\n    if (*(void **)(param_1 + 0xc) != (void *)0x0) {\n      pvVar1 = realloc(*(void **)(param_1 + 0xc),param_2 * 4);\n      if (pvVar1 == (void *)0x0) {\n        return 0xc;\n      }\n      *(void **)(param_1 + 0xc) = pvVar1;\n    }\n  }\n  if (*(char *)(param_1 + 0x4b) != '\0') {\n    pvVar1 = realloc(*(void **)(param_1 + 4),param_2);\n    if (pvVar1 == (void *)0x0) {\n      return 0xc;\n    }\n    *(void **)(param_1 + 4) = pvVar1;\n  }\n  *(uint *)(param_1 + 0x24) = param_2;\n  return 0;\n}\n\n" (function_definition "undefined4 FUN_0001d850(int param_1,uint param_2)\n\n{\n  void *pvVar1;\n  \n  if (1 < *(int *)(param_1 + 0x50)) {\n    if (0x3fffffff < param_2) {\n      return 0xc;\n    }\n    pvVar1 = realloc(*(void **)(param_1 + 8),param_2 * 4);\n    if (pvVar1 == (void *)0x0) {\n      return 0xc;\n    }\n    *(void **)(param_1 + 8) = pvVar1;\n    if (*(void **)(param_1 + 0xc) != (void *)0x0) {\n      pvVar1 = realloc(*(void **)(param_1 + 0xc),param_2 * 4);\n      if (pvVar1 == (void *)0x0) {\n        return 0xc;\n      }\n      *(void **)(param_1 + 0xc) = pvVar1;\n    }\n  }\n  if (*(char *)(param_1 + 0x4b) != '\0') {\n    pvVar1 = realloc(*(void **)(param_1 + 4),param_2);\n    if (pvVar1 == (void *)0x0) {\n      return 0xc;\n    }\n    *(void **)(param_1 + 4) = pvVar1;\n  }\n  *(uint *)(param_1 + 0x24) = param_2;\n  return 0;\n}" type_identifier (function_declarator "FUN_0001d850(int param_1,uint param_2)" identifier (parameter_list "(int param_1,uint param_2)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "uint param_2" type_identifier identifier) ))) (compound_statement "{\n  void *pvVar1;\n  \n  if (1 < *(int *)(param_1 + 0x50)) {\n    if (0x3fffffff < param_2) {\n      return 0xc;\n    }\n    pvVar1 = realloc(*(void **)(param_1 + 8),param_2 * 4);\n    if (pvVar1 == (void *)0x0) {\n      return 0xc;\n    }\n    *(void **)(param_1 + 8) = pvVar1;\n    if (*(void **)(param_1 + 0xc) != (void *)0x0) {\n      pvVar1 = realloc(*(void **)(param_1 + 0xc),param_2 * 4);\n      if (pvVar1 == (void *)0x0) {\n        return 0xc;\n      }\n      *(void **)(param_1 + 0xc) = pvVar1;\n    }\n  }\n  if (*(char *)(param_1 + 0x4b) != '\0') {\n    pvVar1 = realloc(*(void **)(param_1 + 4),param_2);\n    if (pvVar1 == (void *)0x0) {\n      return 0xc;\n    }\n    *(void **)(param_1 + 4) = pvVar1;\n  }\n  *(uint *)(param_1 + 0x24) = param_2;\n  return 0;\n}" { (declaration "void *pvVar1;" primitive_type (pointer_declarator "*pvVar1" * identifier) ;) (if_statement "if (1 < *(int *)(param_1 + 0x50)) {\n    if (0x3fffffff < param_2) {\n      return 0xc;\n    }\n    pvVar1 = realloc(*(void **)(param_1 + 8),param_2 * 4);\n    if (pvVar1 == (void *)0x0) {\n      return 0xc;\n    }\n    *(void **)(param_1 + 8) = pvVar1;\n    if (*(void **)(param_1 + 0xc) != (void *)0x0) {\n      pvVar1 = realloc(*(void **)(param_1 + 0xc),param_2 * 4);\n      if (pvVar1 == (void *)0x0) {\n        return 0xc;\n      }\n      *(void **)(param_1 + 0xc) = pvVar1;\n    }\n  }" if (parenthesized_expression "(1 < *(int *)(param_1 + 0x50))" ( (binary_expression "1 < *(int *)(param_1 + 0x50)" number_literal < (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) ))))) )) (compound_statement "{\n    if (0x3fffffff < param_2) {\n      return 0xc;\n    }\n    pvVar1 = realloc(*(void **)(param_1 + 8),param_2 * 4);\n    if (pvVar1 == (void *)0x0) {\n      return 0xc;\n    }\n    *(void **)(param_1 + 8) = pvVar1;\n    if (*(void **)(param_1 + 0xc) != (void *)0x0) {\n      pvVar1 = realloc(*(void **)(param_1 + 0xc),param_2 * 4);\n      if (pvVar1 == (void *)0x0) {\n        return 0xc;\n      }\n      *(void **)(param_1 + 0xc) = pvVar1;\n    }\n  }" { (if_statement "if (0x3fffffff < param_2) {\n      return 0xc;\n    }" if (parenthesized_expression "(0x3fffffff < param_2)" ( (binary_expression "0x3fffffff < param_2" number_literal < identifier) )) (compound_statement "{\n      return 0xc;\n    }" { (return_statement "return 0xc;" return number_literal ;) })) (expression_statement "pvVar1 = realloc(*(void **)(param_1 + 8),param_2 * 4);" (assignment_expression "pvVar1 = realloc(*(void **)(param_1 + 8),param_2 * 4)" identifier = (call_expression "realloc(*(void **)(param_1 + 8),param_2 * 4)" identifier (argument_list "(*(void **)(param_1 + 8),param_2 * 4)" ( (pointer_expression "*(void **)(param_1 + 8)" * (cast_expression "(void **)(param_1 + 8)" ( (type_descriptor "void **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) )))) , (binary_expression "param_2 * 4" identifier * number_literal) )))) ;) (if_statement "if (pvVar1 == (void *)0x0) {\n      return 0xc;\n    }" if (parenthesized_expression "(pvVar1 == (void *)0x0)" ( (binary_expression "pvVar1 == (void *)0x0" identifier == (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      return 0xc;\n    }" { (return_statement "return 0xc;" return number_literal ;) })) (expression_statement "*(void **)(param_1 + 8) = pvVar1;" (assignment_expression "*(void **)(param_1 + 8) = pvVar1" (pointer_expression "*(void **)(param_1 + 8)" * (cast_expression "(void **)(param_1 + 8)" ( (type_descriptor "void **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) )))) = identifier) ;) (if_statement "if (*(void **)(param_1 + 0xc) != (void *)0x0) {\n      pvVar1 = realloc(*(void **)(param_1 + 0xc),param_2 * 4);\n      if (pvVar1 == (void *)0x0) {\n        return 0xc;\n      }\n      *(void **)(param_1 + 0xc) = pvVar1;\n    }" if (parenthesized_expression "(*(void **)(param_1 + 0xc) != (void *)0x0)" ( (binary_expression "*(void **)(param_1 + 0xc) != (void *)0x0" (pointer_expression "*(void **)(param_1 + 0xc)" * (cast_expression "(void **)(param_1 + 0xc)" ( (type_descriptor "void **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0xc)" ( (binary_expression "param_1 + 0xc" identifier + number_literal) )))) != (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      pvVar1 = realloc(*(void **)(param_1 + 0xc),param_2 * 4);\n      if (pvVar1 == (void *)0x0) {\n        return 0xc;\n      }\n      *(void **)(param_1 + 0xc) = pvVar1;\n    }" { (expression_statement "pvVar1 = realloc(*(void **)(param_1 + 0xc),param_2 * 4);" (assignment_expression "pvVar1 = realloc(*(void **)(param_1 + 0xc),param_2 * 4)" identifier = (call_expression "realloc(*(void **)(param_1 + 0xc),param_2 * 4)" identifier (argument_list "(*(void **)(param_1 + 0xc),param_2 * 4)" ( (pointer_expression "*(void **)(param_1 + 0xc)" * (cast_expression "(void **)(param_1 + 0xc)" ( (type_descriptor "void **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0xc)" ( (binary_expression "param_1 + 0xc" identifier + number_literal) )))) , (binary_expression "param_2 * 4" identifier * number_literal) )))) ;) (if_statement "if (pvVar1 == (void *)0x0) {\n        return 0xc;\n      }" if (parenthesized_expression "(pvVar1 == (void *)0x0)" ( (binary_expression "pvVar1 == (void *)0x0" identifier == (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n        return 0xc;\n      }" { (return_statement "return 0xc;" return number_literal ;) })) (expression_statement "*(void **)(param_1 + 0xc) = pvVar1;" (assignment_expression "*(void **)(param_1 + 0xc) = pvVar1" (pointer_expression "*(void **)(param_1 + 0xc)" * (cast_expression "(void **)(param_1 + 0xc)" ( (type_descriptor "void **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0xc)" ( (binary_expression "param_1 + 0xc" identifier + number_literal) )))) = identifier) ;) })) })) (if_statement "if (*(char *)(param_1 + 0x4b) != '\0') {\n    pvVar1 = realloc(*(void **)(param_1 + 4),param_2);\n    if (pvVar1 == (void *)0x0) {\n      return 0xc;\n    }\n    *(void **)(param_1 + 4) = pvVar1;\n  }" if (parenthesized_expression "(*(char *)(param_1 + 0x4b) != '\0')" ( (binary_expression "*(char *)(param_1 + 0x4b) != '\0'" (pointer_expression "*(char *)(param_1 + 0x4b)" * (cast_expression "(char *)(param_1 + 0x4b)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x4b)" ( (binary_expression "param_1 + 0x4b" identifier + number_literal) )))) != (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\n    pvVar1 = realloc(*(void **)(param_1 + 4),param_2);\n    if (pvVar1 == (void *)0x0) {\n      return 0xc;\n    }\n    *(void **)(param_1 + 4) = pvVar1;\n  }" { (expression_statement "pvVar1 = realloc(*(void **)(param_1 + 4),param_2);" (assignment_expression "pvVar1 = realloc(*(void **)(param_1 + 4),param_2)" identifier = (call_expression "realloc(*(void **)(param_1 + 4),param_2)" identifier (argument_list "(*(void **)(param_1 + 4),param_2)" ( (pointer_expression "*(void **)(param_1 + 4)" * (cast_expression "(void **)(param_1 + 4)" ( (type_descriptor "void **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 4)" ( (binary_expression "param_1 + 4" identifier + number_literal) )))) , identifier )))) ;) (if_statement "if (pvVar1 == (void *)0x0) {\n      return 0xc;\n    }" if (parenthesized_expression "(pvVar1 == (void *)0x0)" ( (binary_expression "pvVar1 == (void *)0x0" identifier == (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      return 0xc;\n    }" { (return_statement "return 0xc;" return number_literal ;) })) (expression_statement "*(void **)(param_1 + 4) = pvVar1;" (assignment_expression "*(void **)(param_1 + 4) = pvVar1" (pointer_expression "*(void **)(param_1 + 4)" * (cast_expression "(void **)(param_1 + 4)" ( (type_descriptor "void **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 4)" ( (binary_expression "param_1 + 4" identifier + number_literal) )))) = identifier) ;) })) (expression_statement "*(uint *)(param_1 + 0x24) = param_2;" (assignment_expression "*(uint *)(param_1 + 0x24) = param_2" (pointer_expression "*(uint *)(param_1 + 0x24)" * (cast_expression "(uint *)(param_1 + 0x24)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x24)" ( (binary_expression "param_1 + 0x24" identifier + number_literal) )))) = identifier) ;) (return_statement "return 0;" return number_literal ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression LIT < (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (compound_statement { (return_statement return LIT ;) })) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) , (binary_expression IDENT * LIT) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (return_statement return 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) ;) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) , (binary_expression IDENT * LIT) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (return_statement return 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) ;) })) })) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) != (char_literal ' escape_sequence ')) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) , IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (return_statement return 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) ;) })) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = IDENT) ;) (return_statement return LIT ;) })))
(function_definition "undefined4 FUN_0001d850(int param_1,uint param_2)\n\n{\n  void *pvVar1;\n  \n  if (1 < *(int *)(param_1 + 0x50)) {\n    if (0x3fffffff < param_2) {\n      return 0xc;\n    }\n    pvVar1 = realloc(*(void **)(param_1 + 8),param_2 * 4);\n    if (pvVar1 == (void *)0x0) {\n      return 0xc;\n    }\n    *(void **)(param_1 + 8) = pvVar1;\n    if (*(void **)(param_1 + 0xc) != (void *)0x0) {\n      pvVar1 = realloc(*(void **)(param_1 + 0xc),param_2 * 4);\n      if (pvVar1 == (void *)0x0) {\n        return 0xc;\n      }\n      *(void **)(param_1 + 0xc) = pvVar1;\n    }\n  }\n  if (*(char *)(param_1 + 0x4b) != '\0') {\n    pvVar1 = realloc(*(void **)(param_1 + 4),param_2);\n    if (pvVar1 == (void *)0x0) {\n      return 0xc;\n    }\n    *(void **)(param_1 + 4) = pvVar1;\n  }\n  *(uint *)(param_1 + 0x24) = param_2;\n  return 0;\n}" (type_identifier "undefined4") (function_declarator "FUN_0001d850(int param_1,uint param_2)" (identifier "FUN_0001d850") (parameter_list "(int param_1,uint param_2)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) (, ",") (parameter_declaration "uint param_2" (type_identifier "uint") (identifier "param_2")) () ")"))) (compound_statement "{\n  void *pvVar1;\n  \n  if (1 < *(int *)(param_1 + 0x50)) {\n    if (0x3fffffff < param_2) {\n      return 0xc;\n    }\n    pvVar1 = realloc(*(void **)(param_1 + 8),param_2 * 4);\n    if (pvVar1 == (void *)0x0) {\n      return 0xc;\n    }\n    *(void **)(param_1 + 8) = pvVar1;\n    if (*(void **)(param_1 + 0xc) != (void *)0x0) {\n      pvVar1 = realloc(*(void **)(param_1 + 0xc),param_2 * 4);\n      if (pvVar1 == (void *)0x0) {\n        return 0xc;\n      }\n      *(void **)(param_1 + 0xc) = pvVar1;\n    }\n  }\n  if (*(char *)(param_1 + 0x4b) != '\0') {\n    pvVar1 = realloc(*(void **)(param_1 + 4),param_2);\n    if (pvVar1 == (void *)0x0) {\n      return 0xc;\n    }\n    *(void **)(param_1 + 4) = pvVar1;\n  }\n  *(uint *)(param_1 + 0x24) = param_2;\n  return 0;\n}" ({ "{") (declaration "void *pvVar1;" (primitive_type "void") (pointer_declarator "*pvVar1" (* "*") (identifier "pvVar1")) (; ";")) (if_statement "if (1 < *(int *)(param_1 + 0x50)) {\n    if (0x3fffffff < param_2) {\n      return 0xc;\n    }\n    pvVar1 = realloc(*(void **)(param_1 + 8),param_2 * 4);\n    if (pvVar1 == (void *)0x0) {\n      return 0xc;\n    }\n    *(void **)(param_1 + 8) = pvVar1;\n    if (*(void **)(param_1 + 0xc) != (void *)0x0) {\n      pvVar1 = realloc(*(void **)(param_1 + 0xc),param_2 * 4);\n      if (pvVar1 == (void *)0x0) {\n        return 0xc;\n      }\n      *(void **)(param_1 + 0xc) = pvVar1;\n    }\n  }" (if "if") (parenthesized_expression "(1 < *(int *)(param_1 + 0x50))" (( "(") (binary_expression "1 < *(int *)(param_1 + 0x50)" (number_literal "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")) () ")"))))) () ")")) (compound_statement "{\n    if (0x3fffffff < param_2) {\n      return 0xc;\n    }\n    pvVar1 = realloc(*(void **)(param_1 + 8),param_2 * 4);\n    if (pvVar1 == (void *)0x0) {\n      return 0xc;\n    }\n    *(void **)(param_1 + 8) = pvVar1;\n    if (*(void **)(param_1 + 0xc) != (void *)0x0) {\n      pvVar1 = realloc(*(void **)(param_1 + 0xc),param_2 * 4);\n      if (pvVar1 == (void *)0x0) {\n        return 0xc;\n      }\n      *(void **)(param_1 + 0xc) = pvVar1;\n    }\n  }" ({ "{") (if_statement "if (0x3fffffff < param_2) {\n      return 0xc;\n    }" (if "if") (parenthesized_expression "(0x3fffffff < param_2)" (( "(") (binary_expression "0x3fffffff < param_2" (number_literal "0x3fffffff") (< "<") (identifier "param_2")) () ")")) (compound_statement "{\n      return 0xc;\n    }" ({ "{") (return_statement "return 0xc;" (return "return") (number_literal "0xc") (; ";")) (} "}"))) (expression_statement "pvVar1 = realloc(*(void **)(param_1 + 8),param_2 * 4);" (assignment_expression "pvVar1 = realloc(*(void **)(param_1 + 8),param_2 * 4)" (identifier "pvVar1") (= "=") (call_expression "realloc(*(void **)(param_1 + 8),param_2 * 4)" (identifier "realloc") (argument_list "(*(void **)(param_1 + 8),param_2 * 4)" (( "(") (pointer_expression "*(void **)(param_1 + 8)" (* "*") (cast_expression "(void **)(param_1 + 8)" (( "(") (type_descriptor "void **" (primitive_type "void") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(param_1 + 8)" (( "(") (binary_expression "param_1 + 8" (identifier "param_1") (+ "+") (number_literal "8")) () ")")))) (, ",") (binary_expression "param_2 * 4" (identifier "param_2") (* "*") (number_literal "4")) () ")")))) (; ";")) (if_statement "if (pvVar1 == (void *)0x0) {\n      return 0xc;\n    }" (if "if") (parenthesized_expression "(pvVar1 == (void *)0x0)" (( "(") (binary_expression "pvVar1 == (void *)0x0" (identifier "pvVar1") (== "==") (cast_expression "(void *)0x0" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n      return 0xc;\n    }" ({ "{") (return_statement "return 0xc;" (return "return") (number_literal "0xc") (; ";")) (} "}"))) (expression_statement "*(void **)(param_1 + 8) = pvVar1;" (assignment_expression "*(void **)(param_1 + 8) = pvVar1" (pointer_expression "*(void **)(param_1 + 8)" (* "*") (cast_expression "(void **)(param_1 + 8)" (( "(") (type_descriptor "void **" (primitive_type "void") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(param_1 + 8)" (( "(") (binary_expression "param_1 + 8" (identifier "param_1") (+ "+") (number_literal "8")) () ")")))) (= "=") (identifier "pvVar1")) (; ";")) (if_statement "if (*(void **)(param_1 + 0xc) != (void *)0x0) {\n      pvVar1 = realloc(*(void **)(param_1 + 0xc),param_2 * 4);\n      if (pvVar1 == (void *)0x0) {\n        return 0xc;\n      }\n      *(void **)(param_1 + 0xc) = pvVar1;\n    }" (if "if") (parenthesized_expression "(*(void **)(param_1 + 0xc) != (void *)0x0)" (( "(") (binary_expression "*(void **)(param_1 + 0xc) != (void *)0x0" (pointer_expression "*(void **)(param_1 + 0xc)" (* "*") (cast_expression "(void **)(param_1 + 0xc)" (( "(") (type_descriptor "void **" (primitive_type "void") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(param_1 + 0xc)" (( "(") (binary_expression "param_1 + 0xc" (identifier "param_1") (+ "+") (number_literal "0xc")) () ")")))) (!= "!=") (cast_expression "(void *)0x0" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n      pvVar1 = realloc(*(void **)(param_1 + 0xc),param_2 * 4);\n      if (pvVar1 == (void *)0x0) {\n        return 0xc;\n      }\n      *(void **)(param_1 + 0xc) = pvVar1;\n    }" ({ "{") (expression_statement "pvVar1 = realloc(*(void **)(param_1 + 0xc),param_2 * 4);" (assignment_expression "pvVar1 = realloc(*(void **)(param_1 + 0xc),param_2 * 4)" (identifier "pvVar1") (= "=") (call_expression "realloc(*(void **)(param_1 + 0xc),param_2 * 4)" (identifier "realloc") (argument_list "(*(void **)(param_1 + 0xc),param_2 * 4)" (( "(") (pointer_expression "*(void **)(param_1 + 0xc)" (* "*") (cast_expression "(void **)(param_1 + 0xc)" (( "(") (type_descriptor "void **" (primitive_type "void") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(param_1 + 0xc)" (( "(") (binary_expression "param_1 + 0xc" (identifier "param_1") (+ "+") (number_literal "0xc")) () ")")))) (, ",") (binary_expression "param_2 * 4" (identifier "param_2") (* "*") (number_literal "4")) () ")")))) (; ";")) (if_statement "if (pvVar1 == (void *)0x0) {\n        return 0xc;\n      }" (if "if") (parenthesized_expression "(pvVar1 == (void *)0x0)" (( "(") (binary_expression "pvVar1 == (void *)0x0" (identifier "pvVar1") (== "==") (cast_expression "(void *)0x0" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n        return 0xc;\n      }" ({ "{") (return_statement "return 0xc;" (return "return") (number_literal "0xc") (; ";")) (} "}"))) (expression_statement "*(void **)(param_1 + 0xc) = pvVar1;" (assignment_expression "*(void **)(param_1 + 0xc) = pvVar1" (pointer_expression "*(void **)(param_1 + 0xc)" (* "*") (cast_expression "(void **)(param_1 + 0xc)" (( "(") (type_descriptor "void **" (primitive_type "void") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(param_1 + 0xc)" (( "(") (binary_expression "param_1 + 0xc" (identifier "param_1") (+ "+") (number_literal "0xc")) () ")")))) (= "=") (identifier "pvVar1")) (; ";")) (} "}"))) (} "}"))) (if_statement "if (*(char *)(param_1 + 0x4b) != '\0') {\n    pvVar1 = realloc(*(void **)(param_1 + 4),param_2);\n    if (pvVar1 == (void *)0x0) {\n      return 0xc;\n    }\n    *(void **)(param_1 + 4) = pvVar1;\n  }" (if "if") (parenthesized_expression "(*(char *)(param_1 + 0x4b) != '\0')" (( "(") (binary_expression "*(char *)(param_1 + 0x4b) != '\0'" (pointer_expression "*(char *)(param_1 + 0x4b)" (* "*") (cast_expression "(char *)(param_1 + 0x4b)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x4b)" (( "(") (binary_expression "param_1 + 0x4b" (identifier "param_1") (+ "+") (number_literal "0x4b")) () ")")))) (!= "!=") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) () ")")) (compound_statement "{\n    pvVar1 = realloc(*(void **)(param_1 + 4),param_2);\n    if (pvVar1 == (void *)0x0) {\n      return 0xc;\n    }\n    *(void **)(param_1 + 4) = pvVar1;\n  }" ({ "{") (expression_statement "pvVar1 = realloc(*(void **)(param_1 + 4),param_2);" (assignment_expression "pvVar1 = realloc(*(void **)(param_1 + 4),param_2)" (identifier "pvVar1") (= "=") (call_expression "realloc(*(void **)(param_1 + 4),param_2)" (identifier "realloc") (argument_list "(*(void **)(param_1 + 4),param_2)" (( "(") (pointer_expression "*(void **)(param_1 + 4)" (* "*") (cast_expression "(void **)(param_1 + 4)" (( "(") (type_descriptor "void **" (primitive_type "void") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(param_1 + 4)" (( "(") (binary_expression "param_1 + 4" (identifier "param_1") (+ "+") (number_literal "4")) () ")")))) (, ",") (identifier "param_2") () ")")))) (; ";")) (if_statement "if (pvVar1 == (void *)0x0) {\n      return 0xc;\n    }" (if "if") (parenthesized_expression "(pvVar1 == (void *)0x0)" (( "(") (binary_expression "pvVar1 == (void *)0x0" (identifier "pvVar1") (== "==") (cast_expression "(void *)0x0" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n      return 0xc;\n    }" ({ "{") (return_statement "return 0xc;" (return "return") (number_literal "0xc") (; ";")) (} "}"))) (expression_statement "*(void **)(param_1 + 4) = pvVar1;" (assignment_expression "*(void **)(param_1 + 4) = pvVar1" (pointer_expression "*(void **)(param_1 + 4)" (* "*") (cast_expression "(void **)(param_1 + 4)" (( "(") (type_descriptor "void **" (primitive_type "void") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(param_1 + 4)" (( "(") (binary_expression "param_1 + 4" (identifier "param_1") (+ "+") (number_literal "4")) () ")")))) (= "=") (identifier "pvVar1")) (; ";")) (} "}"))) (expression_statement "*(uint *)(param_1 + 0x24) = param_2;" (assignment_expression "*(uint *)(param_1 + 0x24) = param_2" (pointer_expression "*(uint *)(param_1 + 0x24)" (* "*") (cast_expression "(uint *)(param_1 + 0x24)" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x24)" (( "(") (binary_expression "param_1 + 0x24" (identifier "param_1") (+ "+") (number_literal "0x24")) () ")")))) (= "=") (identifier "param_2")) (; ";")) (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}")))

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

type_1 function_1(type_2 *pstr,type_3 var_2)

{
  type_4 *var_3;
  type_3 *var_4;
  type_5 *var_5;
  
  if (1 < pstr->mb_cur_max) {
    if (0x3fffffff < (type_6)var_2) {
      return _REG_ESPACE;
    }
    var_3 = (type_4 *)var_1(pstr->wcs,var_2 * 4);
    if (var_3 == (type_4 *)0x0) {
      return _REG_ESPACE;
    }
    pstr->wcs = var_3;
    if (pstr->offsets != (type_3 *)0x0) {
      var_4 = (type_3 *)var_1(pstr->offsets,var_2 * 4);
      if (var_4 == (type_3 *)0x0) {
        return _REG_ESPACE;
      }
      pstr->offsets = var_4;
    }
  }
  if (pstr->mbs_allocated != '\0') {
    var_5 = (type_5 *)var_1(pstr->mbs,var_2);
    if (var_5 == (type_5 *)0x0) {
      return _REG_ESPACE;
    }
    pstr->mbs = var_5;
  }
  pstr->bufs_len = var_2;
  return _REG_NOERROR;
}


(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: (type_identifier) declarator: (identifier)))) body: (compound_statement (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (number_literal) 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))))))) consequence: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (number_literal) right: (identifier))) consequence: (compound_statement (return_statement (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (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))))) (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 (return_statement (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))) (if_statement condition: (parenthesized_expression (binary_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: (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: (call_expression function: (identifier) arguments: (argument_list (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))))) (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 (return_statement (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))))))) (if_statement condition: (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: (char_literal (escape_sequence)))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (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))))) (identifier))))) (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 (return_statement (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))))) (expression_statement (assignment_expression left: (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))))) right: (identifier))) (return_statement (number_literal)))))

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

undefined4 MASKED(int param_1,uint param_2)

{
  void *pvVar1;
  
  if (1 < *(int *)(param_1 + 0x50)) {
    if (0x3fffffff < param_2) {
      return 0xc;
    }
    pvVar1 = realloc(*(void **)(param_1 + 8),param_2 * 4);
    if (pvVar1 == (void *)0x0) {
      return 0xc;
    }
    *(void **)(param_1 + 8) = pvVar1;
    if (*(void **)(param_1 + 0xc) != (void *)0x0) {
      pvVar1 = realloc(*(void **)(param_1 + 0xc),param_2 * 4);
      if (pvVar1 == (void *)0x0) {
        return 0xc;
      }
      *(void **)(param_1 + 0xc) = pvVar1;
    }
  }
  if (*(char *)(param_1 + 0x4b) != '\0') {
    pvVar1 = realloc(*(void **)(param_1 + 4),param_2);
    if (pvVar1 == (void *)0x0) {
      return 0xc;
    }
    *(void **)(param_1 + 4) = pvVar1;
  }
  *(uint *)(param_1 + 0x24) = param_2;
  return 0;
}

