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

int wc_to_mb(int codepage,int flags,wchar_t *wcstr,int wclen,char *mbstr,int mblen,char *defchr,
            int *defused,unicode_data *ucsdata)

{
  int iVar1;
  char *pcVar2;
  int iVar3;
  char *__dest;
  size_t __n;
  wchar_t wVar4;
  int iVar5;
  int in_GS_OFFSET;
  wchar_t *local_40 [2];
  mbstate_t state;
  char output [16];
  
  pcVar2 = mbstr;
  local_40[0] = wcstr;
  iVar1 = *(int *)(in_GS_OFFSET + 0x14);
  if (defused != (int *)0x0) {
    *defused = 0;
  }
  if (codepage == 0xffff) {
    state.__count = 0;
    state.__value.__wch = 0;
    if (0 < wclen) {
      iVar5 = 0;
      do {
        __n = wcrtomb(output,*local_40[0],(mbstate_t *)&state);
        if ((__n == 0xffffffff) || (iVar5 - mblen < (int)__n)) break;
        __dest = pcVar2 + iVar5;
        iVar5 = iVar5 + __n;
        memcpy(__dest,output,__n);
        local_40[0] = local_40[0] + 1;
        wclen = wclen + -1;
      } while (0 < wclen);
      goto LAB_000a0edc;
    }
  }
  else {
    if (codepage != 0) {
      iVar5 = charset_from_unicode
                        (local_40,&wclen,mbstr,mblen,codepage,(charset_state *)0x0,defchr,
                         (uint)(defchr != (char *)0x0));
      goto LAB_000a0edc;
    }
    if ((0 < mblen) && (0 < wclen)) {
      iVar5 = 0;
      iVar3 = wclen;
      do {
        iVar3 = iVar3 + -1;
        wVar4 = *wcstr;
        if ((uint)(wVar4 + L'\xffff2800') < 0x100) {
LAB_000a0ec0:
          mbstr[iVar5] = (char)wVar4;
          iVar5 = iVar5 + 1;
        }
        else if (defchr != (char *)0x0) {
          wVar4 = (wchar_t)(byte)*defchr;
          goto LAB_000a0ec0;
        }
        wcstr = wcstr + 1;
      } while (0 < iVar3 && iVar5 < mblen);
      goto LAB_000a0edc;
    }
  }
  iVar5 = 0;
LAB_000a0edc:
  if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail_local();
  }
  return iVar5;
}



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

int FUN_000a0e30(int param_1,undefined4 param_2,wchar_t *param_3,int param_4,int param_5,int param_6
                ,byte *param_7,undefined4 *param_8)

{
  int iVar1;
  void *__dest;
  size_t __n;
  wchar_t wVar2;
  int iVar3;
  int in_GS_OFFSET;
  wchar_t *local_40 [2];
  mbstate_t local_38;
  char local_30 [16];
  int local_20;
  undefined4 uStack_14;
  
  iVar1 = param_5;
  uStack_14 = 0xa0e39;
  local_40[0] = param_3;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if (param_8 != (undefined4 *)0x0) {
    *param_8 = 0;
  }
  if (param_1 == 0xffff) {
    local_38.__count = 0;
    local_38.__value.__wch = 0;
    if (0 < param_4) {
      iVar3 = 0;
      do {
        __n = wcrtomb(local_30,*local_40[0],&local_38);
        if ((__n == 0xffffffff) || (iVar3 - param_6 < (int)__n)) break;
        __dest = (void *)(iVar1 + iVar3);
        iVar3 = iVar3 + __n;
        memcpy(__dest,local_30,__n);
        local_40[0] = local_40[0] + 1;
        param_4 = param_4 + -1;
      } while (0 < param_4);
      goto LAB_000a0edc;
    }
  }
  else {
    if (param_1 != 0) {
      iVar3 = FUN_0001cbe0(local_40,&param_4,param_5,param_6,param_1,0,param_7,
                           param_7 != (byte *)0x0);
      goto LAB_000a0edc;
    }
    if ((0 < param_6) && (0 < param_4)) {
      iVar3 = 0;
      iVar1 = param_4;
      do {
        iVar1 = iVar1 + -1;
        wVar2 = *param_3;
        if ((uint)(wVar2 + L'\xffff2800') < 0x100) {
LAB_000a0ec0:
          *(char *)(param_5 + iVar3) = (char)wVar2;
          iVar3 = iVar3 + 1;
        }
        else if (param_7 != (byte *)0x0) {
          wVar2 = (wchar_t)*param_7;
          goto LAB_000a0ec0;
        }
        param_3 = param_3 + 1;
      } while (0 < iVar1 && iVar3 < param_6);
      goto LAB_000a0edc;
    }
  }
  iVar3 = 0;
LAB_000a0edc:
  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    FUN_000a39d0();
  }
  return iVar3;
}


PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x0001c4f0
ADD EBX,0x6f917
SUB ESP,0x3c
MOV ECX,dword ptr [ESP + 0x58]
MOV EDX,dword ptr [ESP + 0x6c]
MOV EAX,dword ptr [ESP + 0x50]
MOV EDI,dword ptr [ESP + 0x60]
MOV dword ptr [ESP + 0xc],ECX
MOV EBP,dword ptr [ESP + 0x68]
MOV ESI,dword ptr GS:[0x14]
MOV dword ptr [ESP + 0x2c],ESI
XOR ESI,ESI
TEST EDX,EDX
JZ 0x000a0e71
MOV dword ptr [EDX],0x0
CMP EAX,0xffff
JZ 0x000a0f30
TEST EAX,EAX
JNZ 0x000a0f00
MOV EDX,dword ptr [ESP + 0x64]
MOV EAX,dword ptr [ESP + 0x5c]
TEST EDX,EDX
JLE 0x000a0fc0
TEST EAX,EAX
JLE 0x000a0fc0
MOV EDX,dword ptr [ESP + 0xc]
SUB EAX,0x1
XOR ESI,ESI
LEA ESI,[ESI]
MOV ECX,dword ptr [EDX]
LEA EBX,[ECX + 0xffff2800]
CMP EBX,0xff
JBE 0x000a0ec0
TEST EBP,EBP
JZ 0x000a0ec6
MOVZX ECX,byte ptr [EBP]
MOV byte ptr [EDI + ESI*0x1],CL
ADD ESI,0x1
TEST EAX,EAX
SETG BL
CMP ESI,dword ptr [ESP + 0x64]
SETL CL
SUB EAX,0x1
ADD EDX,0x4
TEST BL,CL
JNZ 0x000a0ea8
MOV EDI,dword ptr [ESP + 0x2c]
XOR EDI,dword ptr GS:[0x14]
MOV EAX,ESI
JNZ 0x000a0fc7
ADD ESP,0x3c
POP EBX
POP ESI
POP EDI
POP EBP
RET
XOR EDX,EDX
TEST EBP,EBP
SETNZ DL
PUSH EDX
PUSH EBP
PUSH 0x0
PUSH EAX
PUSH dword ptr [ESP + 0x74]
PUSH EDI
LEA EAX,[ESP + 0x74]
PUSH EAX
LEA EAX,[ESP + 0x28]
PUSH EAX
CALL 0x0001cbe0
ADD ESP,0x20
MOV ESI,EAX
JMP 0x000a0edc
MOV ECX,dword ptr [ESP + 0x5c]
MOV dword ptr [ESP + 0x14],0x0
MOV dword ptr [ESP + 0x18],0x0
TEST ECX,ECX
JLE 0x000a0fc0
LEA EDX,[ESP + 0x14]
MOV EAX,dword ptr [ESP + 0xc]
XOR ESI,ESI
LEA EBP,[ESP + 0x1c]
MOV dword ptr [ESP + 0x4],EDX
MOV dword ptr [ESP + 0x8],EDI
JMP 0x000a0fa2
MOV EAX,ESI
SUB EAX,dword ptr [ESP + 0x64]
CMP EAX,EDI
JL 0x000a0edc
MOV EAX,dword ptr [ESP + 0x8]
SUB ESP,0x4
PUSH EDI
ADD EAX,ESI
PUSH EBP
ADD ESI,EDI
PUSH EAX
CALL 0x0001a820
MOV EAX,dword ptr [ESP + 0x1c]
MOV EDI,dword ptr [ESP + 0x6c]
ADD EAX,0x4
LEA EDX,[EDI + -0x1]
MOV dword ptr [ESP + 0x1c],EAX
MOV dword ptr [ESP + 0x6c],EDX
ADD ESP,0x10
TEST EDX,EDX
JLE 0x000a0edc
SUB ESP,0x4
PUSH dword ptr [ESP + 0x8]
PUSH dword ptr [EAX]
PUSH EBP
CALL 0x0001b0f0
ADD ESP,0x10
MOV EDI,EAX
CMP EAX,-0x1
JNZ 0x000a0f60
JMP 0x000a0edc
XOR ESI,ESI
JMP 0x000a0edc
CALL 0x000a39d0
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nint FUN_000a0e30(int param_1,undefined4 param_2,wchar_t *param_3,int param_4,int param_5,int param_6\n                ,byte *param_7,undefined4 *param_8)\n\n{\n  int iVar1;\n  void *__dest;\n  size_t __n;\n  wchar_t wVar2;\n  int iVar3;\n  int in_GS_OFFSET;\n  wchar_t *local_40 [2];\n  mbstate_t local_38;\n  char local_30 [16];\n  int local_20;\n  undefined4 uStack_14;\n  \n  iVar1 = param_5;\n  uStack_14 = 0xa0e39;\n  local_40[0] = param_3;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if (param_8 != (undefined4 *)0x0) {\n    *param_8 = 0;\n  }\n  if (param_1 == 0xffff) {\n    local_38.__count = 0;\n    local_38.__value.__wch = 0;\n    if (0 < param_4) {\n      iVar3 = 0;\n      do {\n        __n = wcrtomb(local_30,*local_40[0],&local_38);\n        if ((__n == 0xffffffff) || (iVar3 - param_6 < (int)__n)) break;\n        __dest = (void *)(iVar1 + iVar3);\n        iVar3 = iVar3 + __n;\n        memcpy(__dest,local_30,__n);\n        local_40[0] = local_40[0] + 1;\n        param_4 = param_4 + -1;\n      } while (0 < param_4);\n      goto LAB_000a0edc;\n    }\n  }\n  else {\n    if (param_1 != 0) {\n      iVar3 = FUN_0001cbe0(local_40,&param_4,param_5,param_6,param_1,0,param_7,\n                           param_7 != (byte *)0x0);\n      goto LAB_000a0edc;\n    }\n    if ((0 < param_6) && (0 < param_4)) {\n      iVar3 = 0;\n      iVar1 = param_4;\n      do {\n        iVar1 = iVar1 + -1;\n        wVar2 = *param_3;\n        if ((uint)(wVar2 + L'\xffff2800') < 0x100) {\nLAB_000a0ec0:\n          *(char *)(param_5 + iVar3) = (char)wVar2;\n          iVar3 = iVar3 + 1;\n        }\n        else if (param_7 != (byte *)0x0) {\n          wVar2 = (wchar_t)*param_7;\n          goto LAB_000a0ec0;\n        }\n        param_3 = param_3 + 1;\n      } while (0 < iVar1 && iVar3 < param_6);\n      goto LAB_000a0edc;\n    }\n  }\n  iVar3 = 0;\nLAB_000a0edc:\n  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    FUN_000a39d0();\n  }\n  return iVar3;\n}\n\n" comment (function_definition "int FUN_000a0e30(int param_1,undefined4 param_2,wchar_t *param_3,int param_4,int param_5,int param_6\n                ,byte *param_7,undefined4 *param_8)\n\n{\n  int iVar1;\n  void *__dest;\n  size_t __n;\n  wchar_t wVar2;\n  int iVar3;\n  int in_GS_OFFSET;\n  wchar_t *local_40 [2];\n  mbstate_t local_38;\n  char local_30 [16];\n  int local_20;\n  undefined4 uStack_14;\n  \n  iVar1 = param_5;\n  uStack_14 = 0xa0e39;\n  local_40[0] = param_3;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if (param_8 != (undefined4 *)0x0) {\n    *param_8 = 0;\n  }\n  if (param_1 == 0xffff) {\n    local_38.__count = 0;\n    local_38.__value.__wch = 0;\n    if (0 < param_4) {\n      iVar3 = 0;\n      do {\n        __n = wcrtomb(local_30,*local_40[0],&local_38);\n        if ((__n == 0xffffffff) || (iVar3 - param_6 < (int)__n)) break;\n        __dest = (void *)(iVar1 + iVar3);\n        iVar3 = iVar3 + __n;\n        memcpy(__dest,local_30,__n);\n        local_40[0] = local_40[0] + 1;\n        param_4 = param_4 + -1;\n      } while (0 < param_4);\n      goto LAB_000a0edc;\n    }\n  }\n  else {\n    if (param_1 != 0) {\n      iVar3 = FUN_0001cbe0(local_40,&param_4,param_5,param_6,param_1,0,param_7,\n                           param_7 != (byte *)0x0);\n      goto LAB_000a0edc;\n    }\n    if ((0 < param_6) && (0 < param_4)) {\n      iVar3 = 0;\n      iVar1 = param_4;\n      do {\n        iVar1 = iVar1 + -1;\n        wVar2 = *param_3;\n        if ((uint)(wVar2 + L'\xffff2800') < 0x100) {\nLAB_000a0ec0:\n          *(char *)(param_5 + iVar3) = (char)wVar2;\n          iVar3 = iVar3 + 1;\n        }\n        else if (param_7 != (byte *)0x0) {\n          wVar2 = (wchar_t)*param_7;\n          goto LAB_000a0ec0;\n        }\n        param_3 = param_3 + 1;\n      } while (0 < iVar1 && iVar3 < param_6);\n      goto LAB_000a0edc;\n    }\n  }\n  iVar3 = 0;\nLAB_000a0edc:\n  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    FUN_000a39d0();\n  }\n  return iVar3;\n}" primitive_type (function_declarator "FUN_000a0e30(int param_1,undefined4 param_2,wchar_t *param_3,int param_4,int param_5,int param_6\n                ,byte *param_7,undefined4 *param_8)" identifier (parameter_list "(int param_1,undefined4 param_2,wchar_t *param_3,int param_4,int param_5,int param_6\n                ,byte *param_7,undefined4 *param_8)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "undefined4 param_2" type_identifier identifier) , (parameter_declaration "wchar_t *param_3" type_identifier (pointer_declarator "*param_3" * identifier)) , (parameter_declaration "int param_4" primitive_type identifier) , (parameter_declaration "int param_5" primitive_type identifier) , (parameter_declaration "int param_6" primitive_type identifier) , (parameter_declaration "byte *param_7" type_identifier (pointer_declarator "*param_7" * identifier)) , (parameter_declaration "undefined4 *param_8" type_identifier (pointer_declarator "*param_8" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  void *__dest;\n  size_t __n;\n  wchar_t wVar2;\n  int iVar3;\n  int in_GS_OFFSET;\n  wchar_t *local_40 [2];\n  mbstate_t local_38;\n  char local_30 [16];\n  int local_20;\n  undefined4 uStack_14;\n  \n  iVar1 = param_5;\n  uStack_14 = 0xa0e39;\n  local_40[0] = param_3;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if (param_8 != (undefined4 *)0x0) {\n    *param_8 = 0;\n  }\n  if (param_1 == 0xffff) {\n    local_38.__count = 0;\n    local_38.__value.__wch = 0;\n    if (0 < param_4) {\n      iVar3 = 0;\n      do {\n        __n = wcrtomb(local_30,*local_40[0],&local_38);\n        if ((__n == 0xffffffff) || (iVar3 - param_6 < (int)__n)) break;\n        __dest = (void *)(iVar1 + iVar3);\n        iVar3 = iVar3 + __n;\n        memcpy(__dest,local_30,__n);\n        local_40[0] = local_40[0] + 1;\n        param_4 = param_4 + -1;\n      } while (0 < param_4);\n      goto LAB_000a0edc;\n    }\n  }\n  else {\n    if (param_1 != 0) {\n      iVar3 = FUN_0001cbe0(local_40,&param_4,param_5,param_6,param_1,0,param_7,\n                           param_7 != (byte *)0x0);\n      goto LAB_000a0edc;\n    }\n    if ((0 < param_6) && (0 < param_4)) {\n      iVar3 = 0;\n      iVar1 = param_4;\n      do {\n        iVar1 = iVar1 + -1;\n        wVar2 = *param_3;\n        if ((uint)(wVar2 + L'\xffff2800') < 0x100) {\nLAB_000a0ec0:\n          *(char *)(param_5 + iVar3) = (char)wVar2;\n          iVar3 = iVar3 + 1;\n        }\n        else if (param_7 != (byte *)0x0) {\n          wVar2 = (wchar_t)*param_7;\n          goto LAB_000a0ec0;\n        }\n        param_3 = param_3 + 1;\n      } while (0 < iVar1 && iVar3 < param_6);\n      goto LAB_000a0edc;\n    }\n  }\n  iVar3 = 0;\nLAB_000a0edc:\n  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    FUN_000a39d0();\n  }\n  return iVar3;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "void *__dest;" primitive_type (pointer_declarator "*__dest" * identifier) ;) (declaration "size_t __n;" primitive_type identifier ;) (declaration "wchar_t wVar2;" type_identifier identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "wchar_t *local_40 [2];" type_identifier (pointer_declarator "*local_40 [2]" * (array_declarator "local_40 [2]" identifier [ number_literal ])) ;) (declaration "mbstate_t local_38;" type_identifier identifier ;) (declaration "char local_30 [16];" primitive_type (array_declarator "local_30 [16]" identifier [ number_literal ]) ;) (declaration "int local_20;" primitive_type identifier ;) (declaration "undefined4 uStack_14;" type_identifier identifier ;) (expression_statement "iVar1 = param_5;" (assignment_expression "iVar1 = param_5" identifier = identifier) ;) (expression_statement "uStack_14 = 0xa0e39;" (assignment_expression "uStack_14 = 0xa0e39" identifier = number_literal) ;) (expression_statement "local_40[0] = param_3;" (assignment_expression "local_40[0] = param_3" (subscript_expression "local_40[0]" identifier [ number_literal ]) = identifier) ;) (expression_statement "local_20 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_20 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (if_statement "if (param_8 != (undefined4 *)0x0) {\n    *param_8 = 0;\n  }" if (parenthesized_expression "(param_8 != (undefined4 *)0x0)" ( (binary_expression "param_8 != (undefined4 *)0x0" identifier != (cast_expression "(undefined4 *)0x0" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    *param_8 = 0;\n  }" { (expression_statement "*param_8 = 0;" (assignment_expression "*param_8 = 0" (pointer_expression "*param_8" * identifier) = number_literal) ;) })) (if_statement "if (param_1 == 0xffff) {\n    local_38.__count = 0;\n    local_38.__value.__wch = 0;\n    if (0 < param_4) {\n      iVar3 = 0;\n      do {\n        __n = wcrtomb(local_30,*local_40[0],&local_38);\n        if ((__n == 0xffffffff) || (iVar3 - param_6 < (int)__n)) break;\n        __dest = (void *)(iVar1 + iVar3);\n        iVar3 = iVar3 + __n;\n        memcpy(__dest,local_30,__n);\n        local_40[0] = local_40[0] + 1;\n        param_4 = param_4 + -1;\n      } while (0 < param_4);\n      goto LAB_000a0edc;\n    }\n  }\n  else {\n    if (param_1 != 0) {\n      iVar3 = FUN_0001cbe0(local_40,&param_4,param_5,param_6,param_1,0,param_7,\n                           param_7 != (byte *)0x0);\n      goto LAB_000a0edc;\n    }\n    if ((0 < param_6) && (0 < param_4)) {\n      iVar3 = 0;\n      iVar1 = param_4;\n      do {\n        iVar1 = iVar1 + -1;\n        wVar2 = *param_3;\n        if ((uint)(wVar2 + L'\xffff2800') < 0x100) {\nLAB_000a0ec0:\n          *(char *)(param_5 + iVar3) = (char)wVar2;\n          iVar3 = iVar3 + 1;\n        }\n        else if (param_7 != (byte *)0x0) {\n          wVar2 = (wchar_t)*param_7;\n          goto LAB_000a0ec0;\n        }\n        param_3 = param_3 + 1;\n      } while (0 < iVar1 && iVar3 < param_6);\n      goto LAB_000a0edc;\n    }\n  }" if (parenthesized_expression "(param_1 == 0xffff)" ( (binary_expression "param_1 == 0xffff" identifier == number_literal) )) (compound_statement "{\n    local_38.__count = 0;\n    local_38.__value.__wch = 0;\n    if (0 < param_4) {\n      iVar3 = 0;\n      do {\n        __n = wcrtomb(local_30,*local_40[0],&local_38);\n        if ((__n == 0xffffffff) || (iVar3 - param_6 < (int)__n)) break;\n        __dest = (void *)(iVar1 + iVar3);\n        iVar3 = iVar3 + __n;\n        memcpy(__dest,local_30,__n);\n        local_40[0] = local_40[0] + 1;\n        param_4 = param_4 + -1;\n      } while (0 < param_4);\n      goto LAB_000a0edc;\n    }\n  }" { (expression_statement "local_38.__count = 0;" (assignment_expression "local_38.__count = 0" (field_expression "local_38.__count" identifier . field_identifier) = number_literal) ;) (expression_statement "local_38.__value.__wch = 0;" (assignment_expression "local_38.__value.__wch = 0" (field_expression "local_38.__value.__wch" (field_expression "local_38.__value" identifier . field_identifier) . field_identifier) = number_literal) ;) (if_statement "if (0 < param_4) {\n      iVar3 = 0;\n      do {\n        __n = wcrtomb(local_30,*local_40[0],&local_38);\n        if ((__n == 0xffffffff) || (iVar3 - param_6 < (int)__n)) break;\n        __dest = (void *)(iVar1 + iVar3);\n        iVar3 = iVar3 + __n;\n        memcpy(__dest,local_30,__n);\n        local_40[0] = local_40[0] + 1;\n        param_4 = param_4 + -1;\n      } while (0 < param_4);\n      goto LAB_000a0edc;\n    }" if (parenthesized_expression "(0 < param_4)" ( (binary_expression "0 < param_4" number_literal < identifier) )) (compound_statement "{\n      iVar3 = 0;\n      do {\n        __n = wcrtomb(local_30,*local_40[0],&local_38);\n        if ((__n == 0xffffffff) || (iVar3 - param_6 < (int)__n)) break;\n        __dest = (void *)(iVar1 + iVar3);\n        iVar3 = iVar3 + __n;\n        memcpy(__dest,local_30,__n);\n        local_40[0] = local_40[0] + 1;\n        param_4 = param_4 + -1;\n      } while (0 < param_4);\n      goto LAB_000a0edc;\n    }" { (expression_statement "iVar3 = 0;" (assignment_expression "iVar3 = 0" identifier = number_literal) ;) (do_statement "do {\n        __n = wcrtomb(local_30,*local_40[0],&local_38);\n        if ((__n == 0xffffffff) || (iVar3 - param_6 < (int)__n)) break;\n        __dest = (void *)(iVar1 + iVar3);\n        iVar3 = iVar3 + __n;\n        memcpy(__dest,local_30,__n);\n        local_40[0] = local_40[0] + 1;\n        param_4 = param_4 + -1;\n      } while (0 < param_4);" do (compound_statement "{\n        __n = wcrtomb(local_30,*local_40[0],&local_38);\n        if ((__n == 0xffffffff) || (iVar3 - param_6 < (int)__n)) break;\n        __dest = (void *)(iVar1 + iVar3);\n        iVar3 = iVar3 + __n;\n        memcpy(__dest,local_30,__n);\n        local_40[0] = local_40[0] + 1;\n        param_4 = param_4 + -1;\n      }" { (expression_statement "__n = wcrtomb(local_30,*local_40[0],&local_38);" (assignment_expression "__n = wcrtomb(local_30,*local_40[0],&local_38)" identifier = (call_expression "wcrtomb(local_30,*local_40[0],&local_38)" identifier (argument_list "(local_30,*local_40[0],&local_38)" ( identifier , (pointer_expression "*local_40[0]" * (subscript_expression "local_40[0]" identifier [ number_literal ])) , (pointer_expression "&local_38" & identifier) )))) ;) (if_statement "if ((__n == 0xffffffff) || (iVar3 - param_6 < (int)__n)) break;" if (parenthesized_expression "((__n == 0xffffffff) || (iVar3 - param_6 < (int)__n))" ( (binary_expression "(__n == 0xffffffff) || (iVar3 - param_6 < (int)__n)" (parenthesized_expression "(__n == 0xffffffff)" ( (binary_expression "__n == 0xffffffff" identifier == number_literal) )) || (parenthesized_expression "(iVar3 - param_6 < (int)__n)" ( (binary_expression "iVar3 - param_6 < (int)__n" (binary_expression "iVar3 - param_6" identifier - identifier) < (cast_expression "(int)__n" ( (type_descriptor "int" primitive_type) ) identifier)) ))) )) (break_statement "break;" break ;)) (expression_statement "__dest = (void *)(iVar1 + iVar3);" (assignment_expression "__dest = (void *)(iVar1 + iVar3)" identifier = (cast_expression "(void *)(iVar1 + iVar3)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + iVar3)" ( (binary_expression "iVar1 + iVar3" identifier + identifier) )))) ;) (expression_statement "iVar3 = iVar3 + __n;" (assignment_expression "iVar3 = iVar3 + __n" identifier = (binary_expression "iVar3 + __n" identifier + identifier)) ;) (expression_statement "memcpy(__dest,local_30,__n);" (call_expression "memcpy(__dest,local_30,__n)" identifier (argument_list "(__dest,local_30,__n)" ( identifier , identifier , identifier ))) ;) (expression_statement "local_40[0] = local_40[0] + 1;" (assignment_expression "local_40[0] = local_40[0] + 1" (subscript_expression "local_40[0]" identifier [ number_literal ]) = (binary_expression "local_40[0] + 1" (subscript_expression "local_40[0]" identifier [ number_literal ]) + number_literal)) ;) (expression_statement "param_4 = param_4 + -1;" (assignment_expression "param_4 = param_4 + -1" identifier = (binary_expression "param_4 + -1" identifier + number_literal)) ;) }) while (parenthesized_expression "(0 < param_4)" ( (binary_expression "0 < param_4" number_literal < identifier) )) ;) (goto_statement "goto LAB_000a0edc;" goto statement_identifier ;) })) }) (else_clause "else {\n    if (param_1 != 0) {\n      iVar3 = FUN_0001cbe0(local_40,&param_4,param_5,param_6,param_1,0,param_7,\n                           param_7 != (byte *)0x0);\n      goto LAB_000a0edc;\n    }\n    if ((0 < param_6) && (0 < param_4)) {\n      iVar3 = 0;\n      iVar1 = param_4;\n      do {\n        iVar1 = iVar1 + -1;\n        wVar2 = *param_3;\n        if ((uint)(wVar2 + L'\xffff2800') < 0x100) {\nLAB_000a0ec0:\n          *(char *)(param_5 + iVar3) = (char)wVar2;\n          iVar3 = iVar3 + 1;\n        }\n        else if (param_7 != (byte *)0x0) {\n          wVar2 = (wchar_t)*param_7;\n          goto LAB_000a0ec0;\n        }\n        param_3 = param_3 + 1;\n      } while (0 < iVar1 && iVar3 < param_6);\n      goto LAB_000a0edc;\n    }\n  }" else (compound_statement "{\n    if (param_1 != 0) {\n      iVar3 = FUN_0001cbe0(local_40,&param_4,param_5,param_6,param_1,0,param_7,\n                           param_7 != (byte *)0x0);\n      goto LAB_000a0edc;\n    }\n    if ((0 < param_6) && (0 < param_4)) {\n      iVar3 = 0;\n      iVar1 = param_4;\n      do {\n        iVar1 = iVar1 + -1;\n        wVar2 = *param_3;\n        if ((uint)(wVar2 + L'\xffff2800') < 0x100) {\nLAB_000a0ec0:\n          *(char *)(param_5 + iVar3) = (char)wVar2;\n          iVar3 = iVar3 + 1;\n        }\n        else if (param_7 != (byte *)0x0) {\n          wVar2 = (wchar_t)*param_7;\n          goto LAB_000a0ec0;\n        }\n        param_3 = param_3 + 1;\n      } while (0 < iVar1 && iVar3 < param_6);\n      goto LAB_000a0edc;\n    }\n  }" { (if_statement "if (param_1 != 0) {\n      iVar3 = FUN_0001cbe0(local_40,&param_4,param_5,param_6,param_1,0,param_7,\n                           param_7 != (byte *)0x0);\n      goto LAB_000a0edc;\n    }" if (parenthesized_expression "(param_1 != 0)" ( (binary_expression "param_1 != 0" identifier != number_literal) )) (compound_statement "{\n      iVar3 = FUN_0001cbe0(local_40,&param_4,param_5,param_6,param_1,0,param_7,\n                           param_7 != (byte *)0x0);\n      goto LAB_000a0edc;\n    }" { (expression_statement "iVar3 = FUN_0001cbe0(local_40,&param_4,param_5,param_6,param_1,0,param_7,\n                           param_7 != (byte *)0x0);" (assignment_expression "iVar3 = FUN_0001cbe0(local_40,&param_4,param_5,param_6,param_1,0,param_7,\n                           param_7 != (byte *)0x0)" identifier = (call_expression "FUN_0001cbe0(local_40,&param_4,param_5,param_6,param_1,0,param_7,\n                           param_7 != (byte *)0x0)" identifier (argument_list "(local_40,&param_4,param_5,param_6,param_1,0,param_7,\n                           param_7 != (byte *)0x0)" ( identifier , (pointer_expression "&param_4" & identifier) , identifier , identifier , identifier , number_literal , identifier , (binary_expression "param_7 != (byte *)0x0" identifier != (cast_expression "(byte *)0x0" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )))) ;) (goto_statement "goto LAB_000a0edc;" goto statement_identifier ;) })) (if_statement "if ((0 < param_6) && (0 < param_4)) {\n      iVar3 = 0;\n      iVar1 = param_4;\n      do {\n        iVar1 = iVar1 + -1;\n        wVar2 = *param_3;\n        if ((uint)(wVar2 + L'\xffff2800') < 0x100) {\nLAB_000a0ec0:\n          *(char *)(param_5 + iVar3) = (char)wVar2;\n          iVar3 = iVar3 + 1;\n        }\n        else if (param_7 != (byte *)0x0) {\n          wVar2 = (wchar_t)*param_7;\n          goto LAB_000a0ec0;\n        }\n        param_3 = param_3 + 1;\n      } while (0 < iVar1 && iVar3 < param_6);\n      goto LAB_000a0edc;\n    }" if (parenthesized_expression "((0 < param_6) && (0 < param_4))" ( (binary_expression "(0 < param_6) && (0 < param_4)" (parenthesized_expression "(0 < param_6)" ( (binary_expression "0 < param_6" number_literal < identifier) )) && (parenthesized_expression "(0 < param_4)" ( (binary_expression "0 < param_4" number_literal < identifier) ))) )) (compound_statement "{\n      iVar3 = 0;\n      iVar1 = param_4;\n      do {\n        iVar1 = iVar1 + -1;\n        wVar2 = *param_3;\n        if ((uint)(wVar2 + L'\xffff2800') < 0x100) {\nLAB_000a0ec0:\n          *(char *)(param_5 + iVar3) = (char)wVar2;\n          iVar3 = iVar3 + 1;\n        }\n        else if (param_7 != (byte *)0x0) {\n          wVar2 = (wchar_t)*param_7;\n          goto LAB_000a0ec0;\n        }\n        param_3 = param_3 + 1;\n      } while (0 < iVar1 && iVar3 < param_6);\n      goto LAB_000a0edc;\n    }" { (expression_statement "iVar3 = 0;" (assignment_expression "iVar3 = 0" identifier = number_literal) ;) (expression_statement "iVar1 = param_4;" (assignment_expression "iVar1 = param_4" identifier = identifier) ;) (do_statement "do {\n        iVar1 = iVar1 + -1;\n        wVar2 = *param_3;\n        if ((uint)(wVar2 + L'\xffff2800') < 0x100) {\nLAB_000a0ec0:\n          *(char *)(param_5 + iVar3) = (char)wVar2;\n          iVar3 = iVar3 + 1;\n        }\n        else if (param_7 != (byte *)0x0) {\n          wVar2 = (wchar_t)*param_7;\n          goto LAB_000a0ec0;\n        }\n        param_3 = param_3 + 1;\n      } while (0 < iVar1 && iVar3 < param_6);" do (compound_statement "{\n        iVar1 = iVar1 + -1;\n        wVar2 = *param_3;\n        if ((uint)(wVar2 + L'\xffff2800') < 0x100) {\nLAB_000a0ec0:\n          *(char *)(param_5 + iVar3) = (char)wVar2;\n          iVar3 = iVar3 + 1;\n        }\n        else if (param_7 != (byte *)0x0) {\n          wVar2 = (wchar_t)*param_7;\n          goto LAB_000a0ec0;\n        }\n        param_3 = param_3 + 1;\n      }" { (expression_statement "iVar1 = iVar1 + -1;" (assignment_expression "iVar1 = iVar1 + -1" identifier = (binary_expression "iVar1 + -1" identifier + number_literal)) ;) (expression_statement "wVar2 = *param_3;" (assignment_expression "wVar2 = *param_3" identifier = (pointer_expression "*param_3" * identifier)) ;) (if_statement "if ((uint)(wVar2 + L'\xffff2800') < 0x100) {\nLAB_000a0ec0:\n          *(char *)(param_5 + iVar3) = (char)wVar2;\n          iVar3 = iVar3 + 1;\n        }\n        else if (param_7 != (byte *)0x0) {\n          wVar2 = (wchar_t)*param_7;\n          goto LAB_000a0ec0;\n        }" if (parenthesized_expression "((uint)(wVar2 + L'\xffff2800') < 0x100)" ( (binary_expression "(uint)(wVar2 + L'\xffff2800') < 0x100" (call_expression "(uint)(wVar2 + L'\xffff2800')" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(wVar2 + L'\xffff2800')" ( (binary_expression "wVar2 + L'\xffff2800'" identifier + (char_literal "L'\xffff2800'" L' escape_sequence character character character character ')) ))) < number_literal) )) (compound_statement "{\nLAB_000a0ec0:\n          *(char *)(param_5 + iVar3) = (char)wVar2;\n          iVar3 = iVar3 + 1;\n        }" { (labeled_statement "LAB_000a0ec0:\n          *(char *)(param_5 + iVar3) = (char)wVar2;" statement_identifier : (expression_statement "*(char *)(param_5 + iVar3) = (char)wVar2;" (assignment_expression "*(char *)(param_5 + iVar3) = (char)wVar2" (pointer_expression "*(char *)(param_5 + iVar3)" * (cast_expression "(char *)(param_5 + iVar3)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_5 + iVar3)" ( (binary_expression "param_5 + iVar3" identifier + identifier) )))) = (cast_expression "(char)wVar2" ( (type_descriptor "char" primitive_type) ) identifier)) ;)) (expression_statement "iVar3 = iVar3 + 1;" (assignment_expression "iVar3 = iVar3 + 1" identifier = (binary_expression "iVar3 + 1" identifier + number_literal)) ;) }) (else_clause "else if (param_7 != (byte *)0x0) {\n          wVar2 = (wchar_t)*param_7;\n          goto LAB_000a0ec0;\n        }" else (if_statement "if (param_7 != (byte *)0x0) {\n          wVar2 = (wchar_t)*param_7;\n          goto LAB_000a0ec0;\n        }" if (parenthesized_expression "(param_7 != (byte *)0x0)" ( (binary_expression "param_7 != (byte *)0x0" identifier != (cast_expression "(byte *)0x0" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n          wVar2 = (wchar_t)*param_7;\n          goto LAB_000a0ec0;\n        }" { (expression_statement "wVar2 = (wchar_t)*param_7;" (assignment_expression "wVar2 = (wchar_t)*param_7" identifier = (binary_expression "(wchar_t)*param_7" (parenthesized_expression "(wchar_t)" ( identifier )) * identifier)) ;) (goto_statement "goto LAB_000a0ec0;" goto statement_identifier ;) })))) (expression_statement "param_3 = param_3 + 1;" (assignment_expression "param_3 = param_3 + 1" identifier = (binary_expression "param_3 + 1" identifier + number_literal)) ;) }) while (parenthesized_expression "(0 < iVar1 && iVar3 < param_6)" ( (binary_expression "0 < iVar1 && iVar3 < param_6" (binary_expression "0 < iVar1" number_literal < identifier) && (binary_expression "iVar3 < param_6" identifier < identifier)) )) ;) (goto_statement "goto LAB_000a0edc;" goto statement_identifier ;) })) }))) (expression_statement "iVar3 = 0;" (assignment_expression "iVar3 = 0" identifier = number_literal) ;) (labeled_statement "LAB_000a0edc:\n  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    FUN_000a39d0();\n  }" statement_identifier : (if_statement "if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    FUN_000a39d0();\n  }" if (parenthesized_expression "(local_20 != *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "local_20 != *(int *)(in_GS_OFFSET + 0x14)" identifier != (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    FUN_000a39d0();\n  }" { comment (expression_statement "FUN_000a39d0();" (call_expression "FUN_000a39d0()" identifier (argument_list "()" ( ))) ;) }))) (return_statement "return iVar3;" return identifier ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nint wc_to_mb(int codepage,int flags,wchar_t *wcstr,int wclen,char *mbstr,int mblen,char *defchr,\n            int *defused,unicode_data *ucsdata)\n\n{\n  int iVar1;\n  char *pcVar2;\n  int iVar3;\n  char *__dest;\n  size_t __n;\n  wchar_t wVar4;\n  int iVar5;\n  int in_GS_OFFSET;\n  wchar_t *local_40 [2];\n  mbstate_t state;\n  char output [16];\n  \n  pcVar2 = mbstr;\n  local_40[0] = wcstr;\n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  if (defused != (int *)0x0) {\n    *defused = 0;\n  }\n  if (codepage == 0xffff) {\n    state.__count = 0;\n    state.__value.__wch = 0;\n    if (0 < wclen) {\n      iVar5 = 0;\n      do {\n        __n = wcrtomb(output,*local_40[0],(mbstate_t *)&state);\n        if ((__n == 0xffffffff) || (iVar5 - mblen < (int)__n)) break;\n        __dest = pcVar2 + iVar5;\n        iVar5 = iVar5 + __n;\n        memcpy(__dest,output,__n);\n        local_40[0] = local_40[0] + 1;\n        wclen = wclen + -1;\n      } while (0 < wclen);\n      goto LAB_000a0edc;\n    }\n  }\n  else {\n    if (codepage != 0) {\n      iVar5 = charset_from_unicode\n                        (local_40,&wclen,mbstr,mblen,codepage,(charset_state *)0x0,defchr,\n                         (uint)(defchr != (char *)0x0));\n      goto LAB_000a0edc;\n    }\n    if ((0 < mblen) && (0 < wclen)) {\n      iVar5 = 0;\n      iVar3 = wclen;\n      do {\n        iVar3 = iVar3 + -1;\n        wVar4 = *wcstr;\n        if ((uint)(wVar4 + L'\xffff2800') < 0x100) {\nLAB_000a0ec0:\n          mbstr[iVar5] = (char)wVar4;\n          iVar5 = iVar5 + 1;\n        }\n        else if (defchr != (char *)0x0) {\n          wVar4 = (wchar_t)(byte)*defchr;\n          goto LAB_000a0ec0;\n        }\n        wcstr = wcstr + 1;\n      } while (0 < iVar3 && iVar5 < mblen);\n      goto LAB_000a0edc;\n    }\n  }\n  iVar5 = 0;\nLAB_000a0edc:\n  if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail_local();\n  }\n  return iVar5;\n}\n\n" comment (function_definition "int wc_to_mb(int codepage,int flags,wchar_t *wcstr,int wclen,char *mbstr,int mblen,char *defchr,\n            int *defused,unicode_data *ucsdata)\n\n{\n  int iVar1;\n  char *pcVar2;\n  int iVar3;\n  char *__dest;\n  size_t __n;\n  wchar_t wVar4;\n  int iVar5;\n  int in_GS_OFFSET;\n  wchar_t *local_40 [2];\n  mbstate_t state;\n  char output [16];\n  \n  pcVar2 = mbstr;\n  local_40[0] = wcstr;\n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  if (defused != (int *)0x0) {\n    *defused = 0;\n  }\n  if (codepage == 0xffff) {\n    state.__count = 0;\n    state.__value.__wch = 0;\n    if (0 < wclen) {\n      iVar5 = 0;\n      do {\n        __n = wcrtomb(output,*local_40[0],(mbstate_t *)&state);\n        if ((__n == 0xffffffff) || (iVar5 - mblen < (int)__n)) break;\n        __dest = pcVar2 + iVar5;\n        iVar5 = iVar5 + __n;\n        memcpy(__dest,output,__n);\n        local_40[0] = local_40[0] + 1;\n        wclen = wclen + -1;\n      } while (0 < wclen);\n      goto LAB_000a0edc;\n    }\n  }\n  else {\n    if (codepage != 0) {\n      iVar5 = charset_from_unicode\n                        (local_40,&wclen,mbstr,mblen,codepage,(charset_state *)0x0,defchr,\n                         (uint)(defchr != (char *)0x0));\n      goto LAB_000a0edc;\n    }\n    if ((0 < mblen) && (0 < wclen)) {\n      iVar5 = 0;\n      iVar3 = wclen;\n      do {\n        iVar3 = iVar3 + -1;\n        wVar4 = *wcstr;\n        if ((uint)(wVar4 + L'\xffff2800') < 0x100) {\nLAB_000a0ec0:\n          mbstr[iVar5] = (char)wVar4;\n          iVar5 = iVar5 + 1;\n        }\n        else if (defchr != (char *)0x0) {\n          wVar4 = (wchar_t)(byte)*defchr;\n          goto LAB_000a0ec0;\n        }\n        wcstr = wcstr + 1;\n      } while (0 < iVar3 && iVar5 < mblen);\n      goto LAB_000a0edc;\n    }\n  }\n  iVar5 = 0;\nLAB_000a0edc:\n  if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail_local();\n  }\n  return iVar5;\n}" primitive_type (function_declarator "wc_to_mb(int codepage,int flags,wchar_t *wcstr,int wclen,char *mbstr,int mblen,char *defchr,\n            int *defused,unicode_data *ucsdata)" identifier (parameter_list "(int codepage,int flags,wchar_t *wcstr,int wclen,char *mbstr,int mblen,char *defchr,\n            int *defused,unicode_data *ucsdata)" ( (parameter_declaration "int codepage" primitive_type identifier) , (parameter_declaration "int flags" primitive_type identifier) , (parameter_declaration "wchar_t *wcstr" type_identifier (pointer_declarator "*wcstr" * identifier)) , (parameter_declaration "int wclen" primitive_type identifier) , (parameter_declaration "char *mbstr" primitive_type (pointer_declarator "*mbstr" * identifier)) , (parameter_declaration "int mblen" primitive_type identifier) , (parameter_declaration "char *defchr" primitive_type (pointer_declarator "*defchr" * identifier)) , (parameter_declaration "int *defused" primitive_type (pointer_declarator "*defused" * identifier)) , (parameter_declaration "unicode_data *ucsdata" type_identifier (pointer_declarator "*ucsdata" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  char *pcVar2;\n  int iVar3;\n  char *__dest;\n  size_t __n;\n  wchar_t wVar4;\n  int iVar5;\n  int in_GS_OFFSET;\n  wchar_t *local_40 [2];\n  mbstate_t state;\n  char output [16];\n  \n  pcVar2 = mbstr;\n  local_40[0] = wcstr;\n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  if (defused != (int *)0x0) {\n    *defused = 0;\n  }\n  if (codepage == 0xffff) {\n    state.__count = 0;\n    state.__value.__wch = 0;\n    if (0 < wclen) {\n      iVar5 = 0;\n      do {\n        __n = wcrtomb(output,*local_40[0],(mbstate_t *)&state);\n        if ((__n == 0xffffffff) || (iVar5 - mblen < (int)__n)) break;\n        __dest = pcVar2 + iVar5;\n        iVar5 = iVar5 + __n;\n        memcpy(__dest,output,__n);\n        local_40[0] = local_40[0] + 1;\n        wclen = wclen + -1;\n      } while (0 < wclen);\n      goto LAB_000a0edc;\n    }\n  }\n  else {\n    if (codepage != 0) {\n      iVar5 = charset_from_unicode\n                        (local_40,&wclen,mbstr,mblen,codepage,(charset_state *)0x0,defchr,\n                         (uint)(defchr != (char *)0x0));\n      goto LAB_000a0edc;\n    }\n    if ((0 < mblen) && (0 < wclen)) {\n      iVar5 = 0;\n      iVar3 = wclen;\n      do {\n        iVar3 = iVar3 + -1;\n        wVar4 = *wcstr;\n        if ((uint)(wVar4 + L'\xffff2800') < 0x100) {\nLAB_000a0ec0:\n          mbstr[iVar5] = (char)wVar4;\n          iVar5 = iVar5 + 1;\n        }\n        else if (defchr != (char *)0x0) {\n          wVar4 = (wchar_t)(byte)*defchr;\n          goto LAB_000a0ec0;\n        }\n        wcstr = wcstr + 1;\n      } while (0 < iVar3 && iVar5 < mblen);\n      goto LAB_000a0edc;\n    }\n  }\n  iVar5 = 0;\nLAB_000a0edc:\n  if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail_local();\n  }\n  return iVar5;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "char *pcVar2;" primitive_type (pointer_declarator "*pcVar2" * identifier) ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "char *__dest;" primitive_type (pointer_declarator "*__dest" * identifier) ;) (declaration "size_t __n;" primitive_type identifier ;) (declaration "wchar_t wVar4;" type_identifier identifier ;) (declaration "int iVar5;" primitive_type identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "wchar_t *local_40 [2];" type_identifier (pointer_declarator "*local_40 [2]" * (array_declarator "local_40 [2]" identifier [ number_literal ])) ;) (declaration "mbstate_t state;" type_identifier identifier ;) (declaration "char output [16];" primitive_type (array_declarator "output [16]" identifier [ number_literal ]) ;) (expression_statement "pcVar2 = mbstr;" (assignment_expression "pcVar2 = mbstr" identifier = identifier) ;) (expression_statement "local_40[0] = wcstr;" (assignment_expression "local_40[0] = wcstr" (subscript_expression "local_40[0]" identifier [ number_literal ]) = identifier) ;) (expression_statement "iVar1 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "iVar1 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (if_statement "if (defused != (int *)0x0) {\n    *defused = 0;\n  }" if (parenthesized_expression "(defused != (int *)0x0)" ( (binary_expression "defused != (int *)0x0" identifier != (cast_expression "(int *)0x0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    *defused = 0;\n  }" { (expression_statement "*defused = 0;" (assignment_expression "*defused = 0" (pointer_expression "*defused" * identifier) = number_literal) ;) })) (if_statement "if (codepage == 0xffff) {\n    state.__count = 0;\n    state.__value.__wch = 0;\n    if (0 < wclen) {\n      iVar5 = 0;\n      do {\n        __n = wcrtomb(output,*local_40[0],(mbstate_t *)&state);\n        if ((__n == 0xffffffff) || (iVar5 - mblen < (int)__n)) break;\n        __dest = pcVar2 + iVar5;\n        iVar5 = iVar5 + __n;\n        memcpy(__dest,output,__n);\n        local_40[0] = local_40[0] + 1;\n        wclen = wclen + -1;\n      } while (0 < wclen);\n      goto LAB_000a0edc;\n    }\n  }\n  else {\n    if (codepage != 0) {\n      iVar5 = charset_from_unicode\n                        (local_40,&wclen,mbstr,mblen,codepage,(charset_state *)0x0,defchr,\n                         (uint)(defchr != (char *)0x0));\n      goto LAB_000a0edc;\n    }\n    if ((0 < mblen) && (0 < wclen)) {\n      iVar5 = 0;\n      iVar3 = wclen;\n      do {\n        iVar3 = iVar3 + -1;\n        wVar4 = *wcstr;\n        if ((uint)(wVar4 + L'\xffff2800') < 0x100) {\nLAB_000a0ec0:\n          mbstr[iVar5] = (char)wVar4;\n          iVar5 = iVar5 + 1;\n        }\n        else if (defchr != (char *)0x0) {\n          wVar4 = (wchar_t)(byte)*defchr;\n          goto LAB_000a0ec0;\n        }\n        wcstr = wcstr + 1;\n      } while (0 < iVar3 && iVar5 < mblen);\n      goto LAB_000a0edc;\n    }\n  }" if (parenthesized_expression "(codepage == 0xffff)" ( (binary_expression "codepage == 0xffff" identifier == number_literal) )) (compound_statement "{\n    state.__count = 0;\n    state.__value.__wch = 0;\n    if (0 < wclen) {\n      iVar5 = 0;\n      do {\n        __n = wcrtomb(output,*local_40[0],(mbstate_t *)&state);\n        if ((__n == 0xffffffff) || (iVar5 - mblen < (int)__n)) break;\n        __dest = pcVar2 + iVar5;\n        iVar5 = iVar5 + __n;\n        memcpy(__dest,output,__n);\n        local_40[0] = local_40[0] + 1;\n        wclen = wclen + -1;\n      } while (0 < wclen);\n      goto LAB_000a0edc;\n    }\n  }" { (expression_statement "state.__count = 0;" (assignment_expression "state.__count = 0" (field_expression "state.__count" identifier . field_identifier) = number_literal) ;) (expression_statement "state.__value.__wch = 0;" (assignment_expression "state.__value.__wch = 0" (field_expression "state.__value.__wch" (field_expression "state.__value" identifier . field_identifier) . field_identifier) = number_literal) ;) (if_statement "if (0 < wclen) {\n      iVar5 = 0;\n      do {\n        __n = wcrtomb(output,*local_40[0],(mbstate_t *)&state);\n        if ((__n == 0xffffffff) || (iVar5 - mblen < (int)__n)) break;\n        __dest = pcVar2 + iVar5;\n        iVar5 = iVar5 + __n;\n        memcpy(__dest,output,__n);\n        local_40[0] = local_40[0] + 1;\n        wclen = wclen + -1;\n      } while (0 < wclen);\n      goto LAB_000a0edc;\n    }" if (parenthesized_expression "(0 < wclen)" ( (binary_expression "0 < wclen" number_literal < identifier) )) (compound_statement "{\n      iVar5 = 0;\n      do {\n        __n = wcrtomb(output,*local_40[0],(mbstate_t *)&state);\n        if ((__n == 0xffffffff) || (iVar5 - mblen < (int)__n)) break;\n        __dest = pcVar2 + iVar5;\n        iVar5 = iVar5 + __n;\n        memcpy(__dest,output,__n);\n        local_40[0] = local_40[0] + 1;\n        wclen = wclen + -1;\n      } while (0 < wclen);\n      goto LAB_000a0edc;\n    }" { (expression_statement "iVar5 = 0;" (assignment_expression "iVar5 = 0" identifier = number_literal) ;) (do_statement "do {\n        __n = wcrtomb(output,*local_40[0],(mbstate_t *)&state);\n        if ((__n == 0xffffffff) || (iVar5 - mblen < (int)__n)) break;\n        __dest = pcVar2 + iVar5;\n        iVar5 = iVar5 + __n;\n        memcpy(__dest,output,__n);\n        local_40[0] = local_40[0] + 1;\n        wclen = wclen + -1;\n      } while (0 < wclen);" do (compound_statement "{\n        __n = wcrtomb(output,*local_40[0],(mbstate_t *)&state);\n        if ((__n == 0xffffffff) || (iVar5 - mblen < (int)__n)) break;\n        __dest = pcVar2 + iVar5;\n        iVar5 = iVar5 + __n;\n        memcpy(__dest,output,__n);\n        local_40[0] = local_40[0] + 1;\n        wclen = wclen + -1;\n      }" { (expression_statement "__n = wcrtomb(output,*local_40[0],(mbstate_t *)&state);" (assignment_expression "__n = wcrtomb(output,*local_40[0],(mbstate_t *)&state)" identifier = (call_expression "wcrtomb(output,*local_40[0],(mbstate_t *)&state)" identifier (argument_list "(output,*local_40[0],(mbstate_t *)&state)" ( identifier , (pointer_expression "*local_40[0]" * (subscript_expression "local_40[0]" identifier [ number_literal ])) , (cast_expression "(mbstate_t *)&state" ( (type_descriptor "mbstate_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "&state" & identifier)) )))) ;) (if_statement "if ((__n == 0xffffffff) || (iVar5 - mblen < (int)__n)) break;" if (parenthesized_expression "((__n == 0xffffffff) || (iVar5 - mblen < (int)__n))" ( (binary_expression "(__n == 0xffffffff) || (iVar5 - mblen < (int)__n)" (parenthesized_expression "(__n == 0xffffffff)" ( (binary_expression "__n == 0xffffffff" identifier == number_literal) )) || (parenthesized_expression "(iVar5 - mblen < (int)__n)" ( (binary_expression "iVar5 - mblen < (int)__n" (binary_expression "iVar5 - mblen" identifier - identifier) < (cast_expression "(int)__n" ( (type_descriptor "int" primitive_type) ) identifier)) ))) )) (break_statement "break;" break ;)) (expression_statement "__dest = pcVar2 + iVar5;" (assignment_expression "__dest = pcVar2 + iVar5" identifier = (binary_expression "pcVar2 + iVar5" identifier + identifier)) ;) (expression_statement "iVar5 = iVar5 + __n;" (assignment_expression "iVar5 = iVar5 + __n" identifier = (binary_expression "iVar5 + __n" identifier + identifier)) ;) (expression_statement "memcpy(__dest,output,__n);" (call_expression "memcpy(__dest,output,__n)" identifier (argument_list "(__dest,output,__n)" ( identifier , identifier , identifier ))) ;) (expression_statement "local_40[0] = local_40[0] + 1;" (assignment_expression "local_40[0] = local_40[0] + 1" (subscript_expression "local_40[0]" identifier [ number_literal ]) = (binary_expression "local_40[0] + 1" (subscript_expression "local_40[0]" identifier [ number_literal ]) + number_literal)) ;) (expression_statement "wclen = wclen + -1;" (assignment_expression "wclen = wclen + -1" identifier = (binary_expression "wclen + -1" identifier + number_literal)) ;) }) while (parenthesized_expression "(0 < wclen)" ( (binary_expression "0 < wclen" number_literal < identifier) )) ;) (goto_statement "goto LAB_000a0edc;" goto statement_identifier ;) })) }) (else_clause "else {\n    if (codepage != 0) {\n      iVar5 = charset_from_unicode\n                        (local_40,&wclen,mbstr,mblen,codepage,(charset_state *)0x0,defchr,\n                         (uint)(defchr != (char *)0x0));\n      goto LAB_000a0edc;\n    }\n    if ((0 < mblen) && (0 < wclen)) {\n      iVar5 = 0;\n      iVar3 = wclen;\n      do {\n        iVar3 = iVar3 + -1;\n        wVar4 = *wcstr;\n        if ((uint)(wVar4 + L'\xffff2800') < 0x100) {\nLAB_000a0ec0:\n          mbstr[iVar5] = (char)wVar4;\n          iVar5 = iVar5 + 1;\n        }\n        else if (defchr != (char *)0x0) {\n          wVar4 = (wchar_t)(byte)*defchr;\n          goto LAB_000a0ec0;\n        }\n        wcstr = wcstr + 1;\n      } while (0 < iVar3 && iVar5 < mblen);\n      goto LAB_000a0edc;\n    }\n  }" else (compound_statement "{\n    if (codepage != 0) {\n      iVar5 = charset_from_unicode\n                        (local_40,&wclen,mbstr,mblen,codepage,(charset_state *)0x0,defchr,\n                         (uint)(defchr != (char *)0x0));\n      goto LAB_000a0edc;\n    }\n    if ((0 < mblen) && (0 < wclen)) {\n      iVar5 = 0;\n      iVar3 = wclen;\n      do {\n        iVar3 = iVar3 + -1;\n        wVar4 = *wcstr;\n        if ((uint)(wVar4 + L'\xffff2800') < 0x100) {\nLAB_000a0ec0:\n          mbstr[iVar5] = (char)wVar4;\n          iVar5 = iVar5 + 1;\n        }\n        else if (defchr != (char *)0x0) {\n          wVar4 = (wchar_t)(byte)*defchr;\n          goto LAB_000a0ec0;\n        }\n        wcstr = wcstr + 1;\n      } while (0 < iVar3 && iVar5 < mblen);\n      goto LAB_000a0edc;\n    }\n  }" { (if_statement "if (codepage != 0) {\n      iVar5 = charset_from_unicode\n                        (local_40,&wclen,mbstr,mblen,codepage,(charset_state *)0x0,defchr,\n                         (uint)(defchr != (char *)0x0));\n      goto LAB_000a0edc;\n    }" if (parenthesized_expression "(codepage != 0)" ( (binary_expression "codepage != 0" identifier != number_literal) )) (compound_statement "{\n      iVar5 = charset_from_unicode\n                        (local_40,&wclen,mbstr,mblen,codepage,(charset_state *)0x0,defchr,\n                         (uint)(defchr != (char *)0x0));\n      goto LAB_000a0edc;\n    }" { (expression_statement "iVar5 = charset_from_unicode\n                        (local_40,&wclen,mbstr,mblen,codepage,(charset_state *)0x0,defchr,\n                         (uint)(defchr != (char *)0x0));" (assignment_expression "iVar5 = charset_from_unicode\n                        (local_40,&wclen,mbstr,mblen,codepage,(charset_state *)0x0,defchr,\n                         (uint)(defchr != (char *)0x0))" identifier = (call_expression "charset_from_unicode\n                        (local_40,&wclen,mbstr,mblen,codepage,(charset_state *)0x0,defchr,\n                         (uint)(defchr != (char *)0x0))" identifier (argument_list "(local_40,&wclen,mbstr,mblen,codepage,(charset_state *)0x0,defchr,\n                         (uint)(defchr != (char *)0x0))" ( identifier , (pointer_expression "&wclen" & identifier) , identifier , identifier , identifier , (cast_expression "(charset_state *)0x0" ( (type_descriptor "charset_state *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal) , identifier , (call_expression "(uint)(defchr != (char *)0x0)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(defchr != (char *)0x0)" ( (binary_expression "defchr != (char *)0x0" identifier != (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ))) )))) ;) (goto_statement "goto LAB_000a0edc;" goto statement_identifier ;) })) (if_statement "if ((0 < mblen) && (0 < wclen)) {\n      iVar5 = 0;\n      iVar3 = wclen;\n      do {\n        iVar3 = iVar3 + -1;\n        wVar4 = *wcstr;\n        if ((uint)(wVar4 + L'\xffff2800') < 0x100) {\nLAB_000a0ec0:\n          mbstr[iVar5] = (char)wVar4;\n          iVar5 = iVar5 + 1;\n        }\n        else if (defchr != (char *)0x0) {\n          wVar4 = (wchar_t)(byte)*defchr;\n          goto LAB_000a0ec0;\n        }\n        wcstr = wcstr + 1;\n      } while (0 < iVar3 && iVar5 < mblen);\n      goto LAB_000a0edc;\n    }" if (parenthesized_expression "((0 < mblen) && (0 < wclen))" ( (binary_expression "(0 < mblen) && (0 < wclen)" (parenthesized_expression "(0 < mblen)" ( (binary_expression "0 < mblen" number_literal < identifier) )) && (parenthesized_expression "(0 < wclen)" ( (binary_expression "0 < wclen" number_literal < identifier) ))) )) (compound_statement "{\n      iVar5 = 0;\n      iVar3 = wclen;\n      do {\n        iVar3 = iVar3 + -1;\n        wVar4 = *wcstr;\n        if ((uint)(wVar4 + L'\xffff2800') < 0x100) {\nLAB_000a0ec0:\n          mbstr[iVar5] = (char)wVar4;\n          iVar5 = iVar5 + 1;\n        }\n        else if (defchr != (char *)0x0) {\n          wVar4 = (wchar_t)(byte)*defchr;\n          goto LAB_000a0ec0;\n        }\n        wcstr = wcstr + 1;\n      } while (0 < iVar3 && iVar5 < mblen);\n      goto LAB_000a0edc;\n    }" { (expression_statement "iVar5 = 0;" (assignment_expression "iVar5 = 0" identifier = number_literal) ;) (expression_statement "iVar3 = wclen;" (assignment_expression "iVar3 = wclen" identifier = identifier) ;) (do_statement "do {\n        iVar3 = iVar3 + -1;\n        wVar4 = *wcstr;\n        if ((uint)(wVar4 + L'\xffff2800') < 0x100) {\nLAB_000a0ec0:\n          mbstr[iVar5] = (char)wVar4;\n          iVar5 = iVar5 + 1;\n        }\n        else if (defchr != (char *)0x0) {\n          wVar4 = (wchar_t)(byte)*defchr;\n          goto LAB_000a0ec0;\n        }\n        wcstr = wcstr + 1;\n      } while (0 < iVar3 && iVar5 < mblen);" do (compound_statement "{\n        iVar3 = iVar3 + -1;\n        wVar4 = *wcstr;\n        if ((uint)(wVar4 + L'\xffff2800') < 0x100) {\nLAB_000a0ec0:\n          mbstr[iVar5] = (char)wVar4;\n          iVar5 = iVar5 + 1;\n        }\n        else if (defchr != (char *)0x0) {\n          wVar4 = (wchar_t)(byte)*defchr;\n          goto LAB_000a0ec0;\n        }\n        wcstr = wcstr + 1;\n      }" { (expression_statement "iVar3 = iVar3 + -1;" (assignment_expression "iVar3 = iVar3 + -1" identifier = (binary_expression "iVar3 + -1" identifier + number_literal)) ;) (expression_statement "wVar4 = *wcstr;" (assignment_expression "wVar4 = *wcstr" identifier = (pointer_expression "*wcstr" * identifier)) ;) (if_statement "if ((uint)(wVar4 + L'\xffff2800') < 0x100) {\nLAB_000a0ec0:\n          mbstr[iVar5] = (char)wVar4;\n          iVar5 = iVar5 + 1;\n        }\n        else if (defchr != (char *)0x0) {\n          wVar4 = (wchar_t)(byte)*defchr;\n          goto LAB_000a0ec0;\n        }" if (parenthesized_expression "((uint)(wVar4 + L'\xffff2800') < 0x100)" ( (binary_expression "(uint)(wVar4 + L'\xffff2800') < 0x100" (call_expression "(uint)(wVar4 + L'\xffff2800')" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(wVar4 + L'\xffff2800')" ( (binary_expression "wVar4 + L'\xffff2800'" identifier + (char_literal "L'\xffff2800'" L' escape_sequence character character character character ')) ))) < number_literal) )) (compound_statement "{\nLAB_000a0ec0:\n          mbstr[iVar5] = (char)wVar4;\n          iVar5 = iVar5 + 1;\n        }" { (labeled_statement "LAB_000a0ec0:\n          mbstr[iVar5] = (char)wVar4;" statement_identifier : (expression_statement "mbstr[iVar5] = (char)wVar4;" (assignment_expression "mbstr[iVar5] = (char)wVar4" (subscript_expression "mbstr[iVar5]" identifier [ identifier ]) = (cast_expression "(char)wVar4" ( (type_descriptor "char" primitive_type) ) identifier)) ;)) (expression_statement "iVar5 = iVar5 + 1;" (assignment_expression "iVar5 = iVar5 + 1" identifier = (binary_expression "iVar5 + 1" identifier + number_literal)) ;) }) (else_clause "else if (defchr != (char *)0x0) {\n          wVar4 = (wchar_t)(byte)*defchr;\n          goto LAB_000a0ec0;\n        }" else (if_statement "if (defchr != (char *)0x0) {\n          wVar4 = (wchar_t)(byte)*defchr;\n          goto LAB_000a0ec0;\n        }" if (parenthesized_expression "(defchr != (char *)0x0)" ( (binary_expression "defchr != (char *)0x0" identifier != (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n          wVar4 = (wchar_t)(byte)*defchr;\n          goto LAB_000a0ec0;\n        }" { (expression_statement "wVar4 = (wchar_t)(byte)*defchr;" (assignment_expression "wVar4 = (wchar_t)(byte)*defchr" identifier = (binary_expression "(wchar_t)(byte)*defchr" (call_expression "(wchar_t)(byte)" (parenthesized_expression "(wchar_t)" ( identifier )) (argument_list "(byte)" ( identifier ))) * identifier)) ;) (goto_statement "goto LAB_000a0ec0;" goto statement_identifier ;) })))) (expression_statement "wcstr = wcstr + 1;" (assignment_expression "wcstr = wcstr + 1" identifier = (binary_expression "wcstr + 1" identifier + number_literal)) ;) }) while (parenthesized_expression "(0 < iVar3 && iVar5 < mblen)" ( (binary_expression "0 < iVar3 && iVar5 < mblen" (binary_expression "0 < iVar3" number_literal < identifier) && (binary_expression "iVar5 < mblen" identifier < identifier)) )) ;) (goto_statement "goto LAB_000a0edc;" goto statement_identifier ;) })) }))) (expression_statement "iVar5 = 0;" (assignment_expression "iVar5 = 0" identifier = number_literal) ;) (labeled_statement "LAB_000a0edc:\n  if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail_local();\n  }" statement_identifier : (if_statement "if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail_local();\n  }" if (parenthesized_expression "(iVar1 != *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "iVar1 != *(int *)(in_GS_OFFSET + 0x14)" identifier != (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail_local();\n  }" { comment (expression_statement "__stack_chk_fail_local();" (call_expression "__stack_chk_fail_local()" identifier (argument_list "()" ( ))) ;) }))) (return_statement "return iVar5;" return identifier ;) })))
(translation_unit "int FUN_000a0e30(int param_1,undefined4 param_2,wchar_t *param_3,int param_4,int param_5,int param_6\n                ,byte *param_7,undefined4 *param_8)\n\n{\n  int iVar1;\n  void *__dest;\n  size_t __n;\n  wchar_t wVar2;\n  int iVar3;\n  int in_GS_OFFSET;\n  wchar_t *local_40 [2];\n  mbstate_t local_38;\n  char local_30 [16];\n  int local_20;\n  undefined4 uStack_14;\n  \n  iVar1 = param_5;\n  uStack_14 = 0xa0e39;\n  local_40[0] = param_3;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if (param_8 != (undefined4 *)0x0) {\n    *param_8 = 0;\n  }\n  if (param_1 == 0xffff) {\n    local_38.__count = 0;\n    local_38.__value.__wch = 0;\n    if (0 < param_4) {\n      iVar3 = 0;\n      do {\n        __n = wcrtomb(local_30,*local_40[0],&local_38);\n        if ((__n == 0xffffffff) || (iVar3 - param_6 < (int)__n)) break;\n        __dest = (void *)(iVar1 + iVar3);\n        iVar3 = iVar3 + __n;\n        memcpy(__dest,local_30,__n);\n        local_40[0] = local_40[0] + 1;\n        param_4 = param_4 + -1;\n      } while (0 < param_4);\n      goto LAB_000a0edc;\n    }\n  }\n  else {\n    if (param_1 != 0) {\n      iVar3 = FUN_0001cbe0(local_40,&param_4,param_5,param_6,param_1,0,param_7,\n                           param_7 != (byte *)0x0);\n      goto LAB_000a0edc;\n    }\n    if ((0 < param_6) && (0 < param_4)) {\n      iVar3 = 0;\n      iVar1 = param_4;\n      do {\n        iVar1 = iVar1 + -1;\n        wVar2 = *param_3;\n        if ((uint)(wVar2 + L'\xffff2800') < 0x100) {\nLAB_000a0ec0:\n          *(char *)(param_5 + iVar3) = (char)wVar2;\n          iVar3 = iVar3 + 1;\n        }\n        else if (param_7 != (byte *)0x0) {\n          wVar2 = (wchar_t)*param_7;\n          goto LAB_000a0ec0;\n        }\n        param_3 = param_3 + 1;\n      } while (0 < iVar1 && iVar3 < param_6);\n      goto LAB_000a0edc;\n    }\n  }\n  iVar3 = 0;\nLAB_000a0edc:\n  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_000a39d0();\n  }\n  return iVar3;\n}\n\n" (function_definition "int FUN_000a0e30(int param_1,undefined4 param_2,wchar_t *param_3,int param_4,int param_5,int param_6\n                ,byte *param_7,undefined4 *param_8)\n\n{\n  int iVar1;\n  void *__dest;\n  size_t __n;\n  wchar_t wVar2;\n  int iVar3;\n  int in_GS_OFFSET;\n  wchar_t *local_40 [2];\n  mbstate_t local_38;\n  char local_30 [16];\n  int local_20;\n  undefined4 uStack_14;\n  \n  iVar1 = param_5;\n  uStack_14 = 0xa0e39;\n  local_40[0] = param_3;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if (param_8 != (undefined4 *)0x0) {\n    *param_8 = 0;\n  }\n  if (param_1 == 0xffff) {\n    local_38.__count = 0;\n    local_38.__value.__wch = 0;\n    if (0 < param_4) {\n      iVar3 = 0;\n      do {\n        __n = wcrtomb(local_30,*local_40[0],&local_38);\n        if ((__n == 0xffffffff) || (iVar3 - param_6 < (int)__n)) break;\n        __dest = (void *)(iVar1 + iVar3);\n        iVar3 = iVar3 + __n;\n        memcpy(__dest,local_30,__n);\n        local_40[0] = local_40[0] + 1;\n        param_4 = param_4 + -1;\n      } while (0 < param_4);\n      goto LAB_000a0edc;\n    }\n  }\n  else {\n    if (param_1 != 0) {\n      iVar3 = FUN_0001cbe0(local_40,&param_4,param_5,param_6,param_1,0,param_7,\n                           param_7 != (byte *)0x0);\n      goto LAB_000a0edc;\n    }\n    if ((0 < param_6) && (0 < param_4)) {\n      iVar3 = 0;\n      iVar1 = param_4;\n      do {\n        iVar1 = iVar1 + -1;\n        wVar2 = *param_3;\n        if ((uint)(wVar2 + L'\xffff2800') < 0x100) {\nLAB_000a0ec0:\n          *(char *)(param_5 + iVar3) = (char)wVar2;\n          iVar3 = iVar3 + 1;\n        }\n        else if (param_7 != (byte *)0x0) {\n          wVar2 = (wchar_t)*param_7;\n          goto LAB_000a0ec0;\n        }\n        param_3 = param_3 + 1;\n      } while (0 < iVar1 && iVar3 < param_6);\n      goto LAB_000a0edc;\n    }\n  }\n  iVar3 = 0;\nLAB_000a0edc:\n  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_000a39d0();\n  }\n  return iVar3;\n}" primitive_type (function_declarator "FUN_000a0e30(int param_1,undefined4 param_2,wchar_t *param_3,int param_4,int param_5,int param_6\n                ,byte *param_7,undefined4 *param_8)" identifier (parameter_list "(int param_1,undefined4 param_2,wchar_t *param_3,int param_4,int param_5,int param_6\n                ,byte *param_7,undefined4 *param_8)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "undefined4 param_2" type_identifier identifier) , (parameter_declaration "wchar_t *param_3" type_identifier (pointer_declarator "*param_3" * identifier)) , (parameter_declaration "int param_4" primitive_type identifier) , (parameter_declaration "int param_5" primitive_type identifier) , (parameter_declaration "int param_6" primitive_type identifier) , (parameter_declaration "byte *param_7" type_identifier (pointer_declarator "*param_7" * identifier)) , (parameter_declaration "undefined4 *param_8" type_identifier (pointer_declarator "*param_8" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  void *__dest;\n  size_t __n;\n  wchar_t wVar2;\n  int iVar3;\n  int in_GS_OFFSET;\n  wchar_t *local_40 [2];\n  mbstate_t local_38;\n  char local_30 [16];\n  int local_20;\n  undefined4 uStack_14;\n  \n  iVar1 = param_5;\n  uStack_14 = 0xa0e39;\n  local_40[0] = param_3;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if (param_8 != (undefined4 *)0x0) {\n    *param_8 = 0;\n  }\n  if (param_1 == 0xffff) {\n    local_38.__count = 0;\n    local_38.__value.__wch = 0;\n    if (0 < param_4) {\n      iVar3 = 0;\n      do {\n        __n = wcrtomb(local_30,*local_40[0],&local_38);\n        if ((__n == 0xffffffff) || (iVar3 - param_6 < (int)__n)) break;\n        __dest = (void *)(iVar1 + iVar3);\n        iVar3 = iVar3 + __n;\n        memcpy(__dest,local_30,__n);\n        local_40[0] = local_40[0] + 1;\n        param_4 = param_4 + -1;\n      } while (0 < param_4);\n      goto LAB_000a0edc;\n    }\n  }\n  else {\n    if (param_1 != 0) {\n      iVar3 = FUN_0001cbe0(local_40,&param_4,param_5,param_6,param_1,0,param_7,\n                           param_7 != (byte *)0x0);\n      goto LAB_000a0edc;\n    }\n    if ((0 < param_6) && (0 < param_4)) {\n      iVar3 = 0;\n      iVar1 = param_4;\n      do {\n        iVar1 = iVar1 + -1;\n        wVar2 = *param_3;\n        if ((uint)(wVar2 + L'\xffff2800') < 0x100) {\nLAB_000a0ec0:\n          *(char *)(param_5 + iVar3) = (char)wVar2;\n          iVar3 = iVar3 + 1;\n        }\n        else if (param_7 != (byte *)0x0) {\n          wVar2 = (wchar_t)*param_7;\n          goto LAB_000a0ec0;\n        }\n        param_3 = param_3 + 1;\n      } while (0 < iVar1 && iVar3 < param_6);\n      goto LAB_000a0edc;\n    }\n  }\n  iVar3 = 0;\nLAB_000a0edc:\n  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_000a39d0();\n  }\n  return iVar3;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "void *__dest;" primitive_type (pointer_declarator "*__dest" * identifier) ;) (declaration "size_t __n;" primitive_type identifier ;) (declaration "wchar_t wVar2;" type_identifier identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "wchar_t *local_40 [2];" type_identifier (pointer_declarator "*local_40 [2]" * (array_declarator "local_40 [2]" identifier [ number_literal ])) ;) (declaration "mbstate_t local_38;" type_identifier identifier ;) (declaration "char local_30 [16];" primitive_type (array_declarator "local_30 [16]" identifier [ number_literal ]) ;) (declaration "int local_20;" primitive_type identifier ;) (declaration "undefined4 uStack_14;" type_identifier identifier ;) (expression_statement "iVar1 = param_5;" (assignment_expression "iVar1 = param_5" identifier = identifier) ;) (expression_statement "uStack_14 = 0xa0e39;" (assignment_expression "uStack_14 = 0xa0e39" identifier = number_literal) ;) (expression_statement "local_40[0] = param_3;" (assignment_expression "local_40[0] = param_3" (subscript_expression "local_40[0]" identifier [ number_literal ]) = identifier) ;) (expression_statement "local_20 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_20 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (if_statement "if (param_8 != (undefined4 *)0x0) {\n    *param_8 = 0;\n  }" if (parenthesized_expression "(param_8 != (undefined4 *)0x0)" ( (binary_expression "param_8 != (undefined4 *)0x0" identifier != (cast_expression "(undefined4 *)0x0" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    *param_8 = 0;\n  }" { (expression_statement "*param_8 = 0;" (assignment_expression "*param_8 = 0" (pointer_expression "*param_8" * identifier) = number_literal) ;) })) (if_statement "if (param_1 == 0xffff) {\n    local_38.__count = 0;\n    local_38.__value.__wch = 0;\n    if (0 < param_4) {\n      iVar3 = 0;\n      do {\n        __n = wcrtomb(local_30,*local_40[0],&local_38);\n        if ((__n == 0xffffffff) || (iVar3 - param_6 < (int)__n)) break;\n        __dest = (void *)(iVar1 + iVar3);\n        iVar3 = iVar3 + __n;\n        memcpy(__dest,local_30,__n);\n        local_40[0] = local_40[0] + 1;\n        param_4 = param_4 + -1;\n      } while (0 < param_4);\n      goto LAB_000a0edc;\n    }\n  }\n  else {\n    if (param_1 != 0) {\n      iVar3 = FUN_0001cbe0(local_40,&param_4,param_5,param_6,param_1,0,param_7,\n                           param_7 != (byte *)0x0);\n      goto LAB_000a0edc;\n    }\n    if ((0 < param_6) && (0 < param_4)) {\n      iVar3 = 0;\n      iVar1 = param_4;\n      do {\n        iVar1 = iVar1 + -1;\n        wVar2 = *param_3;\n        if ((uint)(wVar2 + L'\xffff2800') < 0x100) {\nLAB_000a0ec0:\n          *(char *)(param_5 + iVar3) = (char)wVar2;\n          iVar3 = iVar3 + 1;\n        }\n        else if (param_7 != (byte *)0x0) {\n          wVar2 = (wchar_t)*param_7;\n          goto LAB_000a0ec0;\n        }\n        param_3 = param_3 + 1;\n      } while (0 < iVar1 && iVar3 < param_6);\n      goto LAB_000a0edc;\n    }\n  }" if (parenthesized_expression "(param_1 == 0xffff)" ( (binary_expression "param_1 == 0xffff" identifier == number_literal) )) (compound_statement "{\n    local_38.__count = 0;\n    local_38.__value.__wch = 0;\n    if (0 < param_4) {\n      iVar3 = 0;\n      do {\n        __n = wcrtomb(local_30,*local_40[0],&local_38);\n        if ((__n == 0xffffffff) || (iVar3 - param_6 < (int)__n)) break;\n        __dest = (void *)(iVar1 + iVar3);\n        iVar3 = iVar3 + __n;\n        memcpy(__dest,local_30,__n);\n        local_40[0] = local_40[0] + 1;\n        param_4 = param_4 + -1;\n      } while (0 < param_4);\n      goto LAB_000a0edc;\n    }\n  }" { (expression_statement "local_38.__count = 0;" (assignment_expression "local_38.__count = 0" (field_expression "local_38.__count" identifier . field_identifier) = number_literal) ;) (expression_statement "local_38.__value.__wch = 0;" (assignment_expression "local_38.__value.__wch = 0" (field_expression "local_38.__value.__wch" (field_expression "local_38.__value" identifier . field_identifier) . field_identifier) = number_literal) ;) (if_statement "if (0 < param_4) {\n      iVar3 = 0;\n      do {\n        __n = wcrtomb(local_30,*local_40[0],&local_38);\n        if ((__n == 0xffffffff) || (iVar3 - param_6 < (int)__n)) break;\n        __dest = (void *)(iVar1 + iVar3);\n        iVar3 = iVar3 + __n;\n        memcpy(__dest,local_30,__n);\n        local_40[0] = local_40[0] + 1;\n        param_4 = param_4 + -1;\n      } while (0 < param_4);\n      goto LAB_000a0edc;\n    }" if (parenthesized_expression "(0 < param_4)" ( (binary_expression "0 < param_4" number_literal < identifier) )) (compound_statement "{\n      iVar3 = 0;\n      do {\n        __n = wcrtomb(local_30,*local_40[0],&local_38);\n        if ((__n == 0xffffffff) || (iVar3 - param_6 < (int)__n)) break;\n        __dest = (void *)(iVar1 + iVar3);\n        iVar3 = iVar3 + __n;\n        memcpy(__dest,local_30,__n);\n        local_40[0] = local_40[0] + 1;\n        param_4 = param_4 + -1;\n      } while (0 < param_4);\n      goto LAB_000a0edc;\n    }" { (expression_statement "iVar3 = 0;" (assignment_expression "iVar3 = 0" identifier = number_literal) ;) (do_statement "do {\n        __n = wcrtomb(local_30,*local_40[0],&local_38);\n        if ((__n == 0xffffffff) || (iVar3 - param_6 < (int)__n)) break;\n        __dest = (void *)(iVar1 + iVar3);\n        iVar3 = iVar3 + __n;\n        memcpy(__dest,local_30,__n);\n        local_40[0] = local_40[0] + 1;\n        param_4 = param_4 + -1;\n      } while (0 < param_4);" do (compound_statement "{\n        __n = wcrtomb(local_30,*local_40[0],&local_38);\n        if ((__n == 0xffffffff) || (iVar3 - param_6 < (int)__n)) break;\n        __dest = (void *)(iVar1 + iVar3);\n        iVar3 = iVar3 + __n;\n        memcpy(__dest,local_30,__n);\n        local_40[0] = local_40[0] + 1;\n        param_4 = param_4 + -1;\n      }" { (expression_statement "__n = wcrtomb(local_30,*local_40[0],&local_38);" (assignment_expression "__n = wcrtomb(local_30,*local_40[0],&local_38)" identifier = (call_expression "wcrtomb(local_30,*local_40[0],&local_38)" identifier (argument_list "(local_30,*local_40[0],&local_38)" ( identifier , (pointer_expression "*local_40[0]" * (subscript_expression "local_40[0]" identifier [ number_literal ])) , (pointer_expression "&local_38" & identifier) )))) ;) (if_statement "if ((__n == 0xffffffff) || (iVar3 - param_6 < (int)__n)) break;" if (parenthesized_expression "((__n == 0xffffffff) || (iVar3 - param_6 < (int)__n))" ( (binary_expression "(__n == 0xffffffff) || (iVar3 - param_6 < (int)__n)" (parenthesized_expression "(__n == 0xffffffff)" ( (binary_expression "__n == 0xffffffff" identifier == number_literal) )) || (parenthesized_expression "(iVar3 - param_6 < (int)__n)" ( (binary_expression "iVar3 - param_6 < (int)__n" (binary_expression "iVar3 - param_6" identifier - identifier) < (cast_expression "(int)__n" ( (type_descriptor "int" primitive_type) ) identifier)) ))) )) (break_statement "break;" break ;)) (expression_statement "__dest = (void *)(iVar1 + iVar3);" (assignment_expression "__dest = (void *)(iVar1 + iVar3)" identifier = (cast_expression "(void *)(iVar1 + iVar3)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + iVar3)" ( (binary_expression "iVar1 + iVar3" identifier + identifier) )))) ;) (expression_statement "iVar3 = iVar3 + __n;" (assignment_expression "iVar3 = iVar3 + __n" identifier = (binary_expression "iVar3 + __n" identifier + identifier)) ;) (expression_statement "memcpy(__dest,local_30,__n);" (call_expression "memcpy(__dest,local_30,__n)" identifier (argument_list "(__dest,local_30,__n)" ( identifier , identifier , identifier ))) ;) (expression_statement "local_40[0] = local_40[0] + 1;" (assignment_expression "local_40[0] = local_40[0] + 1" (subscript_expression "local_40[0]" identifier [ number_literal ]) = (binary_expression "local_40[0] + 1" (subscript_expression "local_40[0]" identifier [ number_literal ]) + number_literal)) ;) (expression_statement "param_4 = param_4 + -1;" (assignment_expression "param_4 = param_4 + -1" identifier = (binary_expression "param_4 + -1" identifier + number_literal)) ;) }) while (parenthesized_expression "(0 < param_4)" ( (binary_expression "0 < param_4" number_literal < identifier) )) ;) (goto_statement "goto LAB_000a0edc;" goto statement_identifier ;) })) }) (else_clause "else {\n    if (param_1 != 0) {\n      iVar3 = FUN_0001cbe0(local_40,&param_4,param_5,param_6,param_1,0,param_7,\n                           param_7 != (byte *)0x0);\n      goto LAB_000a0edc;\n    }\n    if ((0 < param_6) && (0 < param_4)) {\n      iVar3 = 0;\n      iVar1 = param_4;\n      do {\n        iVar1 = iVar1 + -1;\n        wVar2 = *param_3;\n        if ((uint)(wVar2 + L'\xffff2800') < 0x100) {\nLAB_000a0ec0:\n          *(char *)(param_5 + iVar3) = (char)wVar2;\n          iVar3 = iVar3 + 1;\n        }\n        else if (param_7 != (byte *)0x0) {\n          wVar2 = (wchar_t)*param_7;\n          goto LAB_000a0ec0;\n        }\n        param_3 = param_3 + 1;\n      } while (0 < iVar1 && iVar3 < param_6);\n      goto LAB_000a0edc;\n    }\n  }" else (compound_statement "{\n    if (param_1 != 0) {\n      iVar3 = FUN_0001cbe0(local_40,&param_4,param_5,param_6,param_1,0,param_7,\n                           param_7 != (byte *)0x0);\n      goto LAB_000a0edc;\n    }\n    if ((0 < param_6) && (0 < param_4)) {\n      iVar3 = 0;\n      iVar1 = param_4;\n      do {\n        iVar1 = iVar1 + -1;\n        wVar2 = *param_3;\n        if ((uint)(wVar2 + L'\xffff2800') < 0x100) {\nLAB_000a0ec0:\n          *(char *)(param_5 + iVar3) = (char)wVar2;\n          iVar3 = iVar3 + 1;\n        }\n        else if (param_7 != (byte *)0x0) {\n          wVar2 = (wchar_t)*param_7;\n          goto LAB_000a0ec0;\n        }\n        param_3 = param_3 + 1;\n      } while (0 < iVar1 && iVar3 < param_6);\n      goto LAB_000a0edc;\n    }\n  }" { (if_statement "if (param_1 != 0) {\n      iVar3 = FUN_0001cbe0(local_40,&param_4,param_5,param_6,param_1,0,param_7,\n                           param_7 != (byte *)0x0);\n      goto LAB_000a0edc;\n    }" if (parenthesized_expression "(param_1 != 0)" ( (binary_expression "param_1 != 0" identifier != number_literal) )) (compound_statement "{\n      iVar3 = FUN_0001cbe0(local_40,&param_4,param_5,param_6,param_1,0,param_7,\n                           param_7 != (byte *)0x0);\n      goto LAB_000a0edc;\n    }" { (expression_statement "iVar3 = FUN_0001cbe0(local_40,&param_4,param_5,param_6,param_1,0,param_7,\n                           param_7 != (byte *)0x0);" (assignment_expression "iVar3 = FUN_0001cbe0(local_40,&param_4,param_5,param_6,param_1,0,param_7,\n                           param_7 != (byte *)0x0)" identifier = (call_expression "FUN_0001cbe0(local_40,&param_4,param_5,param_6,param_1,0,param_7,\n                           param_7 != (byte *)0x0)" identifier (argument_list "(local_40,&param_4,param_5,param_6,param_1,0,param_7,\n                           param_7 != (byte *)0x0)" ( identifier , (pointer_expression "&param_4" & identifier) , identifier , identifier , identifier , number_literal , identifier , (binary_expression "param_7 != (byte *)0x0" identifier != (cast_expression "(byte *)0x0" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )))) ;) (goto_statement "goto LAB_000a0edc;" goto statement_identifier ;) })) (if_statement "if ((0 < param_6) && (0 < param_4)) {\n      iVar3 = 0;\n      iVar1 = param_4;\n      do {\n        iVar1 = iVar1 + -1;\n        wVar2 = *param_3;\n        if ((uint)(wVar2 + L'\xffff2800') < 0x100) {\nLAB_000a0ec0:\n          *(char *)(param_5 + iVar3) = (char)wVar2;\n          iVar3 = iVar3 + 1;\n        }\n        else if (param_7 != (byte *)0x0) {\n          wVar2 = (wchar_t)*param_7;\n          goto LAB_000a0ec0;\n        }\n        param_3 = param_3 + 1;\n      } while (0 < iVar1 && iVar3 < param_6);\n      goto LAB_000a0edc;\n    }" if (parenthesized_expression "((0 < param_6) && (0 < param_4))" ( (binary_expression "(0 < param_6) && (0 < param_4)" (parenthesized_expression "(0 < param_6)" ( (binary_expression "0 < param_6" number_literal < identifier) )) && (parenthesized_expression "(0 < param_4)" ( (binary_expression "0 < param_4" number_literal < identifier) ))) )) (compound_statement "{\n      iVar3 = 0;\n      iVar1 = param_4;\n      do {\n        iVar1 = iVar1 + -1;\n        wVar2 = *param_3;\n        if ((uint)(wVar2 + L'\xffff2800') < 0x100) {\nLAB_000a0ec0:\n          *(char *)(param_5 + iVar3) = (char)wVar2;\n          iVar3 = iVar3 + 1;\n        }\n        else if (param_7 != (byte *)0x0) {\n          wVar2 = (wchar_t)*param_7;\n          goto LAB_000a0ec0;\n        }\n        param_3 = param_3 + 1;\n      } while (0 < iVar1 && iVar3 < param_6);\n      goto LAB_000a0edc;\n    }" { (expression_statement "iVar3 = 0;" (assignment_expression "iVar3 = 0" identifier = number_literal) ;) (expression_statement "iVar1 = param_4;" (assignment_expression "iVar1 = param_4" identifier = identifier) ;) (do_statement "do {\n        iVar1 = iVar1 + -1;\n        wVar2 = *param_3;\n        if ((uint)(wVar2 + L'\xffff2800') < 0x100) {\nLAB_000a0ec0:\n          *(char *)(param_5 + iVar3) = (char)wVar2;\n          iVar3 = iVar3 + 1;\n        }\n        else if (param_7 != (byte *)0x0) {\n          wVar2 = (wchar_t)*param_7;\n          goto LAB_000a0ec0;\n        }\n        param_3 = param_3 + 1;\n      } while (0 < iVar1 && iVar3 < param_6);" do (compound_statement "{\n        iVar1 = iVar1 + -1;\n        wVar2 = *param_3;\n        if ((uint)(wVar2 + L'\xffff2800') < 0x100) {\nLAB_000a0ec0:\n          *(char *)(param_5 + iVar3) = (char)wVar2;\n          iVar3 = iVar3 + 1;\n        }\n        else if (param_7 != (byte *)0x0) {\n          wVar2 = (wchar_t)*param_7;\n          goto LAB_000a0ec0;\n        }\n        param_3 = param_3 + 1;\n      }" { (expression_statement "iVar1 = iVar1 + -1;" (assignment_expression "iVar1 = iVar1 + -1" identifier = (binary_expression "iVar1 + -1" identifier + number_literal)) ;) (expression_statement "wVar2 = *param_3;" (assignment_expression "wVar2 = *param_3" identifier = (pointer_expression "*param_3" * identifier)) ;) (if_statement "if ((uint)(wVar2 + L'\xffff2800') < 0x100) {\nLAB_000a0ec0:\n          *(char *)(param_5 + iVar3) = (char)wVar2;\n          iVar3 = iVar3 + 1;\n        }\n        else if (param_7 != (byte *)0x0) {\n          wVar2 = (wchar_t)*param_7;\n          goto LAB_000a0ec0;\n        }" if (parenthesized_expression "((uint)(wVar2 + L'\xffff2800') < 0x100)" ( (binary_expression "(uint)(wVar2 + L'\xffff2800') < 0x100" (call_expression "(uint)(wVar2 + L'\xffff2800')" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(wVar2 + L'\xffff2800')" ( (binary_expression "wVar2 + L'\xffff2800'" identifier + (char_literal "L'\xffff2800'" L' escape_sequence character character character character ')) ))) < number_literal) )) (compound_statement "{\nLAB_000a0ec0:\n          *(char *)(param_5 + iVar3) = (char)wVar2;\n          iVar3 = iVar3 + 1;\n        }" { (labeled_statement "LAB_000a0ec0:\n          *(char *)(param_5 + iVar3) = (char)wVar2;" statement_identifier : (expression_statement "*(char *)(param_5 + iVar3) = (char)wVar2;" (assignment_expression "*(char *)(param_5 + iVar3) = (char)wVar2" (pointer_expression "*(char *)(param_5 + iVar3)" * (cast_expression "(char *)(param_5 + iVar3)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_5 + iVar3)" ( (binary_expression "param_5 + iVar3" identifier + identifier) )))) = (cast_expression "(char)wVar2" ( (type_descriptor "char" primitive_type) ) identifier)) ;)) (expression_statement "iVar3 = iVar3 + 1;" (assignment_expression "iVar3 = iVar3 + 1" identifier = (binary_expression "iVar3 + 1" identifier + number_literal)) ;) }) (else_clause "else if (param_7 != (byte *)0x0) {\n          wVar2 = (wchar_t)*param_7;\n          goto LAB_000a0ec0;\n        }" else (if_statement "if (param_7 != (byte *)0x0) {\n          wVar2 = (wchar_t)*param_7;\n          goto LAB_000a0ec0;\n        }" if (parenthesized_expression "(param_7 != (byte *)0x0)" ( (binary_expression "param_7 != (byte *)0x0" identifier != (cast_expression "(byte *)0x0" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n          wVar2 = (wchar_t)*param_7;\n          goto LAB_000a0ec0;\n        }" { (expression_statement "wVar2 = (wchar_t)*param_7;" (assignment_expression "wVar2 = (wchar_t)*param_7" identifier = (binary_expression "(wchar_t)*param_7" (parenthesized_expression "(wchar_t)" ( identifier )) * identifier)) ;) (goto_statement "goto LAB_000a0ec0;" goto statement_identifier ;) })))) (expression_statement "param_3 = param_3 + 1;" (assignment_expression "param_3 = param_3 + 1" identifier = (binary_expression "param_3 + 1" identifier + number_literal)) ;) }) while (parenthesized_expression "(0 < iVar1 && iVar3 < param_6)" ( (binary_expression "0 < iVar1 && iVar3 < param_6" (binary_expression "0 < iVar1" number_literal < identifier) && (binary_expression "iVar3 < param_6" identifier < identifier)) )) ;) (goto_statement "goto LAB_000a0edc;" goto statement_identifier ;) })) }))) (expression_statement "iVar3 = 0;" (assignment_expression "iVar3 = 0" identifier = number_literal) ;) (labeled_statement "LAB_000a0edc:\n  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_000a39d0();\n  }" statement_identifier : (if_statement "if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_000a39d0();\n  }" if (parenthesized_expression "(local_20 != *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "local_20 != *(int *)(in_GS_OFFSET + 0x14)" identifier != (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n                    \n    FUN_000a39d0();\n  }" { (expression_statement "FUN_000a39d0();" (call_expression "FUN_000a39d0()" identifier (argument_list "()" ( ))) ;) }))) (return_statement "return iVar3;" return identifier ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (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 IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * (array_declarator IDENT [ LIT ])) ;) (declaration TYPE IDENT ;) (declaration TYPE (array_declarator IDENT [ LIT ]) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (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 (pointer_expression * IDENT) = LIT) ;) })) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression (field_expression IDENT . field_identifier) = LIT) ;) (expression_statement (assignment_expression (field_expression (field_expression IDENT . field_identifier) . field_identifier) = LIT) ;) (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , (pointer_expression * (subscript_expression IDENT [ LIT ])) , (pointer_expression & IDENT) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT == LIT) )) || (parenthesized_expression ( (binary_expression (binary_expression IDENT - IDENT) < (cast_expression ( (type_descriptor TYPE) ) IDENT)) ))) )) (break_statement break ;)) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + IDENT) )))) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + IDENT)) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT ))) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (binary_expression (subscript_expression IDENT [ LIT ]) + LIT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) }) while (parenthesized_expression ( (binary_expression LIT < IDENT) )) ;) (goto_statement goto statement_identifier ;) })) }) (else_clause else (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , (pointer_expression & IDENT) , IDENT , IDENT , IDENT , LIT , IDENT , (binary_expression IDENT != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )))) ;) (goto_statement goto statement_identifier ;) })) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression LIT < IDENT) )) && (parenthesized_expression ( (binary_expression LIT < IDENT) ))) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression (call_expression (parenthesized_expression ( IDENT )) (argument_list ( (binary_expression IDENT + (char_literal L' escape_sequence character character character character ')) ))) < LIT) )) (compound_statement { (labeled_statement statement_identifier : (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + IDENT) )))) = (cast_expression ( (type_descriptor TYPE) ) IDENT)) ;)) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) }) (else_clause else (if_statement if (parenthesized_expression ( (binary_expression IDENT != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression (parenthesized_expression ( IDENT )) * IDENT)) ;) (goto_statement goto statement_identifier ;) })))) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) }) while (parenthesized_expression ( (binary_expression (binary_expression LIT < IDENT) && (binary_expression IDENT < IDENT)) )) ;) (goto_statement goto statement_identifier ;) })) }))) (expression_statement (assignment_expression IDENT = LIT) ;) (labeled_statement statement_identifier : (if_statement if (parenthesized_expression ( (binary_expression IDENT != (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( ))) ;) }))) (return_statement return IDENT ;) })))
(function_definition "int FUN_000a0e30(int param_1,undefined4 param_2,wchar_t *param_3,int param_4,int param_5,int param_6\n                ,byte *param_7,undefined4 *param_8)\n\n{\n  int iVar1;\n  void *__dest;\n  size_t __n;\n  wchar_t wVar2;\n  int iVar3;\n  int in_GS_OFFSET;\n  wchar_t *local_40 [2];\n  mbstate_t local_38;\n  char local_30 [16];\n  int local_20;\n  undefined4 uStack_14;\n  \n  iVar1 = param_5;\n  uStack_14 = 0xa0e39;\n  local_40[0] = param_3;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if (param_8 != (undefined4 *)0x0) {\n    *param_8 = 0;\n  }\n  if (param_1 == 0xffff) {\n    local_38.__count = 0;\n    local_38.__value.__wch = 0;\n    if (0 < param_4) {\n      iVar3 = 0;\n      do {\n        __n = wcrtomb(local_30,*local_40[0],&local_38);\n        if ((__n == 0xffffffff) || (iVar3 - param_6 < (int)__n)) break;\n        __dest = (void *)(iVar1 + iVar3);\n        iVar3 = iVar3 + __n;\n        memcpy(__dest,local_30,__n);\n        local_40[0] = local_40[0] + 1;\n        param_4 = param_4 + -1;\n      } while (0 < param_4);\n      goto LAB_000a0edc;\n    }\n  }\n  else {\n    if (param_1 != 0) {\n      iVar3 = FUN_0001cbe0(local_40,&param_4,param_5,param_6,param_1,0,param_7,\n                           param_7 != (byte *)0x0);\n      goto LAB_000a0edc;\n    }\n    if ((0 < param_6) && (0 < param_4)) {\n      iVar3 = 0;\n      iVar1 = param_4;\n      do {\n        iVar1 = iVar1 + -1;\n        wVar2 = *param_3;\n        if ((uint)(wVar2 + L'\xffff2800') < 0x100) {\nLAB_000a0ec0:\n          *(char *)(param_5 + iVar3) = (char)wVar2;\n          iVar3 = iVar3 + 1;\n        }\n        else if (param_7 != (byte *)0x0) {\n          wVar2 = (wchar_t)*param_7;\n          goto LAB_000a0ec0;\n        }\n        param_3 = param_3 + 1;\n      } while (0 < iVar1 && iVar3 < param_6);\n      goto LAB_000a0edc;\n    }\n  }\n  iVar3 = 0;\nLAB_000a0edc:\n  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_000a39d0();\n  }\n  return iVar3;\n}" (primitive_type "int") (function_declarator "FUN_000a0e30(int param_1,undefined4 param_2,wchar_t *param_3,int param_4,int param_5,int param_6\n                ,byte *param_7,undefined4 *param_8)" (identifier "FUN_000a0e30") (parameter_list "(int param_1,undefined4 param_2,wchar_t *param_3,int param_4,int param_5,int param_6\n                ,byte *param_7,undefined4 *param_8)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) (, ",") (parameter_declaration "undefined4 param_2" (type_identifier "undefined4") (identifier "param_2")) (, ",") (parameter_declaration "wchar_t *param_3" (type_identifier "wchar_t") (pointer_declarator "*param_3" (* "*") (identifier "param_3"))) (, ",") (parameter_declaration "int param_4" (primitive_type "int") (identifier "param_4")) (, ",") (parameter_declaration "int param_5" (primitive_type "int") (identifier "param_5")) (, ",") (parameter_declaration "int param_6" (primitive_type "int") (identifier "param_6")) (, ",") (parameter_declaration "byte *param_7" (type_identifier "byte") (pointer_declarator "*param_7" (* "*") (identifier "param_7"))) (, ",") (parameter_declaration "undefined4 *param_8" (type_identifier "undefined4") (pointer_declarator "*param_8" (* "*") (identifier "param_8"))) () ")"))) (compound_statement "{\n  int iVar1;\n  void *__dest;\n  size_t __n;\n  wchar_t wVar2;\n  int iVar3;\n  int in_GS_OFFSET;\n  wchar_t *local_40 [2];\n  mbstate_t local_38;\n  char local_30 [16];\n  int local_20;\n  undefined4 uStack_14;\n  \n  iVar1 = param_5;\n  uStack_14 = 0xa0e39;\n  local_40[0] = param_3;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if (param_8 != (undefined4 *)0x0) {\n    *param_8 = 0;\n  }\n  if (param_1 == 0xffff) {\n    local_38.__count = 0;\n    local_38.__value.__wch = 0;\n    if (0 < param_4) {\n      iVar3 = 0;\n      do {\n        __n = wcrtomb(local_30,*local_40[0],&local_38);\n        if ((__n == 0xffffffff) || (iVar3 - param_6 < (int)__n)) break;\n        __dest = (void *)(iVar1 + iVar3);\n        iVar3 = iVar3 + __n;\n        memcpy(__dest,local_30,__n);\n        local_40[0] = local_40[0] + 1;\n        param_4 = param_4 + -1;\n      } while (0 < param_4);\n      goto LAB_000a0edc;\n    }\n  }\n  else {\n    if (param_1 != 0) {\n      iVar3 = FUN_0001cbe0(local_40,&param_4,param_5,param_6,param_1,0,param_7,\n                           param_7 != (byte *)0x0);\n      goto LAB_000a0edc;\n    }\n    if ((0 < param_6) && (0 < param_4)) {\n      iVar3 = 0;\n      iVar1 = param_4;\n      do {\n        iVar1 = iVar1 + -1;\n        wVar2 = *param_3;\n        if ((uint)(wVar2 + L'\xffff2800') < 0x100) {\nLAB_000a0ec0:\n          *(char *)(param_5 + iVar3) = (char)wVar2;\n          iVar3 = iVar3 + 1;\n        }\n        else if (param_7 != (byte *)0x0) {\n          wVar2 = (wchar_t)*param_7;\n          goto LAB_000a0ec0;\n        }\n        param_3 = param_3 + 1;\n      } while (0 < iVar1 && iVar3 < param_6);\n      goto LAB_000a0edc;\n    }\n  }\n  iVar3 = 0;\nLAB_000a0edc:\n  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_000a39d0();\n  }\n  return iVar3;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "void *__dest;" (primitive_type "void") (pointer_declarator "*__dest" (* "*") (identifier "__dest")) (; ";")) (declaration "size_t __n;" (primitive_type "size_t") (identifier "__n") (; ";")) (declaration "wchar_t wVar2;" (type_identifier "wchar_t") (identifier "wVar2") (; ";")) (declaration "int iVar3;" (primitive_type "int") (identifier "iVar3") (; ";")) (declaration "int in_GS_OFFSET;" (primitive_type "int") (identifier "in_GS_OFFSET") (; ";")) (declaration "wchar_t *local_40 [2];" (type_identifier "wchar_t") (pointer_declarator "*local_40 [2]" (* "*") (array_declarator "local_40 [2]" (identifier "local_40") ([ "[") (number_literal "2") (] "]"))) (; ";")) (declaration "mbstate_t local_38;" (type_identifier "mbstate_t") (identifier "local_38") (; ";")) (declaration "char local_30 [16];" (primitive_type "char") (array_declarator "local_30 [16]" (identifier "local_30") ([ "[") (number_literal "16") (] "]")) (; ";")) (declaration "int local_20;" (primitive_type "int") (identifier "local_20") (; ";")) (declaration "undefined4 uStack_14;" (type_identifier "undefined4") (identifier "uStack_14") (; ";")) (expression_statement "iVar1 = param_5;" (assignment_expression "iVar1 = param_5" (identifier "iVar1") (= "=") (identifier "param_5")) (; ";")) (expression_statement "uStack_14 = 0xa0e39;" (assignment_expression "uStack_14 = 0xa0e39" (identifier "uStack_14") (= "=") (number_literal "0xa0e39")) (; ";")) (expression_statement "local_40[0] = param_3;" (assignment_expression "local_40[0] = param_3" (subscript_expression "local_40[0]" (identifier "local_40") ([ "[") (number_literal "0") (] "]")) (= "=") (identifier "param_3")) (; ";")) (expression_statement "local_20 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_20 = *(int *)(in_GS_OFFSET + 0x14)" (identifier "local_20") (= "=") (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" (* "*") (cast_expression "(int *)(in_GS_OFFSET + 0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_GS_OFFSET + 0x14)" (( "(") (binary_expression "in_GS_OFFSET + 0x14" (identifier "in_GS_OFFSET") (+ "+") (number_literal "0x14")) () ")"))))) (; ";")) (if_statement "if (param_8 != (undefined4 *)0x0) {\n    *param_8 = 0;\n  }" (if "if") (parenthesized_expression "(param_8 != (undefined4 *)0x0)" (( "(") (binary_expression "param_8 != (undefined4 *)0x0" (identifier "param_8") (!= "!=") (cast_expression "(undefined4 *)0x0" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n    *param_8 = 0;\n  }" ({ "{") (expression_statement "*param_8 = 0;" (assignment_expression "*param_8 = 0" (pointer_expression "*param_8" (* "*") (identifier "param_8")) (= "=") (number_literal "0")) (; ";")) (} "}"))) (if_statement "if (param_1 == 0xffff) {\n    local_38.__count = 0;\n    local_38.__value.__wch = 0;\n    if (0 < param_4) {\n      iVar3 = 0;\n      do {\n        __n = wcrtomb(local_30,*local_40[0],&local_38);\n        if ((__n == 0xffffffff) || (iVar3 - param_6 < (int)__n)) break;\n        __dest = (void *)(iVar1 + iVar3);\n        iVar3 = iVar3 + __n;\n        memcpy(__dest,local_30,__n);\n        local_40[0] = local_40[0] + 1;\n        param_4 = param_4 + -1;\n      } while (0 < param_4);\n      goto LAB_000a0edc;\n    }\n  }\n  else {\n    if (param_1 != 0) {\n      iVar3 = FUN_0001cbe0(local_40,&param_4,param_5,param_6,param_1,0,param_7,\n                           param_7 != (byte *)0x0);\n      goto LAB_000a0edc;\n    }\n    if ((0 < param_6) && (0 < param_4)) {\n      iVar3 = 0;\n      iVar1 = param_4;\n      do {\n        iVar1 = iVar1 + -1;\n        wVar2 = *param_3;\n        if ((uint)(wVar2 + L'\xffff2800') < 0x100) {\nLAB_000a0ec0:\n          *(char *)(param_5 + iVar3) = (char)wVar2;\n          iVar3 = iVar3 + 1;\n        }\n        else if (param_7 != (byte *)0x0) {\n          wVar2 = (wchar_t)*param_7;\n          goto LAB_000a0ec0;\n        }\n        param_3 = param_3 + 1;\n      } while (0 < iVar1 && iVar3 < param_6);\n      goto LAB_000a0edc;\n    }\n  }" (if "if") (parenthesized_expression "(param_1 == 0xffff)" (( "(") (binary_expression "param_1 == 0xffff" (identifier "param_1") (== "==") (number_literal "0xffff")) () ")")) (compound_statement "{\n    local_38.__count = 0;\n    local_38.__value.__wch = 0;\n    if (0 < param_4) {\n      iVar3 = 0;\n      do {\n        __n = wcrtomb(local_30,*local_40[0],&local_38);\n        if ((__n == 0xffffffff) || (iVar3 - param_6 < (int)__n)) break;\n        __dest = (void *)(iVar1 + iVar3);\n        iVar3 = iVar3 + __n;\n        memcpy(__dest,local_30,__n);\n        local_40[0] = local_40[0] + 1;\n        param_4 = param_4 + -1;\n      } while (0 < param_4);\n      goto LAB_000a0edc;\n    }\n  }" ({ "{") (expression_statement "local_38.__count = 0;" (assignment_expression "local_38.__count = 0" (field_expression "local_38.__count" (identifier "local_38") (. ".") (field_identifier "__count")) (= "=") (number_literal "0")) (; ";")) (expression_statement "local_38.__value.__wch = 0;" (assignment_expression "local_38.__value.__wch = 0" (field_expression "local_38.__value.__wch" (field_expression "local_38.__value" (identifier "local_38") (. ".") (field_identifier "__value")) (. ".") (field_identifier "__wch")) (= "=") (number_literal "0")) (; ";")) (if_statement "if (0 < param_4) {\n      iVar3 = 0;\n      do {\n        __n = wcrtomb(local_30,*local_40[0],&local_38);\n        if ((__n == 0xffffffff) || (iVar3 - param_6 < (int)__n)) break;\n        __dest = (void *)(iVar1 + iVar3);\n        iVar3 = iVar3 + __n;\n        memcpy(__dest,local_30,__n);\n        local_40[0] = local_40[0] + 1;\n        param_4 = param_4 + -1;\n      } while (0 < param_4);\n      goto LAB_000a0edc;\n    }" (if "if") (parenthesized_expression "(0 < param_4)" (( "(") (binary_expression "0 < param_4" (number_literal "0") (< "<") (identifier "param_4")) () ")")) (compound_statement "{\n      iVar3 = 0;\n      do {\n        __n = wcrtomb(local_30,*local_40[0],&local_38);\n        if ((__n == 0xffffffff) || (iVar3 - param_6 < (int)__n)) break;\n        __dest = (void *)(iVar1 + iVar3);\n        iVar3 = iVar3 + __n;\n        memcpy(__dest,local_30,__n);\n        local_40[0] = local_40[0] + 1;\n        param_4 = param_4 + -1;\n      } while (0 < param_4);\n      goto LAB_000a0edc;\n    }" ({ "{") (expression_statement "iVar3 = 0;" (assignment_expression "iVar3 = 0" (identifier "iVar3") (= "=") (number_literal "0")) (; ";")) (do_statement "do {\n        __n = wcrtomb(local_30,*local_40[0],&local_38);\n        if ((__n == 0xffffffff) || (iVar3 - param_6 < (int)__n)) break;\n        __dest = (void *)(iVar1 + iVar3);\n        iVar3 = iVar3 + __n;\n        memcpy(__dest,local_30,__n);\n        local_40[0] = local_40[0] + 1;\n        param_4 = param_4 + -1;\n      } while (0 < param_4);" (do "do") (compound_statement "{\n        __n = wcrtomb(local_30,*local_40[0],&local_38);\n        if ((__n == 0xffffffff) || (iVar3 - param_6 < (int)__n)) break;\n        __dest = (void *)(iVar1 + iVar3);\n        iVar3 = iVar3 + __n;\n        memcpy(__dest,local_30,__n);\n        local_40[0] = local_40[0] + 1;\n        param_4 = param_4 + -1;\n      }" ({ "{") (expression_statement "__n = wcrtomb(local_30,*local_40[0],&local_38);" (assignment_expression "__n = wcrtomb(local_30,*local_40[0],&local_38)" (identifier "__n") (= "=") (call_expression "wcrtomb(local_30,*local_40[0],&local_38)" (identifier "wcrtomb") (argument_list "(local_30,*local_40[0],&local_38)" (( "(") (identifier "local_30") (, ",") (pointer_expression "*local_40[0]" (* "*") (subscript_expression "local_40[0]" (identifier "local_40") ([ "[") (number_literal "0") (] "]"))) (, ",") (pointer_expression "&local_38" (& "&") (identifier "local_38")) () ")")))) (; ";")) (if_statement "if ((__n == 0xffffffff) || (iVar3 - param_6 < (int)__n)) break;" (if "if") (parenthesized_expression "((__n == 0xffffffff) || (iVar3 - param_6 < (int)__n))" (( "(") (binary_expression "(__n == 0xffffffff) || (iVar3 - param_6 < (int)__n)" (parenthesized_expression "(__n == 0xffffffff)" (( "(") (binary_expression "__n == 0xffffffff" (identifier "__n") (== "==") (number_literal "0xffffffff")) () ")")) (|| "||") (parenthesized_expression "(iVar3 - param_6 < (int)__n)" (( "(") (binary_expression "iVar3 - param_6 < (int)__n" (binary_expression "iVar3 - param_6" (identifier "iVar3") (- "-") (identifier "param_6")) (< "<") (cast_expression "(int)__n" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "__n"))) () ")"))) () ")")) (break_statement "break;" (break "break") (; ";"))) (expression_statement "__dest = (void *)(iVar1 + iVar3);" (assignment_expression "__dest = (void *)(iVar1 + iVar3)" (identifier "__dest") (= "=") (cast_expression "(void *)(iVar1 + iVar3)" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar1 + iVar3)" (( "(") (binary_expression "iVar1 + iVar3" (identifier "iVar1") (+ "+") (identifier "iVar3")) () ")")))) (; ";")) (expression_statement "iVar3 = iVar3 + __n;" (assignment_expression "iVar3 = iVar3 + __n" (identifier "iVar3") (= "=") (binary_expression "iVar3 + __n" (identifier "iVar3") (+ "+") (identifier "__n"))) (; ";")) (expression_statement "memcpy(__dest,local_30,__n);" (call_expression "memcpy(__dest,local_30,__n)" (identifier "memcpy") (argument_list "(__dest,local_30,__n)" (( "(") (identifier "__dest") (, ",") (identifier "local_30") (, ",") (identifier "__n") () ")"))) (; ";")) (expression_statement "local_40[0] = local_40[0] + 1;" (assignment_expression "local_40[0] = local_40[0] + 1" (subscript_expression "local_40[0]" (identifier "local_40") ([ "[") (number_literal "0") (] "]")) (= "=") (binary_expression "local_40[0] + 1" (subscript_expression "local_40[0]" (identifier "local_40") ([ "[") (number_literal "0") (] "]")) (+ "+") (number_literal "1"))) (; ";")) (expression_statement "param_4 = param_4 + -1;" (assignment_expression "param_4 = param_4 + -1" (identifier "param_4") (= "=") (binary_expression "param_4 + -1" (identifier "param_4") (+ "+") (number_literal "-1"))) (; ";")) (} "}")) (while "while") (parenthesized_expression "(0 < param_4)" (( "(") (binary_expression "0 < param_4" (number_literal "0") (< "<") (identifier "param_4")) () ")")) (; ";")) (goto_statement "goto LAB_000a0edc;" (goto "goto") (statement_identifier "LAB_000a0edc") (; ";")) (} "}"))) (} "}")) (else_clause "else {\n    if (param_1 != 0) {\n      iVar3 = FUN_0001cbe0(local_40,&param_4,param_5,param_6,param_1,0,param_7,\n                           param_7 != (byte *)0x0);\n      goto LAB_000a0edc;\n    }\n    if ((0 < param_6) && (0 < param_4)) {\n      iVar3 = 0;\n      iVar1 = param_4;\n      do {\n        iVar1 = iVar1 + -1;\n        wVar2 = *param_3;\n        if ((uint)(wVar2 + L'\xffff2800') < 0x100) {\nLAB_000a0ec0:\n          *(char *)(param_5 + iVar3) = (char)wVar2;\n          iVar3 = iVar3 + 1;\n        }\n        else if (param_7 != (byte *)0x0) {\n          wVar2 = (wchar_t)*param_7;\n          goto LAB_000a0ec0;\n        }\n        param_3 = param_3 + 1;\n      } while (0 < iVar1 && iVar3 < param_6);\n      goto LAB_000a0edc;\n    }\n  }" (else "else") (compound_statement "{\n    if (param_1 != 0) {\n      iVar3 = FUN_0001cbe0(local_40,&param_4,param_5,param_6,param_1,0,param_7,\n                           param_7 != (byte *)0x0);\n      goto LAB_000a0edc;\n    }\n    if ((0 < param_6) && (0 < param_4)) {\n      iVar3 = 0;\n      iVar1 = param_4;\n      do {\n        iVar1 = iVar1 + -1;\n        wVar2 = *param_3;\n        if ((uint)(wVar2 + L'\xffff2800') < 0x100) {\nLAB_000a0ec0:\n          *(char *)(param_5 + iVar3) = (char)wVar2;\n          iVar3 = iVar3 + 1;\n        }\n        else if (param_7 != (byte *)0x0) {\n          wVar2 = (wchar_t)*param_7;\n          goto LAB_000a0ec0;\n        }\n        param_3 = param_3 + 1;\n      } while (0 < iVar1 && iVar3 < param_6);\n      goto LAB_000a0edc;\n    }\n  }" ({ "{") (if_statement "if (param_1 != 0) {\n      iVar3 = FUN_0001cbe0(local_40,&param_4,param_5,param_6,param_1,0,param_7,\n                           param_7 != (byte *)0x0);\n      goto LAB_000a0edc;\n    }" (if "if") (parenthesized_expression "(param_1 != 0)" (( "(") (binary_expression "param_1 != 0" (identifier "param_1") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n      iVar3 = FUN_0001cbe0(local_40,&param_4,param_5,param_6,param_1,0,param_7,\n                           param_7 != (byte *)0x0);\n      goto LAB_000a0edc;\n    }" ({ "{") (expression_statement "iVar3 = FUN_0001cbe0(local_40,&param_4,param_5,param_6,param_1,0,param_7,\n                           param_7 != (byte *)0x0);" (assignment_expression "iVar3 = FUN_0001cbe0(local_40,&param_4,param_5,param_6,param_1,0,param_7,\n                           param_7 != (byte *)0x0)" (identifier "iVar3") (= "=") (call_expression "FUN_0001cbe0(local_40,&param_4,param_5,param_6,param_1,0,param_7,\n                           param_7 != (byte *)0x0)" (identifier "FUN_0001cbe0") (argument_list "(local_40,&param_4,param_5,param_6,param_1,0,param_7,\n                           param_7 != (byte *)0x0)" (( "(") (identifier "local_40") (, ",") (pointer_expression "&param_4" (& "&") (identifier "param_4")) (, ",") (identifier "param_5") (, ",") (identifier "param_6") (, ",") (identifier "param_1") (, ",") (number_literal "0") (, ",") (identifier "param_7") (, ",") (binary_expression "param_7 != (byte *)0x0" (identifier "param_7") (!= "!=") (cast_expression "(byte *)0x0" (( "(") (type_descriptor "byte *" (type_identifier "byte") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")))) (; ";")) (goto_statement "goto LAB_000a0edc;" (goto "goto") (statement_identifier "LAB_000a0edc") (; ";")) (} "}"))) (if_statement "if ((0 < param_6) && (0 < param_4)) {\n      iVar3 = 0;\n      iVar1 = param_4;\n      do {\n        iVar1 = iVar1 + -1;\n        wVar2 = *param_3;\n        if ((uint)(wVar2 + L'\xffff2800') < 0x100) {\nLAB_000a0ec0:\n          *(char *)(param_5 + iVar3) = (char)wVar2;\n          iVar3 = iVar3 + 1;\n        }\n        else if (param_7 != (byte *)0x0) {\n          wVar2 = (wchar_t)*param_7;\n          goto LAB_000a0ec0;\n        }\n        param_3 = param_3 + 1;\n      } while (0 < iVar1 && iVar3 < param_6);\n      goto LAB_000a0edc;\n    }" (if "if") (parenthesized_expression "((0 < param_6) && (0 < param_4))" (( "(") (binary_expression "(0 < param_6) && (0 < param_4)" (parenthesized_expression "(0 < param_6)" (( "(") (binary_expression "0 < param_6" (number_literal "0") (< "<") (identifier "param_6")) () ")")) (&& "&&") (parenthesized_expression "(0 < param_4)" (( "(") (binary_expression "0 < param_4" (number_literal "0") (< "<") (identifier "param_4")) () ")"))) () ")")) (compound_statement "{\n      iVar3 = 0;\n      iVar1 = param_4;\n      do {\n        iVar1 = iVar1 + -1;\n        wVar2 = *param_3;\n        if ((uint)(wVar2 + L'\xffff2800') < 0x100) {\nLAB_000a0ec0:\n          *(char *)(param_5 + iVar3) = (char)wVar2;\n          iVar3 = iVar3 + 1;\n        }\n        else if (param_7 != (byte *)0x0) {\n          wVar2 = (wchar_t)*param_7;\n          goto LAB_000a0ec0;\n        }\n        param_3 = param_3 + 1;\n      } while (0 < iVar1 && iVar3 < param_6);\n      goto LAB_000a0edc;\n    }" ({ "{") (expression_statement "iVar3 = 0;" (assignment_expression "iVar3 = 0" (identifier "iVar3") (= "=") (number_literal "0")) (; ";")) (expression_statement "iVar1 = param_4;" (assignment_expression "iVar1 = param_4" (identifier "iVar1") (= "=") (identifier "param_4")) (; ";")) (do_statement "do {\n        iVar1 = iVar1 + -1;\n        wVar2 = *param_3;\n        if ((uint)(wVar2 + L'\xffff2800') < 0x100) {\nLAB_000a0ec0:\n          *(char *)(param_5 + iVar3) = (char)wVar2;\n          iVar3 = iVar3 + 1;\n        }\n        else if (param_7 != (byte *)0x0) {\n          wVar2 = (wchar_t)*param_7;\n          goto LAB_000a0ec0;\n        }\n        param_3 = param_3 + 1;\n      } while (0 < iVar1 && iVar3 < param_6);" (do "do") (compound_statement "{\n        iVar1 = iVar1 + -1;\n        wVar2 = *param_3;\n        if ((uint)(wVar2 + L'\xffff2800') < 0x100) {\nLAB_000a0ec0:\n          *(char *)(param_5 + iVar3) = (char)wVar2;\n          iVar3 = iVar3 + 1;\n        }\n        else if (param_7 != (byte *)0x0) {\n          wVar2 = (wchar_t)*param_7;\n          goto LAB_000a0ec0;\n        }\n        param_3 = param_3 + 1;\n      }" ({ "{") (expression_statement "iVar1 = iVar1 + -1;" (assignment_expression "iVar1 = iVar1 + -1" (identifier "iVar1") (= "=") (binary_expression "iVar1 + -1" (identifier "iVar1") (+ "+") (number_literal "-1"))) (; ";")) (expression_statement "wVar2 = *param_3;" (assignment_expression "wVar2 = *param_3" (identifier "wVar2") (= "=") (pointer_expression "*param_3" (* "*") (identifier "param_3"))) (; ";")) (if_statement "if ((uint)(wVar2 + L'\xffff2800') < 0x100) {\nLAB_000a0ec0:\n          *(char *)(param_5 + iVar3) = (char)wVar2;\n          iVar3 = iVar3 + 1;\n        }\n        else if (param_7 != (byte *)0x0) {\n          wVar2 = (wchar_t)*param_7;\n          goto LAB_000a0ec0;\n        }" (if "if") (parenthesized_expression "((uint)(wVar2 + L'\xffff2800') < 0x100)" (( "(") (binary_expression "(uint)(wVar2 + L'\xffff2800') < 0x100" (call_expression "(uint)(wVar2 + L'\xffff2800')" (parenthesized_expression "(uint)" (( "(") (identifier "uint") () ")")) (argument_list "(wVar2 + L'\xffff2800')" (( "(") (binary_expression "wVar2 + L'\xffff2800'" (identifier "wVar2") (+ "+") (char_literal "L'\xffff2800'" (L' "L'") (escape_sequence "\xffff") (character "2") (character "8") (character "0") (character "0") (' "'"))) () ")"))) (< "<") (number_literal "0x100")) () ")")) (compound_statement "{\nLAB_000a0ec0:\n          *(char *)(param_5 + iVar3) = (char)wVar2;\n          iVar3 = iVar3 + 1;\n        }" ({ "{") (labeled_statement "LAB_000a0ec0:\n          *(char *)(param_5 + iVar3) = (char)wVar2;" (statement_identifier "LAB_000a0ec0") (: ":") (expression_statement "*(char *)(param_5 + iVar3) = (char)wVar2;" (assignment_expression "*(char *)(param_5 + iVar3) = (char)wVar2" (pointer_expression "*(char *)(param_5 + iVar3)" (* "*") (cast_expression "(char *)(param_5 + iVar3)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_5 + iVar3)" (( "(") (binary_expression "param_5 + iVar3" (identifier "param_5") (+ "+") (identifier "iVar3")) () ")")))) (= "=") (cast_expression "(char)wVar2" (( "(") (type_descriptor "char" (primitive_type "char")) () ")") (identifier "wVar2"))) (; ";"))) (expression_statement "iVar3 = iVar3 + 1;" (assignment_expression "iVar3 = iVar3 + 1" (identifier "iVar3") (= "=") (binary_expression "iVar3 + 1" (identifier "iVar3") (+ "+") (number_literal "1"))) (; ";")) (} "}")) (else_clause "else if (param_7 != (byte *)0x0) {\n          wVar2 = (wchar_t)*param_7;\n          goto LAB_000a0ec0;\n        }" (else "else") (if_statement "if (param_7 != (byte *)0x0) {\n          wVar2 = (wchar_t)*param_7;\n          goto LAB_000a0ec0;\n        }" (if "if") (parenthesized_expression "(param_7 != (byte *)0x0)" (( "(") (binary_expression "param_7 != (byte *)0x0" (identifier "param_7") (!= "!=") (cast_expression "(byte *)0x0" (( "(") (type_descriptor "byte *" (type_identifier "byte") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n          wVar2 = (wchar_t)*param_7;\n          goto LAB_000a0ec0;\n        }" ({ "{") (expression_statement "wVar2 = (wchar_t)*param_7;" (assignment_expression "wVar2 = (wchar_t)*param_7" (identifier "wVar2") (= "=") (binary_expression "(wchar_t)*param_7" (parenthesized_expression "(wchar_t)" (( "(") (identifier "wchar_t") () ")")) (* "*") (identifier "param_7"))) (; ";")) (goto_statement "goto LAB_000a0ec0;" (goto "goto") (statement_identifier "LAB_000a0ec0") (; ";")) (} "}"))))) (expression_statement "param_3 = param_3 + 1;" (assignment_expression "param_3 = param_3 + 1" (identifier "param_3") (= "=") (binary_expression "param_3 + 1" (identifier "param_3") (+ "+") (number_literal "1"))) (; ";")) (} "}")) (while "while") (parenthesized_expression "(0 < iVar1 && iVar3 < param_6)" (( "(") (binary_expression "0 < iVar1 && iVar3 < param_6" (binary_expression "0 < iVar1" (number_literal "0") (< "<") (identifier "iVar1")) (&& "&&") (binary_expression "iVar3 < param_6" (identifier "iVar3") (< "<") (identifier "param_6"))) () ")")) (; ";")) (goto_statement "goto LAB_000a0edc;" (goto "goto") (statement_identifier "LAB_000a0edc") (; ";")) (} "}"))) (} "}")))) (expression_statement "iVar3 = 0;" (assignment_expression "iVar3 = 0" (identifier "iVar3") (= "=") (number_literal "0")) (; ";")) (labeled_statement "LAB_000a0edc:\n  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_000a39d0();\n  }" (statement_identifier "LAB_000a0edc") (: ":") (if_statement "if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_000a39d0();\n  }" (if "if") (parenthesized_expression "(local_20 != *(int *)(in_GS_OFFSET + 0x14))" (( "(") (binary_expression "local_20 != *(int *)(in_GS_OFFSET + 0x14)" (identifier "local_20") (!= "!=") (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" (* "*") (cast_expression "(int *)(in_GS_OFFSET + 0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_GS_OFFSET + 0x14)" (( "(") (binary_expression "in_GS_OFFSET + 0x14" (identifier "in_GS_OFFSET") (+ "+") (number_literal "0x14")) () ")"))))) () ")")) (compound_statement "{\n                    \n    FUN_000a39d0();\n  }" ({ "{") (expression_statement "FUN_000a39d0();" (call_expression "FUN_000a39d0()" (identifier "FUN_000a39d0") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}")))) (return_statement "return iVar3;" (return "return") (identifier "iVar3") (; ";")) (} "}")))

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

int function_1(int var_3,int flags,type_1 *var_15,int var_4,char *mbstr,int var_8,char *var_12,
            int *var_2,type_2 *ucsdata)

{
  int var_16;
  char *var_9;
  int var_13;
  char *__dest;
  size_t var_6;
  type_1 var_14;
  int var_7;
  int var_1;
  type_1 *local_40 [2];
  type_3 state;
  char output [16];
  
  var_9 = mbstr;
  local_40[0] = var_15;
  var_16 = *(int *)(var_1 + 0x14);
  if (var_2 != (int *)0x0) {
    *var_2 = 0;
  }
  if (var_3 == 0xffff) {
    state.__count = 0;
    state.__value.__wch = 0;
    if (0 < var_4) {
      var_7 = 0;
      do {
        var_6 = var_5(output,*local_40[0],(type_3 *)&state);
        if ((var_6 == 0xffffffff) || (var_7 - var_8 < (int)var_6)) break;
        __dest = var_9 + var_7;
        var_7 = var_7 + var_6;
        var_10(__dest,output,var_6);
        local_40[0] = local_40[0] + 1;
        var_4 = var_4 + -1;
      } while (0 < var_4);
      goto LAB_000a0edc;
    }
  }
  else {
    if (var_3 != 0) {
      var_7 = var_11
                        (local_40,&var_4,mbstr,var_8,var_3,(type_4 *)0x0,var_12,
                         (uint)(var_12 != (char *)0x0));
      goto LAB_000a0edc;
    }
    if ((0 < var_8) && (0 < var_4)) {
      var_7 = 0;
      var_13 = var_4;
      do {
        var_13 = var_13 + -1;
        var_14 = *var_15;
        if ((uint)(var_14 + L'\xffff2800') < 0x100) {
LAB_000a0ec0:
          mbstr[var_7] = (char)var_14;
          var_7 = var_7 + 1;
        }
        else if (var_12 != (char *)0x0) {
          var_14 = (type_1)(byte)*var_12;
          goto LAB_000a0ec0;
        }
        var_15 = var_15 + 1;
      } while (0 < var_13 && var_7 < var_8);
      goto LAB_000a0edc;
    }
  }
  var_7 = 0;
LAB_000a0edc:
  if (var_16 != *(int *)(var_1 + 0x14)) {
                    /* WARNING: Subroutine does not return */
    var_17();
  }
  return var_7;
}


(translation_unit (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (primitive_type) declarator: (identifier)) (parameter_declaration type: (type_identifier) declarator: (identifier)) (parameter_declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (primitive_type) declarator: (identifier)) (parameter_declaration type: (primitive_type) declarator: (identifier)) (parameter_declaration type: (primitive_type) declarator: (identifier)) (parameter_declaration type: (type_identifier) 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: (type_identifier) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (array_declarator declarator: (identifier) size: (number_literal)))) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (primitive_type) declarator: (array_declarator declarator: (identifier) size: (number_literal))) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (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))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (number_literal)))) consequence: (compound_statement (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (number_literal))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (field_expression argument: (identifier) field: (field_identifier)) right: (number_literal))) (expression_statement (assignment_expression left: (field_expression argument: (field_expression argument: (identifier) field: (field_identifier)) field: (field_identifier)) right: (number_literal))) (if_statement condition: (parenthesized_expression (binary_expression left: (number_literal) right: (identifier))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (do_statement body: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (pointer_expression argument: (subscript_expression argument: (identifier) index: (number_literal))) (pointer_expression argument: (identifier)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) right: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier)))))) consequence: (break_statement)) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (identifier)))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (identifier)))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (identifier)))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (binary_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal))))) condition: (parenthesized_expression (binary_expression left: (number_literal) right: (identifier)))) (goto_statement label: (statement_identifier))))) alternative: (else_clause (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (pointer_expression argument: (identifier)) (identifier) (identifier) (identifier) (number_literal) (identifier) (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (number_literal))))))) (goto_statement label: (statement_identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (number_literal) right: (identifier))) right: (parenthesized_expression (binary_expression left: (number_literal) right: (identifier))))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (do_statement body: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (call_expression function: (parenthesized_expression (identifier)) arguments: (argument_list (binary_expression left: (identifier) right: (char_literal (escape_sequence) (character) (character) (character) (character))))) right: (number_literal))) consequence: (compound_statement (labeled_statement label: (statement_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: (identifier))))) right: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal))))) alternative: (else_clause (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (number_literal)))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (parenthesized_expression (identifier)) right: (identifier)))) (goto_statement label: (statement_identifier)))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal))))) condition: (parenthesized_expression (binary_expression left: (binary_expression left: (number_literal) right: (identifier)) right: (binary_expression left: (identifier) right: (identifier))))) (goto_statement label: (statement_identifier))))))) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (labeled_statement label: (statement_identifier) (if_statement condition: (parenthesized_expression (binary_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))))))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list)))))) (return_statement (identifier)))))

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

