
int u32toutf16(uint c,ushort *s)

{
  int iVar1;
  uint uVar2;
  ushort *puVar3;
  
  if ((c < 0xd800) || (c - 0xe000 < 0x2000)) {
    *s = (ushort)c;
    iVar1 = 1;
    puVar3 = s + 1;
  }
  else {
    uVar2 = c - 0x10000;
    if (0xfffff < uVar2) {
      *s = 0;
      return 0;
    }
    *s = (short)(uVar2 >> 10) + 0xd800;
    iVar1 = 2;
    s[1] = ((ushort)uVar2 & 0x3ff) + 0xdc00;
    puVar3 = s + 2;
  }
  *puVar3 = 0;
  return iVar1;
}



undefined4 u32toutf16(uint param_1,short *param_2)

{
  undefined4 uVar1;
  
  if ((param_1 < 0xd800) || (param_1 - 0xe000 < 0x2000)) {
    *param_2 = (short)param_1;
    uVar1 = 1;
    param_2 = param_2 + 1;
  }
  else {
    param_1 = param_1 - 0x10000;
    if (0xfffff < param_1) {
      *param_2 = 0;
      return 0;
    }
    *param_2 = (short)(param_1 >> 10) + -0x2800;
    uVar1 = 2;
    param_2[1] = ((ushort)param_1 & 0x3ff) + 0xdc00;
    param_2 = param_2 + 2;
  }
  *param_2 = 0;
  return uVar1;
}


