
void luni_send(void *handle,wchar_t *widebuf,int len,int interactive)

{
                    /* WARNING: Load size is inaccurate */
  if ((*(int *)(*handle + 0xdc) != 0) || (*(int *)(*(int *)(*handle + 0x1090) + 0xc) == 0x37)) {
    len = len * 3;
  }
                    /* WARNING: Subroutine does not return */
  safemalloc(len << 1,1);
}



void luni_send(int *param_1,uint *param_2,int param_3,undefined4 param_4)

{
  byte *pbVar1;
  int iVar2;
  uint uVar3;
  byte bVar5;
  int iVar4;
  byte bVar6;
  int iVar7;
  uint *puVar8;
  byte *pbVar9;
  byte *pbVar10;
  byte bVar11;
  
  if ((*(int *)(*param_1 + 0xdc) != 0) ||
     (iVar4 = param_3, *(int *)(*(int *)(*param_1 + 0x1090) + 0xc) == 0x37)) {
    iVar4 = param_3 * 3;
  }
  pbVar1 = (byte *)safemalloc(iVar4 << 1,1);
  if (*(int *)(*param_1 + 0xdc) == 0) {
    iVar2 = *(int *)(*param_1 + 0x1090);
    iVar7 = *(int *)(iVar2 + 0xc);
    if (iVar7 == 0x37) goto LAB_0002ed44;
    iVar4 = (*(code *)PTR_wc_to_mb_000a7370)(iVar7,0,param_2,param_3,pbVar1,iVar4 << 1,0,0,iVar2);
    if (iVar4 < 0) goto LAB_0002edb8;
    pbVar10 = pbVar1 + iVar4;
  }
  else {
LAB_0002ed44:
    if (param_3 < 1) goto LAB_0002edb8;
    puVar8 = param_2 + param_3;
    pbVar9 = pbVar1;
    do {
      uVar3 = *param_2;
      if (uVar3 - 0xd800 < 0x800) {
        bVar5 = 0x2e;
LAB_0002ed98:
        *pbVar9 = bVar5;
        pbVar10 = pbVar9 + 1;
      }
      else {
        bVar5 = (byte)uVar3;
        if (uVar3 < 0x80) goto LAB_0002ed98;
        bVar11 = bVar5 & 0x3f | 0x80;
        bVar5 = (byte)((uVar3 << 0x12) >> 0x18);
        if (uVar3 < 0x800) {
          pbVar9[1] = bVar11;
          *pbVar9 = bVar5 | 0xc0;
          pbVar10 = pbVar9 + 2;
        }
        else {
          bVar6 = bVar5 & 0x3f | 0x80;
          bVar5 = (byte)((uVar3 << 0xc) >> 0x18);
          if (uVar3 < 0x10000) {
            pbVar9[1] = bVar6;
            *pbVar9 = bVar5 | 0xe0;
            pbVar10 = pbVar9 + 3;
            pbVar9[2] = bVar11;
          }
          else {
            pbVar9[2] = bVar6;
            pbVar9[3] = bVar11;
            *pbVar9 = (byte)(uVar3 >> 0x12) | 0xf0;
            pbVar9[1] = bVar5 & 0x3f | 0x80;
            pbVar10 = pbVar9 + 4;
          }
        }
      }
      param_2 = param_2 + 1;
      pbVar9 = pbVar10;
    } while (puVar8 != param_2);
  }
  if (pbVar1 < pbVar10) {
    ldisc_send(param_1,pbVar1,(int)pbVar10 - (int)pbVar1,param_4);
    safefree(pbVar1);
    return;
  }
LAB_0002edb8:
  safefree(pbVar1);
  return;
}


