
/* WARNING: Enum "anon_enum_32": Some values do not have unique names */

char * locale_to_utf8(char *str)

{
  char cVar1;
  _Bool _Var2;
  int iVar3;
  char *pcVar4;
  ulong uVar5;
  char *pcVar6;
  long in_FS_OFFSET;
  byte bVar7;
  char *new;
  long local_20;
  
  bVar7 = 0;
  local_20 = *(long *)(in_FS_OFFSET + 0x28);
  pcVar6 = str;
  if (opt.locale == (char *)0x0) {
    pcVar4 = (char *)dcgettext(0,"locale_to_utf8: locale is unset\n",5);
    logprintf(LOG_VERBOSE,pcVar4);
    opt.locale = find_locale();
    if (opt.locale == (char *)0x0) goto LAB_0013e8f7;
  }
  pcVar4 = opt.locale;
  iVar3 = c_strcasecmp(opt.locale,"utf-8");
  if (iVar3 != 0) {
    uVar5 = 0xffffffffffffffff;
    do {
      if (uVar5 == 0) break;
      uVar5 = uVar5 - 1;
      cVar1 = *pcVar6;
      pcVar6 = pcVar6 + (ulong)bVar7 * -2 + 1;
    } while (cVar1 != '\0');
    _Var2 = do_conversion("UTF-8",pcVar4,str,~uVar5 - 1,&new);
    pcVar6 = new;
    if (!_Var2) {
      free(new);
      pcVar6 = str;
    }
  }
LAB_0013e8f7:
  if (local_20 != *(long *)(in_FS_OFFSET + 0x28)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  return pcVar6;
}



char * FUN_0013e8bf(char *param_1)

{
  long lVar1;
  char cVar2;
  int iVar3;
  undefined8 uVar4;
  ulong uVar5;
  char *pcVar6;
  long in_FS_OFFSET;
  byte bVar7;
  char *local_28;
  long local_20;
  
  bVar7 = 0;
  local_20 = *(long *)(in_FS_OFFSET + 0x28);
  pcVar6 = param_1;
  if (DAT_00177610 == 0) {
    uVar4 = dcgettext(0,"locale_to_utf8: locale is unset\n",5);
    FUN_0012bc55(0,uVar4);
    DAT_00177610 = FUN_0013e796();
    if (DAT_00177610 == 0) goto LAB_0013e8f7;
  }
  lVar1 = DAT_00177610;
  iVar3 = FUN_00141bb2(DAT_00177610,"utf-8");
  if (iVar3 != 0) {
    uVar5 = 0xffffffffffffffff;
    do {
      if (uVar5 == 0) break;
      uVar5 = uVar5 - 1;
      cVar2 = *pcVar6;
      pcVar6 = pcVar6 + (ulong)bVar7 * -2 + 1;
    } while (cVar2 != '\0');
    cVar2 = FUN_0013e3e1("UTF-8",lVar1,param_1,~uVar5 - 1,&local_28);
    pcVar6 = local_28;
    if (cVar2 == '\0') {
      free(local_28);
      pcVar6 = param_1;
    }
  }
LAB_0013e8f7:
  if (local_20 != *(long *)(in_FS_OFFSET + 0x28)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  return pcVar6;
}


PUSH RBP
PUSH RBX
SUB RSP,0x18
MOV RBP,RDI
MOV RAX,qword ptr FS:[0x28]
MOV qword ptr [RSP + 0x8],RAX
XOR EAX,EAX
MOV RBX,qword ptr [0x00177610]
TEST RBX,RBX
JZ 0x0013e915
LEA RSI,[0x15f061]
MOV RDI,RBX
CALL 0x00141bb2
TEST EAX,EAX
JNZ 0x0013e953
MOV RAX,RBP
MOV RDX,qword ptr [RSP + 0x8]
XOR RDX,qword ptr FS:[0x28]
JNZ 0x0013e9a1
ADD RSP,0x18
POP RBX
POP RBP
RET
MOV EDX,0x5
LEA RSI,[0x15f018]
MOV EDI,0x0
CALL 0x0010c9f0
MOV RSI,RAX
MOV EDI,0x0
MOV EAX,0x0
CALL 0x0012bc55
CALL 0x0013e796
MOV RBX,RAX
MOV qword ptr [0x00177610],RAX
TEST RAX,RAX
JZ 0x0013e8f7
JMP 0x0013e8e4
MOV RCX,-0x1
MOV EAX,0x0
MOV RDI,RBP
SCASB.REPNE RDI
MOV RSI,RCX
NOT RSI
MOV RCX,RSI
SUB RCX,0x1
MOV R8,RSP
MOV RDX,RBP
MOV RSI,RBX
LEA RDI,[0x15e01a]
CALL 0x0013e3e1
TEST AL,AL
JZ 0x0013e993
MOV RBP,qword ptr [RSP]
JMP 0x0013e8f7
MOV RDI,qword ptr [RSP]
CALL 0x0010c550
JMP 0x0013e8f7
CALL 0x0010ca20
(translation_unit "char * FUN_0013e8bf(char *param_1)\n\n{\n  long lVar1;\n  char cVar2;\n  int iVar3;\n  undefined8 uVar4;\n  ulong uVar5;\n  char *pcVar6;\n  long in_FS_OFFSET;\n  byte bVar7;\n  char *local_28;\n  long local_20;\n  \n  bVar7 = 0;\n  local_20 = *(long *)(in_FS_OFFSET + 0x28);\n  pcVar6 = param_1;\n  if (DAT_00177610 == 0) {\n    uVar4 = dcgettext(0,"locale_to_utf8: locale is unset\n",5);\n    FUN_0012bc55(0,uVar4);\n    DAT_00177610 = FUN_0013e796();\n    if (DAT_00177610 == 0) goto LAB_0013e8f7;\n  }\n  lVar1 = DAT_00177610;\n  iVar3 = FUN_00141bb2(DAT_00177610,"utf-8");\n  if (iVar3 != 0) {\n    uVar5 = 0xffffffffffffffff;\n    do {\n      if (uVar5 == 0) break;\n      uVar5 = uVar5 - 1;\n      cVar2 = *pcVar6;\n      pcVar6 = pcVar6 + (ulong)bVar7 * -2 + 1;\n    } while (cVar2 != '\0');\n    cVar2 = FUN_0013e3e1("UTF-8",lVar1,param_1,~uVar5 - 1,&local_28);\n    pcVar6 = local_28;\n    if (cVar2 == '\0') {\n      free(local_28);\n      pcVar6 = param_1;\n    }\n  }\nLAB_0013e8f7:\n  if (local_20 != *(long *)(in_FS_OFFSET + 0x28)) {\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail();\n  }\n  return pcVar6;\n}\n\n" (function_definition "char * FUN_0013e8bf(char *param_1)\n\n{\n  long lVar1;\n  char cVar2;\n  int iVar3;\n  undefined8 uVar4;\n  ulong uVar5;\n  char *pcVar6;\n  long in_FS_OFFSET;\n  byte bVar7;\n  char *local_28;\n  long local_20;\n  \n  bVar7 = 0;\n  local_20 = *(long *)(in_FS_OFFSET + 0x28);\n  pcVar6 = param_1;\n  if (DAT_00177610 == 0) {\n    uVar4 = dcgettext(0,"locale_to_utf8: locale is unset\n",5);\n    FUN_0012bc55(0,uVar4);\n    DAT_00177610 = FUN_0013e796();\n    if (DAT_00177610 == 0) goto LAB_0013e8f7;\n  }\n  lVar1 = DAT_00177610;\n  iVar3 = FUN_00141bb2(DAT_00177610,"utf-8");\n  if (iVar3 != 0) {\n    uVar5 = 0xffffffffffffffff;\n    do {\n      if (uVar5 == 0) break;\n      uVar5 = uVar5 - 1;\n      cVar2 = *pcVar6;\n      pcVar6 = pcVar6 + (ulong)bVar7 * -2 + 1;\n    } while (cVar2 != '\0');\n    cVar2 = FUN_0013e3e1("UTF-8",lVar1,param_1,~uVar5 - 1,&local_28);\n    pcVar6 = local_28;\n    if (cVar2 == '\0') {\n      free(local_28);\n      pcVar6 = param_1;\n    }\n  }\nLAB_0013e8f7:\n  if (local_20 != *(long *)(in_FS_OFFSET + 0x28)) {\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail();\n  }\n  return pcVar6;\n}" primitive_type (pointer_declarator "* FUN_0013e8bf(char *param_1)" * (function_declarator "FUN_0013e8bf(char *param_1)" identifier (parameter_list "(char *param_1)" ( (parameter_declaration "char *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) )))) (compound_statement "{\n  long lVar1;\n  char cVar2;\n  int iVar3;\n  undefined8 uVar4;\n  ulong uVar5;\n  char *pcVar6;\n  long in_FS_OFFSET;\n  byte bVar7;\n  char *local_28;\n  long local_20;\n  \n  bVar7 = 0;\n  local_20 = *(long *)(in_FS_OFFSET + 0x28);\n  pcVar6 = param_1;\n  if (DAT_00177610 == 0) {\n    uVar4 = dcgettext(0,"locale_to_utf8: locale is unset\n",5);\n    FUN_0012bc55(0,uVar4);\n    DAT_00177610 = FUN_0013e796();\n    if (DAT_00177610 == 0) goto LAB_0013e8f7;\n  }\n  lVar1 = DAT_00177610;\n  iVar3 = FUN_00141bb2(DAT_00177610,"utf-8");\n  if (iVar3 != 0) {\n    uVar5 = 0xffffffffffffffff;\n    do {\n      if (uVar5 == 0) break;\n      uVar5 = uVar5 - 1;\n      cVar2 = *pcVar6;\n      pcVar6 = pcVar6 + (ulong)bVar7 * -2 + 1;\n    } while (cVar2 != '\0');\n    cVar2 = FUN_0013e3e1("UTF-8",lVar1,param_1,~uVar5 - 1,&local_28);\n    pcVar6 = local_28;\n    if (cVar2 == '\0') {\n      free(local_28);\n      pcVar6 = param_1;\n    }\n  }\nLAB_0013e8f7:\n  if (local_20 != *(long *)(in_FS_OFFSET + 0x28)) {\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail();\n  }\n  return pcVar6;\n}" { (declaration "long lVar1;" (sized_type_specifier "long" long) identifier ;) (declaration "char cVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "undefined8 uVar4;" type_identifier identifier ;) (declaration "ulong uVar5;" type_identifier identifier ;) (declaration "char *pcVar6;" primitive_type (pointer_declarator "*pcVar6" * identifier) ;) (declaration "long in_FS_OFFSET;" (sized_type_specifier "long" long) identifier ;) (declaration "byte bVar7;" type_identifier identifier ;) (declaration "char *local_28;" primitive_type (pointer_declarator "*local_28" * identifier) ;) (declaration "long local_20;" (sized_type_specifier "long" long) identifier ;) (expression_statement "bVar7 = 0;" (assignment_expression "bVar7 = 0" identifier = number_literal) ;) (expression_statement "local_20 = *(long *)(in_FS_OFFSET + 0x28);" (assignment_expression "local_20 = *(long *)(in_FS_OFFSET + 0x28)" identifier = (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" * (cast_expression "(long *)(in_FS_OFFSET + 0x28)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_FS_OFFSET + 0x28)" ( (binary_expression "in_FS_OFFSET + 0x28" identifier + number_literal) ))))) ;) (expression_statement "pcVar6 = param_1;" (assignment_expression "pcVar6 = param_1" identifier = identifier) ;) (if_statement "if (DAT_00177610 == 0) {\n    uVar4 = dcgettext(0,"locale_to_utf8: locale is unset\n",5);\n    FUN_0012bc55(0,uVar4);\n    DAT_00177610 = FUN_0013e796();\n    if (DAT_00177610 == 0) goto LAB_0013e8f7;\n  }" if (parenthesized_expression "(DAT_00177610 == 0)" ( (binary_expression "DAT_00177610 == 0" identifier == number_literal) )) (compound_statement "{\n    uVar4 = dcgettext(0,"locale_to_utf8: locale is unset\n",5);\n    FUN_0012bc55(0,uVar4);\n    DAT_00177610 = FUN_0013e796();\n    if (DAT_00177610 == 0) goto LAB_0013e8f7;\n  }" { (expression_statement "uVar4 = dcgettext(0,"locale_to_utf8: locale is unset\n",5);" (assignment_expression "uVar4 = dcgettext(0,"locale_to_utf8: locale is unset\n",5)" identifier = (call_expression "dcgettext(0,"locale_to_utf8: locale is unset\n",5)" identifier (argument_list "(0,"locale_to_utf8: locale is unset\n",5)" ( number_literal , (string_literal ""locale_to_utf8: locale is unset\n"" " string_content escape_sequence ") , number_literal )))) ;) (expression_statement "FUN_0012bc55(0,uVar4);" (call_expression "FUN_0012bc55(0,uVar4)" identifier (argument_list "(0,uVar4)" ( number_literal , identifier ))) ;) (expression_statement "DAT_00177610 = FUN_0013e796();" (assignment_expression "DAT_00177610 = FUN_0013e796()" identifier = (call_expression "FUN_0013e796()" identifier (argument_list "()" ( )))) ;) (if_statement "if (DAT_00177610 == 0) goto LAB_0013e8f7;" if (parenthesized_expression "(DAT_00177610 == 0)" ( (binary_expression "DAT_00177610 == 0" identifier == number_literal) )) (goto_statement "goto LAB_0013e8f7;" goto statement_identifier ;)) })) (expression_statement "lVar1 = DAT_00177610;" (assignment_expression "lVar1 = DAT_00177610" identifier = identifier) ;) (expression_statement "iVar3 = FUN_00141bb2(DAT_00177610,"utf-8");" (assignment_expression "iVar3 = FUN_00141bb2(DAT_00177610,"utf-8")" identifier = (call_expression "FUN_00141bb2(DAT_00177610,"utf-8")" identifier (argument_list "(DAT_00177610,"utf-8")" ( identifier , (string_literal ""utf-8"" " string_content ") )))) ;) (if_statement "if (iVar3 != 0) {\n    uVar5 = 0xffffffffffffffff;\n    do {\n      if (uVar5 == 0) break;\n      uVar5 = uVar5 - 1;\n      cVar2 = *pcVar6;\n      pcVar6 = pcVar6 + (ulong)bVar7 * -2 + 1;\n    } while (cVar2 != '\0');\n    cVar2 = FUN_0013e3e1("UTF-8",lVar1,param_1,~uVar5 - 1,&local_28);\n    pcVar6 = local_28;\n    if (cVar2 == '\0') {\n      free(local_28);\n      pcVar6 = param_1;\n    }\n  }" if (parenthesized_expression "(iVar3 != 0)" ( (binary_expression "iVar3 != 0" identifier != number_literal) )) (compound_statement "{\n    uVar5 = 0xffffffffffffffff;\n    do {\n      if (uVar5 == 0) break;\n      uVar5 = uVar5 - 1;\n      cVar2 = *pcVar6;\n      pcVar6 = pcVar6 + (ulong)bVar7 * -2 + 1;\n    } while (cVar2 != '\0');\n    cVar2 = FUN_0013e3e1("UTF-8",lVar1,param_1,~uVar5 - 1,&local_28);\n    pcVar6 = local_28;\n    if (cVar2 == '\0') {\n      free(local_28);\n      pcVar6 = param_1;\n    }\n  }" { (expression_statement "uVar5 = 0xffffffffffffffff;" (assignment_expression "uVar5 = 0xffffffffffffffff" identifier = number_literal) ;) (do_statement "do {\n      if (uVar5 == 0) break;\n      uVar5 = uVar5 - 1;\n      cVar2 = *pcVar6;\n      pcVar6 = pcVar6 + (ulong)bVar7 * -2 + 1;\n    } while (cVar2 != '\0');" do (compound_statement "{\n      if (uVar5 == 0) break;\n      uVar5 = uVar5 - 1;\n      cVar2 = *pcVar6;\n      pcVar6 = pcVar6 + (ulong)bVar7 * -2 + 1;\n    }" { (if_statement "if (uVar5 == 0) break;" if (parenthesized_expression "(uVar5 == 0)" ( (binary_expression "uVar5 == 0" identifier == number_literal) )) (break_statement "break;" break ;)) (expression_statement "uVar5 = uVar5 - 1;" (assignment_expression "uVar5 = uVar5 - 1" identifier = (binary_expression "uVar5 - 1" identifier - number_literal)) ;) (expression_statement "cVar2 = *pcVar6;" (assignment_expression "cVar2 = *pcVar6" identifier = (pointer_expression "*pcVar6" * identifier)) ;) (expression_statement "pcVar6 = pcVar6 + (ulong)bVar7 * -2 + 1;" (assignment_expression "pcVar6 = pcVar6 + (ulong)bVar7 * -2 + 1" identifier = (binary_expression "pcVar6 + (ulong)bVar7 * -2 + 1" (binary_expression "pcVar6 + (ulong)bVar7 * -2" identifier + (binary_expression "(ulong)bVar7 * -2" (cast_expression "(ulong)bVar7" ( (type_descriptor "ulong" type_identifier) ) identifier) * number_literal)) + number_literal)) ;) }) while (parenthesized_expression "(cVar2 != '\0')" ( (binary_expression "cVar2 != '\0'" identifier != (char_literal "'\0'" ' escape_sequence ')) )) ;) (expression_statement "cVar2 = FUN_0013e3e1("UTF-8",lVar1,param_1,~uVar5 - 1,&local_28);" (assignment_expression "cVar2 = FUN_0013e3e1("UTF-8",lVar1,param_1,~uVar5 - 1,&local_28)" identifier = (call_expression "FUN_0013e3e1("UTF-8",lVar1,param_1,~uVar5 - 1,&local_28)" identifier (argument_list "("UTF-8",lVar1,param_1,~uVar5 - 1,&local_28)" ( (string_literal ""UTF-8"" " string_content ") , identifier , identifier , (binary_expression "~uVar5 - 1" (unary_expression "~uVar5" ~ identifier) - number_literal) , (pointer_expression "&local_28" & identifier) )))) ;) (expression_statement "pcVar6 = local_28;" (assignment_expression "pcVar6 = local_28" identifier = identifier) ;) (if_statement "if (cVar2 == '\0') {\n      free(local_28);\n      pcVar6 = param_1;\n    }" if (parenthesized_expression "(cVar2 == '\0')" ( (binary_expression "cVar2 == '\0'" identifier == (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\n      free(local_28);\n      pcVar6 = param_1;\n    }" { (expression_statement "free(local_28);" (call_expression "free(local_28)" identifier (argument_list "(local_28)" ( identifier ))) ;) (expression_statement "pcVar6 = param_1;" (assignment_expression "pcVar6 = param_1" identifier = identifier) ;) })) })) (labeled_statement "LAB_0013e8f7:\n  if (local_20 != *(long *)(in_FS_OFFSET + 0x28)) {\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail();\n  }" statement_identifier : (if_statement "if (local_20 != *(long *)(in_FS_OFFSET + 0x28)) {\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail();\n  }" if (parenthesized_expression "(local_20 != *(long *)(in_FS_OFFSET + 0x28))" ( (binary_expression "local_20 != *(long *)(in_FS_OFFSET + 0x28)" identifier != (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" * (cast_expression "(long *)(in_FS_OFFSET + 0x28)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_FS_OFFSET + 0x28)" ( (binary_expression "in_FS_OFFSET + 0x28" identifier + number_literal) ))))) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail();\n  }" { comment (expression_statement "__stack_chk_fail();" (call_expression "__stack_chk_fail()" identifier (argument_list "()" ( ))) ;) }))) (return_statement "return pcVar6;" return identifier ;) })))
(translation_unit "/* WARNING: Enum "anon_enum_32": Some values do not have unique names */\n\nchar * locale_to_utf8(char *str)\n\n{\n  char cVar1;\n  _Bool _Var2;\n  int iVar3;\n  char *pcVar4;\n  ulong uVar5;\n  char *pcVar6;\n  long in_FS_OFFSET;\n  byte bVar7;\n  char *new;\n  long local_20;\n  \n  bVar7 = 0;\n  local_20 = *(long *)(in_FS_OFFSET + 0x28);\n  pcVar6 = str;\n  if (opt.locale == (char *)0x0) {\n    pcVar4 = (char *)dcgettext(0,"locale_to_utf8: locale is unset\n",5);\n    logprintf(LOG_VERBOSE,pcVar4);\n    opt.locale = find_locale();\n    if (opt.locale == (char *)0x0) goto LAB_0013e8f7;\n  }\n  pcVar4 = opt.locale;\n  iVar3 = c_strcasecmp(opt.locale,"utf-8");\n  if (iVar3 != 0) {\n    uVar5 = 0xffffffffffffffff;\n    do {\n      if (uVar5 == 0) break;\n      uVar5 = uVar5 - 1;\n      cVar1 = *pcVar6;\n      pcVar6 = pcVar6 + (ulong)bVar7 * -2 + 1;\n    } while (cVar1 != '\0');\n    _Var2 = do_conversion("UTF-8",pcVar4,str,~uVar5 - 1,&new);\n    pcVar6 = new;\n    if (!_Var2) {\n      free(new);\n      pcVar6 = str;\n    }\n  }\nLAB_0013e8f7:\n  if (local_20 != *(long *)(in_FS_OFFSET + 0x28)) {\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail();\n  }\n  return pcVar6;\n}\n\n" comment (function_definition "char * locale_to_utf8(char *str)\n\n{\n  char cVar1;\n  _Bool _Var2;\n  int iVar3;\n  char *pcVar4;\n  ulong uVar5;\n  char *pcVar6;\n  long in_FS_OFFSET;\n  byte bVar7;\n  char *new;\n  long local_20;\n  \n  bVar7 = 0;\n  local_20 = *(long *)(in_FS_OFFSET + 0x28);\n  pcVar6 = str;\n  if (opt.locale == (char *)0x0) {\n    pcVar4 = (char *)dcgettext(0,"locale_to_utf8: locale is unset\n",5);\n    logprintf(LOG_VERBOSE,pcVar4);\n    opt.locale = find_locale();\n    if (opt.locale == (char *)0x0) goto LAB_0013e8f7;\n  }\n  pcVar4 = opt.locale;\n  iVar3 = c_strcasecmp(opt.locale,"utf-8");\n  if (iVar3 != 0) {\n    uVar5 = 0xffffffffffffffff;\n    do {\n      if (uVar5 == 0) break;\n      uVar5 = uVar5 - 1;\n      cVar1 = *pcVar6;\n      pcVar6 = pcVar6 + (ulong)bVar7 * -2 + 1;\n    } while (cVar1 != '\0');\n    _Var2 = do_conversion("UTF-8",pcVar4,str,~uVar5 - 1,&new);\n    pcVar6 = new;\n    if (!_Var2) {\n      free(new);\n      pcVar6 = str;\n    }\n  }\nLAB_0013e8f7:\n  if (local_20 != *(long *)(in_FS_OFFSET + 0x28)) {\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail();\n  }\n  return pcVar6;\n}" primitive_type (pointer_declarator "* locale_to_utf8(char *str)" * (function_declarator "locale_to_utf8(char *str)" identifier (parameter_list "(char *str)" ( (parameter_declaration "char *str" primitive_type (pointer_declarator "*str" * identifier)) )))) (compound_statement "{\n  char cVar1;\n  _Bool _Var2;\n  int iVar3;\n  char *pcVar4;\n  ulong uVar5;\n  char *pcVar6;\n  long in_FS_OFFSET;\n  byte bVar7;\n  char *new;\n  long local_20;\n  \n  bVar7 = 0;\n  local_20 = *(long *)(in_FS_OFFSET + 0x28);\n  pcVar6 = str;\n  if (opt.locale == (char *)0x0) {\n    pcVar4 = (char *)dcgettext(0,"locale_to_utf8: locale is unset\n",5);\n    logprintf(LOG_VERBOSE,pcVar4);\n    opt.locale = find_locale();\n    if (opt.locale == (char *)0x0) goto LAB_0013e8f7;\n  }\n  pcVar4 = opt.locale;\n  iVar3 = c_strcasecmp(opt.locale,"utf-8");\n  if (iVar3 != 0) {\n    uVar5 = 0xffffffffffffffff;\n    do {\n      if (uVar5 == 0) break;\n      uVar5 = uVar5 - 1;\n      cVar1 = *pcVar6;\n      pcVar6 = pcVar6 + (ulong)bVar7 * -2 + 1;\n    } while (cVar1 != '\0');\n    _Var2 = do_conversion("UTF-8",pcVar4,str,~uVar5 - 1,&new);\n    pcVar6 = new;\n    if (!_Var2) {\n      free(new);\n      pcVar6 = str;\n    }\n  }\nLAB_0013e8f7:\n  if (local_20 != *(long *)(in_FS_OFFSET + 0x28)) {\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail();\n  }\n  return pcVar6;\n}" { (declaration "char cVar1;" primitive_type identifier ;) (declaration "_Bool _Var2;" type_identifier identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "char *pcVar4;" primitive_type (pointer_declarator "*pcVar4" * identifier) ;) (declaration "ulong uVar5;" type_identifier identifier ;) (declaration "char *pcVar6;" primitive_type (pointer_declarator "*pcVar6" * identifier) ;) (declaration "long in_FS_OFFSET;" (sized_type_specifier "long" long) identifier ;) (declaration "byte bVar7;" type_identifier identifier ;) (declaration "char *new;" primitive_type (pointer_declarator "*new" * identifier) ;) (declaration "long local_20;" (sized_type_specifier "long" long) identifier ;) (expression_statement "bVar7 = 0;" (assignment_expression "bVar7 = 0" identifier = number_literal) ;) (expression_statement "local_20 = *(long *)(in_FS_OFFSET + 0x28);" (assignment_expression "local_20 = *(long *)(in_FS_OFFSET + 0x28)" identifier = (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" * (cast_expression "(long *)(in_FS_OFFSET + 0x28)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_FS_OFFSET + 0x28)" ( (binary_expression "in_FS_OFFSET + 0x28" identifier + number_literal) ))))) ;) (expression_statement "pcVar6 = str;" (assignment_expression "pcVar6 = str" identifier = identifier) ;) (if_statement "if (opt.locale == (char *)0x0) {\n    pcVar4 = (char *)dcgettext(0,"locale_to_utf8: locale is unset\n",5);\n    logprintf(LOG_VERBOSE,pcVar4);\n    opt.locale = find_locale();\n    if (opt.locale == (char *)0x0) goto LAB_0013e8f7;\n  }" if (parenthesized_expression "(opt.locale == (char *)0x0)" ( (binary_expression "opt.locale == (char *)0x0" (field_expression "opt.locale" identifier . field_identifier) == (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    pcVar4 = (char *)dcgettext(0,"locale_to_utf8: locale is unset\n",5);\n    logprintf(LOG_VERBOSE,pcVar4);\n    opt.locale = find_locale();\n    if (opt.locale == (char *)0x0) goto LAB_0013e8f7;\n  }" { (expression_statement "pcVar4 = (char *)dcgettext(0,"locale_to_utf8: locale is unset\n",5);" (assignment_expression "pcVar4 = (char *)dcgettext(0,"locale_to_utf8: locale is unset\n",5)" identifier = (cast_expression "(char *)dcgettext(0,"locale_to_utf8: locale is unset\n",5)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "dcgettext(0,"locale_to_utf8: locale is unset\n",5)" identifier (argument_list "(0,"locale_to_utf8: locale is unset\n",5)" ( number_literal , (string_literal ""locale_to_utf8: locale is unset\n"" " string_content escape_sequence ") , number_literal ))))) ;) (expression_statement "logprintf(LOG_VERBOSE,pcVar4);" (call_expression "logprintf(LOG_VERBOSE,pcVar4)" identifier (argument_list "(LOG_VERBOSE,pcVar4)" ( identifier , identifier ))) ;) (expression_statement "opt.locale = find_locale();" (assignment_expression "opt.locale = find_locale()" (field_expression "opt.locale" identifier . field_identifier) = (call_expression "find_locale()" identifier (argument_list "()" ( )))) ;) (if_statement "if (opt.locale == (char *)0x0) goto LAB_0013e8f7;" if (parenthesized_expression "(opt.locale == (char *)0x0)" ( (binary_expression "opt.locale == (char *)0x0" (field_expression "opt.locale" identifier . field_identifier) == (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (goto_statement "goto LAB_0013e8f7;" goto statement_identifier ;)) })) (expression_statement "pcVar4 = opt.locale;" (assignment_expression "pcVar4 = opt.locale" identifier = (field_expression "opt.locale" identifier . field_identifier)) ;) (expression_statement "iVar3 = c_strcasecmp(opt.locale,"utf-8");" (assignment_expression "iVar3 = c_strcasecmp(opt.locale,"utf-8")" identifier = (call_expression "c_strcasecmp(opt.locale,"utf-8")" identifier (argument_list "(opt.locale,"utf-8")" ( (field_expression "opt.locale" identifier . field_identifier) , (string_literal ""utf-8"" " string_content ") )))) ;) (if_statement "if (iVar3 != 0) {\n    uVar5 = 0xffffffffffffffff;\n    do {\n      if (uVar5 == 0) break;\n      uVar5 = uVar5 - 1;\n      cVar1 = *pcVar6;\n      pcVar6 = pcVar6 + (ulong)bVar7 * -2 + 1;\n    } while (cVar1 != '\0');\n    _Var2 = do_conversion("UTF-8",pcVar4,str,~uVar5 - 1,&new);\n    pcVar6 = new;\n    if (!_Var2) {\n      free(new);\n      pcVar6 = str;\n    }\n  }" if (parenthesized_expression "(iVar3 != 0)" ( (binary_expression "iVar3 != 0" identifier != number_literal) )) (compound_statement "{\n    uVar5 = 0xffffffffffffffff;\n    do {\n      if (uVar5 == 0) break;\n      uVar5 = uVar5 - 1;\n      cVar1 = *pcVar6;\n      pcVar6 = pcVar6 + (ulong)bVar7 * -2 + 1;\n    } while (cVar1 != '\0');\n    _Var2 = do_conversion("UTF-8",pcVar4,str,~uVar5 - 1,&new);\n    pcVar6 = new;\n    if (!_Var2) {\n      free(new);\n      pcVar6 = str;\n    }\n  }" { (expression_statement "uVar5 = 0xffffffffffffffff;" (assignment_expression "uVar5 = 0xffffffffffffffff" identifier = number_literal) ;) (do_statement "do {\n      if (uVar5 == 0) break;\n      uVar5 = uVar5 - 1;\n      cVar1 = *pcVar6;\n      pcVar6 = pcVar6 + (ulong)bVar7 * -2 + 1;\n    } while (cVar1 != '\0');" do (compound_statement "{\n      if (uVar5 == 0) break;\n      uVar5 = uVar5 - 1;\n      cVar1 = *pcVar6;\n      pcVar6 = pcVar6 + (ulong)bVar7 * -2 + 1;\n    }" { (if_statement "if (uVar5 == 0) break;" if (parenthesized_expression "(uVar5 == 0)" ( (binary_expression "uVar5 == 0" identifier == number_literal) )) (break_statement "break;" break ;)) (expression_statement "uVar5 = uVar5 - 1;" (assignment_expression "uVar5 = uVar5 - 1" identifier = (binary_expression "uVar5 - 1" identifier - number_literal)) ;) (expression_statement "cVar1 = *pcVar6;" (assignment_expression "cVar1 = *pcVar6" identifier = (pointer_expression "*pcVar6" * identifier)) ;) (expression_statement "pcVar6 = pcVar6 + (ulong)bVar7 * -2 + 1;" (assignment_expression "pcVar6 = pcVar6 + (ulong)bVar7 * -2 + 1" identifier = (binary_expression "pcVar6 + (ulong)bVar7 * -2 + 1" (binary_expression "pcVar6 + (ulong)bVar7 * -2" identifier + (binary_expression "(ulong)bVar7 * -2" (cast_expression "(ulong)bVar7" ( (type_descriptor "ulong" type_identifier) ) identifier) * number_literal)) + number_literal)) ;) }) while (parenthesized_expression "(cVar1 != '\0')" ( (binary_expression "cVar1 != '\0'" identifier != (char_literal "'\0'" ' escape_sequence ')) )) ;) (expression_statement "_Var2 = do_conversion("UTF-8",pcVar4,str,~uVar5 - 1,&new);" (assignment_expression "_Var2 = do_conversion("UTF-8",pcVar4,str,~uVar5 - 1,&new)" identifier = (call_expression "do_conversion("UTF-8",pcVar4,str,~uVar5 - 1,&new)" identifier (argument_list "("UTF-8",pcVar4,str,~uVar5 - 1,&new)" ( (string_literal ""UTF-8"" " string_content ") , identifier , identifier , (binary_expression "~uVar5 - 1" (unary_expression "~uVar5" ~ identifier) - number_literal) , (pointer_expression "&new" & identifier) )))) ;) (expression_statement "pcVar6 = new;" (assignment_expression "pcVar6 = new" identifier = identifier) ;) (if_statement "if (!_Var2) {\n      free(new);\n      pcVar6 = str;\n    }" if (parenthesized_expression "(!_Var2)" ( (unary_expression "!_Var2" ! identifier) )) (compound_statement "{\n      free(new);\n      pcVar6 = str;\n    }" { (expression_statement "free(new);" (call_expression "free(new)" identifier (argument_list "(new)" ( identifier ))) ;) (expression_statement "pcVar6 = str;" (assignment_expression "pcVar6 = str" identifier = identifier) ;) })) })) (labeled_statement "LAB_0013e8f7:\n  if (local_20 != *(long *)(in_FS_OFFSET + 0x28)) {\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail();\n  }" statement_identifier : (if_statement "if (local_20 != *(long *)(in_FS_OFFSET + 0x28)) {\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail();\n  }" if (parenthesized_expression "(local_20 != *(long *)(in_FS_OFFSET + 0x28))" ( (binary_expression "local_20 != *(long *)(in_FS_OFFSET + 0x28)" identifier != (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" * (cast_expression "(long *)(in_FS_OFFSET + 0x28)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_FS_OFFSET + 0x28)" ( (binary_expression "in_FS_OFFSET + 0x28" identifier + number_literal) ))))) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail();\n  }" { comment (expression_statement "__stack_chk_fail();" (call_expression "__stack_chk_fail()" identifier (argument_list "()" ( ))) ;) }))) (return_statement "return pcVar6;" return identifier ;) })))
(translation_unit "char * FUN_0013e8bf(char *param_1)\n\n{\n  long lVar1;\n  char cVar2;\n  int iVar3;\n  undefined8 uVar4;\n  ulong uVar5;\n  char *pcVar6;\n  long in_FS_OFFSET;\n  byte bVar7;\n  char *local_28;\n  long local_20;\n  \n  bVar7 = 0;\n  local_20 = *(long *)(in_FS_OFFSET + 0x28);\n  pcVar6 = param_1;\n  if (DAT_00177610 == 0) {\n    uVar4 = dcgettext(0,"locale_to_utf8: locale is unset\n",5);\n    FUN_0012bc55(0,uVar4);\n    DAT_00177610 = FUN_0013e796();\n    if (DAT_00177610 == 0) goto LAB_0013e8f7;\n  }\n  lVar1 = DAT_00177610;\n  iVar3 = FUN_00141bb2(DAT_00177610,"utf-8");\n  if (iVar3 != 0) {\n    uVar5 = 0xffffffffffffffff;\n    do {\n      if (uVar5 == 0) break;\n      uVar5 = uVar5 - 1;\n      cVar2 = *pcVar6;\n      pcVar6 = pcVar6 + (ulong)bVar7 * -2 + 1;\n    } while (cVar2 != '\0');\n    cVar2 = FUN_0013e3e1("UTF-8",lVar1,param_1,~uVar5 - 1,&local_28);\n    pcVar6 = local_28;\n    if (cVar2 == '\0') {\n      free(local_28);\n      pcVar6 = param_1;\n    }\n  }\nLAB_0013e8f7:\n  if (local_20 != *(long *)(in_FS_OFFSET + 0x28)) {\n                    \n    __stack_chk_fail();\n  }\n  return pcVar6;\n}\n\n" (function_definition "char * FUN_0013e8bf(char *param_1)\n\n{\n  long lVar1;\n  char cVar2;\n  int iVar3;\n  undefined8 uVar4;\n  ulong uVar5;\n  char *pcVar6;\n  long in_FS_OFFSET;\n  byte bVar7;\n  char *local_28;\n  long local_20;\n  \n  bVar7 = 0;\n  local_20 = *(long *)(in_FS_OFFSET + 0x28);\n  pcVar6 = param_1;\n  if (DAT_00177610 == 0) {\n    uVar4 = dcgettext(0,"locale_to_utf8: locale is unset\n",5);\n    FUN_0012bc55(0,uVar4);\n    DAT_00177610 = FUN_0013e796();\n    if (DAT_00177610 == 0) goto LAB_0013e8f7;\n  }\n  lVar1 = DAT_00177610;\n  iVar3 = FUN_00141bb2(DAT_00177610,"utf-8");\n  if (iVar3 != 0) {\n    uVar5 = 0xffffffffffffffff;\n    do {\n      if (uVar5 == 0) break;\n      uVar5 = uVar5 - 1;\n      cVar2 = *pcVar6;\n      pcVar6 = pcVar6 + (ulong)bVar7 * -2 + 1;\n    } while (cVar2 != '\0');\n    cVar2 = FUN_0013e3e1("UTF-8",lVar1,param_1,~uVar5 - 1,&local_28);\n    pcVar6 = local_28;\n    if (cVar2 == '\0') {\n      free(local_28);\n      pcVar6 = param_1;\n    }\n  }\nLAB_0013e8f7:\n  if (local_20 != *(long *)(in_FS_OFFSET + 0x28)) {\n                    \n    __stack_chk_fail();\n  }\n  return pcVar6;\n}" primitive_type (pointer_declarator "* FUN_0013e8bf(char *param_1)" * (function_declarator "FUN_0013e8bf(char *param_1)" identifier (parameter_list "(char *param_1)" ( (parameter_declaration "char *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) )))) (compound_statement "{\n  long lVar1;\n  char cVar2;\n  int iVar3;\n  undefined8 uVar4;\n  ulong uVar5;\n  char *pcVar6;\n  long in_FS_OFFSET;\n  byte bVar7;\n  char *local_28;\n  long local_20;\n  \n  bVar7 = 0;\n  local_20 = *(long *)(in_FS_OFFSET + 0x28);\n  pcVar6 = param_1;\n  if (DAT_00177610 == 0) {\n    uVar4 = dcgettext(0,"locale_to_utf8: locale is unset\n",5);\n    FUN_0012bc55(0,uVar4);\n    DAT_00177610 = FUN_0013e796();\n    if (DAT_00177610 == 0) goto LAB_0013e8f7;\n  }\n  lVar1 = DAT_00177610;\n  iVar3 = FUN_00141bb2(DAT_00177610,"utf-8");\n  if (iVar3 != 0) {\n    uVar5 = 0xffffffffffffffff;\n    do {\n      if (uVar5 == 0) break;\n      uVar5 = uVar5 - 1;\n      cVar2 = *pcVar6;\n      pcVar6 = pcVar6 + (ulong)bVar7 * -2 + 1;\n    } while (cVar2 != '\0');\n    cVar2 = FUN_0013e3e1("UTF-8",lVar1,param_1,~uVar5 - 1,&local_28);\n    pcVar6 = local_28;\n    if (cVar2 == '\0') {\n      free(local_28);\n      pcVar6 = param_1;\n    }\n  }\nLAB_0013e8f7:\n  if (local_20 != *(long *)(in_FS_OFFSET + 0x28)) {\n                    \n    __stack_chk_fail();\n  }\n  return pcVar6;\n}" { (declaration "long lVar1;" (sized_type_specifier "long" long) identifier ;) (declaration "char cVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "undefined8 uVar4;" type_identifier identifier ;) (declaration "ulong uVar5;" type_identifier identifier ;) (declaration "char *pcVar6;" primitive_type (pointer_declarator "*pcVar6" * identifier) ;) (declaration "long in_FS_OFFSET;" (sized_type_specifier "long" long) identifier ;) (declaration "byte bVar7;" type_identifier identifier ;) (declaration "char *local_28;" primitive_type (pointer_declarator "*local_28" * identifier) ;) (declaration "long local_20;" (sized_type_specifier "long" long) identifier ;) (expression_statement "bVar7 = 0;" (assignment_expression "bVar7 = 0" identifier = number_literal) ;) (expression_statement "local_20 = *(long *)(in_FS_OFFSET + 0x28);" (assignment_expression "local_20 = *(long *)(in_FS_OFFSET + 0x28)" identifier = (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" * (cast_expression "(long *)(in_FS_OFFSET + 0x28)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_FS_OFFSET + 0x28)" ( (binary_expression "in_FS_OFFSET + 0x28" identifier + number_literal) ))))) ;) (expression_statement "pcVar6 = param_1;" (assignment_expression "pcVar6 = param_1" identifier = identifier) ;) (if_statement "if (DAT_00177610 == 0) {\n    uVar4 = dcgettext(0,"locale_to_utf8: locale is unset\n",5);\n    FUN_0012bc55(0,uVar4);\n    DAT_00177610 = FUN_0013e796();\n    if (DAT_00177610 == 0) goto LAB_0013e8f7;\n  }" if (parenthesized_expression "(DAT_00177610 == 0)" ( (binary_expression "DAT_00177610 == 0" identifier == number_literal) )) (compound_statement "{\n    uVar4 = dcgettext(0,"locale_to_utf8: locale is unset\n",5);\n    FUN_0012bc55(0,uVar4);\n    DAT_00177610 = FUN_0013e796();\n    if (DAT_00177610 == 0) goto LAB_0013e8f7;\n  }" { (expression_statement "uVar4 = dcgettext(0,"locale_to_utf8: locale is unset\n",5);" (assignment_expression "uVar4 = dcgettext(0,"locale_to_utf8: locale is unset\n",5)" identifier = (call_expression "dcgettext(0,"locale_to_utf8: locale is unset\n",5)" identifier (argument_list "(0,"locale_to_utf8: locale is unset\n",5)" ( number_literal , (string_literal ""locale_to_utf8: locale is unset\n"" " string_content escape_sequence ") , number_literal )))) ;) (expression_statement "FUN_0012bc55(0,uVar4);" (call_expression "FUN_0012bc55(0,uVar4)" identifier (argument_list "(0,uVar4)" ( number_literal , identifier ))) ;) (expression_statement "DAT_00177610 = FUN_0013e796();" (assignment_expression "DAT_00177610 = FUN_0013e796()" identifier = (call_expression "FUN_0013e796()" identifier (argument_list "()" ( )))) ;) (if_statement "if (DAT_00177610 == 0) goto LAB_0013e8f7;" if (parenthesized_expression "(DAT_00177610 == 0)" ( (binary_expression "DAT_00177610 == 0" identifier == number_literal) )) (goto_statement "goto LAB_0013e8f7;" goto statement_identifier ;)) })) (expression_statement "lVar1 = DAT_00177610;" (assignment_expression "lVar1 = DAT_00177610" identifier = identifier) ;) (expression_statement "iVar3 = FUN_00141bb2(DAT_00177610,"utf-8");" (assignment_expression "iVar3 = FUN_00141bb2(DAT_00177610,"utf-8")" identifier = (call_expression "FUN_00141bb2(DAT_00177610,"utf-8")" identifier (argument_list "(DAT_00177610,"utf-8")" ( identifier , (string_literal ""utf-8"" " string_content ") )))) ;) (if_statement "if (iVar3 != 0) {\n    uVar5 = 0xffffffffffffffff;\n    do {\n      if (uVar5 == 0) break;\n      uVar5 = uVar5 - 1;\n      cVar2 = *pcVar6;\n      pcVar6 = pcVar6 + (ulong)bVar7 * -2 + 1;\n    } while (cVar2 != '\0');\n    cVar2 = FUN_0013e3e1("UTF-8",lVar1,param_1,~uVar5 - 1,&local_28);\n    pcVar6 = local_28;\n    if (cVar2 == '\0') {\n      free(local_28);\n      pcVar6 = param_1;\n    }\n  }" if (parenthesized_expression "(iVar3 != 0)" ( (binary_expression "iVar3 != 0" identifier != number_literal) )) (compound_statement "{\n    uVar5 = 0xffffffffffffffff;\n    do {\n      if (uVar5 == 0) break;\n      uVar5 = uVar5 - 1;\n      cVar2 = *pcVar6;\n      pcVar6 = pcVar6 + (ulong)bVar7 * -2 + 1;\n    } while (cVar2 != '\0');\n    cVar2 = FUN_0013e3e1("UTF-8",lVar1,param_1,~uVar5 - 1,&local_28);\n    pcVar6 = local_28;\n    if (cVar2 == '\0') {\n      free(local_28);\n      pcVar6 = param_1;\n    }\n  }" { (expression_statement "uVar5 = 0xffffffffffffffff;" (assignment_expression "uVar5 = 0xffffffffffffffff" identifier = number_literal) ;) (do_statement "do {\n      if (uVar5 == 0) break;\n      uVar5 = uVar5 - 1;\n      cVar2 = *pcVar6;\n      pcVar6 = pcVar6 + (ulong)bVar7 * -2 + 1;\n    } while (cVar2 != '\0');" do (compound_statement "{\n      if (uVar5 == 0) break;\n      uVar5 = uVar5 - 1;\n      cVar2 = *pcVar6;\n      pcVar6 = pcVar6 + (ulong)bVar7 * -2 + 1;\n    }" { (if_statement "if (uVar5 == 0) break;" if (parenthesized_expression "(uVar5 == 0)" ( (binary_expression "uVar5 == 0" identifier == number_literal) )) (break_statement "break;" break ;)) (expression_statement "uVar5 = uVar5 - 1;" (assignment_expression "uVar5 = uVar5 - 1" identifier = (binary_expression "uVar5 - 1" identifier - number_literal)) ;) (expression_statement "cVar2 = *pcVar6;" (assignment_expression "cVar2 = *pcVar6" identifier = (pointer_expression "*pcVar6" * identifier)) ;) (expression_statement "pcVar6 = pcVar6 + (ulong)bVar7 * -2 + 1;" (assignment_expression "pcVar6 = pcVar6 + (ulong)bVar7 * -2 + 1" identifier = (binary_expression "pcVar6 + (ulong)bVar7 * -2 + 1" (binary_expression "pcVar6 + (ulong)bVar7 * -2" identifier + (binary_expression "(ulong)bVar7 * -2" (cast_expression "(ulong)bVar7" ( (type_descriptor "ulong" type_identifier) ) identifier) * number_literal)) + number_literal)) ;) }) while (parenthesized_expression "(cVar2 != '\0')" ( (binary_expression "cVar2 != '\0'" identifier != (char_literal "'\0'" ' escape_sequence ')) )) ;) (expression_statement "cVar2 = FUN_0013e3e1("UTF-8",lVar1,param_1,~uVar5 - 1,&local_28);" (assignment_expression "cVar2 = FUN_0013e3e1("UTF-8",lVar1,param_1,~uVar5 - 1,&local_28)" identifier = (call_expression "FUN_0013e3e1("UTF-8",lVar1,param_1,~uVar5 - 1,&local_28)" identifier (argument_list "("UTF-8",lVar1,param_1,~uVar5 - 1,&local_28)" ( (string_literal ""UTF-8"" " string_content ") , identifier , identifier , (binary_expression "~uVar5 - 1" (unary_expression "~uVar5" ~ identifier) - number_literal) , (pointer_expression "&local_28" & identifier) )))) ;) (expression_statement "pcVar6 = local_28;" (assignment_expression "pcVar6 = local_28" identifier = identifier) ;) (if_statement "if (cVar2 == '\0') {\n      free(local_28);\n      pcVar6 = param_1;\n    }" if (parenthesized_expression "(cVar2 == '\0')" ( (binary_expression "cVar2 == '\0'" identifier == (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\n      free(local_28);\n      pcVar6 = param_1;\n    }" { (expression_statement "free(local_28);" (call_expression "free(local_28)" identifier (argument_list "(local_28)" ( identifier ))) ;) (expression_statement "pcVar6 = param_1;" (assignment_expression "pcVar6 = param_1" identifier = identifier) ;) })) })) (labeled_statement "LAB_0013e8f7:\n  if (local_20 != *(long *)(in_FS_OFFSET + 0x28)) {\n                    \n    __stack_chk_fail();\n  }" statement_identifier : (if_statement "if (local_20 != *(long *)(in_FS_OFFSET + 0x28)) {\n                    \n    __stack_chk_fail();\n  }" if (parenthesized_expression "(local_20 != *(long *)(in_FS_OFFSET + 0x28))" ( (binary_expression "local_20 != *(long *)(in_FS_OFFSET + 0x28)" identifier != (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" * (cast_expression "(long *)(in_FS_OFFSET + 0x28)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_FS_OFFSET + 0x28)" ( (binary_expression "in_FS_OFFSET + 0x28" identifier + number_literal) ))))) )) (compound_statement "{\n                    \n    __stack_chk_fail();\n  }" { (expression_statement "__stack_chk_fail();" (call_expression "__stack_chk_fail()" identifier (argument_list "()" ( ))) ;) }))) (return_statement "return pcVar6;" return identifier ;) })))
(translation_unit (function_definition TYPE (pointer_declarator * (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) )))) (compound_statement { (declaration (sized_type_specifier long) IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration (sized_type_specifier long) IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration (sized_type_specifier long) IDENT ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor (sized_type_specifier long) (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( LIT , (string_literal " string_content escape_sequence ") , LIT )))) ;) (expression_statement (call_expression IDENT (argument_list ( LIT , IDENT ))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (goto_statement goto statement_identifier ;)) })) (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , (string_literal " string_content ") )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) (do_statement do (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (break_statement break ;)) (expression_statement (assignment_expression IDENT = (binary_expression IDENT - LIT)) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression (binary_expression IDENT + (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) * LIT)) + LIT)) ;) }) while (parenthesized_expression ( (binary_expression IDENT != (char_literal ' escape_sequence ')) )) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (string_literal " string_content ") , IDENT , IDENT , (binary_expression (unary_expression ~ IDENT) - LIT) , (pointer_expression & IDENT) )))) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (char_literal ' escape_sequence ')) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) })) })) (labeled_statement statement_identifier : (if_statement if (parenthesized_expression ( (binary_expression IDENT != (pointer_expression * (cast_expression ( (type_descriptor (sized_type_specifier long) (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( ))) ;) }))) (return_statement return IDENT ;) })))
(function_definition "char * FUN_0013e8bf(char *param_1)\n\n{\n  long lVar1;\n  char cVar2;\n  int iVar3;\n  undefined8 uVar4;\n  ulong uVar5;\n  char *pcVar6;\n  long in_FS_OFFSET;\n  byte bVar7;\n  char *local_28;\n  long local_20;\n  \n  bVar7 = 0;\n  local_20 = *(long *)(in_FS_OFFSET + 0x28);\n  pcVar6 = param_1;\n  if (DAT_00177610 == 0) {\n    uVar4 = dcgettext(0,"locale_to_utf8: locale is unset\n",5);\n    FUN_0012bc55(0,uVar4);\n    DAT_00177610 = FUN_0013e796();\n    if (DAT_00177610 == 0) goto LAB_0013e8f7;\n  }\n  lVar1 = DAT_00177610;\n  iVar3 = FUN_00141bb2(DAT_00177610,"utf-8");\n  if (iVar3 != 0) {\n    uVar5 = 0xffffffffffffffff;\n    do {\n      if (uVar5 == 0) break;\n      uVar5 = uVar5 - 1;\n      cVar2 = *pcVar6;\n      pcVar6 = pcVar6 + (ulong)bVar7 * -2 + 1;\n    } while (cVar2 != '\0');\n    cVar2 = FUN_0013e3e1("UTF-8",lVar1,param_1,~uVar5 - 1,&local_28);\n    pcVar6 = local_28;\n    if (cVar2 == '\0') {\n      free(local_28);\n      pcVar6 = param_1;\n    }\n  }\nLAB_0013e8f7:\n  if (local_20 != *(long *)(in_FS_OFFSET + 0x28)) {\n                    \n    __stack_chk_fail();\n  }\n  return pcVar6;\n}" (primitive_type "char") (pointer_declarator "* FUN_0013e8bf(char *param_1)" (* "*") (function_declarator "FUN_0013e8bf(char *param_1)" (identifier "FUN_0013e8bf") (parameter_list "(char *param_1)" (( "(") (parameter_declaration "char *param_1" (primitive_type "char") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) () ")")))) (compound_statement "{\n  long lVar1;\n  char cVar2;\n  int iVar3;\n  undefined8 uVar4;\n  ulong uVar5;\n  char *pcVar6;\n  long in_FS_OFFSET;\n  byte bVar7;\n  char *local_28;\n  long local_20;\n  \n  bVar7 = 0;\n  local_20 = *(long *)(in_FS_OFFSET + 0x28);\n  pcVar6 = param_1;\n  if (DAT_00177610 == 0) {\n    uVar4 = dcgettext(0,"locale_to_utf8: locale is unset\n",5);\n    FUN_0012bc55(0,uVar4);\n    DAT_00177610 = FUN_0013e796();\n    if (DAT_00177610 == 0) goto LAB_0013e8f7;\n  }\n  lVar1 = DAT_00177610;\n  iVar3 = FUN_00141bb2(DAT_00177610,"utf-8");\n  if (iVar3 != 0) {\n    uVar5 = 0xffffffffffffffff;\n    do {\n      if (uVar5 == 0) break;\n      uVar5 = uVar5 - 1;\n      cVar2 = *pcVar6;\n      pcVar6 = pcVar6 + (ulong)bVar7 * -2 + 1;\n    } while (cVar2 != '\0');\n    cVar2 = FUN_0013e3e1("UTF-8",lVar1,param_1,~uVar5 - 1,&local_28);\n    pcVar6 = local_28;\n    if (cVar2 == '\0') {\n      free(local_28);\n      pcVar6 = param_1;\n    }\n  }\nLAB_0013e8f7:\n  if (local_20 != *(long *)(in_FS_OFFSET + 0x28)) {\n                    \n    __stack_chk_fail();\n  }\n  return pcVar6;\n}" ({ "{") (declaration "long lVar1;" (sized_type_specifier "long" (long "long")) (identifier "lVar1") (; ";")) (declaration "char cVar2;" (primitive_type "char") (identifier "cVar2") (; ";")) (declaration "int iVar3;" (primitive_type "int") (identifier "iVar3") (; ";")) (declaration "undefined8 uVar4;" (type_identifier "undefined8") (identifier "uVar4") (; ";")) (declaration "ulong uVar5;" (type_identifier "ulong") (identifier "uVar5") (; ";")) (declaration "char *pcVar6;" (primitive_type "char") (pointer_declarator "*pcVar6" (* "*") (identifier "pcVar6")) (; ";")) (declaration "long in_FS_OFFSET;" (sized_type_specifier "long" (long "long")) (identifier "in_FS_OFFSET") (; ";")) (declaration "byte bVar7;" (type_identifier "byte") (identifier "bVar7") (; ";")) (declaration "char *local_28;" (primitive_type "char") (pointer_declarator "*local_28" (* "*") (identifier "local_28")) (; ";")) (declaration "long local_20;" (sized_type_specifier "long" (long "long")) (identifier "local_20") (; ";")) (expression_statement "bVar7 = 0;" (assignment_expression "bVar7 = 0" (identifier "bVar7") (= "=") (number_literal "0")) (; ";")) (expression_statement "local_20 = *(long *)(in_FS_OFFSET + 0x28);" (assignment_expression "local_20 = *(long *)(in_FS_OFFSET + 0x28)" (identifier "local_20") (= "=") (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" (* "*") (cast_expression "(long *)(in_FS_OFFSET + 0x28)" (( "(") (type_descriptor "long *" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_FS_OFFSET + 0x28)" (( "(") (binary_expression "in_FS_OFFSET + 0x28" (identifier "in_FS_OFFSET") (+ "+") (number_literal "0x28")) () ")"))))) (; ";")) (expression_statement "pcVar6 = param_1;" (assignment_expression "pcVar6 = param_1" (identifier "pcVar6") (= "=") (identifier "param_1")) (; ";")) (if_statement "if (DAT_00177610 == 0) {\n    uVar4 = dcgettext(0,"locale_to_utf8: locale is unset\n",5);\n    FUN_0012bc55(0,uVar4);\n    DAT_00177610 = FUN_0013e796();\n    if (DAT_00177610 == 0) goto LAB_0013e8f7;\n  }" (if "if") (parenthesized_expression "(DAT_00177610 == 0)" (( "(") (binary_expression "DAT_00177610 == 0" (identifier "DAT_00177610") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    uVar4 = dcgettext(0,"locale_to_utf8: locale is unset\n",5);\n    FUN_0012bc55(0,uVar4);\n    DAT_00177610 = FUN_0013e796();\n    if (DAT_00177610 == 0) goto LAB_0013e8f7;\n  }" ({ "{") (expression_statement "uVar4 = dcgettext(0,"locale_to_utf8: locale is unset\n",5);" (assignment_expression "uVar4 = dcgettext(0,"locale_to_utf8: locale is unset\n",5)" (identifier "uVar4") (= "=") (call_expression "dcgettext(0,"locale_to_utf8: locale is unset\n",5)" (identifier "dcgettext") (argument_list "(0,"locale_to_utf8: locale is unset\n",5)" (( "(") (number_literal "0") (, ",") (string_literal ""locale_to_utf8: locale is unset\n"" (" """) (string_content "locale_to_utf8: locale is unset") (escape_sequence "\n") (" """)) (, ",") (number_literal "5") () ")")))) (; ";")) (expression_statement "FUN_0012bc55(0,uVar4);" (call_expression "FUN_0012bc55(0,uVar4)" (identifier "FUN_0012bc55") (argument_list "(0,uVar4)" (( "(") (number_literal "0") (, ",") (identifier "uVar4") () ")"))) (; ";")) (expression_statement "DAT_00177610 = FUN_0013e796();" (assignment_expression "DAT_00177610 = FUN_0013e796()" (identifier "DAT_00177610") (= "=") (call_expression "FUN_0013e796()" (identifier "FUN_0013e796") (argument_list "()" (( "(") () ")")))) (; ";")) (if_statement "if (DAT_00177610 == 0) goto LAB_0013e8f7;" (if "if") (parenthesized_expression "(DAT_00177610 == 0)" (( "(") (binary_expression "DAT_00177610 == 0" (identifier "DAT_00177610") (== "==") (number_literal "0")) () ")")) (goto_statement "goto LAB_0013e8f7;" (goto "goto") (statement_identifier "LAB_0013e8f7") (; ";"))) (} "}"))) (expression_statement "lVar1 = DAT_00177610;" (assignment_expression "lVar1 = DAT_00177610" (identifier "lVar1") (= "=") (identifier "DAT_00177610")) (; ";")) (expression_statement "iVar3 = FUN_00141bb2(DAT_00177610,"utf-8");" (assignment_expression "iVar3 = FUN_00141bb2(DAT_00177610,"utf-8")" (identifier "iVar3") (= "=") (call_expression "FUN_00141bb2(DAT_00177610,"utf-8")" (identifier "FUN_00141bb2") (argument_list "(DAT_00177610,"utf-8")" (( "(") (identifier "DAT_00177610") (, ",") (string_literal ""utf-8"" (" """) (string_content "utf-8") (" """)) () ")")))) (; ";")) (if_statement "if (iVar3 != 0) {\n    uVar5 = 0xffffffffffffffff;\n    do {\n      if (uVar5 == 0) break;\n      uVar5 = uVar5 - 1;\n      cVar2 = *pcVar6;\n      pcVar6 = pcVar6 + (ulong)bVar7 * -2 + 1;\n    } while (cVar2 != '\0');\n    cVar2 = FUN_0013e3e1("UTF-8",lVar1,param_1,~uVar5 - 1,&local_28);\n    pcVar6 = local_28;\n    if (cVar2 == '\0') {\n      free(local_28);\n      pcVar6 = param_1;\n    }\n  }" (if "if") (parenthesized_expression "(iVar3 != 0)" (( "(") (binary_expression "iVar3 != 0" (identifier "iVar3") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n    uVar5 = 0xffffffffffffffff;\n    do {\n      if (uVar5 == 0) break;\n      uVar5 = uVar5 - 1;\n      cVar2 = *pcVar6;\n      pcVar6 = pcVar6 + (ulong)bVar7 * -2 + 1;\n    } while (cVar2 != '\0');\n    cVar2 = FUN_0013e3e1("UTF-8",lVar1,param_1,~uVar5 - 1,&local_28);\n    pcVar6 = local_28;\n    if (cVar2 == '\0') {\n      free(local_28);\n      pcVar6 = param_1;\n    }\n  }" ({ "{") (expression_statement "uVar5 = 0xffffffffffffffff;" (assignment_expression "uVar5 = 0xffffffffffffffff" (identifier "uVar5") (= "=") (number_literal "0xffffffffffffffff")) (; ";")) (do_statement "do {\n      if (uVar5 == 0) break;\n      uVar5 = uVar5 - 1;\n      cVar2 = *pcVar6;\n      pcVar6 = pcVar6 + (ulong)bVar7 * -2 + 1;\n    } while (cVar2 != '\0');" (do "do") (compound_statement "{\n      if (uVar5 == 0) break;\n      uVar5 = uVar5 - 1;\n      cVar2 = *pcVar6;\n      pcVar6 = pcVar6 + (ulong)bVar7 * -2 + 1;\n    }" ({ "{") (if_statement "if (uVar5 == 0) break;" (if "if") (parenthesized_expression "(uVar5 == 0)" (( "(") (binary_expression "uVar5 == 0" (identifier "uVar5") (== "==") (number_literal "0")) () ")")) (break_statement "break;" (break "break") (; ";"))) (expression_statement "uVar5 = uVar5 - 1;" (assignment_expression "uVar5 = uVar5 - 1" (identifier "uVar5") (= "=") (binary_expression "uVar5 - 1" (identifier "uVar5") (- "-") (number_literal "1"))) (; ";")) (expression_statement "cVar2 = *pcVar6;" (assignment_expression "cVar2 = *pcVar6" (identifier "cVar2") (= "=") (pointer_expression "*pcVar6" (* "*") (identifier "pcVar6"))) (; ";")) (expression_statement "pcVar6 = pcVar6 + (ulong)bVar7 * -2 + 1;" (assignment_expression "pcVar6 = pcVar6 + (ulong)bVar7 * -2 + 1" (identifier "pcVar6") (= "=") (binary_expression "pcVar6 + (ulong)bVar7 * -2 + 1" (binary_expression "pcVar6 + (ulong)bVar7 * -2" (identifier "pcVar6") (+ "+") (binary_expression "(ulong)bVar7 * -2" (cast_expression "(ulong)bVar7" (( "(") (type_descriptor "ulong" (type_identifier "ulong")) () ")") (identifier "bVar7")) (* "*") (number_literal "-2"))) (+ "+") (number_literal "1"))) (; ";")) (} "}")) (while "while") (parenthesized_expression "(cVar2 != '\0')" (( "(") (binary_expression "cVar2 != '\0'" (identifier "cVar2") (!= "!=") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) () ")")) (; ";")) (expression_statement "cVar2 = FUN_0013e3e1("UTF-8",lVar1,param_1,~uVar5 - 1,&local_28);" (assignment_expression "cVar2 = FUN_0013e3e1("UTF-8",lVar1,param_1,~uVar5 - 1,&local_28)" (identifier "cVar2") (= "=") (call_expression "FUN_0013e3e1("UTF-8",lVar1,param_1,~uVar5 - 1,&local_28)" (identifier "FUN_0013e3e1") (argument_list "("UTF-8",lVar1,param_1,~uVar5 - 1,&local_28)" (( "(") (string_literal ""UTF-8"" (" """) (string_content "UTF-8") (" """)) (, ",") (identifier "lVar1") (, ",") (identifier "param_1") (, ",") (binary_expression "~uVar5 - 1" (unary_expression "~uVar5" (~ "~") (identifier "uVar5")) (- "-") (number_literal "1")) (, ",") (pointer_expression "&local_28" (& "&") (identifier "local_28")) () ")")))) (; ";")) (expression_statement "pcVar6 = local_28;" (assignment_expression "pcVar6 = local_28" (identifier "pcVar6") (= "=") (identifier "local_28")) (; ";")) (if_statement "if (cVar2 == '\0') {\n      free(local_28);\n      pcVar6 = param_1;\n    }" (if "if") (parenthesized_expression "(cVar2 == '\0')" (( "(") (binary_expression "cVar2 == '\0'" (identifier "cVar2") (== "==") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) () ")")) (compound_statement "{\n      free(local_28);\n      pcVar6 = param_1;\n    }" ({ "{") (expression_statement "free(local_28);" (call_expression "free(local_28)" (identifier "free") (argument_list "(local_28)" (( "(") (identifier "local_28") () ")"))) (; ";")) (expression_statement "pcVar6 = param_1;" (assignment_expression "pcVar6 = param_1" (identifier "pcVar6") (= "=") (identifier "param_1")) (; ";")) (} "}"))) (} "}"))) (labeled_statement "LAB_0013e8f7:\n  if (local_20 != *(long *)(in_FS_OFFSET + 0x28)) {\n                    \n    __stack_chk_fail();\n  }" (statement_identifier "LAB_0013e8f7") (: ":") (if_statement "if (local_20 != *(long *)(in_FS_OFFSET + 0x28)) {\n                    \n    __stack_chk_fail();\n  }" (if "if") (parenthesized_expression "(local_20 != *(long *)(in_FS_OFFSET + 0x28))" (( "(") (binary_expression "local_20 != *(long *)(in_FS_OFFSET + 0x28)" (identifier "local_20") (!= "!=") (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" (* "*") (cast_expression "(long *)(in_FS_OFFSET + 0x28)" (( "(") (type_descriptor "long *" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_FS_OFFSET + 0x28)" (( "(") (binary_expression "in_FS_OFFSET + 0x28" (identifier "in_FS_OFFSET") (+ "+") (number_literal "0x28")) () ")"))))) () ")")) (compound_statement "{\n                    \n    __stack_chk_fail();\n  }" ({ "{") (expression_statement "__stack_chk_fail();" (call_expression "__stack_chk_fail()" (identifier "__stack_chk_fail") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}")))) (return_statement "return pcVar6;" (return "return") (identifier "pcVar6") (; ";")) (} "}")))

/* WARNING: Enum "anon_enum_32": Some values do not have unique names */

char * function_1(char *str)

{
  char var_9;
  type_1 _Var2;
  int var_6;
  char *pcVar4;
  type_2 var_7;
  char *var_8;
  long var_1;
  type_3 bVar7;
  char *new;
  long var_12;
  
  bVar7 = 0;
  var_12 = *(long *)(var_1 + 0x28);
  var_8 = str;
  if (opt.locale == (char *)0x0) {
    pcVar4 = (char *)var_2(0,"locale_to_utf8: locale is unset\n",5);
    var_3(LOG_VERBOSE,pcVar4);
    opt.locale = var_4();
    if (opt.locale == (char *)0x0) goto LAB_0013e8f7;
  }
  pcVar4 = opt.locale;
  var_6 = var_5(opt.locale,"utf-8");
  if (var_6 != 0) {
    var_7 = 0xffffffffffffffff;
    do {
      if (var_7 == 0) break;
      var_7 = var_7 - 1;
      var_9 = *var_8;
      var_8 = var_8 + (type_2)bVar7 * -2 + 1;
    } while (var_9 != '\0');
    _Var2 = var_10("UTF-8",pcVar4,str,~var_7 - 1,&new);
    var_8 = new;
    if (!_Var2) {
      var_11(new);
      var_8 = str;
    }
  }
LAB_0013e8f7:
  if (var_12 != *(long *)(var_1 + 0x28)) {
                    /* WARNING: Subroutine does not return */
    var_13();
  }
  return var_8;
}


(translation_unit (function_definition type: (primitive_type) declarator: (pointer_declarator declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier)))))) body: (compound_statement (declaration type: (sized_type_specifier) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (sized_type_specifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (sized_type_specifier) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (sized_type_specifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (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 (number_literal) (string_literal (string_content) (escape_sequence)) (number_literal))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (number_literal) (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (goto_statement label: (statement_identifier))))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (string_literal (string_content)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (do_statement body: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (break_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)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (binary_expression left: (identifier) right: (binary_expression left: (cast_expression type: (type_descriptor type: (type_identifier)) value: (identifier)) right: (number_literal))) right: (number_literal))))) condition: (parenthesized_expression (binary_expression left: (identifier) right: (char_literal (escape_sequence))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (string_literal (string_content)) (identifier) (identifier) (binary_expression left: (unary_expression argument: (identifier)) right: (number_literal)) (pointer_expression argument: (identifier)))))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (char_literal (escape_sequence)))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (identifier))))))) (labeled_statement label: (statement_identifier) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (sized_type_specifier) 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)))))