ori v0,zero,0xd800
sltu v0,a0,v0
bne v0,zero,0x000dea08
_nop
lui v1,0xffff
addiu v0,v1,0x2000
addu v0,a0,v0
sltiu v0,v0,0x2000
beq v0,zero,0x000dea1c
_nop
sh a0,0x0(a1)
li v0,0x1
addiu a1,a1,0x2
jr ra
_sh zero,0x0(a1)
addu a0,a0,v1
lui v0,0x10
sltu v0,a0,v0
bne v0,zero,0x000dea3c
_nop
or v0,zero,zero
jr ra
_sh zero,0x0(a1)
srl v0,a0,0xa
andi a0,a0,0x3ff
addiu v0,v0,-0x2800
addiu a0,a0,-0x2400
sh v0,0x0(a1)
li v0,0x2
sh a0,0x2(a1)
b 0x000dea14
_addiu a1,a1,0x4
(translation_unit "undefined4 u32toutf16(uint param_1,short *param_2)\n\n{\n  undefined4 uVar1;\n  \n  if ((param_1 < 0xd800) || (param_1 - 0xe000 < 0x2000)) {\n    *param_2 = (short)param_1;\n    uVar1 = 1;\n    param_2 = param_2 + 1;\n  }\n  else {\n    param_1 = param_1 - 0x10000;\n    if (0xfffff < param_1) {\n      *param_2 = 0;\n      return 0;\n    }\n    *param_2 = (short)(param_1 >> 10) + -0x2800;\n    uVar1 = 2;\n    param_2[1] = ((ushort)param_1 & 0x3ff) + 0xdc00;\n    param_2 = param_2 + 2;\n  }\n  *param_2 = 0;\n  return uVar1;\n}\n\n" (function_definition "undefined4 u32toutf16(uint param_1,short *param_2)\n\n{\n  undefined4 uVar1;\n  \n  if ((param_1 < 0xd800) || (param_1 - 0xe000 < 0x2000)) {\n    *param_2 = (short)param_1;\n    uVar1 = 1;\n    param_2 = param_2 + 1;\n  }\n  else {\n    param_1 = param_1 - 0x10000;\n    if (0xfffff < param_1) {\n      *param_2 = 0;\n      return 0;\n    }\n    *param_2 = (short)(param_1 >> 10) + -0x2800;\n    uVar1 = 2;\n    param_2[1] = ((ushort)param_1 & 0x3ff) + 0xdc00;\n    param_2 = param_2 + 2;\n  }\n  *param_2 = 0;\n  return uVar1;\n}" type_identifier (function_declarator "u32toutf16(uint param_1,short *param_2)" identifier (parameter_list "(uint param_1,short *param_2)" ( (parameter_declaration "uint param_1" type_identifier identifier) , (parameter_declaration "short *param_2" (sized_type_specifier "short" short) (pointer_declarator "*param_2" * identifier)) ))) (compound_statement "{\n  undefined4 uVar1;\n  \n  if ((param_1 < 0xd800) || (param_1 - 0xe000 < 0x2000)) {\n    *param_2 = (short)param_1;\n    uVar1 = 1;\n    param_2 = param_2 + 1;\n  }\n  else {\n    param_1 = param_1 - 0x10000;\n    if (0xfffff < param_1) {\n      *param_2 = 0;\n      return 0;\n    }\n    *param_2 = (short)(param_1 >> 10) + -0x2800;\n    uVar1 = 2;\n    param_2[1] = ((ushort)param_1 & 0x3ff) + 0xdc00;\n    param_2 = param_2 + 2;\n  }\n  *param_2 = 0;\n  return uVar1;\n}" { (declaration "undefined4 uVar1;" type_identifier identifier ;) (if_statement "if ((param_1 < 0xd800) || (param_1 - 0xe000 < 0x2000)) {\n    *param_2 = (short)param_1;\n    uVar1 = 1;\n    param_2 = param_2 + 1;\n  }\n  else {\n    param_1 = param_1 - 0x10000;\n    if (0xfffff < param_1) {\n      *param_2 = 0;\n      return 0;\n    }\n    *param_2 = (short)(param_1 >> 10) + -0x2800;\n    uVar1 = 2;\n    param_2[1] = ((ushort)param_1 & 0x3ff) + 0xdc00;\n    param_2 = param_2 + 2;\n  }" if (parenthesized_expression "((param_1 < 0xd800) || (param_1 - 0xe000 < 0x2000))" ( (binary_expression "(param_1 < 0xd800) || (param_1 - 0xe000 < 0x2000)" (parenthesized_expression "(param_1 < 0xd800)" ( (binary_expression "param_1 < 0xd800" identifier < number_literal) )) || (parenthesized_expression "(param_1 - 0xe000 < 0x2000)" ( (binary_expression "param_1 - 0xe000 < 0x2000" (binary_expression "param_1 - 0xe000" identifier - number_literal) < number_literal) ))) )) (compound_statement "{\n    *param_2 = (short)param_1;\n    uVar1 = 1;\n    param_2 = param_2 + 1;\n  }" { (expression_statement "*param_2 = (short)param_1;" (assignment_expression "*param_2 = (short)param_1" (pointer_expression "*param_2" * identifier) = (cast_expression "(short)param_1" ( (type_descriptor "short" (sized_type_specifier "short" short)) ) identifier)) ;) (expression_statement "uVar1 = 1;" (assignment_expression "uVar1 = 1" identifier = number_literal) ;) (expression_statement "param_2 = param_2 + 1;" (assignment_expression "param_2 = param_2 + 1" identifier = (binary_expression "param_2 + 1" identifier + number_literal)) ;) }) (else_clause "else {\n    param_1 = param_1 - 0x10000;\n    if (0xfffff < param_1) {\n      *param_2 = 0;\n      return 0;\n    }\n    *param_2 = (short)(param_1 >> 10) + -0x2800;\n    uVar1 = 2;\n    param_2[1] = ((ushort)param_1 & 0x3ff) + 0xdc00;\n    param_2 = param_2 + 2;\n  }" else (compound_statement "{\n    param_1 = param_1 - 0x10000;\n    if (0xfffff < param_1) {\n      *param_2 = 0;\n      return 0;\n    }\n    *param_2 = (short)(param_1 >> 10) + -0x2800;\n    uVar1 = 2;\n    param_2[1] = ((ushort)param_1 & 0x3ff) + 0xdc00;\n    param_2 = param_2 + 2;\n  }" { (expression_statement "param_1 = param_1 - 0x10000;" (assignment_expression "param_1 = param_1 - 0x10000" identifier = (binary_expression "param_1 - 0x10000" identifier - number_literal)) ;) (if_statement "if (0xfffff < param_1) {\n      *param_2 = 0;\n      return 0;\n    }" if (parenthesized_expression "(0xfffff < param_1)" ( (binary_expression "0xfffff < param_1" number_literal < identifier) )) (compound_statement "{\n      *param_2 = 0;\n      return 0;\n    }" { (expression_statement "*param_2 = 0;" (assignment_expression "*param_2 = 0" (pointer_expression "*param_2" * identifier) = number_literal) ;) (return_statement "return 0;" return number_literal ;) })) (expression_statement "*param_2 = (short)(param_1 >> 10) + -0x2800;" (assignment_expression "*param_2 = (short)(param_1 >> 10) + -0x2800" (pointer_expression "*param_2" * identifier) = (binary_expression "(short)(param_1 >> 10) + -0x2800" (cast_expression "(short)(param_1 >> 10)" ( (type_descriptor "short" (sized_type_specifier "short" short)) ) (parenthesized_expression "(param_1 >> 10)" ( (binary_expression "param_1 >> 10" identifier >> number_literal) ))) + number_literal)) ;) (expression_statement "uVar1 = 2;" (assignment_expression "uVar1 = 2" identifier = number_literal) ;) (expression_statement "param_2[1] = ((ushort)param_1 & 0x3ff) + 0xdc00;" (assignment_expression "param_2[1] = ((ushort)param_1 & 0x3ff) + 0xdc00" (subscript_expression "param_2[1]" identifier [ number_literal ]) = (binary_expression "((ushort)param_1 & 0x3ff) + 0xdc00" (parenthesized_expression "((ushort)param_1 & 0x3ff)" ( (binary_expression "(ushort)param_1 & 0x3ff" (cast_expression "(ushort)param_1" ( (type_descriptor "ushort" type_identifier) ) identifier) & number_literal) )) + number_literal)) ;) (expression_statement "param_2 = param_2 + 2;" (assignment_expression "param_2 = param_2 + 2" identifier = (binary_expression "param_2 + 2" identifier + number_literal)) ;) }))) (expression_statement "*param_2 = 0;" (assignment_expression "*param_2 = 0" (pointer_expression "*param_2" * identifier) = number_literal) ;) (return_statement "return uVar1;" return identifier ;) })))
(translation_unit "int u32toutf16(uint c,ushort *s)\n\n{\n  int iVar1;\n  uint uVar2;\n  ushort *puVar3;\n  \n  if ((c < 0xd800) || (c - 0xe000 < 0x2000)) {\n    *s = (ushort)c;\n    iVar1 = 1;\n    puVar3 = s + 1;\n  }\n  else {\n    uVar2 = c - 0x10000;\n    if (0xfffff < uVar2) {\n      *s = 0;\n      return 0;\n    }\n    *s = (short)(uVar2 >> 10) + 0xd800;\n    iVar1 = 2;\n    s[1] = ((ushort)uVar2 & 0x3ff) + 0xdc00;\n    puVar3 = s + 2;\n  }\n  *puVar3 = 0;\n  return iVar1;\n}\n\n" (function_definition "int u32toutf16(uint c,ushort *s)\n\n{\n  int iVar1;\n  uint uVar2;\n  ushort *puVar3;\n  \n  if ((c < 0xd800) || (c - 0xe000 < 0x2000)) {\n    *s = (ushort)c;\n    iVar1 = 1;\n    puVar3 = s + 1;\n  }\n  else {\n    uVar2 = c - 0x10000;\n    if (0xfffff < uVar2) {\n      *s = 0;\n      return 0;\n    }\n    *s = (short)(uVar2 >> 10) + 0xd800;\n    iVar1 = 2;\n    s[1] = ((ushort)uVar2 & 0x3ff) + 0xdc00;\n    puVar3 = s + 2;\n  }\n  *puVar3 = 0;\n  return iVar1;\n}" primitive_type (function_declarator "u32toutf16(uint c,ushort *s)" identifier (parameter_list "(uint c,ushort *s)" ( (parameter_declaration "uint c" type_identifier identifier) , (parameter_declaration "ushort *s" type_identifier (pointer_declarator "*s" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  uint uVar2;\n  ushort *puVar3;\n  \n  if ((c < 0xd800) || (c - 0xe000 < 0x2000)) {\n    *s = (ushort)c;\n    iVar1 = 1;\n    puVar3 = s + 1;\n  }\n  else {\n    uVar2 = c - 0x10000;\n    if (0xfffff < uVar2) {\n      *s = 0;\n      return 0;\n    }\n    *s = (short)(uVar2 >> 10) + 0xd800;\n    iVar1 = 2;\n    s[1] = ((ushort)uVar2 & 0x3ff) + 0xdc00;\n    puVar3 = s + 2;\n  }\n  *puVar3 = 0;\n  return iVar1;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "uint uVar2;" type_identifier identifier ;) (declaration "ushort *puVar3;" type_identifier (pointer_declarator "*puVar3" * identifier) ;) (if_statement "if ((c < 0xd800) || (c - 0xe000 < 0x2000)) {\n    *s = (ushort)c;\n    iVar1 = 1;\n    puVar3 = s + 1;\n  }\n  else {\n    uVar2 = c - 0x10000;\n    if (0xfffff < uVar2) {\n      *s = 0;\n      return 0;\n    }\n    *s = (short)(uVar2 >> 10) + 0xd800;\n    iVar1 = 2;\n    s[1] = ((ushort)uVar2 & 0x3ff) + 0xdc00;\n    puVar3 = s + 2;\n  }" if (parenthesized_expression "((c < 0xd800) || (c - 0xe000 < 0x2000))" ( (binary_expression "(c < 0xd800) || (c - 0xe000 < 0x2000)" (parenthesized_expression "(c < 0xd800)" ( (binary_expression "c < 0xd800" identifier < number_literal) )) || (parenthesized_expression "(c - 0xe000 < 0x2000)" ( (binary_expression "c - 0xe000 < 0x2000" (binary_expression "c - 0xe000" identifier - number_literal) < number_literal) ))) )) (compound_statement "{\n    *s = (ushort)c;\n    iVar1 = 1;\n    puVar3 = s + 1;\n  }" { (expression_statement "*s = (ushort)c;" (assignment_expression "*s = (ushort)c" (pointer_expression "*s" * identifier) = (cast_expression "(ushort)c" ( (type_descriptor "ushort" type_identifier) ) identifier)) ;) (expression_statement "iVar1 = 1;" (assignment_expression "iVar1 = 1" identifier = number_literal) ;) (expression_statement "puVar3 = s + 1;" (assignment_expression "puVar3 = s + 1" identifier = (binary_expression "s + 1" identifier + number_literal)) ;) }) (else_clause "else {\n    uVar2 = c - 0x10000;\n    if (0xfffff < uVar2) {\n      *s = 0;\n      return 0;\n    }\n    *s = (short)(uVar2 >> 10) + 0xd800;\n    iVar1 = 2;\n    s[1] = ((ushort)uVar2 & 0x3ff) + 0xdc00;\n    puVar3 = s + 2;\n  }" else (compound_statement "{\n    uVar2 = c - 0x10000;\n    if (0xfffff < uVar2) {\n      *s = 0;\n      return 0;\n    }\n    *s = (short)(uVar2 >> 10) + 0xd800;\n    iVar1 = 2;\n    s[1] = ((ushort)uVar2 & 0x3ff) + 0xdc00;\n    puVar3 = s + 2;\n  }" { (expression_statement "uVar2 = c - 0x10000;" (assignment_expression "uVar2 = c - 0x10000" identifier = (binary_expression "c - 0x10000" identifier - number_literal)) ;) (if_statement "if (0xfffff < uVar2) {\n      *s = 0;\n      return 0;\n    }" if (parenthesized_expression "(0xfffff < uVar2)" ( (binary_expression "0xfffff < uVar2" number_literal < identifier) )) (compound_statement "{\n      *s = 0;\n      return 0;\n    }" { (expression_statement "*s = 0;" (assignment_expression "*s = 0" (pointer_expression "*s" * identifier) = number_literal) ;) (return_statement "return 0;" return number_literal ;) })) (expression_statement "*s = (short)(uVar2 >> 10) + 0xd800;" (assignment_expression "*s = (short)(uVar2 >> 10) + 0xd800" (pointer_expression "*s" * identifier) = (binary_expression "(short)(uVar2 >> 10) + 0xd800" (cast_expression "(short)(uVar2 >> 10)" ( (type_descriptor "short" (sized_type_specifier "short" short)) ) (parenthesized_expression "(uVar2 >> 10)" ( (binary_expression "uVar2 >> 10" identifier >> number_literal) ))) + number_literal)) ;) (expression_statement "iVar1 = 2;" (assignment_expression "iVar1 = 2" identifier = number_literal) ;) (expression_statement "s[1] = ((ushort)uVar2 & 0x3ff) + 0xdc00;" (assignment_expression "s[1] = ((ushort)uVar2 & 0x3ff) + 0xdc00" (subscript_expression "s[1]" identifier [ number_literal ]) = (binary_expression "((ushort)uVar2 & 0x3ff) + 0xdc00" (parenthesized_expression "((ushort)uVar2 & 0x3ff)" ( (binary_expression "(ushort)uVar2 & 0x3ff" (cast_expression "(ushort)uVar2" ( (type_descriptor "ushort" type_identifier) ) identifier) & number_literal) )) + number_literal)) ;) (expression_statement "puVar3 = s + 2;" (assignment_expression "puVar3 = s + 2" identifier = (binary_expression "s + 2" identifier + number_literal)) ;) }))) (expression_statement "*puVar3 = 0;" (assignment_expression "*puVar3 = 0" (pointer_expression "*puVar3" * identifier) = number_literal) ;) (return_statement "return iVar1;" return identifier ;) })))
(translation_unit "undefined4 u32toutf16(uint param_1,short *param_2)\n\n{\n  undefined4 uVar1;\n  \n  if ((param_1 < 0xd800) || (param_1 - 0xe000 < 0x2000)) {\n    *param_2 = (short)param_1;\n    uVar1 = 1;\n    param_2 = param_2 + 1;\n  }\n  else {\n    param_1 = param_1 - 0x10000;\n    if (0xfffff < param_1) {\n      *param_2 = 0;\n      return 0;\n    }\n    *param_2 = (short)(param_1 >> 10) + -0x2800;\n    uVar1 = 2;\n    param_2[1] = ((ushort)param_1 & 0x3ff) + 0xdc00;\n    param_2 = param_2 + 2;\n  }\n  *param_2 = 0;\n  return uVar1;\n}\n\n" (function_definition "undefined4 u32toutf16(uint param_1,short *param_2)\n\n{\n  undefined4 uVar1;\n  \n  if ((param_1 < 0xd800) || (param_1 - 0xe000 < 0x2000)) {\n    *param_2 = (short)param_1;\n    uVar1 = 1;\n    param_2 = param_2 + 1;\n  }\n  else {\n    param_1 = param_1 - 0x10000;\n    if (0xfffff < param_1) {\n      *param_2 = 0;\n      return 0;\n    }\n    *param_2 = (short)(param_1 >> 10) + -0x2800;\n    uVar1 = 2;\n    param_2[1] = ((ushort)param_1 & 0x3ff) + 0xdc00;\n    param_2 = param_2 + 2;\n  }\n  *param_2 = 0;\n  return uVar1;\n}" type_identifier (function_declarator "u32toutf16(uint param_1,short *param_2)" identifier (parameter_list "(uint param_1,short *param_2)" ( (parameter_declaration "uint param_1" type_identifier identifier) , (parameter_declaration "short *param_2" (sized_type_specifier "short" short) (pointer_declarator "*param_2" * identifier)) ))) (compound_statement "{\n  undefined4 uVar1;\n  \n  if ((param_1 < 0xd800) || (param_1 - 0xe000 < 0x2000)) {\n    *param_2 = (short)param_1;\n    uVar1 = 1;\n    param_2 = param_2 + 1;\n  }\n  else {\n    param_1 = param_1 - 0x10000;\n    if (0xfffff < param_1) {\n      *param_2 = 0;\n      return 0;\n    }\n    *param_2 = (short)(param_1 >> 10) + -0x2800;\n    uVar1 = 2;\n    param_2[1] = ((ushort)param_1 & 0x3ff) + 0xdc00;\n    param_2 = param_2 + 2;\n  }\n  *param_2 = 0;\n  return uVar1;\n}" { (declaration "undefined4 uVar1;" type_identifier identifier ;) (if_statement "if ((param_1 < 0xd800) || (param_1 - 0xe000 < 0x2000)) {\n    *param_2 = (short)param_1;\n    uVar1 = 1;\n    param_2 = param_2 + 1;\n  }\n  else {\n    param_1 = param_1 - 0x10000;\n    if (0xfffff < param_1) {\n      *param_2 = 0;\n      return 0;\n    }\n    *param_2 = (short)(param_1 >> 10) + -0x2800;\n    uVar1 = 2;\n    param_2[1] = ((ushort)param_1 & 0x3ff) + 0xdc00;\n    param_2 = param_2 + 2;\n  }" if (parenthesized_expression "((param_1 < 0xd800) || (param_1 - 0xe000 < 0x2000))" ( (binary_expression "(param_1 < 0xd800) || (param_1 - 0xe000 < 0x2000)" (parenthesized_expression "(param_1 < 0xd800)" ( (binary_expression "param_1 < 0xd800" identifier < number_literal) )) || (parenthesized_expression "(param_1 - 0xe000 < 0x2000)" ( (binary_expression "param_1 - 0xe000 < 0x2000" (binary_expression "param_1 - 0xe000" identifier - number_literal) < number_literal) ))) )) (compound_statement "{\n    *param_2 = (short)param_1;\n    uVar1 = 1;\n    param_2 = param_2 + 1;\n  }" { (expression_statement "*param_2 = (short)param_1;" (assignment_expression "*param_2 = (short)param_1" (pointer_expression "*param_2" * identifier) = (cast_expression "(short)param_1" ( (type_descriptor "short" (sized_type_specifier "short" short)) ) identifier)) ;) (expression_statement "uVar1 = 1;" (assignment_expression "uVar1 = 1" identifier = number_literal) ;) (expression_statement "param_2 = param_2 + 1;" (assignment_expression "param_2 = param_2 + 1" identifier = (binary_expression "param_2 + 1" identifier + number_literal)) ;) }) (else_clause "else {\n    param_1 = param_1 - 0x10000;\n    if (0xfffff < param_1) {\n      *param_2 = 0;\n      return 0;\n    }\n    *param_2 = (short)(param_1 >> 10) + -0x2800;\n    uVar1 = 2;\n    param_2[1] = ((ushort)param_1 & 0x3ff) + 0xdc00;\n    param_2 = param_2 + 2;\n  }" else (compound_statement "{\n    param_1 = param_1 - 0x10000;\n    if (0xfffff < param_1) {\n      *param_2 = 0;\n      return 0;\n    }\n    *param_2 = (short)(param_1 >> 10) + -0x2800;\n    uVar1 = 2;\n    param_2[1] = ((ushort)param_1 & 0x3ff) + 0xdc00;\n    param_2 = param_2 + 2;\n  }" { (expression_statement "param_1 = param_1 - 0x10000;" (assignment_expression "param_1 = param_1 - 0x10000" identifier = (binary_expression "param_1 - 0x10000" identifier - number_literal)) ;) (if_statement "if (0xfffff < param_1) {\n      *param_2 = 0;\n      return 0;\n    }" if (parenthesized_expression "(0xfffff < param_1)" ( (binary_expression "0xfffff < param_1" number_literal < identifier) )) (compound_statement "{\n      *param_2 = 0;\n      return 0;\n    }" { (expression_statement "*param_2 = 0;" (assignment_expression "*param_2 = 0" (pointer_expression "*param_2" * identifier) = number_literal) ;) (return_statement "return 0;" return number_literal ;) })) (expression_statement "*param_2 = (short)(param_1 >> 10) + -0x2800;" (assignment_expression "*param_2 = (short)(param_1 >> 10) + -0x2800" (pointer_expression "*param_2" * identifier) = (binary_expression "(short)(param_1 >> 10) + -0x2800" (cast_expression "(short)(param_1 >> 10)" ( (type_descriptor "short" (sized_type_specifier "short" short)) ) (parenthesized_expression "(param_1 >> 10)" ( (binary_expression "param_1 >> 10" identifier >> number_literal) ))) + number_literal)) ;) (expression_statement "uVar1 = 2;" (assignment_expression "uVar1 = 2" identifier = number_literal) ;) (expression_statement "param_2[1] = ((ushort)param_1 & 0x3ff) + 0xdc00;" (assignment_expression "param_2[1] = ((ushort)param_1 & 0x3ff) + 0xdc00" (subscript_expression "param_2[1]" identifier [ number_literal ]) = (binary_expression "((ushort)param_1 & 0x3ff) + 0xdc00" (parenthesized_expression "((ushort)param_1 & 0x3ff)" ( (binary_expression "(ushort)param_1 & 0x3ff" (cast_expression "(ushort)param_1" ( (type_descriptor "ushort" type_identifier) ) identifier) & number_literal) )) + number_literal)) ;) (expression_statement "param_2 = param_2 + 2;" (assignment_expression "param_2 = param_2 + 2" identifier = (binary_expression "param_2 + 2" identifier + number_literal)) ;) }))) (expression_statement "*param_2 = 0;" (assignment_expression "*param_2 = 0" (pointer_expression "*param_2" * identifier) = number_literal) ;) (return_statement "return uVar1;" return identifier ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration (sized_type_specifier short) (pointer_declarator * IDENT)) ))) (compound_statement { (declaration TYPE IDENT ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT < LIT) )) || (parenthesized_expression ( (binary_expression (binary_expression IDENT - LIT) < LIT) ))) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = (cast_expression ( (type_descriptor (sized_type_specifier short)) ) IDENT)) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT - LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;) (return_statement return LIT ;) })) (expression_statement (assignment_expression (pointer_expression * IDENT) = (binary_expression (cast_expression ( (type_descriptor (sized_type_specifier short)) ) (parenthesized_expression ( (binary_expression IDENT >> LIT) ))) + LIT)) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (binary_expression (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) & LIT) )) + LIT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) }))) (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;) (return_statement return IDENT ;) })))
(function_definition "undefined4 u32toutf16(uint param_1,short *param_2)\n\n{\n  undefined4 uVar1;\n  \n  if ((param_1 < 0xd800) || (param_1 - 0xe000 < 0x2000)) {\n    *param_2 = (short)param_1;\n    uVar1 = 1;\n    param_2 = param_2 + 1;\n  }\n  else {\n    param_1 = param_1 - 0x10000;\n    if (0xfffff < param_1) {\n      *param_2 = 0;\n      return 0;\n    }\n    *param_2 = (short)(param_1 >> 10) + -0x2800;\n    uVar1 = 2;\n    param_2[1] = ((ushort)param_1 & 0x3ff) + 0xdc00;\n    param_2 = param_2 + 2;\n  }\n  *param_2 = 0;\n  return uVar1;\n}" (type_identifier "undefined4") (function_declarator "u32toutf16(uint param_1,short *param_2)" (identifier "u32toutf16") (parameter_list "(uint param_1,short *param_2)" (( "(") (parameter_declaration "uint param_1" (type_identifier "uint") (identifier "param_1")) (, ",") (parameter_declaration "short *param_2" (sized_type_specifier "short" (short "short")) (pointer_declarator "*param_2" (* "*") (identifier "param_2"))) () ")"))) (compound_statement "{\n  undefined4 uVar1;\n  \n  if ((param_1 < 0xd800) || (param_1 - 0xe000 < 0x2000)) {\n    *param_2 = (short)param_1;\n    uVar1 = 1;\n    param_2 = param_2 + 1;\n  }\n  else {\n    param_1 = param_1 - 0x10000;\n    if (0xfffff < param_1) {\n      *param_2 = 0;\n      return 0;\n    }\n    *param_2 = (short)(param_1 >> 10) + -0x2800;\n    uVar1 = 2;\n    param_2[1] = ((ushort)param_1 & 0x3ff) + 0xdc00;\n    param_2 = param_2 + 2;\n  }\n  *param_2 = 0;\n  return uVar1;\n}" ({ "{") (declaration "undefined4 uVar1;" (type_identifier "undefined4") (identifier "uVar1") (; ";")) (if_statement "if ((param_1 < 0xd800) || (param_1 - 0xe000 < 0x2000)) {\n    *param_2 = (short)param_1;\n    uVar1 = 1;\n    param_2 = param_2 + 1;\n  }\n  else {\n    param_1 = param_1 - 0x10000;\n    if (0xfffff < param_1) {\n      *param_2 = 0;\n      return 0;\n    }\n    *param_2 = (short)(param_1 >> 10) + -0x2800;\n    uVar1 = 2;\n    param_2[1] = ((ushort)param_1 & 0x3ff) + 0xdc00;\n    param_2 = param_2 + 2;\n  }" (if "if") (parenthesized_expression "((param_1 < 0xd800) || (param_1 - 0xe000 < 0x2000))" (( "(") (binary_expression "(param_1 < 0xd800) || (param_1 - 0xe000 < 0x2000)" (parenthesized_expression "(param_1 < 0xd800)" (( "(") (binary_expression "param_1 < 0xd800" (identifier "param_1") (< "<") (number_literal "0xd800")) () ")")) (|| "||") (parenthesized_expression "(param_1 - 0xe000 < 0x2000)" (( "(") (binary_expression "param_1 - 0xe000 < 0x2000" (binary_expression "param_1 - 0xe000" (identifier "param_1") (- "-") (number_literal "0xe000")) (< "<") (number_literal "0x2000")) () ")"))) () ")")) (compound_statement "{\n    *param_2 = (short)param_1;\n    uVar1 = 1;\n    param_2 = param_2 + 1;\n  }" ({ "{") (expression_statement "*param_2 = (short)param_1;" (assignment_expression "*param_2 = (short)param_1" (pointer_expression "*param_2" (* "*") (identifier "param_2")) (= "=") (cast_expression "(short)param_1" (( "(") (type_descriptor "short" (sized_type_specifier "short" (short "short"))) () ")") (identifier "param_1"))) (; ";")) (expression_statement "uVar1 = 1;" (assignment_expression "uVar1 = 1" (identifier "uVar1") (= "=") (number_literal "1")) (; ";")) (expression_statement "param_2 = param_2 + 1;" (assignment_expression "param_2 = param_2 + 1" (identifier "param_2") (= "=") (binary_expression "param_2 + 1" (identifier "param_2") (+ "+") (number_literal "1"))) (; ";")) (} "}")) (else_clause "else {\n    param_1 = param_1 - 0x10000;\n    if (0xfffff < param_1) {\n      *param_2 = 0;\n      return 0;\n    }\n    *param_2 = (short)(param_1 >> 10) + -0x2800;\n    uVar1 = 2;\n    param_2[1] = ((ushort)param_1 & 0x3ff) + 0xdc00;\n    param_2 = param_2 + 2;\n  }" (else "else") (compound_statement "{\n    param_1 = param_1 - 0x10000;\n    if (0xfffff < param_1) {\n      *param_2 = 0;\n      return 0;\n    }\n    *param_2 = (short)(param_1 >> 10) + -0x2800;\n    uVar1 = 2;\n    param_2[1] = ((ushort)param_1 & 0x3ff) + 0xdc00;\n    param_2 = param_2 + 2;\n  }" ({ "{") (expression_statement "param_1 = param_1 - 0x10000;" (assignment_expression "param_1 = param_1 - 0x10000" (identifier "param_1") (= "=") (binary_expression "param_1 - 0x10000" (identifier "param_1") (- "-") (number_literal "0x10000"))) (; ";")) (if_statement "if (0xfffff < param_1) {\n      *param_2 = 0;\n      return 0;\n    }" (if "if") (parenthesized_expression "(0xfffff < param_1)" (( "(") (binary_expression "0xfffff < param_1" (number_literal "0xfffff") (< "<") (identifier "param_1")) () ")")) (compound_statement "{\n      *param_2 = 0;\n      return 0;\n    }" ({ "{") (expression_statement "*param_2 = 0;" (assignment_expression "*param_2 = 0" (pointer_expression "*param_2" (* "*") (identifier "param_2")) (= "=") (number_literal "0")) (; ";")) (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}"))) (expression_statement "*param_2 = (short)(param_1 >> 10) + -0x2800;" (assignment_expression "*param_2 = (short)(param_1 >> 10) + -0x2800" (pointer_expression "*param_2" (* "*") (identifier "param_2")) (= "=") (binary_expression "(short)(param_1 >> 10) + -0x2800" (cast_expression "(short)(param_1 >> 10)" (( "(") (type_descriptor "short" (sized_type_specifier "short" (short "short"))) () ")") (parenthesized_expression "(param_1 >> 10)" (( "(") (binary_expression "param_1 >> 10" (identifier "param_1") (>> ">>") (number_literal "10")) () ")"))) (+ "+") (number_literal "-0x2800"))) (; ";")) (expression_statement "uVar1 = 2;" (assignment_expression "uVar1 = 2" (identifier "uVar1") (= "=") (number_literal "2")) (; ";")) (expression_statement "param_2[1] = ((ushort)param_1 & 0x3ff) + 0xdc00;" (assignment_expression "param_2[1] = ((ushort)param_1 & 0x3ff) + 0xdc00" (subscript_expression "param_2[1]" (identifier "param_2") ([ "[") (number_literal "1") (] "]")) (= "=") (binary_expression "((ushort)param_1 & 0x3ff) + 0xdc00" (parenthesized_expression "((ushort)param_1 & 0x3ff)" (( "(") (binary_expression "(ushort)param_1 & 0x3ff" (cast_expression "(ushort)param_1" (( "(") (type_descriptor "ushort" (type_identifier "ushort")) () ")") (identifier "param_1")) (& "&") (number_literal "0x3ff")) () ")")) (+ "+") (number_literal "0xdc00"))) (; ";")) (expression_statement "param_2 = param_2 + 2;" (assignment_expression "param_2 = param_2 + 2" (identifier "param_2") (= "=") (binary_expression "param_2 + 2" (identifier "param_2") (+ "+") (number_literal "2"))) (; ";")) (} "}")))) (expression_statement "*param_2 = 0;" (assignment_expression "*param_2 = 0" (pointer_expression "*param_2" (* "*") (identifier "param_2")) (= "=") (number_literal "0")) (; ";")) (return_statement "return uVar1;" (return "return") (identifier "uVar1") (; ";")) (} "}")))
(translation_unit (function_definition type: (type_identifier) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (type_identifier) declarator: (identifier)) (parameter_declaration type: (sized_type_specifier) declarator: (pointer_declarator declarator: (identifier))))) body: (compound_statement (declaration type: (type_identifier) declarator: (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: (number_literal)) right: (number_literal))))) consequence: (compound_statement (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (cast_expression type: (type_descriptor type: (sized_type_specifier)) value: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal))))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (if_statement condition: (parenthesized_expression (binary_expression left: (number_literal) right: (identifier))) consequence: (compound_statement (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (number_literal))) (return_statement (number_literal)))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (binary_expression left: (cast_expression type: (type_descriptor type: (sized_type_specifier)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal)))) right: (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (binary_expression left: (parenthesized_expression (binary_expression left: (cast_expression type: (type_descriptor type: (type_identifier)) value: (identifier)) right: (number_literal))) right: (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal))))))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (number_literal))) (return_statement (identifier)))))

undefined4 MASKED(uint param_1,short *param_2)

{
  undefined4 uVar1;
  
  if ((param_1 < 0xd800) || (param_1 - 0xe000 < 0x2000)) {
    *param_2 = (short)param_1;
    uVar1 = 1;
    param_2 = param_2 + 1;
  }
  else {
    param_1 = param_1 - 0x10000;
    if (0xfffff < param_1) {
      *param_2 = 0;
      return 0;
    }
    *param_2 = (short)(param_1 >> 10) + -0x2800;
    uVar1 = 2;
    param_2[1] = ((ushort)param_1 & 0x3ff) + 0xdc00;
    param_2 = param_2 + 2;
  }
  *param_2 = 0;
  return uVar1;
}