lui gp,0x8
addiu gp,gp,0x3f0
addu gp,gp,t9
lw v0,0x0(a0)
addiu sp,sp,-0x50
sw gp,0x28(sp)
sw s5,0x48(sp)
or s5,a1,zero
sw s3,0x40(sp)
or s3,a2,zero
sw s2,0x3c(sp)
or s2,a0,zero
sw s0,0x34(sp)
sw ra,0x4c(sp)
sw s4,0x44(sp)
sw s1,0x38(sp)
lw v1,0xdc(v0)
bne v1,zero,0x0002ed00
_or s0,a3,zero
lw v1,0x1090(v0)
li v0,0x37
lw v1,0xc(v1)
bne v1,v0,0x0002ed08
_or s4,a2,zero
sll s4,s3,0x1
addu s4,s4,s3
lw t9,-0x7fc0(gp)
sll s4,s4,0x1
li a1,0x1
bal 0x00033ac4
_or a0,s4,zero
lw v1,0x0(s2)
or s1,v0,zero
lw v0,0xdc(v1)
bne v0,zero,0x0002ed44
_lw gp,0x28(sp)
lw v0,0x1090(v1)
li v1,0x37
lw a0,0xc(v0)
bne a0,v1,0x0002eea4
_lw t9,-0x7d20(gp)
blez s3,0x0002edb8
_lw ra,0x4c(sp)
sll a0,s3,0x2
lui a3,0xffff
addu a0,s5,a0
addiu a3,a3,0x2800
li t1,-0x80
lui t3,0x1
li t5,-0x10
li t4,-0x20
li t2,-0x40
or a1,s5,zero
or a2,s1,zero
lw v0,0x0(a1)
addu v1,v0,a3
sltiu v1,v1,0x800
bne v1,zero,0x0002ede0
_sltiu v1,v0,0x80
beq v1,zero,0x0002ede8
_andi t6,v0,0x3f
seb v0,v0
sb v0,0x0(a2)
addiu a2,a2,0x1
addiu a1,a1,0x4
bne a0,a1,0x0002ed78
_sltu v0,s1,a2
bne v0,zero,0x0002ee60
_lw t9,-0x7d1c(gp)
lw ra,0x4c(sp)
or a0,s1,zero
lw s5,0x48(sp)
lw s4,0x44(sp)
lw s3,0x40(sp)
lw s2,0x3c(sp)
lw s1,0x38(sp)
lw s0,0x34(sp)
lw t9,-0x7fbc(gp)
b 0x000347f4
_addiu sp,sp,0x50
b 0x0002ed98
_li v0,0x2e
sltiu t0,v0,0x800
ext v1,v0,0x6,0x8
beq t0,zero,0x0002ee0c
_or t6,t6,t1
or v1,v1,t2
sb t6,0x1(a2)
sb v1,0x0(a2)
b 0x0002eda0
_addiu a2,a2,0x2
andi v1,v1,0x3f
sltu t7,v0,t3
ext t0,v0,0xc,0x8
beq t7,zero,0x0002ee38
_or v1,v1,t1
or t0,t0,t4
sb v1,0x1(a2)
sb t0,0x0(a2)
addiu a2,a2,0x3
b 0x0002eda0
_sb t6,-0x1(a2)
srl v0,v0,0x12
sb v1,0x2(a2)
andi t0,t0,0x3f
sb t6,0x3(a2)
or v0,v0,t5
or t0,t0,t1
sb v0,0x0(a2)
sb t0,0x1(a2)
b 0x0002eda0
_addiu a2,a2,0x4
subu a2,a2,s1
or a0,s2,zero
or a3,s0,zero
bal 0x0002e0cc
_or a1,s1,zero
or a0,s1,zero
lw gp,0x28(sp)
lw ra,0x4c(sp)
lw s5,0x48(sp)
lw s4,0x44(sp)
lw s3,0x40(sp)
lw s2,0x3c(sp)
lw s1,0x38(sp)
lw s0,0x34(sp)
lw t9,-0x7fbc(gp)
b 0x000347f4
_addiu sp,sp,0x50
or a1,zero,zero
sw v0,0x20(sp)
or a3,s3,zero
sw zero,0x1c(sp)
or a2,s5,zero
sw zero,0x18(sp)
sw s4,0x14(sp)
jalr t9
_sw s1,0x10(sp)
bltz v0,0x0002edb4
_lw gp,0x28(sp)
addu a2,s1,v0
sltu v0,s1,a2
beq v0,zero,0x0002edb8
_lw ra,0x4c(sp)
b 0x0002ee60
_lw t9,-0x7d1c(gp)
(translation_unit "void luni_send(int *param_1,uint *param_2,int param_3,undefined4 param_4)\n\n{\n  byte *pbVar1;\n  int iVar2;\n  uint uVar3;\n  byte bVar5;\n  int iVar4;\n  byte bVar6;\n  int iVar7;\n  uint *puVar8;\n  byte *pbVar9;\n  byte *pbVar10;\n  byte bVar11;\n  \n  if ((*(int *)(*param_1 + 0xdc) != 0) ||\n     (iVar4 = param_3, *(int *)(*(int *)(*param_1 + 0x1090) + 0xc) == 0x37)) {\n    iVar4 = param_3 * 3;\n  }\n  pbVar1 = (byte *)safemalloc(iVar4 << 1,1);\n  if (*(int *)(*param_1 + 0xdc) == 0) {\n    iVar2 = *(int *)(*param_1 + 0x1090);\n    iVar7 = *(int *)(iVar2 + 0xc);\n    if (iVar7 == 0x37) goto LAB_0002ed44;\n    iVar4 = (*(code *)PTR_wc_to_mb_000a7370)(iVar7,0,param_2,param_3,pbVar1,iVar4 << 1,0,0,iVar2);\n    if (iVar4 < 0) goto LAB_0002edb8;\n    pbVar10 = pbVar1 + iVar4;\n  }\n  else {\nLAB_0002ed44:\n    if (param_3 < 1) goto LAB_0002edb8;\n    puVar8 = param_2 + param_3;\n    pbVar9 = pbVar1;\n    do {\n      uVar3 = *param_2;\n      if (uVar3 - 0xd800 < 0x800) {\n        bVar5 = 0x2e;\nLAB_0002ed98:\n        *pbVar9 = bVar5;\n        pbVar10 = pbVar9 + 1;\n      }\n      else {\n        bVar5 = (byte)uVar3;\n        if (uVar3 < 0x80) goto LAB_0002ed98;\n        bVar11 = bVar5 & 0x3f | 0x80;\n        bVar5 = (byte)((uVar3 << 0x12) >> 0x18);\n        if (uVar3 < 0x800) {\n          pbVar9[1] = bVar11;\n          *pbVar9 = bVar5 | 0xc0;\n          pbVar10 = pbVar9 + 2;\n        }\n        else {\n          bVar6 = bVar5 & 0x3f | 0x80;\n          bVar5 = (byte)((uVar3 << 0xc) >> 0x18);\n          if (uVar3 < 0x10000) {\n            pbVar9[1] = bVar6;\n            *pbVar9 = bVar5 | 0xe0;\n            pbVar10 = pbVar9 + 3;\n            pbVar9[2] = bVar11;\n          }\n          else {\n            pbVar9[2] = bVar6;\n            pbVar9[3] = bVar11;\n            *pbVar9 = (byte)(uVar3 >> 0x12) | 0xf0;\n            pbVar9[1] = bVar5 & 0x3f | 0x80;\n            pbVar10 = pbVar9 + 4;\n          }\n        }\n      }\n      param_2 = param_2 + 1;\n      pbVar9 = pbVar10;\n    } while (puVar8 != param_2);\n  }\n  if (pbVar1 < pbVar10) {\n    ldisc_send(param_1,pbVar1,(int)pbVar10 - (int)pbVar1,param_4);\n    safefree(pbVar1);\n    return;\n  }\nLAB_0002edb8:\n  safefree(pbVar1);\n  return;\n}\n\n" (function_definition "void luni_send(int *param_1,uint *param_2,int param_3,undefined4 param_4)\n\n{\n  byte *pbVar1;\n  int iVar2;\n  uint uVar3;\n  byte bVar5;\n  int iVar4;\n  byte bVar6;\n  int iVar7;\n  uint *puVar8;\n  byte *pbVar9;\n  byte *pbVar10;\n  byte bVar11;\n  \n  if ((*(int *)(*param_1 + 0xdc) != 0) ||\n     (iVar4 = param_3, *(int *)(*(int *)(*param_1 + 0x1090) + 0xc) == 0x37)) {\n    iVar4 = param_3 * 3;\n  }\n  pbVar1 = (byte *)safemalloc(iVar4 << 1,1);\n  if (*(int *)(*param_1 + 0xdc) == 0) {\n    iVar2 = *(int *)(*param_1 + 0x1090);\n    iVar7 = *(int *)(iVar2 + 0xc);\n    if (iVar7 == 0x37) goto LAB_0002ed44;\n    iVar4 = (*(code *)PTR_wc_to_mb_000a7370)(iVar7,0,param_2,param_3,pbVar1,iVar4 << 1,0,0,iVar2);\n    if (iVar4 < 0) goto LAB_0002edb8;\n    pbVar10 = pbVar1 + iVar4;\n  }\n  else {\nLAB_0002ed44:\n    if (param_3 < 1) goto LAB_0002edb8;\n    puVar8 = param_2 + param_3;\n    pbVar9 = pbVar1;\n    do {\n      uVar3 = *param_2;\n      if (uVar3 - 0xd800 < 0x800) {\n        bVar5 = 0x2e;\nLAB_0002ed98:\n        *pbVar9 = bVar5;\n        pbVar10 = pbVar9 + 1;\n      }\n      else {\n        bVar5 = (byte)uVar3;\n        if (uVar3 < 0x80) goto LAB_0002ed98;\n        bVar11 = bVar5 & 0x3f | 0x80;\n        bVar5 = (byte)((uVar3 << 0x12) >> 0x18);\n        if (uVar3 < 0x800) {\n          pbVar9[1] = bVar11;\n          *pbVar9 = bVar5 | 0xc0;\n          pbVar10 = pbVar9 + 2;\n        }\n        else {\n          bVar6 = bVar5 & 0x3f | 0x80;\n          bVar5 = (byte)((uVar3 << 0xc) >> 0x18);\n          if (uVar3 < 0x10000) {\n            pbVar9[1] = bVar6;\n            *pbVar9 = bVar5 | 0xe0;\n            pbVar10 = pbVar9 + 3;\n            pbVar9[2] = bVar11;\n          }\n          else {\n            pbVar9[2] = bVar6;\n            pbVar9[3] = bVar11;\n            *pbVar9 = (byte)(uVar3 >> 0x12) | 0xf0;\n            pbVar9[1] = bVar5 & 0x3f | 0x80;\n            pbVar10 = pbVar9 + 4;\n          }\n        }\n      }\n      param_2 = param_2 + 1;\n      pbVar9 = pbVar10;\n    } while (puVar8 != param_2);\n  }\n  if (pbVar1 < pbVar10) {\n    ldisc_send(param_1,pbVar1,(int)pbVar10 - (int)pbVar1,param_4);\n    safefree(pbVar1);\n    return;\n  }\nLAB_0002edb8:\n  safefree(pbVar1);\n  return;\n}" primitive_type (function_declarator "luni_send(int *param_1,uint *param_2,int param_3,undefined4 param_4)" identifier (parameter_list "(int *param_1,uint *param_2,int param_3,undefined4 param_4)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "uint *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "int param_3" primitive_type identifier) , (parameter_declaration "undefined4 param_4" type_identifier identifier) ))) (compound_statement "{\n  byte *pbVar1;\n  int iVar2;\n  uint uVar3;\n  byte bVar5;\n  int iVar4;\n  byte bVar6;\n  int iVar7;\n  uint *puVar8;\n  byte *pbVar9;\n  byte *pbVar10;\n  byte bVar11;\n  \n  if ((*(int *)(*param_1 + 0xdc) != 0) ||\n     (iVar4 = param_3, *(int *)(*(int *)(*param_1 + 0x1090) + 0xc) == 0x37)) {\n    iVar4 = param_3 * 3;\n  }\n  pbVar1 = (byte *)safemalloc(iVar4 << 1,1);\n  if (*(int *)(*param_1 + 0xdc) == 0) {\n    iVar2 = *(int *)(*param_1 + 0x1090);\n    iVar7 = *(int *)(iVar2 + 0xc);\n    if (iVar7 == 0x37) goto LAB_0002ed44;\n    iVar4 = (*(code *)PTR_wc_to_mb_000a7370)(iVar7,0,param_2,param_3,pbVar1,iVar4 << 1,0,0,iVar2);\n    if (iVar4 < 0) goto LAB_0002edb8;\n    pbVar10 = pbVar1 + iVar4;\n  }\n  else {\nLAB_0002ed44:\n    if (param_3 < 1) goto LAB_0002edb8;\n    puVar8 = param_2 + param_3;\n    pbVar9 = pbVar1;\n    do {\n      uVar3 = *param_2;\n      if (uVar3 - 0xd800 < 0x800) {\n        bVar5 = 0x2e;\nLAB_0002ed98:\n        *pbVar9 = bVar5;\n        pbVar10 = pbVar9 + 1;\n      }\n      else {\n        bVar5 = (byte)uVar3;\n        if (uVar3 < 0x80) goto LAB_0002ed98;\n        bVar11 = bVar5 & 0x3f | 0x80;\n        bVar5 = (byte)((uVar3 << 0x12) >> 0x18);\n        if (uVar3 < 0x800) {\n          pbVar9[1] = bVar11;\n          *pbVar9 = bVar5 | 0xc0;\n          pbVar10 = pbVar9 + 2;\n        }\n        else {\n          bVar6 = bVar5 & 0x3f | 0x80;\n          bVar5 = (byte)((uVar3 << 0xc) >> 0x18);\n          if (uVar3 < 0x10000) {\n            pbVar9[1] = bVar6;\n            *pbVar9 = bVar5 | 0xe0;\n            pbVar10 = pbVar9 + 3;\n            pbVar9[2] = bVar11;\n          }\n          else {\n            pbVar9[2] = bVar6;\n            pbVar9[3] = bVar11;\n            *pbVar9 = (byte)(uVar3 >> 0x12) | 0xf0;\n            pbVar9[1] = bVar5 & 0x3f | 0x80;\n            pbVar10 = pbVar9 + 4;\n          }\n        }\n      }\n      param_2 = param_2 + 1;\n      pbVar9 = pbVar10;\n    } while (puVar8 != param_2);\n  }\n  if (pbVar1 < pbVar10) {\n    ldisc_send(param_1,pbVar1,(int)pbVar10 - (int)pbVar1,param_4);\n    safefree(pbVar1);\n    return;\n  }\nLAB_0002edb8:\n  safefree(pbVar1);\n  return;\n}" { (declaration "byte *pbVar1;" type_identifier (pointer_declarator "*pbVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "uint uVar3;" type_identifier identifier ;) (declaration "byte bVar5;" type_identifier identifier ;) (declaration "int iVar4;" primitive_type identifier ;) (declaration "byte bVar6;" type_identifier identifier ;) (declaration "int iVar7;" primitive_type identifier ;) (declaration "uint *puVar8;" type_identifier (pointer_declarator "*puVar8" * identifier) ;) (declaration "byte *pbVar9;" type_identifier (pointer_declarator "*pbVar9" * identifier) ;) (declaration "byte *pbVar10;" type_identifier (pointer_declarator "*pbVar10" * identifier) ;) (declaration "byte bVar11;" type_identifier identifier ;) (if_statement "if ((*(int *)(*param_1 + 0xdc) != 0) ||\n     (iVar4 = param_3, *(int *)(*(int *)(*param_1 + 0x1090) + 0xc) == 0x37)) {\n    iVar4 = param_3 * 3;\n  }" if (parenthesized_expression "((*(int *)(*param_1 + 0xdc) != 0) ||\n     (iVar4 = param_3, *(int *)(*(int *)(*param_1 + 0x1090) + 0xc) == 0x37))" ( (binary_expression "(*(int *)(*param_1 + 0xdc) != 0) ||\n     (iVar4 = param_3, *(int *)(*(int *)(*param_1 + 0x1090) + 0xc) == 0x37)" (parenthesized_expression "(*(int *)(*param_1 + 0xdc) != 0)" ( (binary_expression "*(int *)(*param_1 + 0xdc) != 0" (pointer_expression "*(int *)(*param_1 + 0xdc)" * (cast_expression "(int *)(*param_1 + 0xdc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + 0xdc)" ( (binary_expression "*param_1 + 0xdc" (pointer_expression "*param_1" * identifier) + number_literal) )))) != number_literal) )) || (parenthesized_expression "(iVar4 = param_3, *(int *)(*(int *)(*param_1 + 0x1090) + 0xc) == 0x37)" ( (comma_expression "iVar4 = param_3, *(int *)(*(int *)(*param_1 + 0x1090) + 0xc) == 0x37" (assignment_expression "iVar4 = param_3" identifier = identifier) , (binary_expression "*(int *)(*(int *)(*param_1 + 0x1090) + 0xc) == 0x37" (pointer_expression "*(int *)(*(int *)(*param_1 + 0x1090) + 0xc)" * (cast_expression "(int *)(*(int *)(*param_1 + 0x1090) + 0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*(int *)(*param_1 + 0x1090) + 0xc)" ( (binary_expression "*(int *)(*param_1 + 0x1090) + 0xc" (pointer_expression "*(int *)(*param_1 + 0x1090)" * (cast_expression "(int *)(*param_1 + 0x1090)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + 0x1090)" ( (binary_expression "*param_1 + 0x1090" (pointer_expression "*param_1" * identifier) + number_literal) )))) + number_literal) )))) == number_literal)) ))) )) (compound_statement "{\n    iVar4 = param_3 * 3;\n  }" { (expression_statement "iVar4 = param_3 * 3;" (assignment_expression "iVar4 = param_3 * 3" identifier = (binary_expression "param_3 * 3" identifier * number_literal)) ;) })) (expression_statement "pbVar1 = (byte *)safemalloc(iVar4 << 1,1);" (assignment_expression "pbVar1 = (byte *)safemalloc(iVar4 << 1,1)" identifier = (cast_expression "(byte *)safemalloc(iVar4 << 1,1)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "safemalloc(iVar4 << 1,1)" identifier (argument_list "(iVar4 << 1,1)" ( (binary_expression "iVar4 << 1" identifier << number_literal) , number_literal ))))) ;) (if_statement "if (*(int *)(*param_1 + 0xdc) == 0) {\n    iVar2 = *(int *)(*param_1 + 0x1090);\n    iVar7 = *(int *)(iVar2 + 0xc);\n    if (iVar7 == 0x37) goto LAB_0002ed44;\n    iVar4 = (*(code *)PTR_wc_to_mb_000a7370)(iVar7,0,param_2,param_3,pbVar1,iVar4 << 1,0,0,iVar2);\n    if (iVar4 < 0) goto LAB_0002edb8;\n    pbVar10 = pbVar1 + iVar4;\n  }\n  else {\nLAB_0002ed44:\n    if (param_3 < 1) goto LAB_0002edb8;\n    puVar8 = param_2 + param_3;\n    pbVar9 = pbVar1;\n    do {\n      uVar3 = *param_2;\n      if (uVar3 - 0xd800 < 0x800) {\n        bVar5 = 0x2e;\nLAB_0002ed98:\n        *pbVar9 = bVar5;\n        pbVar10 = pbVar9 + 1;\n      }\n      else {\n        bVar5 = (byte)uVar3;\n        if (uVar3 < 0x80) goto LAB_0002ed98;\n        bVar11 = bVar5 & 0x3f | 0x80;\n        bVar5 = (byte)((uVar3 << 0x12) >> 0x18);\n        if (uVar3 < 0x800) {\n          pbVar9[1] = bVar11;\n          *pbVar9 = bVar5 | 0xc0;\n          pbVar10 = pbVar9 + 2;\n        }\n        else {\n          bVar6 = bVar5 & 0x3f | 0x80;\n          bVar5 = (byte)((uVar3 << 0xc) >> 0x18);\n          if (uVar3 < 0x10000) {\n            pbVar9[1] = bVar6;\n            *pbVar9 = bVar5 | 0xe0;\n            pbVar10 = pbVar9 + 3;\n            pbVar9[2] = bVar11;\n          }\n          else {\n            pbVar9[2] = bVar6;\n            pbVar9[3] = bVar11;\n            *pbVar9 = (byte)(uVar3 >> 0x12) | 0xf0;\n            pbVar9[1] = bVar5 & 0x3f | 0x80;\n            pbVar10 = pbVar9 + 4;\n          }\n        }\n      }\n      param_2 = param_2 + 1;\n      pbVar9 = pbVar10;\n    } while (puVar8 != param_2);\n  }" if (parenthesized_expression "(*(int *)(*param_1 + 0xdc) == 0)" ( (binary_expression "*(int *)(*param_1 + 0xdc) == 0" (pointer_expression "*(int *)(*param_1 + 0xdc)" * (cast_expression "(int *)(*param_1 + 0xdc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + 0xdc)" ( (binary_expression "*param_1 + 0xdc" (pointer_expression "*param_1" * identifier) + number_literal) )))) == number_literal) )) (compound_statement "{\n    iVar2 = *(int *)(*param_1 + 0x1090);\n    iVar7 = *(int *)(iVar2 + 0xc);\n    if (iVar7 == 0x37) goto LAB_0002ed44;\n    iVar4 = (*(code *)PTR_wc_to_mb_000a7370)(iVar7,0,param_2,param_3,pbVar1,iVar4 << 1,0,0,iVar2);\n    if (iVar4 < 0) goto LAB_0002edb8;\n    pbVar10 = pbVar1 + iVar4;\n  }" { (expression_statement "iVar2 = *(int *)(*param_1 + 0x1090);" (assignment_expression "iVar2 = *(int *)(*param_1 + 0x1090)" identifier = (pointer_expression "*(int *)(*param_1 + 0x1090)" * (cast_expression "(int *)(*param_1 + 0x1090)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + 0x1090)" ( (binary_expression "*param_1 + 0x1090" (pointer_expression "*param_1" * identifier) + number_literal) ))))) ;) (expression_statement "iVar7 = *(int *)(iVar2 + 0xc);" (assignment_expression "iVar7 = *(int *)(iVar2 + 0xc)" identifier = (pointer_expression "*(int *)(iVar2 + 0xc)" * (cast_expression "(int *)(iVar2 + 0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + 0xc)" ( (binary_expression "iVar2 + 0xc" identifier + number_literal) ))))) ;) (if_statement "if (iVar7 == 0x37) goto LAB_0002ed44;" if (parenthesized_expression "(iVar7 == 0x37)" ( (binary_expression "iVar7 == 0x37" identifier == number_literal) )) (goto_statement "goto LAB_0002ed44;" goto statement_identifier ;)) (expression_statement "iVar4 = (*(code *)PTR_wc_to_mb_000a7370)(iVar7,0,param_2,param_3,pbVar1,iVar4 << 1,0,0,iVar2);" (assignment_expression "iVar4 = (*(code *)PTR_wc_to_mb_000a7370)(iVar7,0,param_2,param_3,pbVar1,iVar4 << 1,0,0,iVar2)" identifier = (call_expression "(*(code *)PTR_wc_to_mb_000a7370)(iVar7,0,param_2,param_3,pbVar1,iVar4 << 1,0,0,iVar2)" (parenthesized_expression "(*(code *)PTR_wc_to_mb_000a7370)" ( (pointer_expression "*(code *)PTR_wc_to_mb_000a7370" * (cast_expression "(code *)PTR_wc_to_mb_000a7370" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar7,0,param_2,param_3,pbVar1,iVar4 << 1,0,0,iVar2)" ( identifier , number_literal , identifier , identifier , identifier , (binary_expression "iVar4 << 1" identifier << number_literal) , number_literal , number_literal , identifier )))) ;) (if_statement "if (iVar4 < 0) goto LAB_0002edb8;" if (parenthesized_expression "(iVar4 < 0)" ( (binary_expression "iVar4 < 0" identifier < number_literal) )) (goto_statement "goto LAB_0002edb8;" goto statement_identifier ;)) (expression_statement "pbVar10 = pbVar1 + iVar4;" (assignment_expression "pbVar10 = pbVar1 + iVar4" identifier = (binary_expression "pbVar1 + iVar4" identifier + identifier)) ;) }) (else_clause "else {\nLAB_0002ed44:\n    if (param_3 < 1) goto LAB_0002edb8;\n    puVar8 = param_2 + param_3;\n    pbVar9 = pbVar1;\n    do {\n      uVar3 = *param_2;\n      if (uVar3 - 0xd800 < 0x800) {\n        bVar5 = 0x2e;\nLAB_0002ed98:\n        *pbVar9 = bVar5;\n        pbVar10 = pbVar9 + 1;\n      }\n      else {\n        bVar5 = (byte)uVar3;\n        if (uVar3 < 0x80) goto LAB_0002ed98;\n        bVar11 = bVar5 & 0x3f | 0x80;\n        bVar5 = (byte)((uVar3 << 0x12) >> 0x18);\n        if (uVar3 < 0x800) {\n          pbVar9[1] = bVar11;\n          *pbVar9 = bVar5 | 0xc0;\n          pbVar10 = pbVar9 + 2;\n        }\n        else {\n          bVar6 = bVar5 & 0x3f | 0x80;\n          bVar5 = (byte)((uVar3 << 0xc) >> 0x18);\n          if (uVar3 < 0x10000) {\n            pbVar9[1] = bVar6;\n            *pbVar9 = bVar5 | 0xe0;\n            pbVar10 = pbVar9 + 3;\n            pbVar9[2] = bVar11;\n          }\n          else {\n            pbVar9[2] = bVar6;\n            pbVar9[3] = bVar11;\n            *pbVar9 = (byte)(uVar3 >> 0x12) | 0xf0;\n            pbVar9[1] = bVar5 & 0x3f | 0x80;\n            pbVar10 = pbVar9 + 4;\n          }\n        }\n      }\n      param_2 = param_2 + 1;\n      pbVar9 = pbVar10;\n    } while (puVar8 != param_2);\n  }" else (compound_statement "{\nLAB_0002ed44:\n    if (param_3 < 1) goto LAB_0002edb8;\n    puVar8 = param_2 + param_3;\n    pbVar9 = pbVar1;\n    do {\n      uVar3 = *param_2;\n      if (uVar3 - 0xd800 < 0x800) {\n        bVar5 = 0x2e;\nLAB_0002ed98:\n        *pbVar9 = bVar5;\n        pbVar10 = pbVar9 + 1;\n      }\n      else {\n        bVar5 = (byte)uVar3;\n        if (uVar3 < 0x80) goto LAB_0002ed98;\n        bVar11 = bVar5 & 0x3f | 0x80;\n        bVar5 = (byte)((uVar3 << 0x12) >> 0x18);\n        if (uVar3 < 0x800) {\n          pbVar9[1] = bVar11;\n          *pbVar9 = bVar5 | 0xc0;\n          pbVar10 = pbVar9 + 2;\n        }\n        else {\n          bVar6 = bVar5 & 0x3f | 0x80;\n          bVar5 = (byte)((uVar3 << 0xc) >> 0x18);\n          if (uVar3 < 0x10000) {\n            pbVar9[1] = bVar6;\n            *pbVar9 = bVar5 | 0xe0;\n            pbVar10 = pbVar9 + 3;\n            pbVar9[2] = bVar11;\n          }\n          else {\n            pbVar9[2] = bVar6;\n            pbVar9[3] = bVar11;\n            *pbVar9 = (byte)(uVar3 >> 0x12) | 0xf0;\n            pbVar9[1] = bVar5 & 0x3f | 0x80;\n            pbVar10 = pbVar9 + 4;\n          }\n        }\n      }\n      param_2 = param_2 + 1;\n      pbVar9 = pbVar10;\n    } while (puVar8 != param_2);\n  }" { (labeled_statement "LAB_0002ed44:\n    if (param_3 < 1) goto LAB_0002edb8;" statement_identifier : (if_statement "if (param_3 < 1) goto LAB_0002edb8;" if (parenthesized_expression "(param_3 < 1)" ( (binary_expression "param_3 < 1" identifier < number_literal) )) (goto_statement "goto LAB_0002edb8;" goto statement_identifier ;))) (expression_statement "puVar8 = param_2 + param_3;" (assignment_expression "puVar8 = param_2 + param_3" identifier = (binary_expression "param_2 + param_3" identifier + identifier)) ;) (expression_statement "pbVar9 = pbVar1;" (assignment_expression "pbVar9 = pbVar1" identifier = identifier) ;) (do_statement "do {\n      uVar3 = *param_2;\n      if (uVar3 - 0xd800 < 0x800) {\n        bVar5 = 0x2e;\nLAB_0002ed98:\n        *pbVar9 = bVar5;\n        pbVar10 = pbVar9 + 1;\n      }\n      else {\n        bVar5 = (byte)uVar3;\n        if (uVar3 < 0x80) goto LAB_0002ed98;\n        bVar11 = bVar5 & 0x3f | 0x80;\n        bVar5 = (byte)((uVar3 << 0x12) >> 0x18);\n        if (uVar3 < 0x800) {\n          pbVar9[1] = bVar11;\n          *pbVar9 = bVar5 | 0xc0;\n          pbVar10 = pbVar9 + 2;\n        }\n        else {\n          bVar6 = bVar5 & 0x3f | 0x80;\n          bVar5 = (byte)((uVar3 << 0xc) >> 0x18);\n          if (uVar3 < 0x10000) {\n            pbVar9[1] = bVar6;\n            *pbVar9 = bVar5 | 0xe0;\n            pbVar10 = pbVar9 + 3;\n            pbVar9[2] = bVar11;\n          }\n          else {\n            pbVar9[2] = bVar6;\n            pbVar9[3] = bVar11;\n            *pbVar9 = (byte)(uVar3 >> 0x12) | 0xf0;\n            pbVar9[1] = bVar5 & 0x3f | 0x80;\n            pbVar10 = pbVar9 + 4;\n          }\n        }\n      }\n      param_2 = param_2 + 1;\n      pbVar9 = pbVar10;\n    } while (puVar8 != param_2);" do (compound_statement "{\n      uVar3 = *param_2;\n      if (uVar3 - 0xd800 < 0x800) {\n        bVar5 = 0x2e;\nLAB_0002ed98:\n        *pbVar9 = bVar5;\n        pbVar10 = pbVar9 + 1;\n      }\n      else {\n        bVar5 = (byte)uVar3;\n        if (uVar3 < 0x80) goto LAB_0002ed98;\n        bVar11 = bVar5 & 0x3f | 0x80;\n        bVar5 = (byte)((uVar3 << 0x12) >> 0x18);\n        if (uVar3 < 0x800) {\n          pbVar9[1] = bVar11;\n          *pbVar9 = bVar5 | 0xc0;\n          pbVar10 = pbVar9 + 2;\n        }\n        else {\n          bVar6 = bVar5 & 0x3f | 0x80;\n          bVar5 = (byte)((uVar3 << 0xc) >> 0x18);\n          if (uVar3 < 0x10000) {\n            pbVar9[1] = bVar6;\n            *pbVar9 = bVar5 | 0xe0;\n            pbVar10 = pbVar9 + 3;\n            pbVar9[2] = bVar11;\n          }\n          else {\n            pbVar9[2] = bVar6;\n            pbVar9[3] = bVar11;\n            *pbVar9 = (byte)(uVar3 >> 0x12) | 0xf0;\n            pbVar9[1] = bVar5 & 0x3f | 0x80;\n            pbVar10 = pbVar9 + 4;\n          }\n        }\n      }\n      param_2 = param_2 + 1;\n      pbVar9 = pbVar10;\n    }" { (expression_statement "uVar3 = *param_2;" (assignment_expression "uVar3 = *param_2" identifier = (pointer_expression "*param_2" * identifier)) ;) (if_statement "if (uVar3 - 0xd800 < 0x800) {\n        bVar5 = 0x2e;\nLAB_0002ed98:\n        *pbVar9 = bVar5;\n        pbVar10 = pbVar9 + 1;\n      }\n      else {\n        bVar5 = (byte)uVar3;\n        if (uVar3 < 0x80) goto LAB_0002ed98;\n        bVar11 = bVar5 & 0x3f | 0x80;\n        bVar5 = (byte)((uVar3 << 0x12) >> 0x18);\n        if (uVar3 < 0x800) {\n          pbVar9[1] = bVar11;\n          *pbVar9 = bVar5 | 0xc0;\n          pbVar10 = pbVar9 + 2;\n        }\n        else {\n          bVar6 = bVar5 & 0x3f | 0x80;\n          bVar5 = (byte)((uVar3 << 0xc) >> 0x18);\n          if (uVar3 < 0x10000) {\n            pbVar9[1] = bVar6;\n            *pbVar9 = bVar5 | 0xe0;\n            pbVar10 = pbVar9 + 3;\n            pbVar9[2] = bVar11;\n          }\n          else {\n            pbVar9[2] = bVar6;\n            pbVar9[3] = bVar11;\n            *pbVar9 = (byte)(uVar3 >> 0x12) | 0xf0;\n            pbVar9[1] = bVar5 & 0x3f | 0x80;\n            pbVar10 = pbVar9 + 4;\n          }\n        }\n      }" if (parenthesized_expression "(uVar3 - 0xd800 < 0x800)" ( (binary_expression "uVar3 - 0xd800 < 0x800" (binary_expression "uVar3 - 0xd800" identifier - number_literal) < number_literal) )) (compound_statement "{\n        bVar5 = 0x2e;\nLAB_0002ed98:\n        *pbVar9 = bVar5;\n        pbVar10 = pbVar9 + 1;\n      }" { (expression_statement "bVar5 = 0x2e;" (assignment_expression "bVar5 = 0x2e" identifier = number_literal) ;) (labeled_statement "LAB_0002ed98:\n        *pbVar9 = bVar5;" statement_identifier : (expression_statement "*pbVar9 = bVar5;" (assignment_expression "*pbVar9 = bVar5" (pointer_expression "*pbVar9" * identifier) = identifier) ;)) (expression_statement "pbVar10 = pbVar9 + 1;" (assignment_expression "pbVar10 = pbVar9 + 1" identifier = (binary_expression "pbVar9 + 1" identifier + number_literal)) ;) }) (else_clause "else {\n        bVar5 = (byte)uVar3;\n        if (uVar3 < 0x80) goto LAB_0002ed98;\n        bVar11 = bVar5 & 0x3f | 0x80;\n        bVar5 = (byte)((uVar3 << 0x12) >> 0x18);\n        if (uVar3 < 0x800) {\n          pbVar9[1] = bVar11;\n          *pbVar9 = bVar5 | 0xc0;\n          pbVar10 = pbVar9 + 2;\n        }\n        else {\n          bVar6 = bVar5 & 0x3f | 0x80;\n          bVar5 = (byte)((uVar3 << 0xc) >> 0x18);\n          if (uVar3 < 0x10000) {\n            pbVar9[1] = bVar6;\n            *pbVar9 = bVar5 | 0xe0;\n            pbVar10 = pbVar9 + 3;\n            pbVar9[2] = bVar11;\n          }\n          else {\n            pbVar9[2] = bVar6;\n            pbVar9[3] = bVar11;\n            *pbVar9 = (byte)(uVar3 >> 0x12) | 0xf0;\n            pbVar9[1] = bVar5 & 0x3f | 0x80;\n            pbVar10 = pbVar9 + 4;\n          }\n        }\n      }" else (compound_statement "{\n        bVar5 = (byte)uVar3;\n        if (uVar3 < 0x80) goto LAB_0002ed98;\n        bVar11 = bVar5 & 0x3f | 0x80;\n        bVar5 = (byte)((uVar3 << 0x12) >> 0x18);\n        if (uVar3 < 0x800) {\n          pbVar9[1] = bVar11;\n          *pbVar9 = bVar5 | 0xc0;\n          pbVar10 = pbVar9 + 2;\n        }\n        else {\n          bVar6 = bVar5 & 0x3f | 0x80;\n          bVar5 = (byte)((uVar3 << 0xc) >> 0x18);\n          if (uVar3 < 0x10000) {\n            pbVar9[1] = bVar6;\n            *pbVar9 = bVar5 | 0xe0;\n            pbVar10 = pbVar9 + 3;\n            pbVar9[2] = bVar11;\n          }\n          else {\n            pbVar9[2] = bVar6;\n            pbVar9[3] = bVar11;\n            *pbVar9 = (byte)(uVar3 >> 0x12) | 0xf0;\n            pbVar9[1] = bVar5 & 0x3f | 0x80;\n            pbVar10 = pbVar9 + 4;\n          }\n        }\n      }" { (expression_statement "bVar5 = (byte)uVar3;" (assignment_expression "bVar5 = (byte)uVar3" identifier = (cast_expression "(byte)uVar3" ( (type_descriptor "byte" type_identifier) ) identifier)) ;) (if_statement "if (uVar3 < 0x80) goto LAB_0002ed98;" if (parenthesized_expression "(uVar3 < 0x80)" ( (binary_expression "uVar3 < 0x80" identifier < number_literal) )) (goto_statement "goto LAB_0002ed98;" goto statement_identifier ;)) (expression_statement "bVar11 = bVar5 & 0x3f | 0x80;" (assignment_expression "bVar11 = bVar5 & 0x3f | 0x80" identifier = (binary_expression "bVar5 & 0x3f | 0x80" (binary_expression "bVar5 & 0x3f" identifier & number_literal) | number_literal)) ;) (expression_statement "bVar5 = (byte)((uVar3 << 0x12) >> 0x18);" (assignment_expression "bVar5 = (byte)((uVar3 << 0x12) >> 0x18)" identifier = (call_expression "(byte)((uVar3 << 0x12) >> 0x18)" (parenthesized_expression "(byte)" ( identifier )) (argument_list "((uVar3 << 0x12) >> 0x18)" ( (binary_expression "(uVar3 << 0x12) >> 0x18" (parenthesized_expression "(uVar3 << 0x12)" ( (binary_expression "uVar3 << 0x12" identifier << number_literal) )) >> number_literal) )))) ;) (if_statement "if (uVar3 < 0x800) {\n          pbVar9[1] = bVar11;\n          *pbVar9 = bVar5 | 0xc0;\n          pbVar10 = pbVar9 + 2;\n        }\n        else {\n          bVar6 = bVar5 & 0x3f | 0x80;\n          bVar5 = (byte)((uVar3 << 0xc) >> 0x18);\n          if (uVar3 < 0x10000) {\n            pbVar9[1] = bVar6;\n            *pbVar9 = bVar5 | 0xe0;\n            pbVar10 = pbVar9 + 3;\n            pbVar9[2] = bVar11;\n          }\n          else {\n            pbVar9[2] = bVar6;\n            pbVar9[3] = bVar11;\n            *pbVar9 = (byte)(uVar3 >> 0x12) | 0xf0;\n            pbVar9[1] = bVar5 & 0x3f | 0x80;\n            pbVar10 = pbVar9 + 4;\n          }\n        }" if (parenthesized_expression "(uVar3 < 0x800)" ( (binary_expression "uVar3 < 0x800" identifier < number_literal) )) (compound_statement "{\n          pbVar9[1] = bVar11;\n          *pbVar9 = bVar5 | 0xc0;\n          pbVar10 = pbVar9 + 2;\n        }" { (expression_statement "pbVar9[1] = bVar11;" (assignment_expression "pbVar9[1] = bVar11" (subscript_expression "pbVar9[1]" identifier [ number_literal ]) = identifier) ;) (expression_statement "*pbVar9 = bVar5 | 0xc0;" (assignment_expression "*pbVar9 = bVar5 | 0xc0" (pointer_expression "*pbVar9" * identifier) = (binary_expression "bVar5 | 0xc0" identifier | number_literal)) ;) (expression_statement "pbVar10 = pbVar9 + 2;" (assignment_expression "pbVar10 = pbVar9 + 2" identifier = (binary_expression "pbVar9 + 2" identifier + number_literal)) ;) }) (else_clause "else {\n          bVar6 = bVar5 & 0x3f | 0x80;\n          bVar5 = (byte)((uVar3 << 0xc) >> 0x18);\n          if (uVar3 < 0x10000) {\n            pbVar9[1] = bVar6;\n            *pbVar9 = bVar5 | 0xe0;\n            pbVar10 = pbVar9 + 3;\n            pbVar9[2] = bVar11;\n          }\n          else {\n            pbVar9[2] = bVar6;\n            pbVar9[3] = bVar11;\n            *pbVar9 = (byte)(uVar3 >> 0x12) | 0xf0;\n            pbVar9[1] = bVar5 & 0x3f | 0x80;\n            pbVar10 = pbVar9 + 4;\n          }\n        }" else (compound_statement "{\n          bVar6 = bVar5 & 0x3f | 0x80;\n          bVar5 = (byte)((uVar3 << 0xc) >> 0x18);\n          if (uVar3 < 0x10000) {\n            pbVar9[1] = bVar6;\n            *pbVar9 = bVar5 | 0xe0;\n            pbVar10 = pbVar9 + 3;\n            pbVar9[2] = bVar11;\n          }\n          else {\n            pbVar9[2] = bVar6;\n            pbVar9[3] = bVar11;\n            *pbVar9 = (byte)(uVar3 >> 0x12) | 0xf0;\n            pbVar9[1] = bVar5 & 0x3f | 0x80;\n            pbVar10 = pbVar9 + 4;\n          }\n        }" { (expression_statement "bVar6 = bVar5 & 0x3f | 0x80;" (assignment_expression "bVar6 = bVar5 & 0x3f | 0x80" identifier = (binary_expression "bVar5 & 0x3f | 0x80" (binary_expression "bVar5 & 0x3f" identifier & number_literal) | number_literal)) ;) (expression_statement "bVar5 = (byte)((uVar3 << 0xc) >> 0x18);" (assignment_expression "bVar5 = (byte)((uVar3 << 0xc) >> 0x18)" identifier = (call_expression "(byte)((uVar3 << 0xc) >> 0x18)" (parenthesized_expression "(byte)" ( identifier )) (argument_list "((uVar3 << 0xc) >> 0x18)" ( (binary_expression "(uVar3 << 0xc) >> 0x18" (parenthesized_expression "(uVar3 << 0xc)" ( (binary_expression "uVar3 << 0xc" identifier << number_literal) )) >> number_literal) )))) ;) (if_statement "if (uVar3 < 0x10000) {\n            pbVar9[1] = bVar6;\n            *pbVar9 = bVar5 | 0xe0;\n            pbVar10 = pbVar9 + 3;\n            pbVar9[2] = bVar11;\n          }\n          else {\n            pbVar9[2] = bVar6;\n            pbVar9[3] = bVar11;\n            *pbVar9 = (byte)(uVar3 >> 0x12) | 0xf0;\n            pbVar9[1] = bVar5 & 0x3f | 0x80;\n            pbVar10 = pbVar9 + 4;\n          }" if (parenthesized_expression "(uVar3 < 0x10000)" ( (binary_expression "uVar3 < 0x10000" identifier < number_literal) )) (compound_statement "{\n            pbVar9[1] = bVar6;\n            *pbVar9 = bVar5 | 0xe0;\n            pbVar10 = pbVar9 + 3;\n            pbVar9[2] = bVar11;\n          }" { (expression_statement "pbVar9[1] = bVar6;" (assignment_expression "pbVar9[1] = bVar6" (subscript_expression "pbVar9[1]" identifier [ number_literal ]) = identifier) ;) (expression_statement "*pbVar9 = bVar5 | 0xe0;" (assignment_expression "*pbVar9 = bVar5 | 0xe0" (pointer_expression "*pbVar9" * identifier) = (binary_expression "bVar5 | 0xe0" identifier | number_literal)) ;) (expression_statement "pbVar10 = pbVar9 + 3;" (assignment_expression "pbVar10 = pbVar9 + 3" identifier = (binary_expression "pbVar9 + 3" identifier + number_literal)) ;) (expression_statement "pbVar9[2] = bVar11;" (assignment_expression "pbVar9[2] = bVar11" (subscript_expression "pbVar9[2]" identifier [ number_literal ]) = identifier) ;) }) (else_clause "else {\n            pbVar9[2] = bVar6;\n            pbVar9[3] = bVar11;\n            *pbVar9 = (byte)(uVar3 >> 0x12) | 0xf0;\n            pbVar9[1] = bVar5 & 0x3f | 0x80;\n            pbVar10 = pbVar9 + 4;\n          }" else (compound_statement "{\n            pbVar9[2] = bVar6;\n            pbVar9[3] = bVar11;\n            *pbVar9 = (byte)(uVar3 >> 0x12) | 0xf0;\n            pbVar9[1] = bVar5 & 0x3f | 0x80;\n            pbVar10 = pbVar9 + 4;\n          }" { (expression_statement "pbVar9[2] = bVar6;" (assignment_expression "pbVar9[2] = bVar6" (subscript_expression "pbVar9[2]" identifier [ number_literal ]) = identifier) ;) (expression_statement "pbVar9[3] = bVar11;" (assignment_expression "pbVar9[3] = bVar11" (subscript_expression "pbVar9[3]" identifier [ number_literal ]) = identifier) ;) (expression_statement "*pbVar9 = (byte)(uVar3 >> 0x12) | 0xf0;" (assignment_expression "*pbVar9 = (byte)(uVar3 >> 0x12) | 0xf0" (pointer_expression "*pbVar9" * identifier) = (binary_expression "(byte)(uVar3 >> 0x12) | 0xf0" (call_expression "(byte)(uVar3 >> 0x12)" (parenthesized_expression "(byte)" ( identifier )) (argument_list "(uVar3 >> 0x12)" ( (binary_expression "uVar3 >> 0x12" identifier >> number_literal) ))) | number_literal)) ;) (expression_statement "pbVar9[1] = bVar5 & 0x3f | 0x80;" (assignment_expression "pbVar9[1] = bVar5 & 0x3f | 0x80" (subscript_expression "pbVar9[1]" identifier [ number_literal ]) = (binary_expression "bVar5 & 0x3f | 0x80" (binary_expression "bVar5 & 0x3f" identifier & number_literal) | number_literal)) ;) (expression_statement "pbVar10 = pbVar9 + 4;" (assignment_expression "pbVar10 = pbVar9 + 4" identifier = (binary_expression "pbVar9 + 4" 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)) ;) (expression_statement "pbVar9 = pbVar10;" (assignment_expression "pbVar9 = pbVar10" identifier = identifier) ;) }) while (parenthesized_expression "(puVar8 != param_2)" ( (binary_expression "puVar8 != param_2" identifier != identifier) )) ;) }))) (if_statement "if (pbVar1 < pbVar10) {\n    ldisc_send(param_1,pbVar1,(int)pbVar10 - (int)pbVar1,param_4);\n    safefree(pbVar1);\n    return;\n  }" if (parenthesized_expression "(pbVar1 < pbVar10)" ( (binary_expression "pbVar1 < pbVar10" identifier < identifier) )) (compound_statement "{\n    ldisc_send(param_1,pbVar1,(int)pbVar10 - (int)pbVar1,param_4);\n    safefree(pbVar1);\n    return;\n  }" { (expression_statement "ldisc_send(param_1,pbVar1,(int)pbVar10 - (int)pbVar1,param_4);" (call_expression "ldisc_send(param_1,pbVar1,(int)pbVar10 - (int)pbVar1,param_4)" identifier (argument_list "(param_1,pbVar1,(int)pbVar10 - (int)pbVar1,param_4)" ( identifier , identifier , (binary_expression "(int)pbVar10 - (int)pbVar1" (cast_expression "(int)pbVar10" ( (type_descriptor "int" primitive_type) ) identifier) - (cast_expression "(int)pbVar1" ( (type_descriptor "int" primitive_type) ) identifier)) , identifier ))) ;) (expression_statement "safefree(pbVar1);" (call_expression "safefree(pbVar1)" identifier (argument_list "(pbVar1)" ( identifier ))) ;) (return_statement "return;" return ;) })) (labeled_statement "LAB_0002edb8:\n  safefree(pbVar1);" statement_identifier : (expression_statement "safefree(pbVar1);" (call_expression "safefree(pbVar1)" identifier (argument_list "(pbVar1)" ( identifier ))) ;)) (return_statement "return;" return ;) })))
(translation_unit "void luni_send(void *handle,wchar_t *widebuf,int len,int interactive)\n\n{\n                    /* WARNING: Load size is inaccurate */\n  if ((*(int *)(*handle + 0xdc) != 0) || (*(int *)(*(int *)(*handle + 0x1090) + 0xc) == 0x37)) {\n    len = len * 3;\n  }\n                    /* WARNING: Subroutine does not return */\n  safemalloc(len << 1,1);\n}\n\n" (function_definition "void luni_send(void *handle,wchar_t *widebuf,int len,int interactive)\n\n{\n                    /* WARNING: Load size is inaccurate */\n  if ((*(int *)(*handle + 0xdc) != 0) || (*(int *)(*(int *)(*handle + 0x1090) + 0xc) == 0x37)) {\n    len = len * 3;\n  }\n                    /* WARNING: Subroutine does not return */\n  safemalloc(len << 1,1);\n}" primitive_type (function_declarator "luni_send(void *handle,wchar_t *widebuf,int len,int interactive)" identifier (parameter_list "(void *handle,wchar_t *widebuf,int len,int interactive)" ( (parameter_declaration "void *handle" primitive_type (pointer_declarator "*handle" * identifier)) , (parameter_declaration "wchar_t *widebuf" type_identifier (pointer_declarator "*widebuf" * identifier)) , (parameter_declaration "int len" primitive_type identifier) , (parameter_declaration "int interactive" primitive_type identifier) ))) (compound_statement "{\n                    /* WARNING: Load size is inaccurate */\n  if ((*(int *)(*handle + 0xdc) != 0) || (*(int *)(*(int *)(*handle + 0x1090) + 0xc) == 0x37)) {\n    len = len * 3;\n  }\n                    /* WARNING: Subroutine does not return */\n  safemalloc(len << 1,1);\n}" { comment (if_statement "if ((*(int *)(*handle + 0xdc) != 0) || (*(int *)(*(int *)(*handle + 0x1090) + 0xc) == 0x37)) {\n    len = len * 3;\n  }" if (parenthesized_expression "((*(int *)(*handle + 0xdc) != 0) || (*(int *)(*(int *)(*handle + 0x1090) + 0xc) == 0x37))" ( (binary_expression "(*(int *)(*handle + 0xdc) != 0) || (*(int *)(*(int *)(*handle + 0x1090) + 0xc) == 0x37)" (parenthesized_expression "(*(int *)(*handle + 0xdc) != 0)" ( (binary_expression "*(int *)(*handle + 0xdc) != 0" (pointer_expression "*(int *)(*handle + 0xdc)" * (cast_expression "(int *)(*handle + 0xdc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*handle + 0xdc)" ( (binary_expression "*handle + 0xdc" (pointer_expression "*handle" * identifier) + number_literal) )))) != number_literal) )) || (parenthesized_expression "(*(int *)(*(int *)(*handle + 0x1090) + 0xc) == 0x37)" ( (binary_expression "*(int *)(*(int *)(*handle + 0x1090) + 0xc) == 0x37" (pointer_expression "*(int *)(*(int *)(*handle + 0x1090) + 0xc)" * (cast_expression "(int *)(*(int *)(*handle + 0x1090) + 0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*(int *)(*handle + 0x1090) + 0xc)" ( (binary_expression "*(int *)(*handle + 0x1090) + 0xc" (pointer_expression "*(int *)(*handle + 0x1090)" * (cast_expression "(int *)(*handle + 0x1090)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*handle + 0x1090)" ( (binary_expression "*handle + 0x1090" (pointer_expression "*handle" * identifier) + number_literal) )))) + number_literal) )))) == number_literal) ))) )) (compound_statement "{\n    len = len * 3;\n  }" { (expression_statement "len = len * 3;" (assignment_expression "len = len * 3" identifier = (binary_expression "len * 3" identifier * number_literal)) ;) })) comment (expression_statement "safemalloc(len << 1,1);" (call_expression "safemalloc(len << 1,1)" identifier (argument_list "(len << 1,1)" ( (binary_expression "len << 1" identifier << number_literal) , number_literal ))) ;) })))
(translation_unit "void luni_send(int *param_1,uint *param_2,int param_3,undefined4 param_4)\n\n{\n  byte *pbVar1;\n  int iVar2;\n  uint uVar3;\n  byte bVar5;\n  int iVar4;\n  byte bVar6;\n  int iVar7;\n  uint *puVar8;\n  byte *pbVar9;\n  byte *pbVar10;\n  byte bVar11;\n  \n  if ((*(int *)(*param_1 + 0xdc) != 0) ||\n     (iVar4 = param_3, *(int *)(*(int *)(*param_1 + 0x1090) + 0xc) == 0x37)) {\n    iVar4 = param_3 * 3;\n  }\n  pbVar1 = (byte *)safemalloc(iVar4 << 1,1);\n  if (*(int *)(*param_1 + 0xdc) == 0) {\n    iVar2 = *(int *)(*param_1 + 0x1090);\n    iVar7 = *(int *)(iVar2 + 0xc);\n    if (iVar7 == 0x37) goto LAB_0002ed44;\n    iVar4 = (*(code *)PTR_wc_to_mb_000a7370)(iVar7,0,param_2,param_3,pbVar1,iVar4 << 1,0,0,iVar2);\n    if (iVar4 < 0) goto LAB_0002edb8;\n    pbVar10 = pbVar1 + iVar4;\n  }\n  else {\nLAB_0002ed44:\n    if (param_3 < 1) goto LAB_0002edb8;\n    puVar8 = param_2 + param_3;\n    pbVar9 = pbVar1;\n    do {\n      uVar3 = *param_2;\n      if (uVar3 - 0xd800 < 0x800) {\n        bVar5 = 0x2e;\nLAB_0002ed98:\n        *pbVar9 = bVar5;\n        pbVar10 = pbVar9 + 1;\n      }\n      else {\n        bVar5 = (byte)uVar3;\n        if (uVar3 < 0x80) goto LAB_0002ed98;\n        bVar11 = bVar5 & 0x3f | 0x80;\n        bVar5 = (byte)((uVar3 << 0x12) >> 0x18);\n        if (uVar3 < 0x800) {\n          pbVar9[1] = bVar11;\n          *pbVar9 = bVar5 | 0xc0;\n          pbVar10 = pbVar9 + 2;\n        }\n        else {\n          bVar6 = bVar5 & 0x3f | 0x80;\n          bVar5 = (byte)((uVar3 << 0xc) >> 0x18);\n          if (uVar3 < 0x10000) {\n            pbVar9[1] = bVar6;\n            *pbVar9 = bVar5 | 0xe0;\n            pbVar10 = pbVar9 + 3;\n            pbVar9[2] = bVar11;\n          }\n          else {\n            pbVar9[2] = bVar6;\n            pbVar9[3] = bVar11;\n            *pbVar9 = (byte)(uVar3 >> 0x12) | 0xf0;\n            pbVar9[1] = bVar5 & 0x3f | 0x80;\n            pbVar10 = pbVar9 + 4;\n          }\n        }\n      }\n      param_2 = param_2 + 1;\n      pbVar9 = pbVar10;\n    } while (puVar8 != param_2);\n  }\n  if (pbVar1 < pbVar10) {\n    ldisc_send(param_1,pbVar1,(int)pbVar10 - (int)pbVar1,param_4);\n    safefree(pbVar1);\n    return;\n  }\nLAB_0002edb8:\n  safefree(pbVar1);\n  return;\n}\n\n" (function_definition "void luni_send(int *param_1,uint *param_2,int param_3,undefined4 param_4)\n\n{\n  byte *pbVar1;\n  int iVar2;\n  uint uVar3;\n  byte bVar5;\n  int iVar4;\n  byte bVar6;\n  int iVar7;\n  uint *puVar8;\n  byte *pbVar9;\n  byte *pbVar10;\n  byte bVar11;\n  \n  if ((*(int *)(*param_1 + 0xdc) != 0) ||\n     (iVar4 = param_3, *(int *)(*(int *)(*param_1 + 0x1090) + 0xc) == 0x37)) {\n    iVar4 = param_3 * 3;\n  }\n  pbVar1 = (byte *)safemalloc(iVar4 << 1,1);\n  if (*(int *)(*param_1 + 0xdc) == 0) {\n    iVar2 = *(int *)(*param_1 + 0x1090);\n    iVar7 = *(int *)(iVar2 + 0xc);\n    if (iVar7 == 0x37) goto LAB_0002ed44;\n    iVar4 = (*(code *)PTR_wc_to_mb_000a7370)(iVar7,0,param_2,param_3,pbVar1,iVar4 << 1,0,0,iVar2);\n    if (iVar4 < 0) goto LAB_0002edb8;\n    pbVar10 = pbVar1 + iVar4;\n  }\n  else {\nLAB_0002ed44:\n    if (param_3 < 1) goto LAB_0002edb8;\n    puVar8 = param_2 + param_3;\n    pbVar9 = pbVar1;\n    do {\n      uVar3 = *param_2;\n      if (uVar3 - 0xd800 < 0x800) {\n        bVar5 = 0x2e;\nLAB_0002ed98:\n        *pbVar9 = bVar5;\n        pbVar10 = pbVar9 + 1;\n      }\n      else {\n        bVar5 = (byte)uVar3;\n        if (uVar3 < 0x80) goto LAB_0002ed98;\n        bVar11 = bVar5 & 0x3f | 0x80;\n        bVar5 = (byte)((uVar3 << 0x12) >> 0x18);\n        if (uVar3 < 0x800) {\n          pbVar9[1] = bVar11;\n          *pbVar9 = bVar5 | 0xc0;\n          pbVar10 = pbVar9 + 2;\n        }\n        else {\n          bVar6 = bVar5 & 0x3f | 0x80;\n          bVar5 = (byte)((uVar3 << 0xc) >> 0x18);\n          if (uVar3 < 0x10000) {\n            pbVar9[1] = bVar6;\n            *pbVar9 = bVar5 | 0xe0;\n            pbVar10 = pbVar9 + 3;\n            pbVar9[2] = bVar11;\n          }\n          else {\n            pbVar9[2] = bVar6;\n            pbVar9[3] = bVar11;\n            *pbVar9 = (byte)(uVar3 >> 0x12) | 0xf0;\n            pbVar9[1] = bVar5 & 0x3f | 0x80;\n            pbVar10 = pbVar9 + 4;\n          }\n        }\n      }\n      param_2 = param_2 + 1;\n      pbVar9 = pbVar10;\n    } while (puVar8 != param_2);\n  }\n  if (pbVar1 < pbVar10) {\n    ldisc_send(param_1,pbVar1,(int)pbVar10 - (int)pbVar1,param_4);\n    safefree(pbVar1);\n    return;\n  }\nLAB_0002edb8:\n  safefree(pbVar1);\n  return;\n}" primitive_type (function_declarator "luni_send(int *param_1,uint *param_2,int param_3,undefined4 param_4)" identifier (parameter_list "(int *param_1,uint *param_2,int param_3,undefined4 param_4)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "uint *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "int param_3" primitive_type identifier) , (parameter_declaration "undefined4 param_4" type_identifier identifier) ))) (compound_statement "{\n  byte *pbVar1;\n  int iVar2;\n  uint uVar3;\n  byte bVar5;\n  int iVar4;\n  byte bVar6;\n  int iVar7;\n  uint *puVar8;\n  byte *pbVar9;\n  byte *pbVar10;\n  byte bVar11;\n  \n  if ((*(int *)(*param_1 + 0xdc) != 0) ||\n     (iVar4 = param_3, *(int *)(*(int *)(*param_1 + 0x1090) + 0xc) == 0x37)) {\n    iVar4 = param_3 * 3;\n  }\n  pbVar1 = (byte *)safemalloc(iVar4 << 1,1);\n  if (*(int *)(*param_1 + 0xdc) == 0) {\n    iVar2 = *(int *)(*param_1 + 0x1090);\n    iVar7 = *(int *)(iVar2 + 0xc);\n    if (iVar7 == 0x37) goto LAB_0002ed44;\n    iVar4 = (*(code *)PTR_wc_to_mb_000a7370)(iVar7,0,param_2,param_3,pbVar1,iVar4 << 1,0,0,iVar2);\n    if (iVar4 < 0) goto LAB_0002edb8;\n    pbVar10 = pbVar1 + iVar4;\n  }\n  else {\nLAB_0002ed44:\n    if (param_3 < 1) goto LAB_0002edb8;\n    puVar8 = param_2 + param_3;\n    pbVar9 = pbVar1;\n    do {\n      uVar3 = *param_2;\n      if (uVar3 - 0xd800 < 0x800) {\n        bVar5 = 0x2e;\nLAB_0002ed98:\n        *pbVar9 = bVar5;\n        pbVar10 = pbVar9 + 1;\n      }\n      else {\n        bVar5 = (byte)uVar3;\n        if (uVar3 < 0x80) goto LAB_0002ed98;\n        bVar11 = bVar5 & 0x3f | 0x80;\n        bVar5 = (byte)((uVar3 << 0x12) >> 0x18);\n        if (uVar3 < 0x800) {\n          pbVar9[1] = bVar11;\n          *pbVar9 = bVar5 | 0xc0;\n          pbVar10 = pbVar9 + 2;\n        }\n        else {\n          bVar6 = bVar5 & 0x3f | 0x80;\n          bVar5 = (byte)((uVar3 << 0xc) >> 0x18);\n          if (uVar3 < 0x10000) {\n            pbVar9[1] = bVar6;\n            *pbVar9 = bVar5 | 0xe0;\n            pbVar10 = pbVar9 + 3;\n            pbVar9[2] = bVar11;\n          }\n          else {\n            pbVar9[2] = bVar6;\n            pbVar9[3] = bVar11;\n            *pbVar9 = (byte)(uVar3 >> 0x12) | 0xf0;\n            pbVar9[1] = bVar5 & 0x3f | 0x80;\n            pbVar10 = pbVar9 + 4;\n          }\n        }\n      }\n      param_2 = param_2 + 1;\n      pbVar9 = pbVar10;\n    } while (puVar8 != param_2);\n  }\n  if (pbVar1 < pbVar10) {\n    ldisc_send(param_1,pbVar1,(int)pbVar10 - (int)pbVar1,param_4);\n    safefree(pbVar1);\n    return;\n  }\nLAB_0002edb8:\n  safefree(pbVar1);\n  return;\n}" { (declaration "byte *pbVar1;" type_identifier (pointer_declarator "*pbVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "uint uVar3;" type_identifier identifier ;) (declaration "byte bVar5;" type_identifier identifier ;) (declaration "int iVar4;" primitive_type identifier ;) (declaration "byte bVar6;" type_identifier identifier ;) (declaration "int iVar7;" primitive_type identifier ;) (declaration "uint *puVar8;" type_identifier (pointer_declarator "*puVar8" * identifier) ;) (declaration "byte *pbVar9;" type_identifier (pointer_declarator "*pbVar9" * identifier) ;) (declaration "byte *pbVar10;" type_identifier (pointer_declarator "*pbVar10" * identifier) ;) (declaration "byte bVar11;" type_identifier identifier ;) (if_statement "if ((*(int *)(*param_1 + 0xdc) != 0) ||\n     (iVar4 = param_3, *(int *)(*(int *)(*param_1 + 0x1090) + 0xc) == 0x37)) {\n    iVar4 = param_3 * 3;\n  }" if (parenthesized_expression "((*(int *)(*param_1 + 0xdc) != 0) ||\n     (iVar4 = param_3, *(int *)(*(int *)(*param_1 + 0x1090) + 0xc) == 0x37))" ( (binary_expression "(*(int *)(*param_1 + 0xdc) != 0) ||\n     (iVar4 = param_3, *(int *)(*(int *)(*param_1 + 0x1090) + 0xc) == 0x37)" (parenthesized_expression "(*(int *)(*param_1 + 0xdc) != 0)" ( (binary_expression "*(int *)(*param_1 + 0xdc) != 0" (pointer_expression "*(int *)(*param_1 + 0xdc)" * (cast_expression "(int *)(*param_1 + 0xdc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + 0xdc)" ( (binary_expression "*param_1 + 0xdc" (pointer_expression "*param_1" * identifier) + number_literal) )))) != number_literal) )) || (parenthesized_expression "(iVar4 = param_3, *(int *)(*(int *)(*param_1 + 0x1090) + 0xc) == 0x37)" ( (comma_expression "iVar4 = param_3, *(int *)(*(int *)(*param_1 + 0x1090) + 0xc) == 0x37" (assignment_expression "iVar4 = param_3" identifier = identifier) , (binary_expression "*(int *)(*(int *)(*param_1 + 0x1090) + 0xc) == 0x37" (pointer_expression "*(int *)(*(int *)(*param_1 + 0x1090) + 0xc)" * (cast_expression "(int *)(*(int *)(*param_1 + 0x1090) + 0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*(int *)(*param_1 + 0x1090) + 0xc)" ( (binary_expression "*(int *)(*param_1 + 0x1090) + 0xc" (pointer_expression "*(int *)(*param_1 + 0x1090)" * (cast_expression "(int *)(*param_1 + 0x1090)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + 0x1090)" ( (binary_expression "*param_1 + 0x1090" (pointer_expression "*param_1" * identifier) + number_literal) )))) + number_literal) )))) == number_literal)) ))) )) (compound_statement "{\n    iVar4 = param_3 * 3;\n  }" { (expression_statement "iVar4 = param_3 * 3;" (assignment_expression "iVar4 = param_3 * 3" identifier = (binary_expression "param_3 * 3" identifier * number_literal)) ;) })) (expression_statement "pbVar1 = (byte *)safemalloc(iVar4 << 1,1);" (assignment_expression "pbVar1 = (byte *)safemalloc(iVar4 << 1,1)" identifier = (cast_expression "(byte *)safemalloc(iVar4 << 1,1)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "safemalloc(iVar4 << 1,1)" identifier (argument_list "(iVar4 << 1,1)" ( (binary_expression "iVar4 << 1" identifier << number_literal) , number_literal ))))) ;) (if_statement "if (*(int *)(*param_1 + 0xdc) == 0) {\n    iVar2 = *(int *)(*param_1 + 0x1090);\n    iVar7 = *(int *)(iVar2 + 0xc);\n    if (iVar7 == 0x37) goto LAB_0002ed44;\n    iVar4 = (*(code *)PTR_wc_to_mb_000a7370)(iVar7,0,param_2,param_3,pbVar1,iVar4 << 1,0,0,iVar2);\n    if (iVar4 < 0) goto LAB_0002edb8;\n    pbVar10 = pbVar1 + iVar4;\n  }\n  else {\nLAB_0002ed44:\n    if (param_3 < 1) goto LAB_0002edb8;\n    puVar8 = param_2 + param_3;\n    pbVar9 = pbVar1;\n    do {\n      uVar3 = *param_2;\n      if (uVar3 - 0xd800 < 0x800) {\n        bVar5 = 0x2e;\nLAB_0002ed98:\n        *pbVar9 = bVar5;\n        pbVar10 = pbVar9 + 1;\n      }\n      else {\n        bVar5 = (byte)uVar3;\n        if (uVar3 < 0x80) goto LAB_0002ed98;\n        bVar11 = bVar5 & 0x3f | 0x80;\n        bVar5 = (byte)((uVar3 << 0x12) >> 0x18);\n        if (uVar3 < 0x800) {\n          pbVar9[1] = bVar11;\n          *pbVar9 = bVar5 | 0xc0;\n          pbVar10 = pbVar9 + 2;\n        }\n        else {\n          bVar6 = bVar5 & 0x3f | 0x80;\n          bVar5 = (byte)((uVar3 << 0xc) >> 0x18);\n          if (uVar3 < 0x10000) {\n            pbVar9[1] = bVar6;\n            *pbVar9 = bVar5 | 0xe0;\n            pbVar10 = pbVar9 + 3;\n            pbVar9[2] = bVar11;\n          }\n          else {\n            pbVar9[2] = bVar6;\n            pbVar9[3] = bVar11;\n            *pbVar9 = (byte)(uVar3 >> 0x12) | 0xf0;\n            pbVar9[1] = bVar5 & 0x3f | 0x80;\n            pbVar10 = pbVar9 + 4;\n          }\n        }\n      }\n      param_2 = param_2 + 1;\n      pbVar9 = pbVar10;\n    } while (puVar8 != param_2);\n  }" if (parenthesized_expression "(*(int *)(*param_1 + 0xdc) == 0)" ( (binary_expression "*(int *)(*param_1 + 0xdc) == 0" (pointer_expression "*(int *)(*param_1 + 0xdc)" * (cast_expression "(int *)(*param_1 + 0xdc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + 0xdc)" ( (binary_expression "*param_1 + 0xdc" (pointer_expression "*param_1" * identifier) + number_literal) )))) == number_literal) )) (compound_statement "{\n    iVar2 = *(int *)(*param_1 + 0x1090);\n    iVar7 = *(int *)(iVar2 + 0xc);\n    if (iVar7 == 0x37) goto LAB_0002ed44;\n    iVar4 = (*(code *)PTR_wc_to_mb_000a7370)(iVar7,0,param_2,param_3,pbVar1,iVar4 << 1,0,0,iVar2);\n    if (iVar4 < 0) goto LAB_0002edb8;\n    pbVar10 = pbVar1 + iVar4;\n  }" { (expression_statement "iVar2 = *(int *)(*param_1 + 0x1090);" (assignment_expression "iVar2 = *(int *)(*param_1 + 0x1090)" identifier = (pointer_expression "*(int *)(*param_1 + 0x1090)" * (cast_expression "(int *)(*param_1 + 0x1090)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + 0x1090)" ( (binary_expression "*param_1 + 0x1090" (pointer_expression "*param_1" * identifier) + number_literal) ))))) ;) (expression_statement "iVar7 = *(int *)(iVar2 + 0xc);" (assignment_expression "iVar7 = *(int *)(iVar2 + 0xc)" identifier = (pointer_expression "*(int *)(iVar2 + 0xc)" * (cast_expression "(int *)(iVar2 + 0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + 0xc)" ( (binary_expression "iVar2 + 0xc" identifier + number_literal) ))))) ;) (if_statement "if (iVar7 == 0x37) goto LAB_0002ed44;" if (parenthesized_expression "(iVar7 == 0x37)" ( (binary_expression "iVar7 == 0x37" identifier == number_literal) )) (goto_statement "goto LAB_0002ed44;" goto statement_identifier ;)) (expression_statement "iVar4 = (*(code *)PTR_wc_to_mb_000a7370)(iVar7,0,param_2,param_3,pbVar1,iVar4 << 1,0,0,iVar2);" (assignment_expression "iVar4 = (*(code *)PTR_wc_to_mb_000a7370)(iVar7,0,param_2,param_3,pbVar1,iVar4 << 1,0,0,iVar2)" identifier = (call_expression "(*(code *)PTR_wc_to_mb_000a7370)(iVar7,0,param_2,param_3,pbVar1,iVar4 << 1,0,0,iVar2)" (parenthesized_expression "(*(code *)PTR_wc_to_mb_000a7370)" ( (pointer_expression "*(code *)PTR_wc_to_mb_000a7370" * (cast_expression "(code *)PTR_wc_to_mb_000a7370" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar7,0,param_2,param_3,pbVar1,iVar4 << 1,0,0,iVar2)" ( identifier , number_literal , identifier , identifier , identifier , (binary_expression "iVar4 << 1" identifier << number_literal) , number_literal , number_literal , identifier )))) ;) (if_statement "if (iVar4 < 0) goto LAB_0002edb8;" if (parenthesized_expression "(iVar4 < 0)" ( (binary_expression "iVar4 < 0" identifier < number_literal) )) (goto_statement "goto LAB_0002edb8;" goto statement_identifier ;)) (expression_statement "pbVar10 = pbVar1 + iVar4;" (assignment_expression "pbVar10 = pbVar1 + iVar4" identifier = (binary_expression "pbVar1 + iVar4" identifier + identifier)) ;) }) (else_clause "else {\nLAB_0002ed44:\n    if (param_3 < 1) goto LAB_0002edb8;\n    puVar8 = param_2 + param_3;\n    pbVar9 = pbVar1;\n    do {\n      uVar3 = *param_2;\n      if (uVar3 - 0xd800 < 0x800) {\n        bVar5 = 0x2e;\nLAB_0002ed98:\n        *pbVar9 = bVar5;\n        pbVar10 = pbVar9 + 1;\n      }\n      else {\n        bVar5 = (byte)uVar3;\n        if (uVar3 < 0x80) goto LAB_0002ed98;\n        bVar11 = bVar5 & 0x3f | 0x80;\n        bVar5 = (byte)((uVar3 << 0x12) >> 0x18);\n        if (uVar3 < 0x800) {\n          pbVar9[1] = bVar11;\n          *pbVar9 = bVar5 | 0xc0;\n          pbVar10 = pbVar9 + 2;\n        }\n        else {\n          bVar6 = bVar5 & 0x3f | 0x80;\n          bVar5 = (byte)((uVar3 << 0xc) >> 0x18);\n          if (uVar3 < 0x10000) {\n            pbVar9[1] = bVar6;\n            *pbVar9 = bVar5 | 0xe0;\n            pbVar10 = pbVar9 + 3;\n            pbVar9[2] = bVar11;\n          }\n          else {\n            pbVar9[2] = bVar6;\n            pbVar9[3] = bVar11;\n            *pbVar9 = (byte)(uVar3 >> 0x12) | 0xf0;\n            pbVar9[1] = bVar5 & 0x3f | 0x80;\n            pbVar10 = pbVar9 + 4;\n          }\n        }\n      }\n      param_2 = param_2 + 1;\n      pbVar9 = pbVar10;\n    } while (puVar8 != param_2);\n  }" else (compound_statement "{\nLAB_0002ed44:\n    if (param_3 < 1) goto LAB_0002edb8;\n    puVar8 = param_2 + param_3;\n    pbVar9 = pbVar1;\n    do {\n      uVar3 = *param_2;\n      if (uVar3 - 0xd800 < 0x800) {\n        bVar5 = 0x2e;\nLAB_0002ed98:\n        *pbVar9 = bVar5;\n        pbVar10 = pbVar9 + 1;\n      }\n      else {\n        bVar5 = (byte)uVar3;\n        if (uVar3 < 0x80) goto LAB_0002ed98;\n        bVar11 = bVar5 & 0x3f | 0x80;\n        bVar5 = (byte)((uVar3 << 0x12) >> 0x18);\n        if (uVar3 < 0x800) {\n          pbVar9[1] = bVar11;\n          *pbVar9 = bVar5 | 0xc0;\n          pbVar10 = pbVar9 + 2;\n        }\n        else {\n          bVar6 = bVar5 & 0x3f | 0x80;\n          bVar5 = (byte)((uVar3 << 0xc) >> 0x18);\n          if (uVar3 < 0x10000) {\n            pbVar9[1] = bVar6;\n            *pbVar9 = bVar5 | 0xe0;\n            pbVar10 = pbVar9 + 3;\n            pbVar9[2] = bVar11;\n          }\n          else {\n            pbVar9[2] = bVar6;\n            pbVar9[3] = bVar11;\n            *pbVar9 = (byte)(uVar3 >> 0x12) | 0xf0;\n            pbVar9[1] = bVar5 & 0x3f | 0x80;\n            pbVar10 = pbVar9 + 4;\n          }\n        }\n      }\n      param_2 = param_2 + 1;\n      pbVar9 = pbVar10;\n    } while (puVar8 != param_2);\n  }" { (labeled_statement "LAB_0002ed44:\n    if (param_3 < 1) goto LAB_0002edb8;" statement_identifier : (if_statement "if (param_3 < 1) goto LAB_0002edb8;" if (parenthesized_expression "(param_3 < 1)" ( (binary_expression "param_3 < 1" identifier < number_literal) )) (goto_statement "goto LAB_0002edb8;" goto statement_identifier ;))) (expression_statement "puVar8 = param_2 + param_3;" (assignment_expression "puVar8 = param_2 + param_3" identifier = (binary_expression "param_2 + param_3" identifier + identifier)) ;) (expression_statement "pbVar9 = pbVar1;" (assignment_expression "pbVar9 = pbVar1" identifier = identifier) ;) (do_statement "do {\n      uVar3 = *param_2;\n      if (uVar3 - 0xd800 < 0x800) {\n        bVar5 = 0x2e;\nLAB_0002ed98:\n        *pbVar9 = bVar5;\n        pbVar10 = pbVar9 + 1;\n      }\n      else {\n        bVar5 = (byte)uVar3;\n        if (uVar3 < 0x80) goto LAB_0002ed98;\n        bVar11 = bVar5 & 0x3f | 0x80;\n        bVar5 = (byte)((uVar3 << 0x12) >> 0x18);\n        if (uVar3 < 0x800) {\n          pbVar9[1] = bVar11;\n          *pbVar9 = bVar5 | 0xc0;\n          pbVar10 = pbVar9 + 2;\n        }\n        else {\n          bVar6 = bVar5 & 0x3f | 0x80;\n          bVar5 = (byte)((uVar3 << 0xc) >> 0x18);\n          if (uVar3 < 0x10000) {\n            pbVar9[1] = bVar6;\n            *pbVar9 = bVar5 | 0xe0;\n            pbVar10 = pbVar9 + 3;\n            pbVar9[2] = bVar11;\n          }\n          else {\n            pbVar9[2] = bVar6;\n            pbVar9[3] = bVar11;\n            *pbVar9 = (byte)(uVar3 >> 0x12) | 0xf0;\n            pbVar9[1] = bVar5 & 0x3f | 0x80;\n            pbVar10 = pbVar9 + 4;\n          }\n        }\n      }\n      param_2 = param_2 + 1;\n      pbVar9 = pbVar10;\n    } while (puVar8 != param_2);" do (compound_statement "{\n      uVar3 = *param_2;\n      if (uVar3 - 0xd800 < 0x800) {\n        bVar5 = 0x2e;\nLAB_0002ed98:\n        *pbVar9 = bVar5;\n        pbVar10 = pbVar9 + 1;\n      }\n      else {\n        bVar5 = (byte)uVar3;\n        if (uVar3 < 0x80) goto LAB_0002ed98;\n        bVar11 = bVar5 & 0x3f | 0x80;\n        bVar5 = (byte)((uVar3 << 0x12) >> 0x18);\n        if (uVar3 < 0x800) {\n          pbVar9[1] = bVar11;\n          *pbVar9 = bVar5 | 0xc0;\n          pbVar10 = pbVar9 + 2;\n        }\n        else {\n          bVar6 = bVar5 & 0x3f | 0x80;\n          bVar5 = (byte)((uVar3 << 0xc) >> 0x18);\n          if (uVar3 < 0x10000) {\n            pbVar9[1] = bVar6;\n            *pbVar9 = bVar5 | 0xe0;\n            pbVar10 = pbVar9 + 3;\n            pbVar9[2] = bVar11;\n          }\n          else {\n            pbVar9[2] = bVar6;\n            pbVar9[3] = bVar11;\n            *pbVar9 = (byte)(uVar3 >> 0x12) | 0xf0;\n            pbVar9[1] = bVar5 & 0x3f | 0x80;\n            pbVar10 = pbVar9 + 4;\n          }\n        }\n      }\n      param_2 = param_2 + 1;\n      pbVar9 = pbVar10;\n    }" { (expression_statement "uVar3 = *param_2;" (assignment_expression "uVar3 = *param_2" identifier = (pointer_expression "*param_2" * identifier)) ;) (if_statement "if (uVar3 - 0xd800 < 0x800) {\n        bVar5 = 0x2e;\nLAB_0002ed98:\n        *pbVar9 = bVar5;\n        pbVar10 = pbVar9 + 1;\n      }\n      else {\n        bVar5 = (byte)uVar3;\n        if (uVar3 < 0x80) goto LAB_0002ed98;\n        bVar11 = bVar5 & 0x3f | 0x80;\n        bVar5 = (byte)((uVar3 << 0x12) >> 0x18);\n        if (uVar3 < 0x800) {\n          pbVar9[1] = bVar11;\n          *pbVar9 = bVar5 | 0xc0;\n          pbVar10 = pbVar9 + 2;\n        }\n        else {\n          bVar6 = bVar5 & 0x3f | 0x80;\n          bVar5 = (byte)((uVar3 << 0xc) >> 0x18);\n          if (uVar3 < 0x10000) {\n            pbVar9[1] = bVar6;\n            *pbVar9 = bVar5 | 0xe0;\n            pbVar10 = pbVar9 + 3;\n            pbVar9[2] = bVar11;\n          }\n          else {\n            pbVar9[2] = bVar6;\n            pbVar9[3] = bVar11;\n            *pbVar9 = (byte)(uVar3 >> 0x12) | 0xf0;\n            pbVar9[1] = bVar5 & 0x3f | 0x80;\n            pbVar10 = pbVar9 + 4;\n          }\n        }\n      }" if (parenthesized_expression "(uVar3 - 0xd800 < 0x800)" ( (binary_expression "uVar3 - 0xd800 < 0x800" (binary_expression "uVar3 - 0xd800" identifier - number_literal) < number_literal) )) (compound_statement "{\n        bVar5 = 0x2e;\nLAB_0002ed98:\n        *pbVar9 = bVar5;\n        pbVar10 = pbVar9 + 1;\n      }" { (expression_statement "bVar5 = 0x2e;" (assignment_expression "bVar5 = 0x2e" identifier = number_literal) ;) (labeled_statement "LAB_0002ed98:\n        *pbVar9 = bVar5;" statement_identifier : (expression_statement "*pbVar9 = bVar5;" (assignment_expression "*pbVar9 = bVar5" (pointer_expression "*pbVar9" * identifier) = identifier) ;)) (expression_statement "pbVar10 = pbVar9 + 1;" (assignment_expression "pbVar10 = pbVar9 + 1" identifier = (binary_expression "pbVar9 + 1" identifier + number_literal)) ;) }) (else_clause "else {\n        bVar5 = (byte)uVar3;\n        if (uVar3 < 0x80) goto LAB_0002ed98;\n        bVar11 = bVar5 & 0x3f | 0x80;\n        bVar5 = (byte)((uVar3 << 0x12) >> 0x18);\n        if (uVar3 < 0x800) {\n          pbVar9[1] = bVar11;\n          *pbVar9 = bVar5 | 0xc0;\n          pbVar10 = pbVar9 + 2;\n        }\n        else {\n          bVar6 = bVar5 & 0x3f | 0x80;\n          bVar5 = (byte)((uVar3 << 0xc) >> 0x18);\n          if (uVar3 < 0x10000) {\n            pbVar9[1] = bVar6;\n            *pbVar9 = bVar5 | 0xe0;\n            pbVar10 = pbVar9 + 3;\n            pbVar9[2] = bVar11;\n          }\n          else {\n            pbVar9[2] = bVar6;\n            pbVar9[3] = bVar11;\n            *pbVar9 = (byte)(uVar3 >> 0x12) | 0xf0;\n            pbVar9[1] = bVar5 & 0x3f | 0x80;\n            pbVar10 = pbVar9 + 4;\n          }\n        }\n      }" else (compound_statement "{\n        bVar5 = (byte)uVar3;\n        if (uVar3 < 0x80) goto LAB_0002ed98;\n        bVar11 = bVar5 & 0x3f | 0x80;\n        bVar5 = (byte)((uVar3 << 0x12) >> 0x18);\n        if (uVar3 < 0x800) {\n          pbVar9[1] = bVar11;\n          *pbVar9 = bVar5 | 0xc0;\n          pbVar10 = pbVar9 + 2;\n        }\n        else {\n          bVar6 = bVar5 & 0x3f | 0x80;\n          bVar5 = (byte)((uVar3 << 0xc) >> 0x18);\n          if (uVar3 < 0x10000) {\n            pbVar9[1] = bVar6;\n            *pbVar9 = bVar5 | 0xe0;\n            pbVar10 = pbVar9 + 3;\n            pbVar9[2] = bVar11;\n          }\n          else {\n            pbVar9[2] = bVar6;\n            pbVar9[3] = bVar11;\n            *pbVar9 = (byte)(uVar3 >> 0x12) | 0xf0;\n            pbVar9[1] = bVar5 & 0x3f | 0x80;\n            pbVar10 = pbVar9 + 4;\n          }\n        }\n      }" { (expression_statement "bVar5 = (byte)uVar3;" (assignment_expression "bVar5 = (byte)uVar3" identifier = (cast_expression "(byte)uVar3" ( (type_descriptor "byte" type_identifier) ) identifier)) ;) (if_statement "if (uVar3 < 0x80) goto LAB_0002ed98;" if (parenthesized_expression "(uVar3 < 0x80)" ( (binary_expression "uVar3 < 0x80" identifier < number_literal) )) (goto_statement "goto LAB_0002ed98;" goto statement_identifier ;)) (expression_statement "bVar11 = bVar5 & 0x3f | 0x80;" (assignment_expression "bVar11 = bVar5 & 0x3f | 0x80" identifier = (binary_expression "bVar5 & 0x3f | 0x80" (binary_expression "bVar5 & 0x3f" identifier & number_literal) | number_literal)) ;) (expression_statement "bVar5 = (byte)((uVar3 << 0x12) >> 0x18);" (assignment_expression "bVar5 = (byte)((uVar3 << 0x12) >> 0x18)" identifier = (call_expression "(byte)((uVar3 << 0x12) >> 0x18)" (parenthesized_expression "(byte)" ( identifier )) (argument_list "((uVar3 << 0x12) >> 0x18)" ( (binary_expression "(uVar3 << 0x12) >> 0x18" (parenthesized_expression "(uVar3 << 0x12)" ( (binary_expression "uVar3 << 0x12" identifier << number_literal) )) >> number_literal) )))) ;) (if_statement "if (uVar3 < 0x800) {\n          pbVar9[1] = bVar11;\n          *pbVar9 = bVar5 | 0xc0;\n          pbVar10 = pbVar9 + 2;\n        }\n        else {\n          bVar6 = bVar5 & 0x3f | 0x80;\n          bVar5 = (byte)((uVar3 << 0xc) >> 0x18);\n          if (uVar3 < 0x10000) {\n            pbVar9[1] = bVar6;\n            *pbVar9 = bVar5 | 0xe0;\n            pbVar10 = pbVar9 + 3;\n            pbVar9[2] = bVar11;\n          }\n          else {\n            pbVar9[2] = bVar6;\n            pbVar9[3] = bVar11;\n            *pbVar9 = (byte)(uVar3 >> 0x12) | 0xf0;\n            pbVar9[1] = bVar5 & 0x3f | 0x80;\n            pbVar10 = pbVar9 + 4;\n          }\n        }" if (parenthesized_expression "(uVar3 < 0x800)" ( (binary_expression "uVar3 < 0x800" identifier < number_literal) )) (compound_statement "{\n          pbVar9[1] = bVar11;\n          *pbVar9 = bVar5 | 0xc0;\n          pbVar10 = pbVar9 + 2;\n        }" { (expression_statement "pbVar9[1] = bVar11;" (assignment_expression "pbVar9[1] = bVar11" (subscript_expression "pbVar9[1]" identifier [ number_literal ]) = identifier) ;) (expression_statement "*pbVar9 = bVar5 | 0xc0;" (assignment_expression "*pbVar9 = bVar5 | 0xc0" (pointer_expression "*pbVar9" * identifier) = (binary_expression "bVar5 | 0xc0" identifier | number_literal)) ;) (expression_statement "pbVar10 = pbVar9 + 2;" (assignment_expression "pbVar10 = pbVar9 + 2" identifier = (binary_expression "pbVar9 + 2" identifier + number_literal)) ;) }) (else_clause "else {\n          bVar6 = bVar5 & 0x3f | 0x80;\n          bVar5 = (byte)((uVar3 << 0xc) >> 0x18);\n          if (uVar3 < 0x10000) {\n            pbVar9[1] = bVar6;\n            *pbVar9 = bVar5 | 0xe0;\n            pbVar10 = pbVar9 + 3;\n            pbVar9[2] = bVar11;\n          }\n          else {\n            pbVar9[2] = bVar6;\n            pbVar9[3] = bVar11;\n            *pbVar9 = (byte)(uVar3 >> 0x12) | 0xf0;\n            pbVar9[1] = bVar5 & 0x3f | 0x80;\n            pbVar10 = pbVar9 + 4;\n          }\n        }" else (compound_statement "{\n          bVar6 = bVar5 & 0x3f | 0x80;\n          bVar5 = (byte)((uVar3 << 0xc) >> 0x18);\n          if (uVar3 < 0x10000) {\n            pbVar9[1] = bVar6;\n            *pbVar9 = bVar5 | 0xe0;\n            pbVar10 = pbVar9 + 3;\n            pbVar9[2] = bVar11;\n          }\n          else {\n            pbVar9[2] = bVar6;\n            pbVar9[3] = bVar11;\n            *pbVar9 = (byte)(uVar3 >> 0x12) | 0xf0;\n            pbVar9[1] = bVar5 & 0x3f | 0x80;\n            pbVar10 = pbVar9 + 4;\n          }\n        }" { (expression_statement "bVar6 = bVar5 & 0x3f | 0x80;" (assignment_expression "bVar6 = bVar5 & 0x3f | 0x80" identifier = (binary_expression "bVar5 & 0x3f | 0x80" (binary_expression "bVar5 & 0x3f" identifier & number_literal) | number_literal)) ;) (expression_statement "bVar5 = (byte)((uVar3 << 0xc) >> 0x18);" (assignment_expression "bVar5 = (byte)((uVar3 << 0xc) >> 0x18)" identifier = (call_expression "(byte)((uVar3 << 0xc) >> 0x18)" (parenthesized_expression "(byte)" ( identifier )) (argument_list "((uVar3 << 0xc) >> 0x18)" ( (binary_expression "(uVar3 << 0xc) >> 0x18" (parenthesized_expression "(uVar3 << 0xc)" ( (binary_expression "uVar3 << 0xc" identifier << number_literal) )) >> number_literal) )))) ;) (if_statement "if (uVar3 < 0x10000) {\n            pbVar9[1] = bVar6;\n            *pbVar9 = bVar5 | 0xe0;\n            pbVar10 = pbVar9 + 3;\n            pbVar9[2] = bVar11;\n          }\n          else {\n            pbVar9[2] = bVar6;\n            pbVar9[3] = bVar11;\n            *pbVar9 = (byte)(uVar3 >> 0x12) | 0xf0;\n            pbVar9[1] = bVar5 & 0x3f | 0x80;\n            pbVar10 = pbVar9 + 4;\n          }" if (parenthesized_expression "(uVar3 < 0x10000)" ( (binary_expression "uVar3 < 0x10000" identifier < number_literal) )) (compound_statement "{\n            pbVar9[1] = bVar6;\n            *pbVar9 = bVar5 | 0xe0;\n            pbVar10 = pbVar9 + 3;\n            pbVar9[2] = bVar11;\n          }" { (expression_statement "pbVar9[1] = bVar6;" (assignment_expression "pbVar9[1] = bVar6" (subscript_expression "pbVar9[1]" identifier [ number_literal ]) = identifier) ;) (expression_statement "*pbVar9 = bVar5 | 0xe0;" (assignment_expression "*pbVar9 = bVar5 | 0xe0" (pointer_expression "*pbVar9" * identifier) = (binary_expression "bVar5 | 0xe0" identifier | number_literal)) ;) (expression_statement "pbVar10 = pbVar9 + 3;" (assignment_expression "pbVar10 = pbVar9 + 3" identifier = (binary_expression "pbVar9 + 3" identifier + number_literal)) ;) (expression_statement "pbVar9[2] = bVar11;" (assignment_expression "pbVar9[2] = bVar11" (subscript_expression "pbVar9[2]" identifier [ number_literal ]) = identifier) ;) }) (else_clause "else {\n            pbVar9[2] = bVar6;\n            pbVar9[3] = bVar11;\n            *pbVar9 = (byte)(uVar3 >> 0x12) | 0xf0;\n            pbVar9[1] = bVar5 & 0x3f | 0x80;\n            pbVar10 = pbVar9 + 4;\n          }" else (compound_statement "{\n            pbVar9[2] = bVar6;\n            pbVar9[3] = bVar11;\n            *pbVar9 = (byte)(uVar3 >> 0x12) | 0xf0;\n            pbVar9[1] = bVar5 & 0x3f | 0x80;\n            pbVar10 = pbVar9 + 4;\n          }" { (expression_statement "pbVar9[2] = bVar6;" (assignment_expression "pbVar9[2] = bVar6" (subscript_expression "pbVar9[2]" identifier [ number_literal ]) = identifier) ;) (expression_statement "pbVar9[3] = bVar11;" (assignment_expression "pbVar9[3] = bVar11" (subscript_expression "pbVar9[3]" identifier [ number_literal ]) = identifier) ;) (expression_statement "*pbVar9 = (byte)(uVar3 >> 0x12) | 0xf0;" (assignment_expression "*pbVar9 = (byte)(uVar3 >> 0x12) | 0xf0" (pointer_expression "*pbVar9" * identifier) = (binary_expression "(byte)(uVar3 >> 0x12) | 0xf0" (call_expression "(byte)(uVar3 >> 0x12)" (parenthesized_expression "(byte)" ( identifier )) (argument_list "(uVar3 >> 0x12)" ( (binary_expression "uVar3 >> 0x12" identifier >> number_literal) ))) | number_literal)) ;) (expression_statement "pbVar9[1] = bVar5 & 0x3f | 0x80;" (assignment_expression "pbVar9[1] = bVar5 & 0x3f | 0x80" (subscript_expression "pbVar9[1]" identifier [ number_literal ]) = (binary_expression "bVar5 & 0x3f | 0x80" (binary_expression "bVar5 & 0x3f" identifier & number_literal) | number_literal)) ;) (expression_statement "pbVar10 = pbVar9 + 4;" (assignment_expression "pbVar10 = pbVar9 + 4" identifier = (binary_expression "pbVar9 + 4" 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)) ;) (expression_statement "pbVar9 = pbVar10;" (assignment_expression "pbVar9 = pbVar10" identifier = identifier) ;) }) while (parenthesized_expression "(puVar8 != param_2)" ( (binary_expression "puVar8 != param_2" identifier != identifier) )) ;) }))) (if_statement "if (pbVar1 < pbVar10) {\n    ldisc_send(param_1,pbVar1,(int)pbVar10 - (int)pbVar1,param_4);\n    safefree(pbVar1);\n    return;\n  }" if (parenthesized_expression "(pbVar1 < pbVar10)" ( (binary_expression "pbVar1 < pbVar10" identifier < identifier) )) (compound_statement "{\n    ldisc_send(param_1,pbVar1,(int)pbVar10 - (int)pbVar1,param_4);\n    safefree(pbVar1);\n    return;\n  }" { (expression_statement "ldisc_send(param_1,pbVar1,(int)pbVar10 - (int)pbVar1,param_4);" (call_expression "ldisc_send(param_1,pbVar1,(int)pbVar10 - (int)pbVar1,param_4)" identifier (argument_list "(param_1,pbVar1,(int)pbVar10 - (int)pbVar1,param_4)" ( identifier , identifier , (binary_expression "(int)pbVar10 - (int)pbVar1" (cast_expression "(int)pbVar10" ( (type_descriptor "int" primitive_type) ) identifier) - (cast_expression "(int)pbVar1" ( (type_descriptor "int" primitive_type) ) identifier)) , identifier ))) ;) (expression_statement "safefree(pbVar1);" (call_expression "safefree(pbVar1)" identifier (argument_list "(pbVar1)" ( identifier ))) ;) (return_statement "return;" return ;) })) (labeled_statement "LAB_0002edb8:\n  safefree(pbVar1);" statement_identifier : (expression_statement "safefree(pbVar1);" (call_expression "safefree(pbVar1)" identifier (argument_list "(pbVar1)" ( identifier ))) ;)) (return_statement "return;" return ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) + LIT) )))) != LIT) )) || (parenthesized_expression ( (comma_expression (assignment_expression IDENT = IDENT) , (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) + LIT) )))) + LIT) )))) == LIT)) ))) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT * LIT)) ;) })) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( (binary_expression IDENT << LIT) , LIT ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) + LIT) )))) == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) + LIT) ))))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (goto_statement goto statement_identifier ;)) (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( IDENT , LIT , IDENT , IDENT , IDENT , (binary_expression IDENT << LIT) , LIT , LIT , IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (goto_statement goto statement_identifier ;)) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + IDENT)) ;) }) (else_clause else (compound_statement { (labeled_statement statement_identifier : (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (goto_statement goto statement_identifier ;))) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + IDENT)) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression (binary_expression IDENT - LIT) < LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) (labeled_statement statement_identifier : (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;)) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE) ) IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (goto_statement goto statement_identifier ;)) (expression_statement (assignment_expression IDENT = (binary_expression (binary_expression IDENT & LIT) | LIT)) ;) (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( IDENT )) (argument_list ( (binary_expression (parenthesized_expression ( (binary_expression IDENT << LIT) )) >> LIT) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = (binary_expression IDENT | LIT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression (binary_expression IDENT & LIT) | LIT)) ;) (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( IDENT )) (argument_list ( (binary_expression (parenthesized_expression ( (binary_expression IDENT << LIT) )) >> LIT) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = (binary_expression IDENT | LIT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = (binary_expression (call_expression (parenthesized_expression ( IDENT )) (argument_list ( (binary_expression IDENT >> LIT) ))) | LIT)) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (binary_expression (binary_expression IDENT & LIT) | LIT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) }))) }))) }))) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) }) while (parenthesized_expression ( (binary_expression IDENT != IDENT) )) ;) }))) (if_statement if (parenthesized_expression ( (binary_expression IDENT < IDENT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) - (cast_expression ( (type_descriptor TYPE) ) IDENT)) , IDENT ))) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (return_statement return ;) })) (labeled_statement statement_identifier : (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;)) (return_statement return ;) })))
(function_definition "void luni_send(int *param_1,uint *param_2,int param_3,undefined4 param_4)\n\n{\n  byte *pbVar1;\n  int iVar2;\n  uint uVar3;\n  byte bVar5;\n  int iVar4;\n  byte bVar6;\n  int iVar7;\n  uint *puVar8;\n  byte *pbVar9;\n  byte *pbVar10;\n  byte bVar11;\n  \n  if ((*(int *)(*param_1 + 0xdc) != 0) ||\n     (iVar4 = param_3, *(int *)(*(int *)(*param_1 + 0x1090) + 0xc) == 0x37)) {\n    iVar4 = param_3 * 3;\n  }\n  pbVar1 = (byte *)safemalloc(iVar4 << 1,1);\n  if (*(int *)(*param_1 + 0xdc) == 0) {\n    iVar2 = *(int *)(*param_1 + 0x1090);\n    iVar7 = *(int *)(iVar2 + 0xc);\n    if (iVar7 == 0x37) goto LAB_0002ed44;\n    iVar4 = (*(code *)PTR_wc_to_mb_000a7370)(iVar7,0,param_2,param_3,pbVar1,iVar4 << 1,0,0,iVar2);\n    if (iVar4 < 0) goto LAB_0002edb8;\n    pbVar10 = pbVar1 + iVar4;\n  }\n  else {\nLAB_0002ed44:\n    if (param_3 < 1) goto LAB_0002edb8;\n    puVar8 = param_2 + param_3;\n    pbVar9 = pbVar1;\n    do {\n      uVar3 = *param_2;\n      if (uVar3 - 0xd800 < 0x800) {\n        bVar5 = 0x2e;\nLAB_0002ed98:\n        *pbVar9 = bVar5;\n        pbVar10 = pbVar9 + 1;\n      }\n      else {\n        bVar5 = (byte)uVar3;\n        if (uVar3 < 0x80) goto LAB_0002ed98;\n        bVar11 = bVar5 & 0x3f | 0x80;\n        bVar5 = (byte)((uVar3 << 0x12) >> 0x18);\n        if (uVar3 < 0x800) {\n          pbVar9[1] = bVar11;\n          *pbVar9 = bVar5 | 0xc0;\n          pbVar10 = pbVar9 + 2;\n        }\n        else {\n          bVar6 = bVar5 & 0x3f | 0x80;\n          bVar5 = (byte)((uVar3 << 0xc) >> 0x18);\n          if (uVar3 < 0x10000) {\n            pbVar9[1] = bVar6;\n            *pbVar9 = bVar5 | 0xe0;\n            pbVar10 = pbVar9 + 3;\n            pbVar9[2] = bVar11;\n          }\n          else {\n            pbVar9[2] = bVar6;\n            pbVar9[3] = bVar11;\n            *pbVar9 = (byte)(uVar3 >> 0x12) | 0xf0;\n            pbVar9[1] = bVar5 & 0x3f | 0x80;\n            pbVar10 = pbVar9 + 4;\n          }\n        }\n      }\n      param_2 = param_2 + 1;\n      pbVar9 = pbVar10;\n    } while (puVar8 != param_2);\n  }\n  if (pbVar1 < pbVar10) {\n    ldisc_send(param_1,pbVar1,(int)pbVar10 - (int)pbVar1,param_4);\n    safefree(pbVar1);\n    return;\n  }\nLAB_0002edb8:\n  safefree(pbVar1);\n  return;\n}" (primitive_type "void") (function_declarator "luni_send(int *param_1,uint *param_2,int param_3,undefined4 param_4)" (identifier "luni_send") (parameter_list "(int *param_1,uint *param_2,int param_3,undefined4 param_4)" (( "(") (parameter_declaration "int *param_1" (primitive_type "int") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "uint *param_2" (type_identifier "uint") (pointer_declarator "*param_2" (* "*") (identifier "param_2"))) (, ",") (parameter_declaration "int param_3" (primitive_type "int") (identifier "param_3")) (, ",") (parameter_declaration "undefined4 param_4" (type_identifier "undefined4") (identifier "param_4")) () ")"))) (compound_statement "{\n  byte *pbVar1;\n  int iVar2;\n  uint uVar3;\n  byte bVar5;\n  int iVar4;\n  byte bVar6;\n  int iVar7;\n  uint *puVar8;\n  byte *pbVar9;\n  byte *pbVar10;\n  byte bVar11;\n  \n  if ((*(int *)(*param_1 + 0xdc) != 0) ||\n     (iVar4 = param_3, *(int *)(*(int *)(*param_1 + 0x1090) + 0xc) == 0x37)) {\n    iVar4 = param_3 * 3;\n  }\n  pbVar1 = (byte *)safemalloc(iVar4 << 1,1);\n  if (*(int *)(*param_1 + 0xdc) == 0) {\n    iVar2 = *(int *)(*param_1 + 0x1090);\n    iVar7 = *(int *)(iVar2 + 0xc);\n    if (iVar7 == 0x37) goto LAB_0002ed44;\n    iVar4 = (*(code *)PTR_wc_to_mb_000a7370)(iVar7,0,param_2,param_3,pbVar1,iVar4 << 1,0,0,iVar2);\n    if (iVar4 < 0) goto LAB_0002edb8;\n    pbVar10 = pbVar1 + iVar4;\n  }\n  else {\nLAB_0002ed44:\n    if (param_3 < 1) goto LAB_0002edb8;\n    puVar8 = param_2 + param_3;\n    pbVar9 = pbVar1;\n    do {\n      uVar3 = *param_2;\n      if (uVar3 - 0xd800 < 0x800) {\n        bVar5 = 0x2e;\nLAB_0002ed98:\n        *pbVar9 = bVar5;\n        pbVar10 = pbVar9 + 1;\n      }\n      else {\n        bVar5 = (byte)uVar3;\n        if (uVar3 < 0x80) goto LAB_0002ed98;\n        bVar11 = bVar5 & 0x3f | 0x80;\n        bVar5 = (byte)((uVar3 << 0x12) >> 0x18);\n        if (uVar3 < 0x800) {\n          pbVar9[1] = bVar11;\n          *pbVar9 = bVar5 | 0xc0;\n          pbVar10 = pbVar9 + 2;\n        }\n        else {\n          bVar6 = bVar5 & 0x3f | 0x80;\n          bVar5 = (byte)((uVar3 << 0xc) >> 0x18);\n          if (uVar3 < 0x10000) {\n            pbVar9[1] = bVar6;\n            *pbVar9 = bVar5 | 0xe0;\n            pbVar10 = pbVar9 + 3;\n            pbVar9[2] = bVar11;\n          }\n          else {\n            pbVar9[2] = bVar6;\n            pbVar9[3] = bVar11;\n            *pbVar9 = (byte)(uVar3 >> 0x12) | 0xf0;\n            pbVar9[1] = bVar5 & 0x3f | 0x80;\n            pbVar10 = pbVar9 + 4;\n          }\n        }\n      }\n      param_2 = param_2 + 1;\n      pbVar9 = pbVar10;\n    } while (puVar8 != param_2);\n  }\n  if (pbVar1 < pbVar10) {\n    ldisc_send(param_1,pbVar1,(int)pbVar10 - (int)pbVar1,param_4);\n    safefree(pbVar1);\n    return;\n  }\nLAB_0002edb8:\n  safefree(pbVar1);\n  return;\n}" ({ "{") (declaration "byte *pbVar1;" (type_identifier "byte") (pointer_declarator "*pbVar1" (* "*") (identifier "pbVar1")) (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "uint uVar3;" (type_identifier "uint") (identifier "uVar3") (; ";")) (declaration "byte bVar5;" (type_identifier "byte") (identifier "bVar5") (; ";")) (declaration "int iVar4;" (primitive_type "int") (identifier "iVar4") (; ";")) (declaration "byte bVar6;" (type_identifier "byte") (identifier "bVar6") (; ";")) (declaration "int iVar7;" (primitive_type "int") (identifier "iVar7") (; ";")) (declaration "uint *puVar8;" (type_identifier "uint") (pointer_declarator "*puVar8" (* "*") (identifier "puVar8")) (; ";")) (declaration "byte *pbVar9;" (type_identifier "byte") (pointer_declarator "*pbVar9" (* "*") (identifier "pbVar9")) (; ";")) (declaration "byte *pbVar10;" (type_identifier "byte") (pointer_declarator "*pbVar10" (* "*") (identifier "pbVar10")) (; ";")) (declaration "byte bVar11;" (type_identifier "byte") (identifier "bVar11") (; ";")) (if_statement "if ((*(int *)(*param_1 + 0xdc) != 0) ||\n     (iVar4 = param_3, *(int *)(*(int *)(*param_1 + 0x1090) + 0xc) == 0x37)) {\n    iVar4 = param_3 * 3;\n  }" (if "if") (parenthesized_expression "((*(int *)(*param_1 + 0xdc) != 0) ||\n     (iVar4 = param_3, *(int *)(*(int *)(*param_1 + 0x1090) + 0xc) == 0x37))" (( "(") (binary_expression "(*(int *)(*param_1 + 0xdc) != 0) ||\n     (iVar4 = param_3, *(int *)(*(int *)(*param_1 + 0x1090) + 0xc) == 0x37)" (parenthesized_expression "(*(int *)(*param_1 + 0xdc) != 0)" (( "(") (binary_expression "*(int *)(*param_1 + 0xdc) != 0" (pointer_expression "*(int *)(*param_1 + 0xdc)" (* "*") (cast_expression "(int *)(*param_1 + 0xdc)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(*param_1 + 0xdc)" (( "(") (binary_expression "*param_1 + 0xdc" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (+ "+") (number_literal "0xdc")) () ")")))) (!= "!=") (number_literal "0")) () ")")) (|| "||") (parenthesized_expression "(iVar4 = param_3, *(int *)(*(int *)(*param_1 + 0x1090) + 0xc) == 0x37)" (( "(") (comma_expression "iVar4 = param_3, *(int *)(*(int *)(*param_1 + 0x1090) + 0xc) == 0x37" (assignment_expression "iVar4 = param_3" (identifier "iVar4") (= "=") (identifier "param_3")) (, ",") (binary_expression "*(int *)(*(int *)(*param_1 + 0x1090) + 0xc) == 0x37" (pointer_expression "*(int *)(*(int *)(*param_1 + 0x1090) + 0xc)" (* "*") (cast_expression "(int *)(*(int *)(*param_1 + 0x1090) + 0xc)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(*(int *)(*param_1 + 0x1090) + 0xc)" (( "(") (binary_expression "*(int *)(*param_1 + 0x1090) + 0xc" (pointer_expression "*(int *)(*param_1 + 0x1090)" (* "*") (cast_expression "(int *)(*param_1 + 0x1090)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(*param_1 + 0x1090)" (( "(") (binary_expression "*param_1 + 0x1090" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (+ "+") (number_literal "0x1090")) () ")")))) (+ "+") (number_literal "0xc")) () ")")))) (== "==") (number_literal "0x37"))) () ")"))) () ")")) (compound_statement "{\n    iVar4 = param_3 * 3;\n  }" ({ "{") (expression_statement "iVar4 = param_3 * 3;" (assignment_expression "iVar4 = param_3 * 3" (identifier "iVar4") (= "=") (binary_expression "param_3 * 3" (identifier "param_3") (* "*") (number_literal "3"))) (; ";")) (} "}"))) (expression_statement "pbVar1 = (byte *)safemalloc(iVar4 << 1,1);" (assignment_expression "pbVar1 = (byte *)safemalloc(iVar4 << 1,1)" (identifier "pbVar1") (= "=") (cast_expression "(byte *)safemalloc(iVar4 << 1,1)" (( "(") (type_descriptor "byte *" (type_identifier "byte") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "safemalloc(iVar4 << 1,1)" (identifier "safemalloc") (argument_list "(iVar4 << 1,1)" (( "(") (binary_expression "iVar4 << 1" (identifier "iVar4") (<< "<<") (number_literal "1")) (, ",") (number_literal "1") () ")"))))) (; ";")) (if_statement "if (*(int *)(*param_1 + 0xdc) == 0) {\n    iVar2 = *(int *)(*param_1 + 0x1090);\n    iVar7 = *(int *)(iVar2 + 0xc);\n    if (iVar7 == 0x37) goto LAB_0002ed44;\n    iVar4 = (*(code *)PTR_wc_to_mb_000a7370)(iVar7,0,param_2,param_3,pbVar1,iVar4 << 1,0,0,iVar2);\n    if (iVar4 < 0) goto LAB_0002edb8;\n    pbVar10 = pbVar1 + iVar4;\n  }\n  else {\nLAB_0002ed44:\n    if (param_3 < 1) goto LAB_0002edb8;\n    puVar8 = param_2 + param_3;\n    pbVar9 = pbVar1;\n    do {\n      uVar3 = *param_2;\n      if (uVar3 - 0xd800 < 0x800) {\n        bVar5 = 0x2e;\nLAB_0002ed98:\n        *pbVar9 = bVar5;\n        pbVar10 = pbVar9 + 1;\n      }\n      else {\n        bVar5 = (byte)uVar3;\n        if (uVar3 < 0x80) goto LAB_0002ed98;\n        bVar11 = bVar5 & 0x3f | 0x80;\n        bVar5 = (byte)((uVar3 << 0x12) >> 0x18);\n        if (uVar3 < 0x800) {\n          pbVar9[1] = bVar11;\n          *pbVar9 = bVar5 | 0xc0;\n          pbVar10 = pbVar9 + 2;\n        }\n        else {\n          bVar6 = bVar5 & 0x3f | 0x80;\n          bVar5 = (byte)((uVar3 << 0xc) >> 0x18);\n          if (uVar3 < 0x10000) {\n            pbVar9[1] = bVar6;\n            *pbVar9 = bVar5 | 0xe0;\n            pbVar10 = pbVar9 + 3;\n            pbVar9[2] = bVar11;\n          }\n          else {\n            pbVar9[2] = bVar6;\n            pbVar9[3] = bVar11;\n            *pbVar9 = (byte)(uVar3 >> 0x12) | 0xf0;\n            pbVar9[1] = bVar5 & 0x3f | 0x80;\n            pbVar10 = pbVar9 + 4;\n          }\n        }\n      }\n      param_2 = param_2 + 1;\n      pbVar9 = pbVar10;\n    } while (puVar8 != param_2);\n  }" (if "if") (parenthesized_expression "(*(int *)(*param_1 + 0xdc) == 0)" (( "(") (binary_expression "*(int *)(*param_1 + 0xdc) == 0" (pointer_expression "*(int *)(*param_1 + 0xdc)" (* "*") (cast_expression "(int *)(*param_1 + 0xdc)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(*param_1 + 0xdc)" (( "(") (binary_expression "*param_1 + 0xdc" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (+ "+") (number_literal "0xdc")) () ")")))) (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    iVar2 = *(int *)(*param_1 + 0x1090);\n    iVar7 = *(int *)(iVar2 + 0xc);\n    if (iVar7 == 0x37) goto LAB_0002ed44;\n    iVar4 = (*(code *)PTR_wc_to_mb_000a7370)(iVar7,0,param_2,param_3,pbVar1,iVar4 << 1,0,0,iVar2);\n    if (iVar4 < 0) goto LAB_0002edb8;\n    pbVar10 = pbVar1 + iVar4;\n  }" ({ "{") (expression_statement "iVar2 = *(int *)(*param_1 + 0x1090);" (assignment_expression "iVar2 = *(int *)(*param_1 + 0x1090)" (identifier "iVar2") (= "=") (pointer_expression "*(int *)(*param_1 + 0x1090)" (* "*") (cast_expression "(int *)(*param_1 + 0x1090)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(*param_1 + 0x1090)" (( "(") (binary_expression "*param_1 + 0x1090" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (+ "+") (number_literal "0x1090")) () ")"))))) (; ";")) (expression_statement "iVar7 = *(int *)(iVar2 + 0xc);" (assignment_expression "iVar7 = *(int *)(iVar2 + 0xc)" (identifier "iVar7") (= "=") (pointer_expression "*(int *)(iVar2 + 0xc)" (* "*") (cast_expression "(int *)(iVar2 + 0xc)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar2 + 0xc)" (( "(") (binary_expression "iVar2 + 0xc" (identifier "iVar2") (+ "+") (number_literal "0xc")) () ")"))))) (; ";")) (if_statement "if (iVar7 == 0x37) goto LAB_0002ed44;" (if "if") (parenthesized_expression "(iVar7 == 0x37)" (( "(") (binary_expression "iVar7 == 0x37" (identifier "iVar7") (== "==") (number_literal "0x37")) () ")")) (goto_statement "goto LAB_0002ed44;" (goto "goto") (statement_identifier "LAB_0002ed44") (; ";"))) (expression_statement "iVar4 = (*(code *)PTR_wc_to_mb_000a7370)(iVar7,0,param_2,param_3,pbVar1,iVar4 << 1,0,0,iVar2);" (assignment_expression "iVar4 = (*(code *)PTR_wc_to_mb_000a7370)(iVar7,0,param_2,param_3,pbVar1,iVar4 << 1,0,0,iVar2)" (identifier "iVar4") (= "=") (call_expression "(*(code *)PTR_wc_to_mb_000a7370)(iVar7,0,param_2,param_3,pbVar1,iVar4 << 1,0,0,iVar2)" (parenthesized_expression "(*(code *)PTR_wc_to_mb_000a7370)" (( "(") (pointer_expression "*(code *)PTR_wc_to_mb_000a7370" (* "*") (cast_expression "(code *)PTR_wc_to_mb_000a7370" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_wc_to_mb_000a7370"))) () ")")) (argument_list "(iVar7,0,param_2,param_3,pbVar1,iVar4 << 1,0,0,iVar2)" (( "(") (identifier "iVar7") (, ",") (number_literal "0") (, ",") (identifier "param_2") (, ",") (identifier "param_3") (, ",") (identifier "pbVar1") (, ",") (binary_expression "iVar4 << 1" (identifier "iVar4") (<< "<<") (number_literal "1")) (, ",") (number_literal "0") (, ",") (number_literal "0") (, ",") (identifier "iVar2") () ")")))) (; ";")) (if_statement "if (iVar4 < 0) goto LAB_0002edb8;" (if "if") (parenthesized_expression "(iVar4 < 0)" (( "(") (binary_expression "iVar4 < 0" (identifier "iVar4") (< "<") (number_literal "0")) () ")")) (goto_statement "goto LAB_0002edb8;" (goto "goto") (statement_identifier "LAB_0002edb8") (; ";"))) (expression_statement "pbVar10 = pbVar1 + iVar4;" (assignment_expression "pbVar10 = pbVar1 + iVar4" (identifier "pbVar10") (= "=") (binary_expression "pbVar1 + iVar4" (identifier "pbVar1") (+ "+") (identifier "iVar4"))) (; ";")) (} "}")) (else_clause "else {\nLAB_0002ed44:\n    if (param_3 < 1) goto LAB_0002edb8;\n    puVar8 = param_2 + param_3;\n    pbVar9 = pbVar1;\n    do {\n      uVar3 = *param_2;\n      if (uVar3 - 0xd800 < 0x800) {\n        bVar5 = 0x2e;\nLAB_0002ed98:\n        *pbVar9 = bVar5;\n        pbVar10 = pbVar9 + 1;\n      }\n      else {\n        bVar5 = (byte)uVar3;\n        if (uVar3 < 0x80) goto LAB_0002ed98;\n        bVar11 = bVar5 & 0x3f | 0x80;\n        bVar5 = (byte)((uVar3 << 0x12) >> 0x18);\n        if (uVar3 < 0x800) {\n          pbVar9[1] = bVar11;\n          *pbVar9 = bVar5 | 0xc0;\n          pbVar10 = pbVar9 + 2;\n        }\n        else {\n          bVar6 = bVar5 & 0x3f | 0x80;\n          bVar5 = (byte)((uVar3 << 0xc) >> 0x18);\n          if (uVar3 < 0x10000) {\n            pbVar9[1] = bVar6;\n            *pbVar9 = bVar5 | 0xe0;\n            pbVar10 = pbVar9 + 3;\n            pbVar9[2] = bVar11;\n          }\n          else {\n            pbVar9[2] = bVar6;\n            pbVar9[3] = bVar11;\n            *pbVar9 = (byte)(uVar3 >> 0x12) | 0xf0;\n            pbVar9[1] = bVar5 & 0x3f | 0x80;\n            pbVar10 = pbVar9 + 4;\n          }\n        }\n      }\n      param_2 = param_2 + 1;\n      pbVar9 = pbVar10;\n    } while (puVar8 != param_2);\n  }" (else "else") (compound_statement "{\nLAB_0002ed44:\n    if (param_3 < 1) goto LAB_0002edb8;\n    puVar8 = param_2 + param_3;\n    pbVar9 = pbVar1;\n    do {\n      uVar3 = *param_2;\n      if (uVar3 - 0xd800 < 0x800) {\n        bVar5 = 0x2e;\nLAB_0002ed98:\n        *pbVar9 = bVar5;\n        pbVar10 = pbVar9 + 1;\n      }\n      else {\n        bVar5 = (byte)uVar3;\n        if (uVar3 < 0x80) goto LAB_0002ed98;\n        bVar11 = bVar5 & 0x3f | 0x80;\n        bVar5 = (byte)((uVar3 << 0x12) >> 0x18);\n        if (uVar3 < 0x800) {\n          pbVar9[1] = bVar11;\n          *pbVar9 = bVar5 | 0xc0;\n          pbVar10 = pbVar9 + 2;\n        }\n        else {\n          bVar6 = bVar5 & 0x3f | 0x80;\n          bVar5 = (byte)((uVar3 << 0xc) >> 0x18);\n          if (uVar3 < 0x10000) {\n            pbVar9[1] = bVar6;\n            *pbVar9 = bVar5 | 0xe0;\n            pbVar10 = pbVar9 + 3;\n            pbVar9[2] = bVar11;\n          }\n          else {\n            pbVar9[2] = bVar6;\n            pbVar9[3] = bVar11;\n            *pbVar9 = (byte)(uVar3 >> 0x12) | 0xf0;\n            pbVar9[1] = bVar5 & 0x3f | 0x80;\n            pbVar10 = pbVar9 + 4;\n          }\n        }\n      }\n      param_2 = param_2 + 1;\n      pbVar9 = pbVar10;\n    } while (puVar8 != param_2);\n  }" ({ "{") (labeled_statement "LAB_0002ed44:\n    if (param_3 < 1) goto LAB_0002edb8;" (statement_identifier "LAB_0002ed44") (: ":") (if_statement "if (param_3 < 1) goto LAB_0002edb8;" (if "if") (parenthesized_expression "(param_3 < 1)" (( "(") (binary_expression "param_3 < 1" (identifier "param_3") (< "<") (number_literal "1")) () ")")) (goto_statement "goto LAB_0002edb8;" (goto "goto") (statement_identifier "LAB_0002edb8") (; ";")))) (expression_statement "puVar8 = param_2 + param_3;" (assignment_expression "puVar8 = param_2 + param_3" (identifier "puVar8") (= "=") (binary_expression "param_2 + param_3" (identifier "param_2") (+ "+") (identifier "param_3"))) (; ";")) (expression_statement "pbVar9 = pbVar1;" (assignment_expression "pbVar9 = pbVar1" (identifier "pbVar9") (= "=") (identifier "pbVar1")) (; ";")) (do_statement "do {\n      uVar3 = *param_2;\n      if (uVar3 - 0xd800 < 0x800) {\n        bVar5 = 0x2e;\nLAB_0002ed98:\n        *pbVar9 = bVar5;\n        pbVar10 = pbVar9 + 1;\n      }\n      else {\n        bVar5 = (byte)uVar3;\n        if (uVar3 < 0x80) goto LAB_0002ed98;\n        bVar11 = bVar5 & 0x3f | 0x80;\n        bVar5 = (byte)((uVar3 << 0x12) >> 0x18);\n        if (uVar3 < 0x800) {\n          pbVar9[1] = bVar11;\n          *pbVar9 = bVar5 | 0xc0;\n          pbVar10 = pbVar9 + 2;\n        }\n        else {\n          bVar6 = bVar5 & 0x3f | 0x80;\n          bVar5 = (byte)((uVar3 << 0xc) >> 0x18);\n          if (uVar3 < 0x10000) {\n            pbVar9[1] = bVar6;\n            *pbVar9 = bVar5 | 0xe0;\n            pbVar10 = pbVar9 + 3;\n            pbVar9[2] = bVar11;\n          }\n          else {\n            pbVar9[2] = bVar6;\n            pbVar9[3] = bVar11;\n            *pbVar9 = (byte)(uVar3 >> 0x12) | 0xf0;\n            pbVar9[1] = bVar5 & 0x3f | 0x80;\n            pbVar10 = pbVar9 + 4;\n          }\n        }\n      }\n      param_2 = param_2 + 1;\n      pbVar9 = pbVar10;\n    } while (puVar8 != param_2);" (do "do") (compound_statement "{\n      uVar3 = *param_2;\n      if (uVar3 - 0xd800 < 0x800) {\n        bVar5 = 0x2e;\nLAB_0002ed98:\n        *pbVar9 = bVar5;\n        pbVar10 = pbVar9 + 1;\n      }\n      else {\n        bVar5 = (byte)uVar3;\n        if (uVar3 < 0x80) goto LAB_0002ed98;\n        bVar11 = bVar5 & 0x3f | 0x80;\n        bVar5 = (byte)((uVar3 << 0x12) >> 0x18);\n        if (uVar3 < 0x800) {\n          pbVar9[1] = bVar11;\n          *pbVar9 = bVar5 | 0xc0;\n          pbVar10 = pbVar9 + 2;\n        }\n        else {\n          bVar6 = bVar5 & 0x3f | 0x80;\n          bVar5 = (byte)((uVar3 << 0xc) >> 0x18);\n          if (uVar3 < 0x10000) {\n            pbVar9[1] = bVar6;\n            *pbVar9 = bVar5 | 0xe0;\n            pbVar10 = pbVar9 + 3;\n            pbVar9[2] = bVar11;\n          }\n          else {\n            pbVar9[2] = bVar6;\n            pbVar9[3] = bVar11;\n            *pbVar9 = (byte)(uVar3 >> 0x12) | 0xf0;\n            pbVar9[1] = bVar5 & 0x3f | 0x80;\n            pbVar10 = pbVar9 + 4;\n          }\n        }\n      }\n      param_2 = param_2 + 1;\n      pbVar9 = pbVar10;\n    }" ({ "{") (expression_statement "uVar3 = *param_2;" (assignment_expression "uVar3 = *param_2" (identifier "uVar3") (= "=") (pointer_expression "*param_2" (* "*") (identifier "param_2"))) (; ";")) (if_statement "if (uVar3 - 0xd800 < 0x800) {\n        bVar5 = 0x2e;\nLAB_0002ed98:\n        *pbVar9 = bVar5;\n        pbVar10 = pbVar9 + 1;\n      }\n      else {\n        bVar5 = (byte)uVar3;\n        if (uVar3 < 0x80) goto LAB_0002ed98;\n        bVar11 = bVar5 & 0x3f | 0x80;\n        bVar5 = (byte)((uVar3 << 0x12) >> 0x18);\n        if (uVar3 < 0x800) {\n          pbVar9[1] = bVar11;\n          *pbVar9 = bVar5 | 0xc0;\n          pbVar10 = pbVar9 + 2;\n        }\n        else {\n          bVar6 = bVar5 & 0x3f | 0x80;\n          bVar5 = (byte)((uVar3 << 0xc) >> 0x18);\n          if (uVar3 < 0x10000) {\n            pbVar9[1] = bVar6;\n            *pbVar9 = bVar5 | 0xe0;\n            pbVar10 = pbVar9 + 3;\n            pbVar9[2] = bVar11;\n          }\n          else {\n            pbVar9[2] = bVar6;\n            pbVar9[3] = bVar11;\n            *pbVar9 = (byte)(uVar3 >> 0x12) | 0xf0;\n            pbVar9[1] = bVar5 & 0x3f | 0x80;\n            pbVar10 = pbVar9 + 4;\n          }\n        }\n      }" (if "if") (parenthesized_expression "(uVar3 - 0xd800 < 0x800)" (( "(") (binary_expression "uVar3 - 0xd800 < 0x800" (binary_expression "uVar3 - 0xd800" (identifier "uVar3") (- "-") (number_literal "0xd800")) (< "<") (number_literal "0x800")) () ")")) (compound_statement "{\n        bVar5 = 0x2e;\nLAB_0002ed98:\n        *pbVar9 = bVar5;\n        pbVar10 = pbVar9 + 1;\n      }" ({ "{") (expression_statement "bVar5 = 0x2e;" (assignment_expression "bVar5 = 0x2e" (identifier "bVar5") (= "=") (number_literal "0x2e")) (; ";")) (labeled_statement "LAB_0002ed98:\n        *pbVar9 = bVar5;" (statement_identifier "LAB_0002ed98") (: ":") (expression_statement "*pbVar9 = bVar5;" (assignment_expression "*pbVar9 = bVar5" (pointer_expression "*pbVar9" (* "*") (identifier "pbVar9")) (= "=") (identifier "bVar5")) (; ";"))) (expression_statement "pbVar10 = pbVar9 + 1;" (assignment_expression "pbVar10 = pbVar9 + 1" (identifier "pbVar10") (= "=") (binary_expression "pbVar9 + 1" (identifier "pbVar9") (+ "+") (number_literal "1"))) (; ";")) (} "}")) (else_clause "else {\n        bVar5 = (byte)uVar3;\n        if (uVar3 < 0x80) goto LAB_0002ed98;\n        bVar11 = bVar5 & 0x3f | 0x80;\n        bVar5 = (byte)((uVar3 << 0x12) >> 0x18);\n        if (uVar3 < 0x800) {\n          pbVar9[1] = bVar11;\n          *pbVar9 = bVar5 | 0xc0;\n          pbVar10 = pbVar9 + 2;\n        }\n        else {\n          bVar6 = bVar5 & 0x3f | 0x80;\n          bVar5 = (byte)((uVar3 << 0xc) >> 0x18);\n          if (uVar3 < 0x10000) {\n            pbVar9[1] = bVar6;\n            *pbVar9 = bVar5 | 0xe0;\n            pbVar10 = pbVar9 + 3;\n            pbVar9[2] = bVar11;\n          }\n          else {\n            pbVar9[2] = bVar6;\n            pbVar9[3] = bVar11;\n            *pbVar9 = (byte)(uVar3 >> 0x12) | 0xf0;\n            pbVar9[1] = bVar5 & 0x3f | 0x80;\n            pbVar10 = pbVar9 + 4;\n          }\n        }\n      }" (else "else") (compound_statement "{\n        bVar5 = (byte)uVar3;\n        if (uVar3 < 0x80) goto LAB_0002ed98;\n        bVar11 = bVar5 & 0x3f | 0x80;\n        bVar5 = (byte)((uVar3 << 0x12) >> 0x18);\n        if (uVar3 < 0x800) {\n          pbVar9[1] = bVar11;\n          *pbVar9 = bVar5 | 0xc0;\n          pbVar10 = pbVar9 + 2;\n        }\n        else {\n          bVar6 = bVar5 & 0x3f | 0x80;\n          bVar5 = (byte)((uVar3 << 0xc) >> 0x18);\n          if (uVar3 < 0x10000) {\n            pbVar9[1] = bVar6;\n            *pbVar9 = bVar5 | 0xe0;\n            pbVar10 = pbVar9 + 3;\n            pbVar9[2] = bVar11;\n          }\n          else {\n            pbVar9[2] = bVar6;\n            pbVar9[3] = bVar11;\n            *pbVar9 = (byte)(uVar3 >> 0x12) | 0xf0;\n            pbVar9[1] = bVar5 & 0x3f | 0x80;\n            pbVar10 = pbVar9 + 4;\n          }\n        }\n      }" ({ "{") (expression_statement "bVar5 = (byte)uVar3;" (assignment_expression "bVar5 = (byte)uVar3" (identifier "bVar5") (= "=") (cast_expression "(byte)uVar3" (( "(") (type_descriptor "byte" (type_identifier "byte")) () ")") (identifier "uVar3"))) (; ";")) (if_statement "if (uVar3 < 0x80) goto LAB_0002ed98;" (if "if") (parenthesized_expression "(uVar3 < 0x80)" (( "(") (binary_expression "uVar3 < 0x80" (identifier "uVar3") (< "<") (number_literal "0x80")) () ")")) (goto_statement "goto LAB_0002ed98;" (goto "goto") (statement_identifier "LAB_0002ed98") (; ";"))) (expression_statement "bVar11 = bVar5 & 0x3f | 0x80;" (assignment_expression "bVar11 = bVar5 & 0x3f | 0x80" (identifier "bVar11") (= "=") (binary_expression "bVar5 & 0x3f | 0x80" (binary_expression "bVar5 & 0x3f" (identifier "bVar5") (& "&") (number_literal "0x3f")) (| "|") (number_literal "0x80"))) (; ";")) (expression_statement "bVar5 = (byte)((uVar3 << 0x12) >> 0x18);" (assignment_expression "bVar5 = (byte)((uVar3 << 0x12) >> 0x18)" (identifier "bVar5") (= "=") (call_expression "(byte)((uVar3 << 0x12) >> 0x18)" (parenthesized_expression "(byte)" (( "(") (identifier "byte") () ")")) (argument_list "((uVar3 << 0x12) >> 0x18)" (( "(") (binary_expression "(uVar3 << 0x12) >> 0x18" (parenthesized_expression "(uVar3 << 0x12)" (( "(") (binary_expression "uVar3 << 0x12" (identifier "uVar3") (<< "<<") (number_literal "0x12")) () ")")) (>> ">>") (number_literal "0x18")) () ")")))) (; ";")) (if_statement "if (uVar3 < 0x800) {\n          pbVar9[1] = bVar11;\n          *pbVar9 = bVar5 | 0xc0;\n          pbVar10 = pbVar9 + 2;\n        }\n        else {\n          bVar6 = bVar5 & 0x3f | 0x80;\n          bVar5 = (byte)((uVar3 << 0xc) >> 0x18);\n          if (uVar3 < 0x10000) {\n            pbVar9[1] = bVar6;\n            *pbVar9 = bVar5 | 0xe0;\n            pbVar10 = pbVar9 + 3;\n            pbVar9[2] = bVar11;\n          }\n          else {\n            pbVar9[2] = bVar6;\n            pbVar9[3] = bVar11;\n            *pbVar9 = (byte)(uVar3 >> 0x12) | 0xf0;\n            pbVar9[1] = bVar5 & 0x3f | 0x80;\n            pbVar10 = pbVar9 + 4;\n          }\n        }" (if "if") (parenthesized_expression "(uVar3 < 0x800)" (( "(") (binary_expression "uVar3 < 0x800" (identifier "uVar3") (< "<") (number_literal "0x800")) () ")")) (compound_statement "{\n          pbVar9[1] = bVar11;\n          *pbVar9 = bVar5 | 0xc0;\n          pbVar10 = pbVar9 + 2;\n        }" ({ "{") (expression_statement "pbVar9[1] = bVar11;" (assignment_expression "pbVar9[1] = bVar11" (subscript_expression "pbVar9[1]" (identifier "pbVar9") ([ "[") (number_literal "1") (] "]")) (= "=") (identifier "bVar11")) (; ";")) (expression_statement "*pbVar9 = bVar5 | 0xc0;" (assignment_expression "*pbVar9 = bVar5 | 0xc0" (pointer_expression "*pbVar9" (* "*") (identifier "pbVar9")) (= "=") (binary_expression "bVar5 | 0xc0" (identifier "bVar5") (| "|") (number_literal "0xc0"))) (; ";")) (expression_statement "pbVar10 = pbVar9 + 2;" (assignment_expression "pbVar10 = pbVar9 + 2" (identifier "pbVar10") (= "=") (binary_expression "pbVar9 + 2" (identifier "pbVar9") (+ "+") (number_literal "2"))) (; ";")) (} "}")) (else_clause "else {\n          bVar6 = bVar5 & 0x3f | 0x80;\n          bVar5 = (byte)((uVar3 << 0xc) >> 0x18);\n          if (uVar3 < 0x10000) {\n            pbVar9[1] = bVar6;\n            *pbVar9 = bVar5 | 0xe0;\n            pbVar10 = pbVar9 + 3;\n            pbVar9[2] = bVar11;\n          }\n          else {\n            pbVar9[2] = bVar6;\n            pbVar9[3] = bVar11;\n            *pbVar9 = (byte)(uVar3 >> 0x12) | 0xf0;\n            pbVar9[1] = bVar5 & 0x3f | 0x80;\n            pbVar10 = pbVar9 + 4;\n          }\n        }" (else "else") (compound_statement "{\n          bVar6 = bVar5 & 0x3f | 0x80;\n          bVar5 = (byte)((uVar3 << 0xc) >> 0x18);\n          if (uVar3 < 0x10000) {\n            pbVar9[1] = bVar6;\n            *pbVar9 = bVar5 | 0xe0;\n            pbVar10 = pbVar9 + 3;\n            pbVar9[2] = bVar11;\n          }\n          else {\n            pbVar9[2] = bVar6;\n            pbVar9[3] = bVar11;\n            *pbVar9 = (byte)(uVar3 >> 0x12) | 0xf0;\n            pbVar9[1] = bVar5 & 0x3f | 0x80;\n            pbVar10 = pbVar9 + 4;\n          }\n        }" ({ "{") (expression_statement "bVar6 = bVar5 & 0x3f | 0x80;" (assignment_expression "bVar6 = bVar5 & 0x3f | 0x80" (identifier "bVar6") (= "=") (binary_expression "bVar5 & 0x3f | 0x80" (binary_expression "bVar5 & 0x3f" (identifier "bVar5") (& "&") (number_literal "0x3f")) (| "|") (number_literal "0x80"))) (; ";")) (expression_statement "bVar5 = (byte)((uVar3 << 0xc) >> 0x18);" (assignment_expression "bVar5 = (byte)((uVar3 << 0xc) >> 0x18)" (identifier "bVar5") (= "=") (call_expression "(byte)((uVar3 << 0xc) >> 0x18)" (parenthesized_expression "(byte)" (( "(") (identifier "byte") () ")")) (argument_list "((uVar3 << 0xc) >> 0x18)" (( "(") (binary_expression "(uVar3 << 0xc) >> 0x18" (parenthesized_expression "(uVar3 << 0xc)" (( "(") (binary_expression "uVar3 << 0xc" (identifier "uVar3") (<< "<<") (number_literal "0xc")) () ")")) (>> ">>") (number_literal "0x18")) () ")")))) (; ";")) (if_statement "if (uVar3 < 0x10000) {\n            pbVar9[1] = bVar6;\n            *pbVar9 = bVar5 | 0xe0;\n            pbVar10 = pbVar9 + 3;\n            pbVar9[2] = bVar11;\n          }\n          else {\n            pbVar9[2] = bVar6;\n            pbVar9[3] = bVar11;\n            *pbVar9 = (byte)(uVar3 >> 0x12) | 0xf0;\n            pbVar9[1] = bVar5 & 0x3f | 0x80;\n            pbVar10 = pbVar9 + 4;\n          }" (if "if") (parenthesized_expression "(uVar3 < 0x10000)" (( "(") (binary_expression "uVar3 < 0x10000" (identifier "uVar3") (< "<") (number_literal "0x10000")) () ")")) (compound_statement "{\n            pbVar9[1] = bVar6;\n            *pbVar9 = bVar5 | 0xe0;\n            pbVar10 = pbVar9 + 3;\n            pbVar9[2] = bVar11;\n          }" ({ "{") (expression_statement "pbVar9[1] = bVar6;" (assignment_expression "pbVar9[1] = bVar6" (subscript_expression "pbVar9[1]" (identifier "pbVar9") ([ "[") (number_literal "1") (] "]")) (= "=") (identifier "bVar6")) (; ";")) (expression_statement "*pbVar9 = bVar5 | 0xe0;" (assignment_expression "*pbVar9 = bVar5 | 0xe0" (pointer_expression "*pbVar9" (* "*") (identifier "pbVar9")) (= "=") (binary_expression "bVar5 | 0xe0" (identifier "bVar5") (| "|") (number_literal "0xe0"))) (; ";")) (expression_statement "pbVar10 = pbVar9 + 3;" (assignment_expression "pbVar10 = pbVar9 + 3" (identifier "pbVar10") (= "=") (binary_expression "pbVar9 + 3" (identifier "pbVar9") (+ "+") (number_literal "3"))) (; ";")) (expression_statement "pbVar9[2] = bVar11;" (assignment_expression "pbVar9[2] = bVar11" (subscript_expression "pbVar9[2]" (identifier "pbVar9") ([ "[") (number_literal "2") (] "]")) (= "=") (identifier "bVar11")) (; ";")) (} "}")) (else_clause "else {\n            pbVar9[2] = bVar6;\n            pbVar9[3] = bVar11;\n            *pbVar9 = (byte)(uVar3 >> 0x12) | 0xf0;\n            pbVar9[1] = bVar5 & 0x3f | 0x80;\n            pbVar10 = pbVar9 + 4;\n          }" (else "else") (compound_statement "{\n            pbVar9[2] = bVar6;\n            pbVar9[3] = bVar11;\n            *pbVar9 = (byte)(uVar3 >> 0x12) | 0xf0;\n            pbVar9[1] = bVar5 & 0x3f | 0x80;\n            pbVar10 = pbVar9 + 4;\n          }" ({ "{") (expression_statement "pbVar9[2] = bVar6;" (assignment_expression "pbVar9[2] = bVar6" (subscript_expression "pbVar9[2]" (identifier "pbVar9") ([ "[") (number_literal "2") (] "]")) (= "=") (identifier "bVar6")) (; ";")) (expression_statement "pbVar9[3] = bVar11;" (assignment_expression "pbVar9[3] = bVar11" (subscript_expression "pbVar9[3]" (identifier "pbVar9") ([ "[") (number_literal "3") (] "]")) (= "=") (identifier "bVar11")) (; ";")) (expression_statement "*pbVar9 = (byte)(uVar3 >> 0x12) | 0xf0;" (assignment_expression "*pbVar9 = (byte)(uVar3 >> 0x12) | 0xf0" (pointer_expression "*pbVar9" (* "*") (identifier "pbVar9")) (= "=") (binary_expression "(byte)(uVar3 >> 0x12) | 0xf0" (call_expression "(byte)(uVar3 >> 0x12)" (parenthesized_expression "(byte)" (( "(") (identifier "byte") () ")")) (argument_list "(uVar3 >> 0x12)" (( "(") (binary_expression "uVar3 >> 0x12" (identifier "uVar3") (>> ">>") (number_literal "0x12")) () ")"))) (| "|") (number_literal "0xf0"))) (; ";")) (expression_statement "pbVar9[1] = bVar5 & 0x3f | 0x80;" (assignment_expression "pbVar9[1] = bVar5 & 0x3f | 0x80" (subscript_expression "pbVar9[1]" (identifier "pbVar9") ([ "[") (number_literal "1") (] "]")) (= "=") (binary_expression "bVar5 & 0x3f | 0x80" (binary_expression "bVar5 & 0x3f" (identifier "bVar5") (& "&") (number_literal "0x3f")) (| "|") (number_literal "0x80"))) (; ";")) (expression_statement "pbVar10 = pbVar9 + 4;" (assignment_expression "pbVar10 = pbVar9 + 4" (identifier "pbVar10") (= "=") (binary_expression "pbVar9 + 4" (identifier "pbVar9") (+ "+") (number_literal "4"))) (; ";")) (} "}")))) (} "}")))) (} "}")))) (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"))) (; ";")) (expression_statement "pbVar9 = pbVar10;" (assignment_expression "pbVar9 = pbVar10" (identifier "pbVar9") (= "=") (identifier "pbVar10")) (; ";")) (} "}")) (while "while") (parenthesized_expression "(puVar8 != param_2)" (( "(") (binary_expression "puVar8 != param_2" (identifier "puVar8") (!= "!=") (identifier "param_2")) () ")")) (; ";")) (} "}")))) (if_statement "if (pbVar1 < pbVar10) {\n    ldisc_send(param_1,pbVar1,(int)pbVar10 - (int)pbVar1,param_4);\n    safefree(pbVar1);\n    return;\n  }" (if "if") (parenthesized_expression "(pbVar1 < pbVar10)" (( "(") (binary_expression "pbVar1 < pbVar10" (identifier "pbVar1") (< "<") (identifier "pbVar10")) () ")")) (compound_statement "{\n    ldisc_send(param_1,pbVar1,(int)pbVar10 - (int)pbVar1,param_4);\n    safefree(pbVar1);\n    return;\n  }" ({ "{") (expression_statement "ldisc_send(param_1,pbVar1,(int)pbVar10 - (int)pbVar1,param_4);" (call_expression "ldisc_send(param_1,pbVar1,(int)pbVar10 - (int)pbVar1,param_4)" (identifier "ldisc_send") (argument_list "(param_1,pbVar1,(int)pbVar10 - (int)pbVar1,param_4)" (( "(") (identifier "param_1") (, ",") (identifier "pbVar1") (, ",") (binary_expression "(int)pbVar10 - (int)pbVar1" (cast_expression "(int)pbVar10" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "pbVar10")) (- "-") (cast_expression "(int)pbVar1" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "pbVar1"))) (, ",") (identifier "param_4") () ")"))) (; ";")) (expression_statement "safefree(pbVar1);" (call_expression "safefree(pbVar1)" (identifier "safefree") (argument_list "(pbVar1)" (( "(") (identifier "pbVar1") () ")"))) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}"))) (labeled_statement "LAB_0002edb8:\n  safefree(pbVar1);" (statement_identifier "LAB_0002edb8") (: ":") (expression_statement "safefree(pbVar1);" (call_expression "safefree(pbVar1)" (identifier "safefree") (argument_list "(pbVar1)" (( "(") (identifier "pbVar1") () ")"))) (; ";"))) (return_statement "return;" (return "return") (; ";")) (} "}")))

void function_1(void *handle,type_1 *widebuf,int var_1,int interactive)

{
                    /* WARNING: Load size is inaccurate */
  if ((*(int *)(*handle + 0xdc) != 0) || (*(int *)(*(int *)(*handle + 0x1090) + 0xc) == 0x37)) {
    var_1 = var_1 * 3;
  }
                    /* WARNING: Subroutine does not return */
  var_2(var_1 << 1,1);
}


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

void MASKED(int *param_1,uint *param_2,int param_3,undefined4 param_4)

{
  byte *pbVar1;
  int iVar2;
  uint uVar3;
  byte bVar5;
  int iVar4;
  byte bVar6;
  int iVar7;
  uint *puVar8;
  byte *pbVar9;
  byte *pbVar10;
  byte bVar11;
  
  if ((*(int *)(*param_1 + 0xdc) != 0) ||
     (iVar4 = param_3, *(int *)(*(int *)(*param_1 + 0x1090) + 0xc) == 0x37)) {
    iVar4 = param_3 * 3;
  }
  pbVar1 = (byte *)safemalloc(iVar4 << 1,1);
  if (*(int *)(*param_1 + 0xdc) == 0) {
    iVar2 = *(int *)(*param_1 + 0x1090);
    iVar7 = *(int *)(iVar2 + 0xc);
    if (iVar7 == 0x37) goto LAB_0002ed44;
    iVar4 = (*(code *)PTR_wc_to_mb_000a7370)(iVar7,0,param_2,param_3,pbVar1,iVar4 << 1,0,0,iVar2);
    if (iVar4 < 0) goto LAB_0002edb8;
    pbVar10 = pbVar1 + iVar4;
  }
  else {
LAB_0002ed44:
    if (param_3 < 1) goto LAB_0002edb8;
    puVar8 = param_2 + param_3;
    pbVar9 = pbVar1;
    do {
      uVar3 = *param_2;
      if (uVar3 - 0xd800 < 0x800) {
        bVar5 = 0x2e;
LAB_0002ed98:
        *pbVar9 = bVar5;
        pbVar10 = pbVar9 + 1;
      }
      else {
        bVar5 = (byte)uVar3;
        if (uVar3 < 0x80) goto LAB_0002ed98;
        bVar11 = bVar5 & 0x3f | 0x80;
        bVar5 = (byte)((uVar3 << 0x12) >> 0x18);
        if (uVar3 < 0x800) {
          pbVar9[1] = bVar11;
          *pbVar9 = bVar5 | 0xc0;
          pbVar10 = pbVar9 + 2;
        }
        else {
          bVar6 = bVar5 & 0x3f | 0x80;
          bVar5 = (byte)((uVar3 << 0xc) >> 0x18);
          if (uVar3 < 0x10000) {
            pbVar9[1] = bVar6;
            *pbVar9 = bVar5 | 0xe0;
            pbVar10 = pbVar9 + 3;
            pbVar9[2] = bVar11;
          }
          else {
            pbVar9[2] = bVar6;
            pbVar9[3] = bVar11;
            *pbVar9 = (byte)(uVar3 >> 0x12) | 0xf0;
            pbVar9[1] = bVar5 & 0x3f | 0x80;
            pbVar10 = pbVar9 + 4;
          }
        }
      }
      param_2 = param_2 + 1;
      pbVar9 = pbVar10;
    } while (puVar8 != param_2);
  }
  if (pbVar1 < pbVar10) {
    ldisc_send(param_1,pbVar1,(int)pbVar10 - (int)pbVar1,param_4);
    safefree(pbVar1);
    return;
  }
LAB_0002edb8:
  safefree(pbVar1);
  return;
}

