
/* WARNING: Unknown calling convention */

int ssh1_write_bignum(void *data,Bignum_conflict bn)

{
  int iVar1;
  int iVar2;
  uint uVar3;
  undefined1 *puVar4;
  undefined1 uVar5;
  int iVar6;
  
  iVar1 = ssh1_bignum_length(bn);
  iVar2 = *bn * 0x20;
  iVar6 = iVar2 + -1;
  if ((-1 < iVar6) && (-1 < (int)bn[(iVar6 >> 5) + 1])) {
    do {
      iVar2 = iVar6;
      iVar6 = iVar2 + -1;
      if (iVar6 == -1) break;
    } while (bn[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f) == 0);
  }
  uVar3 = iVar1 - 3;
  *(ushort *)data = (ushort)iVar2 << 8 | (ushort)iVar2 >> 8;
  puVar4 = (undefined1 *)((int)data + 2);
  if (iVar1 == 2) {
    return 2;
  }
  do {
    if ((int)uVar3 < 0) {
      *puVar4 = 0;
    }
    else {
      uVar5 = 0;
      if (*bn * 4 - uVar3 != 0 && (int)uVar3 <= (int)(*bn * 4)) {
        uVar5 = (undefined1)(bn[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3));
      }
      *puVar4 = uVar5;
      if (uVar3 == 0) {
        return iVar1;
      }
    }
    uVar3 = uVar3 - 1;
    puVar4 = puVar4 + 1;
  } while( true );
}



void FUN_00028d30(ushort *param_1,int *param_2)

{
  int iVar1;
  int iVar2;
  uint uVar3;
  ushort *puVar4;
  undefined1 uVar5;
  int iVar6;
  
  iVar1 = FUN_00028b50(param_2);
  iVar2 = *param_2 * 0x20;
  iVar6 = iVar2 + -1;
  if ((-1 < iVar6) && (-1 < param_2[(iVar6 >> 5) + 1])) {
    do {
      iVar2 = iVar6;
      iVar6 = iVar2 + -1;
      if (iVar6 == -1) break;
    } while ((uint)param_2[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f) == 0);
  }
  uVar3 = iVar1 - 3;
  *param_1 = (ushort)iVar2 << 8 | (ushort)iVar2 >> 8;
  puVar4 = param_1 + 1;
  if (iVar1 == 2) {
    return;
  }
  do {
    if ((int)uVar3 < 0) {
      *(undefined1 *)puVar4 = 0;
    }
    else {
      uVar5 = 0;
      if (*param_2 * 4 - uVar3 != 0 && (int)uVar3 <= *param_2 * 4) {
        uVar5 = (undefined1)((uint)param_2[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3));
      }
      *(undefined1 *)puVar4 = uVar5;
      if (uVar3 == 0) {
        return;
      }
    }
    uVar3 = uVar3 - 1;
    puVar4 = (ushort *)((int)puVar4 + 1);
  } while( true );
}


PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
MOV EBX,dword ptr [ESP + 0x18]
MOV ESI,dword ptr [ESP + 0x14]
PUSH EBX
CALL 0x00028b50
MOV EDX,dword ptr [EBX]
POP EDI
SHL EDX,0x5
MOV EDI,EDX
SUB EDI,0x1
JS 0x00028de0
MOV ECX,EDI
SAR ECX,0x5
MOV ECX,dword ptr [EBX + ECX*0x4 + 0x4]
TEST ECX,ECX
JNS 0x00028d79
JMP 0x00028de0
MOV EDX,ECX
SAR EDX,0x5
MOV EDX,dword ptr [EBX + EDX*0x4 + 0x4]
SHR EDX,CL
TEST EDX,EDX
JNZ 0x00028d81
MOV EDI,ECX
LEA ECX,[EDI + -0x1]
CMP ECX,-0x1
JNZ 0x00028d68
ROL DI,0x8
LEA EBP,[ESI + 0x2]
LEA EDX,[EAX + -0x3]
MOV word ptr [ESI],DI
CMP EAX,0x2
JNZ 0x00028dc6
JMP 0x00028dd8
MOV EDI,dword ptr [EBX]
XOR ESI,ESI
LEA ECX,[EDI*0x4 + 0x0]
CMP ECX,EDX
JLE 0x00028dba
MOV ESI,EDX
MOV ECX,EDX
SAR ESI,0x2
AND ECX,0x3
MOV ESI,dword ptr [EBX + ESI*0x4 + 0x4]
SHL ECX,0x3
SHR ESI,CL
MOV ECX,ESI
MOV byte ptr [EBP + -0x1],CL
TEST EDX,EDX
JZ 0x00028dd8
SUB EDX,0x1
ADD EBP,0x1
TEST EDX,EDX
JNS 0x00028d98
MOV byte ptr [EBP + -0x1],0x0
JMP 0x00028dc3
POP EBX
POP ESI
POP EDI
POP EBP
RET
MOV EDI,EDX
JMP 0x00028d81
(translation_unit "void FUN_00028d30(ushort *param_1,int *param_2)\n\n{\n  int iVar1;\n  int iVar2;\n  uint uVar3;\n  ushort *puVar4;\n  undefined1 uVar5;\n  int iVar6;\n  \n  iVar1 = FUN_00028b50(param_2);\n  iVar2 = *param_2 * 0x20;\n  iVar6 = iVar2 + -1;\n  if ((-1 < iVar6) && (-1 < param_2[(iVar6 >> 5) + 1])) {\n    do {\n      iVar2 = iVar6;\n      iVar6 = iVar2 + -1;\n      if (iVar6 == -1) break;\n    } while ((uint)param_2[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f) == 0);\n  }\n  uVar3 = iVar1 - 3;\n  *param_1 = (ushort)iVar2 << 8 | (ushort)iVar2 >> 8;\n  puVar4 = param_1 + 1;\n  if (iVar1 == 2) {\n    return;\n  }\n  do {\n    if ((int)uVar3 < 0) {\n      *(undefined1 *)puVar4 = 0;\n    }\n    else {\n      uVar5 = 0;\n      if (*param_2 * 4 - uVar3 != 0 && (int)uVar3 <= *param_2 * 4) {\n        uVar5 = (undefined1)((uint)param_2[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3));\n      }\n      *(undefined1 *)puVar4 = uVar5;\n      if (uVar3 == 0) {\n        return;\n      }\n    }\n    uVar3 = uVar3 - 1;\n    puVar4 = (ushort *)((int)puVar4 + 1);\n  } while( true );\n}\n\n" (function_definition "void FUN_00028d30(ushort *param_1,int *param_2)\n\n{\n  int iVar1;\n  int iVar2;\n  uint uVar3;\n  ushort *puVar4;\n  undefined1 uVar5;\n  int iVar6;\n  \n  iVar1 = FUN_00028b50(param_2);\n  iVar2 = *param_2 * 0x20;\n  iVar6 = iVar2 + -1;\n  if ((-1 < iVar6) && (-1 < param_2[(iVar6 >> 5) + 1])) {\n    do {\n      iVar2 = iVar6;\n      iVar6 = iVar2 + -1;\n      if (iVar6 == -1) break;\n    } while ((uint)param_2[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f) == 0);\n  }\n  uVar3 = iVar1 - 3;\n  *param_1 = (ushort)iVar2 << 8 | (ushort)iVar2 >> 8;\n  puVar4 = param_1 + 1;\n  if (iVar1 == 2) {\n    return;\n  }\n  do {\n    if ((int)uVar3 < 0) {\n      *(undefined1 *)puVar4 = 0;\n    }\n    else {\n      uVar5 = 0;\n      if (*param_2 * 4 - uVar3 != 0 && (int)uVar3 <= *param_2 * 4) {\n        uVar5 = (undefined1)((uint)param_2[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3));\n      }\n      *(undefined1 *)puVar4 = uVar5;\n      if (uVar3 == 0) {\n        return;\n      }\n    }\n    uVar3 = uVar3 - 1;\n    puVar4 = (ushort *)((int)puVar4 + 1);\n  } while( true );\n}" primitive_type (function_declarator "FUN_00028d30(ushort *param_1,int *param_2)" identifier (parameter_list "(ushort *param_1,int *param_2)" ( (parameter_declaration "ushort *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  uint uVar3;\n  ushort *puVar4;\n  undefined1 uVar5;\n  int iVar6;\n  \n  iVar1 = FUN_00028b50(param_2);\n  iVar2 = *param_2 * 0x20;\n  iVar6 = iVar2 + -1;\n  if ((-1 < iVar6) && (-1 < param_2[(iVar6 >> 5) + 1])) {\n    do {\n      iVar2 = iVar6;\n      iVar6 = iVar2 + -1;\n      if (iVar6 == -1) break;\n    } while ((uint)param_2[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f) == 0);\n  }\n  uVar3 = iVar1 - 3;\n  *param_1 = (ushort)iVar2 << 8 | (ushort)iVar2 >> 8;\n  puVar4 = param_1 + 1;\n  if (iVar1 == 2) {\n    return;\n  }\n  do {\n    if ((int)uVar3 < 0) {\n      *(undefined1 *)puVar4 = 0;\n    }\n    else {\n      uVar5 = 0;\n      if (*param_2 * 4 - uVar3 != 0 && (int)uVar3 <= *param_2 * 4) {\n        uVar5 = (undefined1)((uint)param_2[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3));\n      }\n      *(undefined1 *)puVar4 = uVar5;\n      if (uVar3 == 0) {\n        return;\n      }\n    }\n    uVar3 = uVar3 - 1;\n    puVar4 = (ushort *)((int)puVar4 + 1);\n  } while( true );\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "uint uVar3;" type_identifier identifier ;) (declaration "ushort *puVar4;" type_identifier (pointer_declarator "*puVar4" * identifier) ;) (declaration "undefined1 uVar5;" type_identifier identifier ;) (declaration "int iVar6;" primitive_type identifier ;) (expression_statement "iVar1 = FUN_00028b50(param_2);" (assignment_expression "iVar1 = FUN_00028b50(param_2)" identifier = (call_expression "FUN_00028b50(param_2)" identifier (argument_list "(param_2)" ( identifier )))) ;) (expression_statement "iVar2 = *param_2 * 0x20;" (assignment_expression "iVar2 = *param_2 * 0x20" identifier = (binary_expression "*param_2 * 0x20" (pointer_expression "*param_2" * identifier) * number_literal)) ;) (expression_statement "iVar6 = iVar2 + -1;" (assignment_expression "iVar6 = iVar2 + -1" identifier = (binary_expression "iVar2 + -1" identifier + number_literal)) ;) (if_statement "if ((-1 < iVar6) && (-1 < param_2[(iVar6 >> 5) + 1])) {\n    do {\n      iVar2 = iVar6;\n      iVar6 = iVar2 + -1;\n      if (iVar6 == -1) break;\n    } while ((uint)param_2[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f) == 0);\n  }" if (parenthesized_expression "((-1 < iVar6) && (-1 < param_2[(iVar6 >> 5) + 1]))" ( (binary_expression "(-1 < iVar6) && (-1 < param_2[(iVar6 >> 5) + 1])" (parenthesized_expression "(-1 < iVar6)" ( (binary_expression "-1 < iVar6" number_literal < identifier) )) && (parenthesized_expression "(-1 < param_2[(iVar6 >> 5) + 1])" ( (binary_expression "-1 < param_2[(iVar6 >> 5) + 1]" number_literal < (subscript_expression "param_2[(iVar6 >> 5) + 1]" identifier [ (binary_expression "(iVar6 >> 5) + 1" (parenthesized_expression "(iVar6 >> 5)" ( (binary_expression "iVar6 >> 5" identifier >> number_literal) )) + number_literal) ])) ))) )) (compound_statement "{\n    do {\n      iVar2 = iVar6;\n      iVar6 = iVar2 + -1;\n      if (iVar6 == -1) break;\n    } while ((uint)param_2[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f) == 0);\n  }" { (do_statement "do {\n      iVar2 = iVar6;\n      iVar6 = iVar2 + -1;\n      if (iVar6 == -1) break;\n    } while ((uint)param_2[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f) == 0);" do (compound_statement "{\n      iVar2 = iVar6;\n      iVar6 = iVar2 + -1;\n      if (iVar6 == -1) break;\n    }" { (expression_statement "iVar2 = iVar6;" (assignment_expression "iVar2 = iVar6" identifier = identifier) ;) (expression_statement "iVar6 = iVar2 + -1;" (assignment_expression "iVar6 = iVar2 + -1" identifier = (binary_expression "iVar2 + -1" identifier + number_literal)) ;) (if_statement "if (iVar6 == -1) break;" if (parenthesized_expression "(iVar6 == -1)" ( (binary_expression "iVar6 == -1" identifier == number_literal) )) (break_statement "break;" break ;)) }) while (parenthesized_expression "((uint)param_2[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f) == 0)" ( (binary_expression "(uint)param_2[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f) == 0" (binary_expression "(uint)param_2[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f)" (cast_expression "(uint)param_2[(iVar6 >> 5) + 1]" ( (type_descriptor "uint" type_identifier) ) (subscript_expression "param_2[(iVar6 >> 5) + 1]" identifier [ (binary_expression "(iVar6 >> 5) + 1" (parenthesized_expression "(iVar6 >> 5)" ( (binary_expression "iVar6 >> 5" identifier >> number_literal) )) + number_literal) ])) >> (parenthesized_expression "((byte)iVar6 & 0x1f)" ( (binary_expression "(byte)iVar6 & 0x1f" (cast_expression "(byte)iVar6" ( (type_descriptor "byte" type_identifier) ) identifier) & number_literal) ))) == number_literal) )) ;) })) (expression_statement "uVar3 = iVar1 - 3;" (assignment_expression "uVar3 = iVar1 - 3" identifier = (binary_expression "iVar1 - 3" identifier - number_literal)) ;) (expression_statement "*param_1 = (ushort)iVar2 << 8 | (ushort)iVar2 >> 8;" (assignment_expression "*param_1 = (ushort)iVar2 << 8 | (ushort)iVar2 >> 8" (pointer_expression "*param_1" * identifier) = (binary_expression "(ushort)iVar2 << 8 | (ushort)iVar2 >> 8" (binary_expression "(ushort)iVar2 << 8" (cast_expression "(ushort)iVar2" ( (type_descriptor "ushort" type_identifier) ) identifier) << number_literal) | (binary_expression "(ushort)iVar2 >> 8" (cast_expression "(ushort)iVar2" ( (type_descriptor "ushort" type_identifier) ) identifier) >> number_literal))) ;) (expression_statement "puVar4 = param_1 + 1;" (assignment_expression "puVar4 = param_1 + 1" identifier = (binary_expression "param_1 + 1" identifier + number_literal)) ;) (if_statement "if (iVar1 == 2) {\n    return;\n  }" if (parenthesized_expression "(iVar1 == 2)" ( (binary_expression "iVar1 == 2" identifier == number_literal) )) (compound_statement "{\n    return;\n  }" { (return_statement "return;" return ;) })) (do_statement "do {\n    if ((int)uVar3 < 0) {\n      *(undefined1 *)puVar4 = 0;\n    }\n    else {\n      uVar5 = 0;\n      if (*param_2 * 4 - uVar3 != 0 && (int)uVar3 <= *param_2 * 4) {\n        uVar5 = (undefined1)((uint)param_2[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3));\n      }\n      *(undefined1 *)puVar4 = uVar5;\n      if (uVar3 == 0) {\n        return;\n      }\n    }\n    uVar3 = uVar3 - 1;\n    puVar4 = (ushort *)((int)puVar4 + 1);\n  } while( true );" do (compound_statement "{\n    if ((int)uVar3 < 0) {\n      *(undefined1 *)puVar4 = 0;\n    }\n    else {\n      uVar5 = 0;\n      if (*param_2 * 4 - uVar3 != 0 && (int)uVar3 <= *param_2 * 4) {\n        uVar5 = (undefined1)((uint)param_2[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3));\n      }\n      *(undefined1 *)puVar4 = uVar5;\n      if (uVar3 == 0) {\n        return;\n      }\n    }\n    uVar3 = uVar3 - 1;\n    puVar4 = (ushort *)((int)puVar4 + 1);\n  }" { (if_statement "if ((int)uVar3 < 0) {\n      *(undefined1 *)puVar4 = 0;\n    }\n    else {\n      uVar5 = 0;\n      if (*param_2 * 4 - uVar3 != 0 && (int)uVar3 <= *param_2 * 4) {\n        uVar5 = (undefined1)((uint)param_2[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3));\n      }\n      *(undefined1 *)puVar4 = uVar5;\n      if (uVar3 == 0) {\n        return;\n      }\n    }" if (parenthesized_expression "((int)uVar3 < 0)" ( (binary_expression "(int)uVar3 < 0" (cast_expression "(int)uVar3" ( (type_descriptor "int" primitive_type) ) identifier) < number_literal) )) (compound_statement "{\n      *(undefined1 *)puVar4 = 0;\n    }" { (expression_statement "*(undefined1 *)puVar4 = 0;" (assignment_expression "*(undefined1 *)puVar4 = 0" (pointer_expression "*(undefined1 *)puVar4" * (cast_expression "(undefined1 *)puVar4" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) = number_literal) ;) }) (else_clause "else {\n      uVar5 = 0;\n      if (*param_2 * 4 - uVar3 != 0 && (int)uVar3 <= *param_2 * 4) {\n        uVar5 = (undefined1)((uint)param_2[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3));\n      }\n      *(undefined1 *)puVar4 = uVar5;\n      if (uVar3 == 0) {\n        return;\n      }\n    }" else (compound_statement "{\n      uVar5 = 0;\n      if (*param_2 * 4 - uVar3 != 0 && (int)uVar3 <= *param_2 * 4) {\n        uVar5 = (undefined1)((uint)param_2[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3));\n      }\n      *(undefined1 *)puVar4 = uVar5;\n      if (uVar3 == 0) {\n        return;\n      }\n    }" { (expression_statement "uVar5 = 0;" (assignment_expression "uVar5 = 0" identifier = number_literal) ;) (if_statement "if (*param_2 * 4 - uVar3 != 0 && (int)uVar3 <= *param_2 * 4) {\n        uVar5 = (undefined1)((uint)param_2[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3));\n      }" if (parenthesized_expression "(*param_2 * 4 - uVar3 != 0 && (int)uVar3 <= *param_2 * 4)" ( (binary_expression "*param_2 * 4 - uVar3 != 0 && (int)uVar3 <= *param_2 * 4" (binary_expression "*param_2 * 4 - uVar3 != 0" (binary_expression "*param_2 * 4 - uVar3" (binary_expression "*param_2 * 4" (pointer_expression "*param_2" * identifier) * number_literal) - identifier) != number_literal) && (binary_expression "(int)uVar3 <= *param_2 * 4" (cast_expression "(int)uVar3" ( (type_descriptor "int" primitive_type) ) identifier) <= (binary_expression "*param_2 * 4" (pointer_expression "*param_2" * identifier) * number_literal))) )) (compound_statement "{\n        uVar5 = (undefined1)((uint)param_2[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3));\n      }" { (expression_statement "uVar5 = (undefined1)((uint)param_2[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3));" (assignment_expression "uVar5 = (undefined1)((uint)param_2[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3))" identifier = (call_expression "(undefined1)((uint)param_2[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3))" (parenthesized_expression "(undefined1)" ( identifier )) (argument_list "((uint)param_2[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3))" ( (binary_expression "(uint)param_2[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3)" (cast_expression "(uint)param_2[((int)uVar3 >> 2) + 1]" ( (type_descriptor "uint" type_identifier) ) (subscript_expression "param_2[((int)uVar3 >> 2) + 1]" identifier [ (binary_expression "((int)uVar3 >> 2) + 1" (parenthesized_expression "((int)uVar3 >> 2)" ( (binary_expression "(int)uVar3 >> 2" (cast_expression "(int)uVar3" ( (type_descriptor "int" primitive_type) ) identifier) >> number_literal) )) + number_literal) ])) >> (call_expression "(sbyte)((uVar3 & 3) << 3)" (parenthesized_expression "(sbyte)" ( identifier )) (argument_list "((uVar3 & 3) << 3)" ( (binary_expression "(uVar3 & 3) << 3" (parenthesized_expression "(uVar3 & 3)" ( (binary_expression "uVar3 & 3" identifier & number_literal) )) << number_literal) )))) )))) ;) })) (expression_statement "*(undefined1 *)puVar4 = uVar5;" (assignment_expression "*(undefined1 *)puVar4 = uVar5" (pointer_expression "*(undefined1 *)puVar4" * (cast_expression "(undefined1 *)puVar4" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) = identifier) ;) (if_statement "if (uVar3 == 0) {\n        return;\n      }" if (parenthesized_expression "(uVar3 == 0)" ( (binary_expression "uVar3 == 0" identifier == number_literal) )) (compound_statement "{\n        return;\n      }" { (return_statement "return;" return ;) })) }))) (expression_statement "uVar3 = uVar3 - 1;" (assignment_expression "uVar3 = uVar3 - 1" identifier = (binary_expression "uVar3 - 1" identifier - number_literal)) ;) (expression_statement "puVar4 = (ushort *)((int)puVar4 + 1);" (assignment_expression "puVar4 = (ushort *)((int)puVar4 + 1)" identifier = (cast_expression "(ushort *)((int)puVar4 + 1)" ( (type_descriptor "ushort *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)puVar4 + 1)" ( (binary_expression "(int)puVar4 + 1" (cast_expression "(int)puVar4" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) )))) ;) }) while (parenthesized_expression "( true )" ( true )) ;) })))
(translation_unit "/* WARNING: Unknown calling convention */\n\nint ssh1_write_bignum(void *data,Bignum_conflict bn)\n\n{\n  int iVar1;\n  int iVar2;\n  uint uVar3;\n  undefined1 *puVar4;\n  undefined1 uVar5;\n  int iVar6;\n  \n  iVar1 = ssh1_bignum_length(bn);\n  iVar2 = *bn * 0x20;\n  iVar6 = iVar2 + -1;\n  if ((-1 < iVar6) && (-1 < (int)bn[(iVar6 >> 5) + 1])) {\n    do {\n      iVar2 = iVar6;\n      iVar6 = iVar2 + -1;\n      if (iVar6 == -1) break;\n    } while (bn[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f) == 0);\n  }\n  uVar3 = iVar1 - 3;\n  *(ushort *)data = (ushort)iVar2 << 8 | (ushort)iVar2 >> 8;\n  puVar4 = (undefined1 *)((int)data + 2);\n  if (iVar1 == 2) {\n    return 2;\n  }\n  do {\n    if ((int)uVar3 < 0) {\n      *puVar4 = 0;\n    }\n    else {\n      uVar5 = 0;\n      if (*bn * 4 - uVar3 != 0 && (int)uVar3 <= (int)(*bn * 4)) {\n        uVar5 = (undefined1)(bn[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3));\n      }\n      *puVar4 = uVar5;\n      if (uVar3 == 0) {\n        return iVar1;\n      }\n    }\n    uVar3 = uVar3 - 1;\n    puVar4 = puVar4 + 1;\n  } while( true );\n}\n\n" comment (function_definition "int ssh1_write_bignum(void *data,Bignum_conflict bn)\n\n{\n  int iVar1;\n  int iVar2;\n  uint uVar3;\n  undefined1 *puVar4;\n  undefined1 uVar5;\n  int iVar6;\n  \n  iVar1 = ssh1_bignum_length(bn);\n  iVar2 = *bn * 0x20;\n  iVar6 = iVar2 + -1;\n  if ((-1 < iVar6) && (-1 < (int)bn[(iVar6 >> 5) + 1])) {\n    do {\n      iVar2 = iVar6;\n      iVar6 = iVar2 + -1;\n      if (iVar6 == -1) break;\n    } while (bn[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f) == 0);\n  }\n  uVar3 = iVar1 - 3;\n  *(ushort *)data = (ushort)iVar2 << 8 | (ushort)iVar2 >> 8;\n  puVar4 = (undefined1 *)((int)data + 2);\n  if (iVar1 == 2) {\n    return 2;\n  }\n  do {\n    if ((int)uVar3 < 0) {\n      *puVar4 = 0;\n    }\n    else {\n      uVar5 = 0;\n      if (*bn * 4 - uVar3 != 0 && (int)uVar3 <= (int)(*bn * 4)) {\n        uVar5 = (undefined1)(bn[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3));\n      }\n      *puVar4 = uVar5;\n      if (uVar3 == 0) {\n        return iVar1;\n      }\n    }\n    uVar3 = uVar3 - 1;\n    puVar4 = puVar4 + 1;\n  } while( true );\n}" primitive_type (function_declarator "ssh1_write_bignum(void *data,Bignum_conflict bn)" identifier (parameter_list "(void *data,Bignum_conflict bn)" ( (parameter_declaration "void *data" primitive_type (pointer_declarator "*data" * identifier)) , (parameter_declaration "Bignum_conflict bn" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  uint uVar3;\n  undefined1 *puVar4;\n  undefined1 uVar5;\n  int iVar6;\n  \n  iVar1 = ssh1_bignum_length(bn);\n  iVar2 = *bn * 0x20;\n  iVar6 = iVar2 + -1;\n  if ((-1 < iVar6) && (-1 < (int)bn[(iVar6 >> 5) + 1])) {\n    do {\n      iVar2 = iVar6;\n      iVar6 = iVar2 + -1;\n      if (iVar6 == -1) break;\n    } while (bn[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f) == 0);\n  }\n  uVar3 = iVar1 - 3;\n  *(ushort *)data = (ushort)iVar2 << 8 | (ushort)iVar2 >> 8;\n  puVar4 = (undefined1 *)((int)data + 2);\n  if (iVar1 == 2) {\n    return 2;\n  }\n  do {\n    if ((int)uVar3 < 0) {\n      *puVar4 = 0;\n    }\n    else {\n      uVar5 = 0;\n      if (*bn * 4 - uVar3 != 0 && (int)uVar3 <= (int)(*bn * 4)) {\n        uVar5 = (undefined1)(bn[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3));\n      }\n      *puVar4 = uVar5;\n      if (uVar3 == 0) {\n        return iVar1;\n      }\n    }\n    uVar3 = uVar3 - 1;\n    puVar4 = puVar4 + 1;\n  } while( true );\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "uint uVar3;" type_identifier identifier ;) (declaration "undefined1 *puVar4;" type_identifier (pointer_declarator "*puVar4" * identifier) ;) (declaration "undefined1 uVar5;" type_identifier identifier ;) (declaration "int iVar6;" primitive_type identifier ;) (expression_statement "iVar1 = ssh1_bignum_length(bn);" (assignment_expression "iVar1 = ssh1_bignum_length(bn)" identifier = (call_expression "ssh1_bignum_length(bn)" identifier (argument_list "(bn)" ( identifier )))) ;) (expression_statement "iVar2 = *bn * 0x20;" (assignment_expression "iVar2 = *bn * 0x20" identifier = (binary_expression "*bn * 0x20" (pointer_expression "*bn" * identifier) * number_literal)) ;) (expression_statement "iVar6 = iVar2 + -1;" (assignment_expression "iVar6 = iVar2 + -1" identifier = (binary_expression "iVar2 + -1" identifier + number_literal)) ;) (if_statement "if ((-1 < iVar6) && (-1 < (int)bn[(iVar6 >> 5) + 1])) {\n    do {\n      iVar2 = iVar6;\n      iVar6 = iVar2 + -1;\n      if (iVar6 == -1) break;\n    } while (bn[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f) == 0);\n  }" if (parenthesized_expression "((-1 < iVar6) && (-1 < (int)bn[(iVar6 >> 5) + 1]))" ( (binary_expression "(-1 < iVar6) && (-1 < (int)bn[(iVar6 >> 5) + 1])" (parenthesized_expression "(-1 < iVar6)" ( (binary_expression "-1 < iVar6" number_literal < identifier) )) && (parenthesized_expression "(-1 < (int)bn[(iVar6 >> 5) + 1])" ( (binary_expression "-1 < (int)bn[(iVar6 >> 5) + 1]" number_literal < (cast_expression "(int)bn[(iVar6 >> 5) + 1]" ( (type_descriptor "int" primitive_type) ) (subscript_expression "bn[(iVar6 >> 5) + 1]" identifier [ (binary_expression "(iVar6 >> 5) + 1" (parenthesized_expression "(iVar6 >> 5)" ( (binary_expression "iVar6 >> 5" identifier >> number_literal) )) + number_literal) ]))) ))) )) (compound_statement "{\n    do {\n      iVar2 = iVar6;\n      iVar6 = iVar2 + -1;\n      if (iVar6 == -1) break;\n    } while (bn[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f) == 0);\n  }" { (do_statement "do {\n      iVar2 = iVar6;\n      iVar6 = iVar2 + -1;\n      if (iVar6 == -1) break;\n    } while (bn[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f) == 0);" do (compound_statement "{\n      iVar2 = iVar6;\n      iVar6 = iVar2 + -1;\n      if (iVar6 == -1) break;\n    }" { (expression_statement "iVar2 = iVar6;" (assignment_expression "iVar2 = iVar6" identifier = identifier) ;) (expression_statement "iVar6 = iVar2 + -1;" (assignment_expression "iVar6 = iVar2 + -1" identifier = (binary_expression "iVar2 + -1" identifier + number_literal)) ;) (if_statement "if (iVar6 == -1) break;" if (parenthesized_expression "(iVar6 == -1)" ( (binary_expression "iVar6 == -1" identifier == number_literal) )) (break_statement "break;" break ;)) }) while (parenthesized_expression "(bn[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f) == 0)" ( (binary_expression "bn[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f) == 0" (binary_expression "bn[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f)" (subscript_expression "bn[(iVar6 >> 5) + 1]" identifier [ (binary_expression "(iVar6 >> 5) + 1" (parenthesized_expression "(iVar6 >> 5)" ( (binary_expression "iVar6 >> 5" identifier >> number_literal) )) + number_literal) ]) >> (parenthesized_expression "((byte)iVar6 & 0x1f)" ( (binary_expression "(byte)iVar6 & 0x1f" (cast_expression "(byte)iVar6" ( (type_descriptor "byte" type_identifier) ) identifier) & number_literal) ))) == number_literal) )) ;) })) (expression_statement "uVar3 = iVar1 - 3;" (assignment_expression "uVar3 = iVar1 - 3" identifier = (binary_expression "iVar1 - 3" identifier - number_literal)) ;) (expression_statement "*(ushort *)data = (ushort)iVar2 << 8 | (ushort)iVar2 >> 8;" (assignment_expression "*(ushort *)data = (ushort)iVar2 << 8 | (ushort)iVar2 >> 8" (pointer_expression "*(ushort *)data" * (cast_expression "(ushort *)data" ( (type_descriptor "ushort *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) = (binary_expression "(ushort)iVar2 << 8 | (ushort)iVar2 >> 8" (binary_expression "(ushort)iVar2 << 8" (cast_expression "(ushort)iVar2" ( (type_descriptor "ushort" type_identifier) ) identifier) << number_literal) | (binary_expression "(ushort)iVar2 >> 8" (cast_expression "(ushort)iVar2" ( (type_descriptor "ushort" type_identifier) ) identifier) >> number_literal))) ;) (expression_statement "puVar4 = (undefined1 *)((int)data + 2);" (assignment_expression "puVar4 = (undefined1 *)((int)data + 2)" identifier = (cast_expression "(undefined1 *)((int)data + 2)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)data + 2)" ( (binary_expression "(int)data + 2" (cast_expression "(int)data" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) )))) ;) (if_statement "if (iVar1 == 2) {\n    return 2;\n  }" if (parenthesized_expression "(iVar1 == 2)" ( (binary_expression "iVar1 == 2" identifier == number_literal) )) (compound_statement "{\n    return 2;\n  }" { (return_statement "return 2;" return number_literal ;) })) (do_statement "do {\n    if ((int)uVar3 < 0) {\n      *puVar4 = 0;\n    }\n    else {\n      uVar5 = 0;\n      if (*bn * 4 - uVar3 != 0 && (int)uVar3 <= (int)(*bn * 4)) {\n        uVar5 = (undefined1)(bn[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3));\n      }\n      *puVar4 = uVar5;\n      if (uVar3 == 0) {\n        return iVar1;\n      }\n    }\n    uVar3 = uVar3 - 1;\n    puVar4 = puVar4 + 1;\n  } while( true );" do (compound_statement "{\n    if ((int)uVar3 < 0) {\n      *puVar4 = 0;\n    }\n    else {\n      uVar5 = 0;\n      if (*bn * 4 - uVar3 != 0 && (int)uVar3 <= (int)(*bn * 4)) {\n        uVar5 = (undefined1)(bn[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3));\n      }\n      *puVar4 = uVar5;\n      if (uVar3 == 0) {\n        return iVar1;\n      }\n    }\n    uVar3 = uVar3 - 1;\n    puVar4 = puVar4 + 1;\n  }" { (if_statement "if ((int)uVar3 < 0) {\n      *puVar4 = 0;\n    }\n    else {\n      uVar5 = 0;\n      if (*bn * 4 - uVar3 != 0 && (int)uVar3 <= (int)(*bn * 4)) {\n        uVar5 = (undefined1)(bn[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3));\n      }\n      *puVar4 = uVar5;\n      if (uVar3 == 0) {\n        return iVar1;\n      }\n    }" if (parenthesized_expression "((int)uVar3 < 0)" ( (binary_expression "(int)uVar3 < 0" (cast_expression "(int)uVar3" ( (type_descriptor "int" primitive_type) ) identifier) < number_literal) )) (compound_statement "{\n      *puVar4 = 0;\n    }" { (expression_statement "*puVar4 = 0;" (assignment_expression "*puVar4 = 0" (pointer_expression "*puVar4" * identifier) = number_literal) ;) }) (else_clause "else {\n      uVar5 = 0;\n      if (*bn * 4 - uVar3 != 0 && (int)uVar3 <= (int)(*bn * 4)) {\n        uVar5 = (undefined1)(bn[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3));\n      }\n      *puVar4 = uVar5;\n      if (uVar3 == 0) {\n        return iVar1;\n      }\n    }" else (compound_statement "{\n      uVar5 = 0;\n      if (*bn * 4 - uVar3 != 0 && (int)uVar3 <= (int)(*bn * 4)) {\n        uVar5 = (undefined1)(bn[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3));\n      }\n      *puVar4 = uVar5;\n      if (uVar3 == 0) {\n        return iVar1;\n      }\n    }" { (expression_statement "uVar5 = 0;" (assignment_expression "uVar5 = 0" identifier = number_literal) ;) (if_statement "if (*bn * 4 - uVar3 != 0 && (int)uVar3 <= (int)(*bn * 4)) {\n        uVar5 = (undefined1)(bn[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3));\n      }" if (parenthesized_expression "(*bn * 4 - uVar3 != 0 && (int)uVar3 <= (int)(*bn * 4))" ( (binary_expression "*bn * 4 - uVar3 != 0 && (int)uVar3 <= (int)(*bn * 4)" (binary_expression "*bn * 4 - uVar3 != 0" (binary_expression "*bn * 4 - uVar3" (binary_expression "*bn * 4" (pointer_expression "*bn" * identifier) * number_literal) - identifier) != number_literal) && (binary_expression "(int)uVar3 <= (int)(*bn * 4)" (cast_expression "(int)uVar3" ( (type_descriptor "int" primitive_type) ) identifier) <= (cast_expression "(int)(*bn * 4)" ( (type_descriptor "int" primitive_type) ) (parenthesized_expression "(*bn * 4)" ( (binary_expression "*bn * 4" (pointer_expression "*bn" * identifier) * number_literal) ))))) )) (compound_statement "{\n        uVar5 = (undefined1)(bn[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3));\n      }" { (expression_statement "uVar5 = (undefined1)(bn[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3));" (assignment_expression "uVar5 = (undefined1)(bn[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3))" identifier = (call_expression "(undefined1)(bn[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3))" (parenthesized_expression "(undefined1)" ( identifier )) (argument_list "(bn[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3))" ( (binary_expression "bn[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3)" (subscript_expression "bn[((int)uVar3 >> 2) + 1]" identifier [ (binary_expression "((int)uVar3 >> 2) + 1" (parenthesized_expression "((int)uVar3 >> 2)" ( (binary_expression "(int)uVar3 >> 2" (cast_expression "(int)uVar3" ( (type_descriptor "int" primitive_type) ) identifier) >> number_literal) )) + number_literal) ]) >> (call_expression "(sbyte)((uVar3 & 3) << 3)" (parenthesized_expression "(sbyte)" ( identifier )) (argument_list "((uVar3 & 3) << 3)" ( (binary_expression "(uVar3 & 3) << 3" (parenthesized_expression "(uVar3 & 3)" ( (binary_expression "uVar3 & 3" identifier & number_literal) )) << number_literal) )))) )))) ;) })) (expression_statement "*puVar4 = uVar5;" (assignment_expression "*puVar4 = uVar5" (pointer_expression "*puVar4" * identifier) = identifier) ;) (if_statement "if (uVar3 == 0) {\n        return iVar1;\n      }" if (parenthesized_expression "(uVar3 == 0)" ( (binary_expression "uVar3 == 0" identifier == number_literal) )) (compound_statement "{\n        return iVar1;\n      }" { (return_statement "return iVar1;" return identifier ;) })) }))) (expression_statement "uVar3 = uVar3 - 1;" (assignment_expression "uVar3 = uVar3 - 1" identifier = (binary_expression "uVar3 - 1" identifier - number_literal)) ;) (expression_statement "puVar4 = puVar4 + 1;" (assignment_expression "puVar4 = puVar4 + 1" identifier = (binary_expression "puVar4 + 1" identifier + number_literal)) ;) }) while (parenthesized_expression "( true )" ( true )) ;) })))
(translation_unit "void FUN_00028d30(ushort *param_1,int *param_2)\n\n{\n  int iVar1;\n  int iVar2;\n  uint uVar3;\n  ushort *puVar4;\n  undefined1 uVar5;\n  int iVar6;\n  \n  iVar1 = FUN_00028b50(param_2);\n  iVar2 = *param_2 * 0x20;\n  iVar6 = iVar2 + -1;\n  if ((-1 < iVar6) && (-1 < param_2[(iVar6 >> 5) + 1])) {\n    do {\n      iVar2 = iVar6;\n      iVar6 = iVar2 + -1;\n      if (iVar6 == -1) break;\n    } while ((uint)param_2[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f) == 0);\n  }\n  uVar3 = iVar1 - 3;\n  *param_1 = (ushort)iVar2 << 8 | (ushort)iVar2 >> 8;\n  puVar4 = param_1 + 1;\n  if (iVar1 == 2) {\n    return;\n  }\n  do {\n    if ((int)uVar3 < 0) {\n      *(undefined1 *)puVar4 = 0;\n    }\n    else {\n      uVar5 = 0;\n      if (*param_2 * 4 - uVar3 != 0 && (int)uVar3 <= *param_2 * 4) {\n        uVar5 = (undefined1)((uint)param_2[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3));\n      }\n      *(undefined1 *)puVar4 = uVar5;\n      if (uVar3 == 0) {\n        return;\n      }\n    }\n    uVar3 = uVar3 - 1;\n    puVar4 = (ushort *)((int)puVar4 + 1);\n  } while( true );\n}\n\n" (function_definition "void FUN_00028d30(ushort *param_1,int *param_2)\n\n{\n  int iVar1;\n  int iVar2;\n  uint uVar3;\n  ushort *puVar4;\n  undefined1 uVar5;\n  int iVar6;\n  \n  iVar1 = FUN_00028b50(param_2);\n  iVar2 = *param_2 * 0x20;\n  iVar6 = iVar2 + -1;\n  if ((-1 < iVar6) && (-1 < param_2[(iVar6 >> 5) + 1])) {\n    do {\n      iVar2 = iVar6;\n      iVar6 = iVar2 + -1;\n      if (iVar6 == -1) break;\n    } while ((uint)param_2[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f) == 0);\n  }\n  uVar3 = iVar1 - 3;\n  *param_1 = (ushort)iVar2 << 8 | (ushort)iVar2 >> 8;\n  puVar4 = param_1 + 1;\n  if (iVar1 == 2) {\n    return;\n  }\n  do {\n    if ((int)uVar3 < 0) {\n      *(undefined1 *)puVar4 = 0;\n    }\n    else {\n      uVar5 = 0;\n      if (*param_2 * 4 - uVar3 != 0 && (int)uVar3 <= *param_2 * 4) {\n        uVar5 = (undefined1)((uint)param_2[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3));\n      }\n      *(undefined1 *)puVar4 = uVar5;\n      if (uVar3 == 0) {\n        return;\n      }\n    }\n    uVar3 = uVar3 - 1;\n    puVar4 = (ushort *)((int)puVar4 + 1);\n  } while( true );\n}" primitive_type (function_declarator "FUN_00028d30(ushort *param_1,int *param_2)" identifier (parameter_list "(ushort *param_1,int *param_2)" ( (parameter_declaration "ushort *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  uint uVar3;\n  ushort *puVar4;\n  undefined1 uVar5;\n  int iVar6;\n  \n  iVar1 = FUN_00028b50(param_2);\n  iVar2 = *param_2 * 0x20;\n  iVar6 = iVar2 + -1;\n  if ((-1 < iVar6) && (-1 < param_2[(iVar6 >> 5) + 1])) {\n    do {\n      iVar2 = iVar6;\n      iVar6 = iVar2 + -1;\n      if (iVar6 == -1) break;\n    } while ((uint)param_2[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f) == 0);\n  }\n  uVar3 = iVar1 - 3;\n  *param_1 = (ushort)iVar2 << 8 | (ushort)iVar2 >> 8;\n  puVar4 = param_1 + 1;\n  if (iVar1 == 2) {\n    return;\n  }\n  do {\n    if ((int)uVar3 < 0) {\n      *(undefined1 *)puVar4 = 0;\n    }\n    else {\n      uVar5 = 0;\n      if (*param_2 * 4 - uVar3 != 0 && (int)uVar3 <= *param_2 * 4) {\n        uVar5 = (undefined1)((uint)param_2[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3));\n      }\n      *(undefined1 *)puVar4 = uVar5;\n      if (uVar3 == 0) {\n        return;\n      }\n    }\n    uVar3 = uVar3 - 1;\n    puVar4 = (ushort *)((int)puVar4 + 1);\n  } while( true );\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "uint uVar3;" type_identifier identifier ;) (declaration "ushort *puVar4;" type_identifier (pointer_declarator "*puVar4" * identifier) ;) (declaration "undefined1 uVar5;" type_identifier identifier ;) (declaration "int iVar6;" primitive_type identifier ;) (expression_statement "iVar1 = FUN_00028b50(param_2);" (assignment_expression "iVar1 = FUN_00028b50(param_2)" identifier = (call_expression "FUN_00028b50(param_2)" identifier (argument_list "(param_2)" ( identifier )))) ;) (expression_statement "iVar2 = *param_2 * 0x20;" (assignment_expression "iVar2 = *param_2 * 0x20" identifier = (binary_expression "*param_2 * 0x20" (pointer_expression "*param_2" * identifier) * number_literal)) ;) (expression_statement "iVar6 = iVar2 + -1;" (assignment_expression "iVar6 = iVar2 + -1" identifier = (binary_expression "iVar2 + -1" identifier + number_literal)) ;) (if_statement "if ((-1 < iVar6) && (-1 < param_2[(iVar6 >> 5) + 1])) {\n    do {\n      iVar2 = iVar6;\n      iVar6 = iVar2 + -1;\n      if (iVar6 == -1) break;\n    } while ((uint)param_2[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f) == 0);\n  }" if (parenthesized_expression "((-1 < iVar6) && (-1 < param_2[(iVar6 >> 5) + 1]))" ( (binary_expression "(-1 < iVar6) && (-1 < param_2[(iVar6 >> 5) + 1])" (parenthesized_expression "(-1 < iVar6)" ( (binary_expression "-1 < iVar6" number_literal < identifier) )) && (parenthesized_expression "(-1 < param_2[(iVar6 >> 5) + 1])" ( (binary_expression "-1 < param_2[(iVar6 >> 5) + 1]" number_literal < (subscript_expression "param_2[(iVar6 >> 5) + 1]" identifier [ (binary_expression "(iVar6 >> 5) + 1" (parenthesized_expression "(iVar6 >> 5)" ( (binary_expression "iVar6 >> 5" identifier >> number_literal) )) + number_literal) ])) ))) )) (compound_statement "{\n    do {\n      iVar2 = iVar6;\n      iVar6 = iVar2 + -1;\n      if (iVar6 == -1) break;\n    } while ((uint)param_2[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f) == 0);\n  }" { (do_statement "do {\n      iVar2 = iVar6;\n      iVar6 = iVar2 + -1;\n      if (iVar6 == -1) break;\n    } while ((uint)param_2[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f) == 0);" do (compound_statement "{\n      iVar2 = iVar6;\n      iVar6 = iVar2 + -1;\n      if (iVar6 == -1) break;\n    }" { (expression_statement "iVar2 = iVar6;" (assignment_expression "iVar2 = iVar6" identifier = identifier) ;) (expression_statement "iVar6 = iVar2 + -1;" (assignment_expression "iVar6 = iVar2 + -1" identifier = (binary_expression "iVar2 + -1" identifier + number_literal)) ;) (if_statement "if (iVar6 == -1) break;" if (parenthesized_expression "(iVar6 == -1)" ( (binary_expression "iVar6 == -1" identifier == number_literal) )) (break_statement "break;" break ;)) }) while (parenthesized_expression "((uint)param_2[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f) == 0)" ( (binary_expression "(uint)param_2[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f) == 0" (binary_expression "(uint)param_2[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f)" (cast_expression "(uint)param_2[(iVar6 >> 5) + 1]" ( (type_descriptor "uint" type_identifier) ) (subscript_expression "param_2[(iVar6 >> 5) + 1]" identifier [ (binary_expression "(iVar6 >> 5) + 1" (parenthesized_expression "(iVar6 >> 5)" ( (binary_expression "iVar6 >> 5" identifier >> number_literal) )) + number_literal) ])) >> (parenthesized_expression "((byte)iVar6 & 0x1f)" ( (binary_expression "(byte)iVar6 & 0x1f" (cast_expression "(byte)iVar6" ( (type_descriptor "byte" type_identifier) ) identifier) & number_literal) ))) == number_literal) )) ;) })) (expression_statement "uVar3 = iVar1 - 3;" (assignment_expression "uVar3 = iVar1 - 3" identifier = (binary_expression "iVar1 - 3" identifier - number_literal)) ;) (expression_statement "*param_1 = (ushort)iVar2 << 8 | (ushort)iVar2 >> 8;" (assignment_expression "*param_1 = (ushort)iVar2 << 8 | (ushort)iVar2 >> 8" (pointer_expression "*param_1" * identifier) = (binary_expression "(ushort)iVar2 << 8 | (ushort)iVar2 >> 8" (binary_expression "(ushort)iVar2 << 8" (cast_expression "(ushort)iVar2" ( (type_descriptor "ushort" type_identifier) ) identifier) << number_literal) | (binary_expression "(ushort)iVar2 >> 8" (cast_expression "(ushort)iVar2" ( (type_descriptor "ushort" type_identifier) ) identifier) >> number_literal))) ;) (expression_statement "puVar4 = param_1 + 1;" (assignment_expression "puVar4 = param_1 + 1" identifier = (binary_expression "param_1 + 1" identifier + number_literal)) ;) (if_statement "if (iVar1 == 2) {\n    return;\n  }" if (parenthesized_expression "(iVar1 == 2)" ( (binary_expression "iVar1 == 2" identifier == number_literal) )) (compound_statement "{\n    return;\n  }" { (return_statement "return;" return ;) })) (do_statement "do {\n    if ((int)uVar3 < 0) {\n      *(undefined1 *)puVar4 = 0;\n    }\n    else {\n      uVar5 = 0;\n      if (*param_2 * 4 - uVar3 != 0 && (int)uVar3 <= *param_2 * 4) {\n        uVar5 = (undefined1)((uint)param_2[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3));\n      }\n      *(undefined1 *)puVar4 = uVar5;\n      if (uVar3 == 0) {\n        return;\n      }\n    }\n    uVar3 = uVar3 - 1;\n    puVar4 = (ushort *)((int)puVar4 + 1);\n  } while( true );" do (compound_statement "{\n    if ((int)uVar3 < 0) {\n      *(undefined1 *)puVar4 = 0;\n    }\n    else {\n      uVar5 = 0;\n      if (*param_2 * 4 - uVar3 != 0 && (int)uVar3 <= *param_2 * 4) {\n        uVar5 = (undefined1)((uint)param_2[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3));\n      }\n      *(undefined1 *)puVar4 = uVar5;\n      if (uVar3 == 0) {\n        return;\n      }\n    }\n    uVar3 = uVar3 - 1;\n    puVar4 = (ushort *)((int)puVar4 + 1);\n  }" { (if_statement "if ((int)uVar3 < 0) {\n      *(undefined1 *)puVar4 = 0;\n    }\n    else {\n      uVar5 = 0;\n      if (*param_2 * 4 - uVar3 != 0 && (int)uVar3 <= *param_2 * 4) {\n        uVar5 = (undefined1)((uint)param_2[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3));\n      }\n      *(undefined1 *)puVar4 = uVar5;\n      if (uVar3 == 0) {\n        return;\n      }\n    }" if (parenthesized_expression "((int)uVar3 < 0)" ( (binary_expression "(int)uVar3 < 0" (cast_expression "(int)uVar3" ( (type_descriptor "int" primitive_type) ) identifier) < number_literal) )) (compound_statement "{\n      *(undefined1 *)puVar4 = 0;\n    }" { (expression_statement "*(undefined1 *)puVar4 = 0;" (assignment_expression "*(undefined1 *)puVar4 = 0" (pointer_expression "*(undefined1 *)puVar4" * (cast_expression "(undefined1 *)puVar4" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) = number_literal) ;) }) (else_clause "else {\n      uVar5 = 0;\n      if (*param_2 * 4 - uVar3 != 0 && (int)uVar3 <= *param_2 * 4) {\n        uVar5 = (undefined1)((uint)param_2[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3));\n      }\n      *(undefined1 *)puVar4 = uVar5;\n      if (uVar3 == 0) {\n        return;\n      }\n    }" else (compound_statement "{\n      uVar5 = 0;\n      if (*param_2 * 4 - uVar3 != 0 && (int)uVar3 <= *param_2 * 4) {\n        uVar5 = (undefined1)((uint)param_2[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3));\n      }\n      *(undefined1 *)puVar4 = uVar5;\n      if (uVar3 == 0) {\n        return;\n      }\n    }" { (expression_statement "uVar5 = 0;" (assignment_expression "uVar5 = 0" identifier = number_literal) ;) (if_statement "if (*param_2 * 4 - uVar3 != 0 && (int)uVar3 <= *param_2 * 4) {\n        uVar5 = (undefined1)((uint)param_2[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3));\n      }" if (parenthesized_expression "(*param_2 * 4 - uVar3 != 0 && (int)uVar3 <= *param_2 * 4)" ( (binary_expression "*param_2 * 4 - uVar3 != 0 && (int)uVar3 <= *param_2 * 4" (binary_expression "*param_2 * 4 - uVar3 != 0" (binary_expression "*param_2 * 4 - uVar3" (binary_expression "*param_2 * 4" (pointer_expression "*param_2" * identifier) * number_literal) - identifier) != number_literal) && (binary_expression "(int)uVar3 <= *param_2 * 4" (cast_expression "(int)uVar3" ( (type_descriptor "int" primitive_type) ) identifier) <= (binary_expression "*param_2 * 4" (pointer_expression "*param_2" * identifier) * number_literal))) )) (compound_statement "{\n        uVar5 = (undefined1)((uint)param_2[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3));\n      }" { (expression_statement "uVar5 = (undefined1)((uint)param_2[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3));" (assignment_expression "uVar5 = (undefined1)((uint)param_2[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3))" identifier = (call_expression "(undefined1)((uint)param_2[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3))" (parenthesized_expression "(undefined1)" ( identifier )) (argument_list "((uint)param_2[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3))" ( (binary_expression "(uint)param_2[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3)" (cast_expression "(uint)param_2[((int)uVar3 >> 2) + 1]" ( (type_descriptor "uint" type_identifier) ) (subscript_expression "param_2[((int)uVar3 >> 2) + 1]" identifier [ (binary_expression "((int)uVar3 >> 2) + 1" (parenthesized_expression "((int)uVar3 >> 2)" ( (binary_expression "(int)uVar3 >> 2" (cast_expression "(int)uVar3" ( (type_descriptor "int" primitive_type) ) identifier) >> number_literal) )) + number_literal) ])) >> (call_expression "(sbyte)((uVar3 & 3) << 3)" (parenthesized_expression "(sbyte)" ( identifier )) (argument_list "((uVar3 & 3) << 3)" ( (binary_expression "(uVar3 & 3) << 3" (parenthesized_expression "(uVar3 & 3)" ( (binary_expression "uVar3 & 3" identifier & number_literal) )) << number_literal) )))) )))) ;) })) (expression_statement "*(undefined1 *)puVar4 = uVar5;" (assignment_expression "*(undefined1 *)puVar4 = uVar5" (pointer_expression "*(undefined1 *)puVar4" * (cast_expression "(undefined1 *)puVar4" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) = identifier) ;) (if_statement "if (uVar3 == 0) {\n        return;\n      }" if (parenthesized_expression "(uVar3 == 0)" ( (binary_expression "uVar3 == 0" identifier == number_literal) )) (compound_statement "{\n        return;\n      }" { (return_statement "return;" return ;) })) }))) (expression_statement "uVar3 = uVar3 - 1;" (assignment_expression "uVar3 = uVar3 - 1" identifier = (binary_expression "uVar3 - 1" identifier - number_literal)) ;) (expression_statement "puVar4 = (ushort *)((int)puVar4 + 1);" (assignment_expression "puVar4 = (ushort *)((int)puVar4 + 1)" identifier = (cast_expression "(ushort *)((int)puVar4 + 1)" ( (type_descriptor "ushort *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)puVar4 + 1)" ( (binary_expression "(int)puVar4 + 1" (cast_expression "(int)puVar4" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) )))) ;) }) while (parenthesized_expression "( true )" ( true )) ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE (pointer_declarator * IDENT)) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (expression_statement (assignment_expression IDENT = (binary_expression (pointer_expression * IDENT) * LIT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression LIT < IDENT) )) && (parenthesized_expression ( (binary_expression LIT < (subscript_expression IDENT [ (binary_expression (parenthesized_expression ( (binary_expression IDENT >> LIT) )) + LIT) ])) ))) )) (compound_statement { (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (break_statement break ;)) }) while (parenthesized_expression ( (binary_expression (binary_expression (cast_expression ( (type_descriptor TYPE) ) (subscript_expression IDENT [ (binary_expression (parenthesized_expression ( (binary_expression IDENT >> LIT) )) + LIT) ])) >> (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) & LIT) ))) == LIT) )) ;) })) (expression_statement (assignment_expression IDENT = (binary_expression IDENT - LIT)) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = (binary_expression (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) << LIT) | (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) >> LIT))) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (return_statement return ;) })) (do_statement do (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) < LIT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) = LIT) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) (if_statement if (parenthesized_expression ( (binary_expression (binary_expression (binary_expression (binary_expression (pointer_expression * IDENT) * LIT) - IDENT) != LIT) && (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) <= (binary_expression (pointer_expression * IDENT) * LIT))) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( IDENT )) (argument_list ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) (subscript_expression IDENT [ (binary_expression (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) >> LIT) )) + LIT) ])) >> (call_expression (parenthesized_expression ( IDENT )) (argument_list ( (binary_expression (parenthesized_expression ( (binary_expression IDENT & LIT) )) << LIT) )))) )))) ;) })) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (return_statement return ;) })) }))) (expression_statement (assignment_expression IDENT = (binary_expression IDENT - LIT)) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) + LIT) )))) ;) }) while (parenthesized_expression ( BOOL )) ;) })))
(function_definition "void FUN_00028d30(ushort *param_1,int *param_2)\n\n{\n  int iVar1;\n  int iVar2;\n  uint uVar3;\n  ushort *puVar4;\n  undefined1 uVar5;\n  int iVar6;\n  \n  iVar1 = FUN_00028b50(param_2);\n  iVar2 = *param_2 * 0x20;\n  iVar6 = iVar2 + -1;\n  if ((-1 < iVar6) && (-1 < param_2[(iVar6 >> 5) + 1])) {\n    do {\n      iVar2 = iVar6;\n      iVar6 = iVar2 + -1;\n      if (iVar6 == -1) break;\n    } while ((uint)param_2[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f) == 0);\n  }\n  uVar3 = iVar1 - 3;\n  *param_1 = (ushort)iVar2 << 8 | (ushort)iVar2 >> 8;\n  puVar4 = param_1 + 1;\n  if (iVar1 == 2) {\n    return;\n  }\n  do {\n    if ((int)uVar3 < 0) {\n      *(undefined1 *)puVar4 = 0;\n    }\n    else {\n      uVar5 = 0;\n      if (*param_2 * 4 - uVar3 != 0 && (int)uVar3 <= *param_2 * 4) {\n        uVar5 = (undefined1)((uint)param_2[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3));\n      }\n      *(undefined1 *)puVar4 = uVar5;\n      if (uVar3 == 0) {\n        return;\n      }\n    }\n    uVar3 = uVar3 - 1;\n    puVar4 = (ushort *)((int)puVar4 + 1);\n  } while( true );\n}" (primitive_type "void") (function_declarator "FUN_00028d30(ushort *param_1,int *param_2)" (identifier "FUN_00028d30") (parameter_list "(ushort *param_1,int *param_2)" (( "(") (parameter_declaration "ushort *param_1" (type_identifier "ushort") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "int *param_2" (primitive_type "int") (pointer_declarator "*param_2" (* "*") (identifier "param_2"))) () ")"))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  uint uVar3;\n  ushort *puVar4;\n  undefined1 uVar5;\n  int iVar6;\n  \n  iVar1 = FUN_00028b50(param_2);\n  iVar2 = *param_2 * 0x20;\n  iVar6 = iVar2 + -1;\n  if ((-1 < iVar6) && (-1 < param_2[(iVar6 >> 5) + 1])) {\n    do {\n      iVar2 = iVar6;\n      iVar6 = iVar2 + -1;\n      if (iVar6 == -1) break;\n    } while ((uint)param_2[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f) == 0);\n  }\n  uVar3 = iVar1 - 3;\n  *param_1 = (ushort)iVar2 << 8 | (ushort)iVar2 >> 8;\n  puVar4 = param_1 + 1;\n  if (iVar1 == 2) {\n    return;\n  }\n  do {\n    if ((int)uVar3 < 0) {\n      *(undefined1 *)puVar4 = 0;\n    }\n    else {\n      uVar5 = 0;\n      if (*param_2 * 4 - uVar3 != 0 && (int)uVar3 <= *param_2 * 4) {\n        uVar5 = (undefined1)((uint)param_2[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3));\n      }\n      *(undefined1 *)puVar4 = uVar5;\n      if (uVar3 == 0) {\n        return;\n      }\n    }\n    uVar3 = uVar3 - 1;\n    puVar4 = (ushort *)((int)puVar4 + 1);\n  } while( true );\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "uint uVar3;" (type_identifier "uint") (identifier "uVar3") (; ";")) (declaration "ushort *puVar4;" (type_identifier "ushort") (pointer_declarator "*puVar4" (* "*") (identifier "puVar4")) (; ";")) (declaration "undefined1 uVar5;" (type_identifier "undefined1") (identifier "uVar5") (; ";")) (declaration "int iVar6;" (primitive_type "int") (identifier "iVar6") (; ";")) (expression_statement "iVar1 = FUN_00028b50(param_2);" (assignment_expression "iVar1 = FUN_00028b50(param_2)" (identifier "iVar1") (= "=") (call_expression "FUN_00028b50(param_2)" (identifier "FUN_00028b50") (argument_list "(param_2)" (( "(") (identifier "param_2") () ")")))) (; ";")) (expression_statement "iVar2 = *param_2 * 0x20;" (assignment_expression "iVar2 = *param_2 * 0x20" (identifier "iVar2") (= "=") (binary_expression "*param_2 * 0x20" (pointer_expression "*param_2" (* "*") (identifier "param_2")) (* "*") (number_literal "0x20"))) (; ";")) (expression_statement "iVar6 = iVar2 + -1;" (assignment_expression "iVar6 = iVar2 + -1" (identifier "iVar6") (= "=") (binary_expression "iVar2 + -1" (identifier "iVar2") (+ "+") (number_literal "-1"))) (; ";")) (if_statement "if ((-1 < iVar6) && (-1 < param_2[(iVar6 >> 5) + 1])) {\n    do {\n      iVar2 = iVar6;\n      iVar6 = iVar2 + -1;\n      if (iVar6 == -1) break;\n    } while ((uint)param_2[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f) == 0);\n  }" (if "if") (parenthesized_expression "((-1 < iVar6) && (-1 < param_2[(iVar6 >> 5) + 1]))" (( "(") (binary_expression "(-1 < iVar6) && (-1 < param_2[(iVar6 >> 5) + 1])" (parenthesized_expression "(-1 < iVar6)" (( "(") (binary_expression "-1 < iVar6" (number_literal "-1") (< "<") (identifier "iVar6")) () ")")) (&& "&&") (parenthesized_expression "(-1 < param_2[(iVar6 >> 5) + 1])" (( "(") (binary_expression "-1 < param_2[(iVar6 >> 5) + 1]" (number_literal "-1") (< "<") (subscript_expression "param_2[(iVar6 >> 5) + 1]" (identifier "param_2") ([ "[") (binary_expression "(iVar6 >> 5) + 1" (parenthesized_expression "(iVar6 >> 5)" (( "(") (binary_expression "iVar6 >> 5" (identifier "iVar6") (>> ">>") (number_literal "5")) () ")")) (+ "+") (number_literal "1")) (] "]"))) () ")"))) () ")")) (compound_statement "{\n    do {\n      iVar2 = iVar6;\n      iVar6 = iVar2 + -1;\n      if (iVar6 == -1) break;\n    } while ((uint)param_2[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f) == 0);\n  }" ({ "{") (do_statement "do {\n      iVar2 = iVar6;\n      iVar6 = iVar2 + -1;\n      if (iVar6 == -1) break;\n    } while ((uint)param_2[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f) == 0);" (do "do") (compound_statement "{\n      iVar2 = iVar6;\n      iVar6 = iVar2 + -1;\n      if (iVar6 == -1) break;\n    }" ({ "{") (expression_statement "iVar2 = iVar6;" (assignment_expression "iVar2 = iVar6" (identifier "iVar2") (= "=") (identifier "iVar6")) (; ";")) (expression_statement "iVar6 = iVar2 + -1;" (assignment_expression "iVar6 = iVar2 + -1" (identifier "iVar6") (= "=") (binary_expression "iVar2 + -1" (identifier "iVar2") (+ "+") (number_literal "-1"))) (; ";")) (if_statement "if (iVar6 == -1) break;" (if "if") (parenthesized_expression "(iVar6 == -1)" (( "(") (binary_expression "iVar6 == -1" (identifier "iVar6") (== "==") (number_literal "-1")) () ")")) (break_statement "break;" (break "break") (; ";"))) (} "}")) (while "while") (parenthesized_expression "((uint)param_2[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f) == 0)" (( "(") (binary_expression "(uint)param_2[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f) == 0" (binary_expression "(uint)param_2[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f)" (cast_expression "(uint)param_2[(iVar6 >> 5) + 1]" (( "(") (type_descriptor "uint" (type_identifier "uint")) () ")") (subscript_expression "param_2[(iVar6 >> 5) + 1]" (identifier "param_2") ([ "[") (binary_expression "(iVar6 >> 5) + 1" (parenthesized_expression "(iVar6 >> 5)" (( "(") (binary_expression "iVar6 >> 5" (identifier "iVar6") (>> ">>") (number_literal "5")) () ")")) (+ "+") (number_literal "1")) (] "]"))) (>> ">>") (parenthesized_expression "((byte)iVar6 & 0x1f)" (( "(") (binary_expression "(byte)iVar6 & 0x1f" (cast_expression "(byte)iVar6" (( "(") (type_descriptor "byte" (type_identifier "byte")) () ")") (identifier "iVar6")) (& "&") (number_literal "0x1f")) () ")"))) (== "==") (number_literal "0")) () ")")) (; ";")) (} "}"))) (expression_statement "uVar3 = iVar1 - 3;" (assignment_expression "uVar3 = iVar1 - 3" (identifier "uVar3") (= "=") (binary_expression "iVar1 - 3" (identifier "iVar1") (- "-") (number_literal "3"))) (; ";")) (expression_statement "*param_1 = (ushort)iVar2 << 8 | (ushort)iVar2 >> 8;" (assignment_expression "*param_1 = (ushort)iVar2 << 8 | (ushort)iVar2 >> 8" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (= "=") (binary_expression "(ushort)iVar2 << 8 | (ushort)iVar2 >> 8" (binary_expression "(ushort)iVar2 << 8" (cast_expression "(ushort)iVar2" (( "(") (type_descriptor "ushort" (type_identifier "ushort")) () ")") (identifier "iVar2")) (<< "<<") (number_literal "8")) (| "|") (binary_expression "(ushort)iVar2 >> 8" (cast_expression "(ushort)iVar2" (( "(") (type_descriptor "ushort" (type_identifier "ushort")) () ")") (identifier "iVar2")) (>> ">>") (number_literal "8")))) (; ";")) (expression_statement "puVar4 = param_1 + 1;" (assignment_expression "puVar4 = param_1 + 1" (identifier "puVar4") (= "=") (binary_expression "param_1 + 1" (identifier "param_1") (+ "+") (number_literal "1"))) (; ";")) (if_statement "if (iVar1 == 2) {\n    return;\n  }" (if "if") (parenthesized_expression "(iVar1 == 2)" (( "(") (binary_expression "iVar1 == 2" (identifier "iVar1") (== "==") (number_literal "2")) () ")")) (compound_statement "{\n    return;\n  }" ({ "{") (return_statement "return;" (return "return") (; ";")) (} "}"))) (do_statement "do {\n    if ((int)uVar3 < 0) {\n      *(undefined1 *)puVar4 = 0;\n    }\n    else {\n      uVar5 = 0;\n      if (*param_2 * 4 - uVar3 != 0 && (int)uVar3 <= *param_2 * 4) {\n        uVar5 = (undefined1)((uint)param_2[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3));\n      }\n      *(undefined1 *)puVar4 = uVar5;\n      if (uVar3 == 0) {\n        return;\n      }\n    }\n    uVar3 = uVar3 - 1;\n    puVar4 = (ushort *)((int)puVar4 + 1);\n  } while( true );" (do "do") (compound_statement "{\n    if ((int)uVar3 < 0) {\n      *(undefined1 *)puVar4 = 0;\n    }\n    else {\n      uVar5 = 0;\n      if (*param_2 * 4 - uVar3 != 0 && (int)uVar3 <= *param_2 * 4) {\n        uVar5 = (undefined1)((uint)param_2[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3));\n      }\n      *(undefined1 *)puVar4 = uVar5;\n      if (uVar3 == 0) {\n        return;\n      }\n    }\n    uVar3 = uVar3 - 1;\n    puVar4 = (ushort *)((int)puVar4 + 1);\n  }" ({ "{") (if_statement "if ((int)uVar3 < 0) {\n      *(undefined1 *)puVar4 = 0;\n    }\n    else {\n      uVar5 = 0;\n      if (*param_2 * 4 - uVar3 != 0 && (int)uVar3 <= *param_2 * 4) {\n        uVar5 = (undefined1)((uint)param_2[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3));\n      }\n      *(undefined1 *)puVar4 = uVar5;\n      if (uVar3 == 0) {\n        return;\n      }\n    }" (if "if") (parenthesized_expression "((int)uVar3 < 0)" (( "(") (binary_expression "(int)uVar3 < 0" (cast_expression "(int)uVar3" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "uVar3")) (< "<") (number_literal "0")) () ")")) (compound_statement "{\n      *(undefined1 *)puVar4 = 0;\n    }" ({ "{") (expression_statement "*(undefined1 *)puVar4 = 0;" (assignment_expression "*(undefined1 *)puVar4 = 0" (pointer_expression "*(undefined1 *)puVar4" (* "*") (cast_expression "(undefined1 *)puVar4" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "puVar4"))) (= "=") (number_literal "0")) (; ";")) (} "}")) (else_clause "else {\n      uVar5 = 0;\n      if (*param_2 * 4 - uVar3 != 0 && (int)uVar3 <= *param_2 * 4) {\n        uVar5 = (undefined1)((uint)param_2[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3));\n      }\n      *(undefined1 *)puVar4 = uVar5;\n      if (uVar3 == 0) {\n        return;\n      }\n    }" (else "else") (compound_statement "{\n      uVar5 = 0;\n      if (*param_2 * 4 - uVar3 != 0 && (int)uVar3 <= *param_2 * 4) {\n        uVar5 = (undefined1)((uint)param_2[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3));\n      }\n      *(undefined1 *)puVar4 = uVar5;\n      if (uVar3 == 0) {\n        return;\n      }\n    }" ({ "{") (expression_statement "uVar5 = 0;" (assignment_expression "uVar5 = 0" (identifier "uVar5") (= "=") (number_literal "0")) (; ";")) (if_statement "if (*param_2 * 4 - uVar3 != 0 && (int)uVar3 <= *param_2 * 4) {\n        uVar5 = (undefined1)((uint)param_2[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3));\n      }" (if "if") (parenthesized_expression "(*param_2 * 4 - uVar3 != 0 && (int)uVar3 <= *param_2 * 4)" (( "(") (binary_expression "*param_2 * 4 - uVar3 != 0 && (int)uVar3 <= *param_2 * 4" (binary_expression "*param_2 * 4 - uVar3 != 0" (binary_expression "*param_2 * 4 - uVar3" (binary_expression "*param_2 * 4" (pointer_expression "*param_2" (* "*") (identifier "param_2")) (* "*") (number_literal "4")) (- "-") (identifier "uVar3")) (!= "!=") (number_literal "0")) (&& "&&") (binary_expression "(int)uVar3 <= *param_2 * 4" (cast_expression "(int)uVar3" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "uVar3")) (<= "<=") (binary_expression "*param_2 * 4" (pointer_expression "*param_2" (* "*") (identifier "param_2")) (* "*") (number_literal "4")))) () ")")) (compound_statement "{\n        uVar5 = (undefined1)((uint)param_2[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3));\n      }" ({ "{") (expression_statement "uVar5 = (undefined1)((uint)param_2[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3));" (assignment_expression "uVar5 = (undefined1)((uint)param_2[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3))" (identifier "uVar5") (= "=") (call_expression "(undefined1)((uint)param_2[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3))" (parenthesized_expression "(undefined1)" (( "(") (identifier "undefined1") () ")")) (argument_list "((uint)param_2[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3))" (( "(") (binary_expression "(uint)param_2[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3)" (cast_expression "(uint)param_2[((int)uVar3 >> 2) + 1]" (( "(") (type_descriptor "uint" (type_identifier "uint")) () ")") (subscript_expression "param_2[((int)uVar3 >> 2) + 1]" (identifier "param_2") ([ "[") (binary_expression "((int)uVar3 >> 2) + 1" (parenthesized_expression "((int)uVar3 >> 2)" (( "(") (binary_expression "(int)uVar3 >> 2" (cast_expression "(int)uVar3" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "uVar3")) (>> ">>") (number_literal "2")) () ")")) (+ "+") (number_literal "1")) (] "]"))) (>> ">>") (call_expression "(sbyte)((uVar3 & 3) << 3)" (parenthesized_expression "(sbyte)" (( "(") (identifier "sbyte") () ")")) (argument_list "((uVar3 & 3) << 3)" (( "(") (binary_expression "(uVar3 & 3) << 3" (parenthesized_expression "(uVar3 & 3)" (( "(") (binary_expression "uVar3 & 3" (identifier "uVar3") (& "&") (number_literal "3")) () ")")) (<< "<<") (number_literal "3")) () ")")))) () ")")))) (; ";")) (} "}"))) (expression_statement "*(undefined1 *)puVar4 = uVar5;" (assignment_expression "*(undefined1 *)puVar4 = uVar5" (pointer_expression "*(undefined1 *)puVar4" (* "*") (cast_expression "(undefined1 *)puVar4" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "puVar4"))) (= "=") (identifier "uVar5")) (; ";")) (if_statement "if (uVar3 == 0) {\n        return;\n      }" (if "if") (parenthesized_expression "(uVar3 == 0)" (( "(") (binary_expression "uVar3 == 0" (identifier "uVar3") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n        return;\n      }" ({ "{") (return_statement "return;" (return "return") (; ";")) (} "}"))) (} "}")))) (expression_statement "uVar3 = uVar3 - 1;" (assignment_expression "uVar3 = uVar3 - 1" (identifier "uVar3") (= "=") (binary_expression "uVar3 - 1" (identifier "uVar3") (- "-") (number_literal "1"))) (; ";")) (expression_statement "puVar4 = (ushort *)((int)puVar4 + 1);" (assignment_expression "puVar4 = (ushort *)((int)puVar4 + 1)" (identifier "puVar4") (= "=") (cast_expression "(ushort *)((int)puVar4 + 1)" (( "(") (type_descriptor "ushort *" (type_identifier "ushort") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((int)puVar4 + 1)" (( "(") (binary_expression "(int)puVar4 + 1" (cast_expression "(int)puVar4" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "puVar4")) (+ "+") (number_literal "1")) () ")")))) (; ";")) (} "}")) (while "while") (parenthesized_expression "( true )" (( "(") (true "true") () ")")) (; ";")) (} "}")))

/* WARNING: Unknown calling convention */

int function_1(void *data,type_1 bn)

{
  int var_4;
  int var_2;
  type_2 var_5;
  type_3 *var_6;
  type_3 uVar5;
  int var_3;
  
  var_4 = var_1(bn);
  var_2 = *bn * 0x20;
  var_3 = var_2 + -1;
  if ((-1 < var_3) && (-1 < (int)bn[(var_3 >> 5) + 1])) {
    do {
      var_2 = var_3;
      var_3 = var_2 + -1;
      if (var_3 == -1) break;
    } while (bn[(var_3 >> 5) + 1] >> ((type_4)var_3 & 0x1f) == 0);
  }
  var_5 = var_4 - 3;
  *(type_5 *)data = (type_5)var_2 << 8 | (type_5)var_2 >> 8;
  var_6 = (type_3 *)((int)data + 2);
  if (var_4 == 2) {
    return 2;
  }
  do {
    if ((int)var_5 < 0) {
      *var_6 = 0;
    }
    else {
      uVar5 = 0;
      if (*bn * 4 - var_5 != 0 && (int)var_5 <= (int)(*bn * 4)) {
        uVar5 = (type_3)(bn[((int)var_5 >> 2) + 1] >> (sbyte)((var_5 & 3) << 3));
      }
      *var_6 = uVar5;
      if (var_5 == 0) {
        return var_4;
      }
    }
    var_5 = var_5 - 1;
    var_6 = var_6 + 1;
  } while( true );
}


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

void MASKED(ushort *param_1,int *param_2)

{
  int iVar1;
  int iVar2;
  uint uVar3;
  ushort *puVar4;
  undefined1 uVar5;
  int iVar6;
  
  iVar1 = FUN_00028b50(param_2);
  iVar2 = *param_2 * 0x20;
  iVar6 = iVar2 + -1;
  if ((-1 < iVar6) && (-1 < param_2[(iVar6 >> 5) + 1])) {
    do {
      iVar2 = iVar6;
      iVar6 = iVar2 + -1;
      if (iVar6 == -1) break;
    } while ((uint)param_2[(iVar6 >> 5) + 1] >> ((byte)iVar6 & 0x1f) == 0);
  }
  uVar3 = iVar1 - 3;
  *param_1 = (ushort)iVar2 << 8 | (ushort)iVar2 >> 8;
  puVar4 = param_1 + 1;
  if (iVar1 == 2) {
    return;
  }
  do {
    if ((int)uVar3 < 0) {
      *(undefined1 *)puVar4 = 0;
    }
    else {
      uVar5 = 0;
      if (*param_2 * 4 - uVar3 != 0 && (int)uVar3 <= *param_2 * 4) {
        uVar5 = (undefined1)((uint)param_2[((int)uVar3 >> 2) + 1] >> (sbyte)((uVar3 & 3) << 3));
      }
      *(undefined1 *)puVar4 = uVar5;
      if (uVar3 == 0) {
        return;
      }
    }
    uVar3 = uVar3 - 1;
    puVar4 = (ushort *)((int)puVar4 + 1);
  } while( true );
}