char * MASKED(char *param_1)

{
  long lVar1;
  char cVar2;
  int iVar3;
  undefined8 uVar4;
  ulong uVar5;
  char *pcVar6;
  long in_FS_OFFSET;
  byte bVar7;
  char *local_28;
  long local_20;
  
  bVar7 = 0;
  local_20 = *(long *)(in_FS_OFFSET + 0x28);
  pcVar6 = param_1;
  if (DAT_00177610 == 0) {
    uVar4 = dcgettext(0,"locale_to_utf8: locale is unset\n",5);
    FUN_0012bc55(0,uVar4);
    DAT_00177610 = FUN_0013e796();
    if (DAT_00177610 == 0) goto LAB_0013e8f7;
  }
  lVar1 = DAT_00177610;
  iVar3 = FUN_00141bb2(DAT_00177610,"utf-8");
  if (iVar3 != 0) {
    uVar5 = 0xffffffffffffffff;
    do {
      if (uVar5 == 0) break;
      uVar5 = uVar5 - 1;
      cVar2 = *pcVar6;
      pcVar6 = pcVar6 + (ulong)bVar7 * -2 + 1;
    } while (cVar2 != '\0');
    cVar2 = FUN_0013e3e1("UTF-8",lVar1,param_1,~uVar5 - 1,&local_28);
    pcVar6 = local_28;
    if (cVar2 == '\0') {
      free(local_28);
      pcVar6 = param_1;
    }
  }
LAB_0013e8f7:
  if (local_20 != *(long *)(in_FS_OFFSET + 0x28)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  return pcVar6;
}