int MASKED(int param_1,undefined4 param_2,wchar_t *param_3,int param_4,int param_5,int param_6
                ,byte *param_7,undefined4 *param_8)

{
  int iVar1;
  void *__dest;
  size_t __n;
  wchar_t wVar2;
  int iVar3;
  int in_GS_OFFSET;
  wchar_t *local_40 [2];
  mbstate_t local_38;
  char local_30 [16];
  int local_20;
  undefined4 uStack_14;
  
  iVar1 = param_5;
  uStack_14 = 0xa0e39;
  local_40[0] = param_3;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if (param_8 != (undefined4 *)0x0) {
    *param_8 = 0;
  }
  if (param_1 == 0xffff) {
    local_38.__count = 0;
    local_38.__value.__wch = 0;
    if (0 < param_4) {
      iVar3 = 0;
      do {
        __n = wcrtomb(local_30,*local_40[0],&local_38);
        if ((__n == 0xffffffff) || (iVar3 - param_6 < (int)__n)) break;
        __dest = (void *)(iVar1 + iVar3);
        iVar3 = iVar3 + __n;
        memcpy(__dest,local_30,__n);
        local_40[0] = local_40[0] + 1;
        param_4 = param_4 + -1;
      } while (0 < param_4);
      goto LAB_000a0edc;
    }
  }
  else {
    if (param_1 != 0) {
      iVar3 = FUN_0001cbe0(local_40,&param_4,param_5,param_6,param_1,0,param_7,
                           param_7 != (byte *)0x0);
      goto LAB_000a0edc;
    }
    if ((0 < param_6) && (0 < param_4)) {
      iVar3 = 0;
      iVar1 = param_4;
      do {
        iVar1 = iVar1 + -1;
        wVar2 = *param_3;
        if ((uint)(wVar2 + L'\xffff2800') < 0x100) {
LAB_000a0ec0:
          *(char *)(param_5 + iVar3) = (char)wVar2;
          iVar3 = iVar3 + 1;
        }
        else if (param_7 != (byte *)0x0) {
          wVar2 = (wchar_t)*param_7;
          goto LAB_000a0ec0;
        }
        param_3 = param_3 + 1;
      } while (0 < iVar1 && iVar3 < param_6);
      goto LAB_000a0edc;
    }
  }
  iVar3 = 0;
LAB_000a0edc:
  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    FUN_000a39d0();
  }
  return iVar3;
}

