
ARRAY_ELEMENT * array_shift(ARRAY *a,int n,int flags)

{
  ARRAY_ELEMENT *pAVar1;
  ARRAY_ELEMENT *pAVar2;
  array_element *paVar3;
  ARRAY_ELEMENT *pAVar4;
  undefined4 uVar5;
  int iVar6;
  int iVar7;
  uint uVar8;
  ARRAY_ELEMENT *pAVar9;
  uint uVar10;
  int iVar11;
  
  if (((a == (ARRAY *)0x0) || (iVar11 = a->num_elements, iVar11 == 0)) || (n < 1)) {
    return (ARRAY_ELEMENT *)0x0;
  }
  pAVar9 = a->head;
  a->lastref = (array_element *)0x0;
  pAVar1 = pAVar9->next;
  if (pAVar9 != pAVar1) {
    iVar7 = 0;
    pAVar2 = pAVar1;
    while( true ) {
      pAVar2 = pAVar2->next;
      iVar7 = iVar7 + 1;
      if (pAVar9 == pAVar2) break;
      if (n == iVar7) {
        pAVar2->prev->next = (array_element *)0x0;
        pAVar9->next = pAVar2;
        pAVar2->prev = pAVar9;
        do {
          uVar8 = (uint)pAVar2->ind;
          iVar6 = *(int *)&pAVar2->ind;
          uVar10 = uVar8 - iVar7;
          *(uint *)((int)&pAVar2->ind + 4) = uVar10;
          *(uint *)&pAVar2->ind = (iVar6 - (iVar7 >> 0x1f)) - (uint)(uVar8 < uVar10);
          pAVar2 = pAVar2->next;
        } while (pAVar9 != pAVar2);
        paVar3 = pAVar9->prev;
        a->num_elements = iVar11 - iVar7;
        uVar5 = *(undefined4 *)&paVar3->ind;
        *(int *)((int)&a->max_index + 4) = (int)paVar3->ind;
        *(undefined4 *)&a->max_index = uVar5;
        if ((flags & 1U) == 0) {
          return pAVar1;
        }
        while (pAVar1 != (ARRAY_ELEMENT *)0x0) {
          paVar3 = pAVar1->next;
          array_dispose_element(pAVar1);
          pAVar1 = paVar3;
        }
        return (ARRAY_ELEMENT *)0x0;
      }
    }
  }
  pAVar2 = pAVar1;
  if ((flags & 1U) == 0) {
    do {
      pAVar4 = pAVar2;
      pAVar2 = pAVar4->next;
    } while (pAVar9 != pAVar2);
    pAVar4->next = (array_element *)0x0;
    pAVar9->prev = pAVar9;
    pAVar9->next = pAVar9;
    *(undefined4 *)((int)&a->max_index + 4) = 0xffffffff;
    *(undefined4 *)&a->max_index = 0xffffffff;
    a->num_elements = 0;
    return pAVar1;
  }
  array_flush(a);
  pAVar1 = (ARRAY_ELEMENT *)FUN_00090f04();
  return pAVar1;
}



int * array_shift(int param_1,int param_2,uint param_3)

{
  int *piVar1;
  int *piVar2;
  undefined4 *puVar3;
  int *piVar4;
  undefined4 uVar5;
  int iVar6;
  uint uVar7;
  int *piVar8;
  uint uVar9;
  int iVar10;
  
  if (((param_1 == 0) || (iVar10 = *(int *)(param_1 + 0x10), iVar10 == 0)) || (param_2 < 1)) {
    return (int *)0x0;
  }
  piVar8 = *(int **)(param_1 + 0x18);
  *(undefined4 *)(param_1 + 0x14) = 0;
  piVar1 = (int *)piVar8[3];
  if (piVar8 == piVar1) {
LAB_00090e18:
    piVar2 = piVar1;
    if ((param_3 & 1) == 0) {
      do {
        piVar4 = piVar2;
        piVar2 = (int *)piVar4[3];
      } while (piVar8 != piVar2);
      piVar4[3] = 0;
      piVar8[4] = (int)piVar8;
      piVar8[3] = (int)piVar8;
      *(undefined4 *)(param_1 + 0xc) = 0xffffffff;
      *(undefined4 *)(param_1 + 8) = 0xffffffff;
      *(undefined4 *)(param_1 + 0x10) = 0;
      return piVar1;
    }
    array_flush(param_1);
  }
  else {
    iVar6 = 0;
    piVar2 = piVar1;
    do {
      piVar2 = (int *)piVar2[3];
      iVar6 = iVar6 + 1;
      if (piVar8 == piVar2) goto LAB_00090e18;
    } while (param_2 != iVar6);
    *(undefined4 *)(piVar2[4] + 0xc) = 0;
    piVar8[3] = (int)piVar2;
    piVar2[4] = (int)piVar8;
    do {
      uVar7 = piVar2[1];
      uVar9 = uVar7 - iVar6;
      piVar2[1] = uVar9;
      *piVar2 = (*piVar2 - (iVar6 >> 0x1f)) - (uint)(uVar7 < uVar9);
      piVar2 = (int *)piVar2[3];
    } while (piVar8 != piVar2);
    puVar3 = (undefined4 *)piVar8[4];
    *(int *)(param_1 + 0x10) = iVar10 - iVar6;
    uVar5 = *puVar3;
    *(undefined4 *)(param_1 + 0xc) = puVar3[1];
    *(undefined4 *)(param_1 + 8) = uVar5;
    if ((param_3 & 1) == 0) {
      return piVar1;
    }
    while (piVar1 != (int *)0x0) {
      piVar8 = (int *)piVar1[3];
      array_dispose_element(piVar1);
      piVar1 = piVar8;
    }
  }
  return (int *)0x0;
}


lui gp,0xc
addiu gp,gp,-0x4868
addu gp,gp,t9
beq a0,zero,0x00090f18
_nop
lw t5,0x10(a0)
beq t5,zero,0x00090f18
_nop
blez a1,0x00090f18
_nop
lw t1,0x18(a0)
addiu sp,sp,-0x28
sw gp,0x10(sp)
sw ra,0x24(sp)
sw s1,0x20(sp)
sw s0,0x1c(sp)
sw zero,0x14(a0)
lw v0,0xc(t1)
beq t1,v0,0x00090e18
_or t4,a0,zero
or a3,zero,zero
b 0x00090e0c
_or v1,v0,zero
beq a1,a3,0x00090e6c
_sra t3,a3,0x1f
lw v1,0xc(v1)
bne t1,v1,0x00090e04
_addiu a3,a3,0x1
andi a2,a2,0x1
bne a2,zero,0x00090f20
_lw t9,-0x7460(gp)
b 0x00090e30
_or a0,v0,zero
or a0,v1,zero
lw v1,0xc(a0)
bne t1,v1,0x00090e2c
_lw ra,0x24(sp)
li a1,-0x1
lw s1,0x20(sp)
lw s0,0x1c(sp)
sw zero,0xc(a0)
li a0,-0x1
sw t1,0x10(t1)
sw t1,0xc(t1)
sw a1,0xc(t4)
sw a0,0x8(t4)
sw zero,0x10(t4)
jr ra
_addiu sp,sp,0x28
lw a0,0x10(v1)
sw zero,0xc(a0)
sw v1,0xc(t1)
sw t1,0x10(v1)
lw t0,0x4(v1)
lw a1,0x0(v1)
subu t2,t0,a3
subu a1,a1,t3
sltu t0,t0,t2
sw t2,0x4(v1)
subu a1,a1,t0
sw a1,0x0(v1)
lw v1,0xc(v1)
bne t1,v1,0x00090e7c
_nop
lw v1,0x10(t1)
subu a3,t5,a3
andi a2,a2,0x1
sw a3,0x10(t4)
lw a1,0x4(v1)
lw a0,0x0(v1)
sw a1,0xc(t4)
bne a2,zero,0x00090ee0
_sw a0,0x8(t4)
lw ra,0x24(sp)
lw s1,0x20(sp)
lw s0,0x1c(sp)
jr ra
_addiu sp,sp,0x28
beq v0,zero,0x00090f00
_lw s1,-0x795c(gp)
lw s0,0xc(v0)
or t9,s1,zero
bal 0x00090cac
_or a0,v0,zero
bne s0,zero,0x00090ee8
_or v0,s0,zero
or v0,zero,zero
lw ra,0x24(sp)
lw s1,0x20(sp)
lw s0,0x1c(sp)
jr ra
_addiu sp,sp,0x28
jr ra
_or v0,zero,zero
bal 0x00090d10
_or a0,t4,zero
b 0x00090f04
_or v0,zero,zero
(translation_unit "int * array_shift(int param_1,int param_2,uint param_3)\n\n{\n  int *piVar1;\n  int *piVar2;\n  undefined4 *puVar3;\n  int *piVar4;\n  undefined4 uVar5;\n  int iVar6;\n  uint uVar7;\n  int *piVar8;\n  uint uVar9;\n  int iVar10;\n  \n  if (((param_1 == 0) || (iVar10 = *(int *)(param_1 + 0x10), iVar10 == 0)) || (param_2 < 1)) {\n    return (int *)0x0;\n  }\n  piVar8 = *(int **)(param_1 + 0x18);\n  *(undefined4 *)(param_1 + 0x14) = 0;\n  piVar1 = (int *)piVar8[3];\n  if (piVar8 == piVar1) {\nLAB_00090e18:\n    piVar2 = piVar1;\n    if ((param_3 & 1) == 0) {\n      do {\n        piVar4 = piVar2;\n        piVar2 = (int *)piVar4[3];\n      } while (piVar8 != piVar2);\n      piVar4[3] = 0;\n      piVar8[4] = (int)piVar8;\n      piVar8[3] = (int)piVar8;\n      *(undefined4 *)(param_1 + 0xc) = 0xffffffff;\n      *(undefined4 *)(param_1 + 8) = 0xffffffff;\n      *(undefined4 *)(param_1 + 0x10) = 0;\n      return piVar1;\n    }\n    array_flush(param_1);\n  }\n  else {\n    iVar6 = 0;\n    piVar2 = piVar1;\n    do {\n      piVar2 = (int *)piVar2[3];\n      iVar6 = iVar6 + 1;\n      if (piVar8 == piVar2) goto LAB_00090e18;\n    } while (param_2 != iVar6);\n    *(undefined4 *)(piVar2[4] + 0xc) = 0;\n    piVar8[3] = (int)piVar2;\n    piVar2[4] = (int)piVar8;\n    do {\n      uVar7 = piVar2[1];\n      uVar9 = uVar7 - iVar6;\n      piVar2[1] = uVar9;\n      *piVar2 = (*piVar2 - (iVar6 >> 0x1f)) - (uint)(uVar7 < uVar9);\n      piVar2 = (int *)piVar2[3];\n    } while (piVar8 != piVar2);\n    puVar3 = (undefined4 *)piVar8[4];\n    *(int *)(param_1 + 0x10) = iVar10 - iVar6;\n    uVar5 = *puVar3;\n    *(undefined4 *)(param_1 + 0xc) = puVar3[1];\n    *(undefined4 *)(param_1 + 8) = uVar5;\n    if ((param_3 & 1) == 0) {\n      return piVar1;\n    }\n    while (piVar1 != (int *)0x0) {\n      piVar8 = (int *)piVar1[3];\n      array_dispose_element(piVar1);\n      piVar1 = piVar8;\n    }\n  }\n  return (int *)0x0;\n}\n\n" (function_definition "int * array_shift(int param_1,int param_2,uint param_3)\n\n{\n  int *piVar1;\n  int *piVar2;\n  undefined4 *puVar3;\n  int *piVar4;\n  undefined4 uVar5;\n  int iVar6;\n  uint uVar7;\n  int *piVar8;\n  uint uVar9;\n  int iVar10;\n  \n  if (((param_1 == 0) || (iVar10 = *(int *)(param_1 + 0x10), iVar10 == 0)) || (param_2 < 1)) {\n    return (int *)0x0;\n  }\n  piVar8 = *(int **)(param_1 + 0x18);\n  *(undefined4 *)(param_1 + 0x14) = 0;\n  piVar1 = (int *)piVar8[3];\n  if (piVar8 == piVar1) {\nLAB_00090e18:\n    piVar2 = piVar1;\n    if ((param_3 & 1) == 0) {\n      do {\n        piVar4 = piVar2;\n        piVar2 = (int *)piVar4[3];\n      } while (piVar8 != piVar2);\n      piVar4[3] = 0;\n      piVar8[4] = (int)piVar8;\n      piVar8[3] = (int)piVar8;\n      *(undefined4 *)(param_1 + 0xc) = 0xffffffff;\n      *(undefined4 *)(param_1 + 8) = 0xffffffff;\n      *(undefined4 *)(param_1 + 0x10) = 0;\n      return piVar1;\n    }\n    array_flush(param_1);\n  }\n  else {\n    iVar6 = 0;\n    piVar2 = piVar1;\n    do {\n      piVar2 = (int *)piVar2[3];\n      iVar6 = iVar6 + 1;\n      if (piVar8 == piVar2) goto LAB_00090e18;\n    } while (param_2 != iVar6);\n    *(undefined4 *)(piVar2[4] + 0xc) = 0;\n    piVar8[3] = (int)piVar2;\n    piVar2[4] = (int)piVar8;\n    do {\n      uVar7 = piVar2[1];\n      uVar9 = uVar7 - iVar6;\n      piVar2[1] = uVar9;\n      *piVar2 = (*piVar2 - (iVar6 >> 0x1f)) - (uint)(uVar7 < uVar9);\n      piVar2 = (int *)piVar2[3];\n    } while (piVar8 != piVar2);\n    puVar3 = (undefined4 *)piVar8[4];\n    *(int *)(param_1 + 0x10) = iVar10 - iVar6;\n    uVar5 = *puVar3;\n    *(undefined4 *)(param_1 + 0xc) = puVar3[1];\n    *(undefined4 *)(param_1 + 8) = uVar5;\n    if ((param_3 & 1) == 0) {\n      return piVar1;\n    }\n    while (piVar1 != (int *)0x0) {\n      piVar8 = (int *)piVar1[3];\n      array_dispose_element(piVar1);\n      piVar1 = piVar8;\n    }\n  }\n  return (int *)0x0;\n}" primitive_type (pointer_declarator "* array_shift(int param_1,int param_2,uint param_3)" * (function_declarator "array_shift(int param_1,int param_2,uint param_3)" identifier (parameter_list "(int param_1,int param_2,uint param_3)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "uint param_3" type_identifier identifier) )))) (compound_statement "{\n  int *piVar1;\n  int *piVar2;\n  undefined4 *puVar3;\n  int *piVar4;\n  undefined4 uVar5;\n  int iVar6;\n  uint uVar7;\n  int *piVar8;\n  uint uVar9;\n  int iVar10;\n  \n  if (((param_1 == 0) || (iVar10 = *(int *)(param_1 + 0x10), iVar10 == 0)) || (param_2 < 1)) {\n    return (int *)0x0;\n  }\n  piVar8 = *(int **)(param_1 + 0x18);\n  *(undefined4 *)(param_1 + 0x14) = 0;\n  piVar1 = (int *)piVar8[3];\n  if (piVar8 == piVar1) {\nLAB_00090e18:\n    piVar2 = piVar1;\n    if ((param_3 & 1) == 0) {\n      do {\n        piVar4 = piVar2;\n        piVar2 = (int *)piVar4[3];\n      } while (piVar8 != piVar2);\n      piVar4[3] = 0;\n      piVar8[4] = (int)piVar8;\n      piVar8[3] = (int)piVar8;\n      *(undefined4 *)(param_1 + 0xc) = 0xffffffff;\n      *(undefined4 *)(param_1 + 8) = 0xffffffff;\n      *(undefined4 *)(param_1 + 0x10) = 0;\n      return piVar1;\n    }\n    array_flush(param_1);\n  }\n  else {\n    iVar6 = 0;\n    piVar2 = piVar1;\n    do {\n      piVar2 = (int *)piVar2[3];\n      iVar6 = iVar6 + 1;\n      if (piVar8 == piVar2) goto LAB_00090e18;\n    } while (param_2 != iVar6);\n    *(undefined4 *)(piVar2[4] + 0xc) = 0;\n    piVar8[3] = (int)piVar2;\n    piVar2[4] = (int)piVar8;\n    do {\n      uVar7 = piVar2[1];\n      uVar9 = uVar7 - iVar6;\n      piVar2[1] = uVar9;\n      *piVar2 = (*piVar2 - (iVar6 >> 0x1f)) - (uint)(uVar7 < uVar9);\n      piVar2 = (int *)piVar2[3];\n    } while (piVar8 != piVar2);\n    puVar3 = (undefined4 *)piVar8[4];\n    *(int *)(param_1 + 0x10) = iVar10 - iVar6;\n    uVar5 = *puVar3;\n    *(undefined4 *)(param_1 + 0xc) = puVar3[1];\n    *(undefined4 *)(param_1 + 8) = uVar5;\n    if ((param_3 & 1) == 0) {\n      return piVar1;\n    }\n    while (piVar1 != (int *)0x0) {\n      piVar8 = (int *)piVar1[3];\n      array_dispose_element(piVar1);\n      piVar1 = piVar8;\n    }\n  }\n  return (int *)0x0;\n}" { (declaration "int *piVar1;" primitive_type (pointer_declarator "*piVar1" * identifier) ;) (declaration "int *piVar2;" primitive_type (pointer_declarator "*piVar2" * identifier) ;) (declaration "undefined4 *puVar3;" type_identifier (pointer_declarator "*puVar3" * identifier) ;) (declaration "int *piVar4;" primitive_type (pointer_declarator "*piVar4" * identifier) ;) (declaration "undefined4 uVar5;" type_identifier identifier ;) (declaration "int iVar6;" primitive_type identifier ;) (declaration "uint uVar7;" type_identifier identifier ;) (declaration "int *piVar8;" primitive_type (pointer_declarator "*piVar8" * identifier) ;) (declaration "uint uVar9;" type_identifier identifier ;) (declaration "int iVar10;" primitive_type identifier ;) (if_statement "if (((param_1 == 0) || (iVar10 = *(int *)(param_1 + 0x10), iVar10 == 0)) || (param_2 < 1)) {\n    return (int *)0x0;\n  }" if (parenthesized_expression "(((param_1 == 0) || (iVar10 = *(int *)(param_1 + 0x10), iVar10 == 0)) || (param_2 < 1))" ( (binary_expression "((param_1 == 0) || (iVar10 = *(int *)(param_1 + 0x10), iVar10 == 0)) || (param_2 < 1)" (parenthesized_expression "((param_1 == 0) || (iVar10 = *(int *)(param_1 + 0x10), iVar10 == 0))" ( (binary_expression "(param_1 == 0) || (iVar10 = *(int *)(param_1 + 0x10), iVar10 == 0)" (parenthesized_expression "(param_1 == 0)" ( (binary_expression "param_1 == 0" identifier == number_literal) )) || (parenthesized_expression "(iVar10 = *(int *)(param_1 + 0x10), iVar10 == 0)" ( (comma_expression "iVar10 = *(int *)(param_1 + 0x10), iVar10 == 0" (assignment_expression "iVar10 = *(int *)(param_1 + 0x10)" identifier = (pointer_expression "*(int *)(param_1 + 0x10)" * (cast_expression "(int *)(param_1 + 0x10)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) ))))) , (binary_expression "iVar10 == 0" identifier == number_literal)) ))) )) || (parenthesized_expression "(param_2 < 1)" ( (binary_expression "param_2 < 1" identifier < number_literal) ))) )) (compound_statement "{\n    return (int *)0x0;\n  }" { (return_statement "return (int *)0x0;" return (cast_expression "(int *)0x0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) ;) })) (expression_statement "piVar8 = *(int **)(param_1 + 0x18);" (assignment_expression "piVar8 = *(int **)(param_1 + 0x18)" identifier = (pointer_expression "*(int **)(param_1 + 0x18)" * (cast_expression "(int **)(param_1 + 0x18)" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0x18)" ( (binary_expression "param_1 + 0x18" identifier + number_literal) ))))) ;) (expression_statement "*(undefined4 *)(param_1 + 0x14) = 0;" (assignment_expression "*(undefined4 *)(param_1 + 0x14) = 0" (pointer_expression "*(undefined4 *)(param_1 + 0x14)" * (cast_expression "(undefined4 *)(param_1 + 0x14)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x14)" ( (binary_expression "param_1 + 0x14" identifier + number_literal) )))) = number_literal) ;) (expression_statement "piVar1 = (int *)piVar8[3];" (assignment_expression "piVar1 = (int *)piVar8[3]" identifier = (cast_expression "(int *)piVar8[3]" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (subscript_expression "piVar8[3]" identifier [ number_literal ]))) ;) (if_statement "if (piVar8 == piVar1) {\nLAB_00090e18:\n    piVar2 = piVar1;\n    if ((param_3 & 1) == 0) {\n      do {\n        piVar4 = piVar2;\n        piVar2 = (int *)piVar4[3];\n      } while (piVar8 != piVar2);\n      piVar4[3] = 0;\n      piVar8[4] = (int)piVar8;\n      piVar8[3] = (int)piVar8;\n      *(undefined4 *)(param_1 + 0xc) = 0xffffffff;\n      *(undefined4 *)(param_1 + 8) = 0xffffffff;\n      *(undefined4 *)(param_1 + 0x10) = 0;\n      return piVar1;\n    }\n    array_flush(param_1);\n  }\n  else {\n    iVar6 = 0;\n    piVar2 = piVar1;\n    do {\n      piVar2 = (int *)piVar2[3];\n      iVar6 = iVar6 + 1;\n      if (piVar8 == piVar2) goto LAB_00090e18;\n    } while (param_2 != iVar6);\n    *(undefined4 *)(piVar2[4] + 0xc) = 0;\n    piVar8[3] = (int)piVar2;\n    piVar2[4] = (int)piVar8;\n    do {\n      uVar7 = piVar2[1];\n      uVar9 = uVar7 - iVar6;\n      piVar2[1] = uVar9;\n      *piVar2 = (*piVar2 - (iVar6 >> 0x1f)) - (uint)(uVar7 < uVar9);\n      piVar2 = (int *)piVar2[3];\n    } while (piVar8 != piVar2);\n    puVar3 = (undefined4 *)piVar8[4];\n    *(int *)(param_1 + 0x10) = iVar10 - iVar6;\n    uVar5 = *puVar3;\n    *(undefined4 *)(param_1 + 0xc) = puVar3[1];\n    *(undefined4 *)(param_1 + 8) = uVar5;\n    if ((param_3 & 1) == 0) {\n      return piVar1;\n    }\n    while (piVar1 != (int *)0x0) {\n      piVar8 = (int *)piVar1[3];\n      array_dispose_element(piVar1);\n      piVar1 = piVar8;\n    }\n  }" if (parenthesized_expression "(piVar8 == piVar1)" ( (binary_expression "piVar8 == piVar1" identifier == identifier) )) (compound_statement "{\nLAB_00090e18:\n    piVar2 = piVar1;\n    if ((param_3 & 1) == 0) {\n      do {\n        piVar4 = piVar2;\n        piVar2 = (int *)piVar4[3];\n      } while (piVar8 != piVar2);\n      piVar4[3] = 0;\n      piVar8[4] = (int)piVar8;\n      piVar8[3] = (int)piVar8;\n      *(undefined4 *)(param_1 + 0xc) = 0xffffffff;\n      *(undefined4 *)(param_1 + 8) = 0xffffffff;\n      *(undefined4 *)(param_1 + 0x10) = 0;\n      return piVar1;\n    }\n    array_flush(param_1);\n  }" { (labeled_statement "LAB_00090e18:\n    piVar2 = piVar1;" statement_identifier : (expression_statement "piVar2 = piVar1;" (assignment_expression "piVar2 = piVar1" identifier = identifier) ;)) (if_statement "if ((param_3 & 1) == 0) {\n      do {\n        piVar4 = piVar2;\n        piVar2 = (int *)piVar4[3];\n      } while (piVar8 != piVar2);\n      piVar4[3] = 0;\n      piVar8[4] = (int)piVar8;\n      piVar8[3] = (int)piVar8;\n      *(undefined4 *)(param_1 + 0xc) = 0xffffffff;\n      *(undefined4 *)(param_1 + 8) = 0xffffffff;\n      *(undefined4 *)(param_1 + 0x10) = 0;\n      return piVar1;\n    }" if (parenthesized_expression "((param_3 & 1) == 0)" ( (binary_expression "(param_3 & 1) == 0" (parenthesized_expression "(param_3 & 1)" ( (binary_expression "param_3 & 1" identifier & number_literal) )) == number_literal) )) (compound_statement "{\n      do {\n        piVar4 = piVar2;\n        piVar2 = (int *)piVar4[3];\n      } while (piVar8 != piVar2);\n      piVar4[3] = 0;\n      piVar8[4] = (int)piVar8;\n      piVar8[3] = (int)piVar8;\n      *(undefined4 *)(param_1 + 0xc) = 0xffffffff;\n      *(undefined4 *)(param_1 + 8) = 0xffffffff;\n      *(undefined4 *)(param_1 + 0x10) = 0;\n      return piVar1;\n    }" { (do_statement "do {\n        piVar4 = piVar2;\n        piVar2 = (int *)piVar4[3];\n      } while (piVar8 != piVar2);" do (compound_statement "{\n        piVar4 = piVar2;\n        piVar2 = (int *)piVar4[3];\n      }" { (expression_statement "piVar4 = piVar2;" (assignment_expression "piVar4 = piVar2" identifier = identifier) ;) (expression_statement "piVar2 = (int *)piVar4[3];" (assignment_expression "piVar2 = (int *)piVar4[3]" identifier = (cast_expression "(int *)piVar4[3]" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (subscript_expression "piVar4[3]" identifier [ number_literal ]))) ;) }) while (parenthesized_expression "(piVar8 != piVar2)" ( (binary_expression "piVar8 != piVar2" identifier != identifier) )) ;) (expression_statement "piVar4[3] = 0;" (assignment_expression "piVar4[3] = 0" (subscript_expression "piVar4[3]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "piVar8[4] = (int)piVar8;" (assignment_expression "piVar8[4] = (int)piVar8" (subscript_expression "piVar8[4]" identifier [ number_literal ]) = (cast_expression "(int)piVar8" ( (type_descriptor "int" primitive_type) ) identifier)) ;) (expression_statement "piVar8[3] = (int)piVar8;" (assignment_expression "piVar8[3] = (int)piVar8" (subscript_expression "piVar8[3]" identifier [ number_literal ]) = (cast_expression "(int)piVar8" ( (type_descriptor "int" primitive_type) ) identifier)) ;) (expression_statement "*(undefined4 *)(param_1 + 0xc) = 0xffffffff;" (assignment_expression "*(undefined4 *)(param_1 + 0xc) = 0xffffffff" (pointer_expression "*(undefined4 *)(param_1 + 0xc)" * (cast_expression "(undefined4 *)(param_1 + 0xc)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xc)" ( (binary_expression "param_1 + 0xc" identifier + number_literal) )))) = number_literal) ;) (expression_statement "*(undefined4 *)(param_1 + 8) = 0xffffffff;" (assignment_expression "*(undefined4 *)(param_1 + 8) = 0xffffffff" (pointer_expression "*(undefined4 *)(param_1 + 8)" * (cast_expression "(undefined4 *)(param_1 + 8)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) )))) = number_literal) ;) (expression_statement "*(undefined4 *)(param_1 + 0x10) = 0;" (assignment_expression "*(undefined4 *)(param_1 + 0x10) = 0" (pointer_expression "*(undefined4 *)(param_1 + 0x10)" * (cast_expression "(undefined4 *)(param_1 + 0x10)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) )))) = number_literal) ;) (return_statement "return piVar1;" return identifier ;) })) (expression_statement "array_flush(param_1);" (call_expression "array_flush(param_1)" identifier (argument_list "(param_1)" ( identifier ))) ;) }) (else_clause "else {\n    iVar6 = 0;\n    piVar2 = piVar1;\n    do {\n      piVar2 = (int *)piVar2[3];\n      iVar6 = iVar6 + 1;\n      if (piVar8 == piVar2) goto LAB_00090e18;\n    } while (param_2 != iVar6);\n    *(undefined4 *)(piVar2[4] + 0xc) = 0;\n    piVar8[3] = (int)piVar2;\n    piVar2[4] = (int)piVar8;\n    do {\n      uVar7 = piVar2[1];\n      uVar9 = uVar7 - iVar6;\n      piVar2[1] = uVar9;\n      *piVar2 = (*piVar2 - (iVar6 >> 0x1f)) - (uint)(uVar7 < uVar9);\n      piVar2 = (int *)piVar2[3];\n    } while (piVar8 != piVar2);\n    puVar3 = (undefined4 *)piVar8[4];\n    *(int *)(param_1 + 0x10) = iVar10 - iVar6;\n    uVar5 = *puVar3;\n    *(undefined4 *)(param_1 + 0xc) = puVar3[1];\n    *(undefined4 *)(param_1 + 8) = uVar5;\n    if ((param_3 & 1) == 0) {\n      return piVar1;\n    }\n    while (piVar1 != (int *)0x0) {\n      piVar8 = (int *)piVar1[3];\n      array_dispose_element(piVar1);\n      piVar1 = piVar8;\n    }\n  }" else (compound_statement "{\n    iVar6 = 0;\n    piVar2 = piVar1;\n    do {\n      piVar2 = (int *)piVar2[3];\n      iVar6 = iVar6 + 1;\n      if (piVar8 == piVar2) goto LAB_00090e18;\n    } while (param_2 != iVar6);\n    *(undefined4 *)(piVar2[4] + 0xc) = 0;\n    piVar8[3] = (int)piVar2;\n    piVar2[4] = (int)piVar8;\n    do {\n      uVar7 = piVar2[1];\n      uVar9 = uVar7 - iVar6;\n      piVar2[1] = uVar9;\n      *piVar2 = (*piVar2 - (iVar6 >> 0x1f)) - (uint)(uVar7 < uVar9);\n      piVar2 = (int *)piVar2[3];\n    } while (piVar8 != piVar2);\n    puVar3 = (undefined4 *)piVar8[4];\n    *(int *)(param_1 + 0x10) = iVar10 - iVar6;\n    uVar5 = *puVar3;\n    *(undefined4 *)(param_1 + 0xc) = puVar3[1];\n    *(undefined4 *)(param_1 + 8) = uVar5;\n    if ((param_3 & 1) == 0) {\n      return piVar1;\n    }\n    while (piVar1 != (int *)0x0) {\n      piVar8 = (int *)piVar1[3];\n      array_dispose_element(piVar1);\n      piVar1 = piVar8;\n    }\n  }" { (expression_statement "iVar6 = 0;" (assignment_expression "iVar6 = 0" identifier = number_literal) ;) (expression_statement "piVar2 = piVar1;" (assignment_expression "piVar2 = piVar1" identifier = identifier) ;) (do_statement "do {\n      piVar2 = (int *)piVar2[3];\n      iVar6 = iVar6 + 1;\n      if (piVar8 == piVar2) goto LAB_00090e18;\n    } while (param_2 != iVar6);" do (compound_statement "{\n      piVar2 = (int *)piVar2[3];\n      iVar6 = iVar6 + 1;\n      if (piVar8 == piVar2) goto LAB_00090e18;\n    }" { (expression_statement "piVar2 = (int *)piVar2[3];" (assignment_expression "piVar2 = (int *)piVar2[3]" identifier = (cast_expression "(int *)piVar2[3]" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (subscript_expression "piVar2[3]" identifier [ number_literal ]))) ;) (expression_statement "iVar6 = iVar6 + 1;" (assignment_expression "iVar6 = iVar6 + 1" identifier = (binary_expression "iVar6 + 1" identifier + number_literal)) ;) (if_statement "if (piVar8 == piVar2) goto LAB_00090e18;" if (parenthesized_expression "(piVar8 == piVar2)" ( (binary_expression "piVar8 == piVar2" identifier == identifier) )) (goto_statement "goto LAB_00090e18;" goto statement_identifier ;)) }) while (parenthesized_expression "(param_2 != iVar6)" ( (binary_expression "param_2 != iVar6" identifier != identifier) )) ;) (expression_statement "*(undefined4 *)(piVar2[4] + 0xc) = 0;" (assignment_expression "*(undefined4 *)(piVar2[4] + 0xc) = 0" (pointer_expression "*(undefined4 *)(piVar2[4] + 0xc)" * (cast_expression "(undefined4 *)(piVar2[4] + 0xc)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(piVar2[4] + 0xc)" ( (binary_expression "piVar2[4] + 0xc" (subscript_expression "piVar2[4]" identifier [ number_literal ]) + number_literal) )))) = number_literal) ;) (expression_statement "piVar8[3] = (int)piVar2;" (assignment_expression "piVar8[3] = (int)piVar2" (subscript_expression "piVar8[3]" identifier [ number_literal ]) = (cast_expression "(int)piVar2" ( (type_descriptor "int" primitive_type) ) identifier)) ;) (expression_statement "piVar2[4] = (int)piVar8;" (assignment_expression "piVar2[4] = (int)piVar8" (subscript_expression "piVar2[4]" identifier [ number_literal ]) = (cast_expression "(int)piVar8" ( (type_descriptor "int" primitive_type) ) identifier)) ;) (do_statement "do {\n      uVar7 = piVar2[1];\n      uVar9 = uVar7 - iVar6;\n      piVar2[1] = uVar9;\n      *piVar2 = (*piVar2 - (iVar6 >> 0x1f)) - (uint)(uVar7 < uVar9);\n      piVar2 = (int *)piVar2[3];\n    } while (piVar8 != piVar2);" do (compound_statement "{\n      uVar7 = piVar2[1];\n      uVar9 = uVar7 - iVar6;\n      piVar2[1] = uVar9;\n      *piVar2 = (*piVar2 - (iVar6 >> 0x1f)) - (uint)(uVar7 < uVar9);\n      piVar2 = (int *)piVar2[3];\n    }" { (expression_statement "uVar7 = piVar2[1];" (assignment_expression "uVar7 = piVar2[1]" identifier = (subscript_expression "piVar2[1]" identifier [ number_literal ])) ;) (expression_statement "uVar9 = uVar7 - iVar6;" (assignment_expression "uVar9 = uVar7 - iVar6" identifier = (binary_expression "uVar7 - iVar6" identifier - identifier)) ;) (expression_statement "piVar2[1] = uVar9;" (assignment_expression "piVar2[1] = uVar9" (subscript_expression "piVar2[1]" identifier [ number_literal ]) = identifier) ;) (expression_statement "*piVar2 = (*piVar2 - (iVar6 >> 0x1f)) - (uint)(uVar7 < uVar9);" (assignment_expression "*piVar2 = (*piVar2 - (iVar6 >> 0x1f)) - (uint)(uVar7 < uVar9)" (pointer_expression "*piVar2" * identifier) = (binary_expression "(*piVar2 - (iVar6 >> 0x1f)) - (uint)(uVar7 < uVar9)" (parenthesized_expression "(*piVar2 - (iVar6 >> 0x1f))" ( (binary_expression "*piVar2 - (iVar6 >> 0x1f)" (pointer_expression "*piVar2" * identifier) - (parenthesized_expression "(iVar6 >> 0x1f)" ( (binary_expression "iVar6 >> 0x1f" identifier >> number_literal) ))) )) - (call_expression "(uint)(uVar7 < uVar9)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(uVar7 < uVar9)" ( (binary_expression "uVar7 < uVar9" identifier < identifier) ))))) ;) (expression_statement "piVar2 = (int *)piVar2[3];" (assignment_expression "piVar2 = (int *)piVar2[3]" identifier = (cast_expression "(int *)piVar2[3]" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (subscript_expression "piVar2[3]" identifier [ number_literal ]))) ;) }) while (parenthesized_expression "(piVar8 != piVar2)" ( (binary_expression "piVar8 != piVar2" identifier != identifier) )) ;) (expression_statement "puVar3 = (undefined4 *)piVar8[4];" (assignment_expression "puVar3 = (undefined4 *)piVar8[4]" identifier = (cast_expression "(undefined4 *)piVar8[4]" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (subscript_expression "piVar8[4]" identifier [ number_literal ]))) ;) (expression_statement "*(int *)(param_1 + 0x10) = iVar10 - iVar6;" (assignment_expression "*(int *)(param_1 + 0x10) = iVar10 - iVar6" (pointer_expression "*(int *)(param_1 + 0x10)" * (cast_expression "(int *)(param_1 + 0x10)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) )))) = (binary_expression "iVar10 - iVar6" identifier - identifier)) ;) (expression_statement "uVar5 = *puVar3;" (assignment_expression "uVar5 = *puVar3" identifier = (pointer_expression "*puVar3" * identifier)) ;) (expression_statement "*(undefined4 *)(param_1 + 0xc) = puVar3[1];" (assignment_expression "*(undefined4 *)(param_1 + 0xc) = puVar3[1]" (pointer_expression "*(undefined4 *)(param_1 + 0xc)" * (cast_expression "(undefined4 *)(param_1 + 0xc)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xc)" ( (binary_expression "param_1 + 0xc" identifier + number_literal) )))) = (subscript_expression "puVar3[1]" identifier [ number_literal ])) ;) (expression_statement "*(undefined4 *)(param_1 + 8) = uVar5;" (assignment_expression "*(undefined4 *)(param_1 + 8) = uVar5" (pointer_expression "*(undefined4 *)(param_1 + 8)" * (cast_expression "(undefined4 *)(param_1 + 8)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) )))) = identifier) ;) (if_statement "if ((param_3 & 1) == 0) {\n      return piVar1;\n    }" if (parenthesized_expression "((param_3 & 1) == 0)" ( (binary_expression "(param_3 & 1) == 0" (parenthesized_expression "(param_3 & 1)" ( (binary_expression "param_3 & 1" identifier & number_literal) )) == number_literal) )) (compound_statement "{\n      return piVar1;\n    }" { (return_statement "return piVar1;" return identifier ;) })) (while_statement "while (piVar1 != (int *)0x0) {\n      piVar8 = (int *)piVar1[3];\n      array_dispose_element(piVar1);\n      piVar1 = piVar8;\n    }" while (parenthesized_expression "(piVar1 != (int *)0x0)" ( (binary_expression "piVar1 != (int *)0x0" identifier != (cast_expression "(int *)0x0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      piVar8 = (int *)piVar1[3];\n      array_dispose_element(piVar1);\n      piVar1 = piVar8;\n    }" { (expression_statement "piVar8 = (int *)piVar1[3];" (assignment_expression "piVar8 = (int *)piVar1[3]" identifier = (cast_expression "(int *)piVar1[3]" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (subscript_expression "piVar1[3]" identifier [ number_literal ]))) ;) (expression_statement "array_dispose_element(piVar1);" (call_expression "array_dispose_element(piVar1)" identifier (argument_list "(piVar1)" ( identifier ))) ;) (expression_statement "piVar1 = piVar8;" (assignment_expression "piVar1 = piVar8" identifier = identifier) ;) })) }))) (return_statement "return (int *)0x0;" return (cast_expression "(int *)0x0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) ;) })))
(translation_unit "ARRAY_ELEMENT * array_shift(ARRAY *a,int n,int flags)\n\n{\n  ARRAY_ELEMENT *pAVar1;\n  ARRAY_ELEMENT *pAVar2;\n  array_element *paVar3;\n  ARRAY_ELEMENT *pAVar4;\n  undefined4 uVar5;\n  int iVar6;\n  int iVar7;\n  uint uVar8;\n  ARRAY_ELEMENT *pAVar9;\n  uint uVar10;\n  int iVar11;\n  \n  if (((a == (ARRAY *)0x0) || (iVar11 = a->num_elements, iVar11 == 0)) || (n < 1)) {\n    return (ARRAY_ELEMENT *)0x0;\n  }\n  pAVar9 = a->head;\n  a->lastref = (array_element *)0x0;\n  pAVar1 = pAVar9->next;\n  if (pAVar9 != pAVar1) {\n    iVar7 = 0;\n    pAVar2 = pAVar1;\n    while( true ) {\n      pAVar2 = pAVar2->next;\n      iVar7 = iVar7 + 1;\n      if (pAVar9 == pAVar2) break;\n      if (n == iVar7) {\n        pAVar2->prev->next = (array_element *)0x0;\n        pAVar9->next = pAVar2;\n        pAVar2->prev = pAVar9;\n        do {\n          uVar8 = (uint)pAVar2->ind;\n          iVar6 = *(int *)&pAVar2->ind;\n          uVar10 = uVar8 - iVar7;\n          *(uint *)((int)&pAVar2->ind + 4) = uVar10;\n          *(uint *)&pAVar2->ind = (iVar6 - (iVar7 >> 0x1f)) - (uint)(uVar8 < uVar10);\n          pAVar2 = pAVar2->next;\n        } while (pAVar9 != pAVar2);\n        paVar3 = pAVar9->prev;\n        a->num_elements = iVar11 - iVar7;\n        uVar5 = *(undefined4 *)&paVar3->ind;\n        *(int *)((int)&a->max_index + 4) = (int)paVar3->ind;\n        *(undefined4 *)&a->max_index = uVar5;\n        if ((flags & 1U) == 0) {\n          return pAVar1;\n        }\n        while (pAVar1 != (ARRAY_ELEMENT *)0x0) {\n          paVar3 = pAVar1->next;\n          array_dispose_element(pAVar1);\n          pAVar1 = paVar3;\n        }\n        return (ARRAY_ELEMENT *)0x0;\n      }\n    }\n  }\n  pAVar2 = pAVar1;\n  if ((flags & 1U) == 0) {\n    do {\n      pAVar4 = pAVar2;\n      pAVar2 = pAVar4->next;\n    } while (pAVar9 != pAVar2);\n    pAVar4->next = (array_element *)0x0;\n    pAVar9->prev = pAVar9;\n    pAVar9->next = pAVar9;\n    *(undefined4 *)((int)&a->max_index + 4) = 0xffffffff;\n    *(undefined4 *)&a->max_index = 0xffffffff;\n    a->num_elements = 0;\n    return pAVar1;\n  }\n  array_flush(a);\n  pAVar1 = (ARRAY_ELEMENT *)FUN_00090f04();\n  return pAVar1;\n}\n\n" (function_definition "ARRAY_ELEMENT * array_shift(ARRAY *a,int n,int flags)\n\n{\n  ARRAY_ELEMENT *pAVar1;\n  ARRAY_ELEMENT *pAVar2;\n  array_element *paVar3;\n  ARRAY_ELEMENT *pAVar4;\n  undefined4 uVar5;\n  int iVar6;\n  int iVar7;\n  uint uVar8;\n  ARRAY_ELEMENT *pAVar9;\n  uint uVar10;\n  int iVar11;\n  \n  if (((a == (ARRAY *)0x0) || (iVar11 = a->num_elements, iVar11 == 0)) || (n < 1)) {\n    return (ARRAY_ELEMENT *)0x0;\n  }\n  pAVar9 = a->head;\n  a->lastref = (array_element *)0x0;\n  pAVar1 = pAVar9->next;\n  if (pAVar9 != pAVar1) {\n    iVar7 = 0;\n    pAVar2 = pAVar1;\n    while( true ) {\n      pAVar2 = pAVar2->next;\n      iVar7 = iVar7 + 1;\n      if (pAVar9 == pAVar2) break;\n      if (n == iVar7) {\n        pAVar2->prev->next = (array_element *)0x0;\n        pAVar9->next = pAVar2;\n        pAVar2->prev = pAVar9;\n        do {\n          uVar8 = (uint)pAVar2->ind;\n          iVar6 = *(int *)&pAVar2->ind;\n          uVar10 = uVar8 - iVar7;\n          *(uint *)((int)&pAVar2->ind + 4) = uVar10;\n          *(uint *)&pAVar2->ind = (iVar6 - (iVar7 >> 0x1f)) - (uint)(uVar8 < uVar10);\n          pAVar2 = pAVar2->next;\n        } while (pAVar9 != pAVar2);\n        paVar3 = pAVar9->prev;\n        a->num_elements = iVar11 - iVar7;\n        uVar5 = *(undefined4 *)&paVar3->ind;\n        *(int *)((int)&a->max_index + 4) = (int)paVar3->ind;\n        *(undefined4 *)&a->max_index = uVar5;\n        if ((flags & 1U) == 0) {\n          return pAVar1;\n        }\n        while (pAVar1 != (ARRAY_ELEMENT *)0x0) {\n          paVar3 = pAVar1->next;\n          array_dispose_element(pAVar1);\n          pAVar1 = paVar3;\n        }\n        return (ARRAY_ELEMENT *)0x0;\n      }\n    }\n  }\n  pAVar2 = pAVar1;\n  if ((flags & 1U) == 0) {\n    do {\n      pAVar4 = pAVar2;\n      pAVar2 = pAVar4->next;\n    } while (pAVar9 != pAVar2);\n    pAVar4->next = (array_element *)0x0;\n    pAVar9->prev = pAVar9;\n    pAVar9->next = pAVar9;\n    *(undefined4 *)((int)&a->max_index + 4) = 0xffffffff;\n    *(undefined4 *)&a->max_index = 0xffffffff;\n    a->num_elements = 0;\n    return pAVar1;\n  }\n  array_flush(a);\n  pAVar1 = (ARRAY_ELEMENT *)FUN_00090f04();\n  return pAVar1;\n}" type_identifier (pointer_declarator "* array_shift(ARRAY *a,int n,int flags)" * (function_declarator "array_shift(ARRAY *a,int n,int flags)" identifier (parameter_list "(ARRAY *a,int n,int flags)" ( (parameter_declaration "ARRAY *a" type_identifier (pointer_declarator "*a" * identifier)) , (parameter_declaration "int n" primitive_type identifier) , (parameter_declaration "int flags" primitive_type identifier) )))) (compound_statement "{\n  ARRAY_ELEMENT *pAVar1;\n  ARRAY_ELEMENT *pAVar2;\n  array_element *paVar3;\n  ARRAY_ELEMENT *pAVar4;\n  undefined4 uVar5;\n  int iVar6;\n  int iVar7;\n  uint uVar8;\n  ARRAY_ELEMENT *pAVar9;\n  uint uVar10;\n  int iVar11;\n  \n  if (((a == (ARRAY *)0x0) || (iVar11 = a->num_elements, iVar11 == 0)) || (n < 1)) {\n    return (ARRAY_ELEMENT *)0x0;\n  }\n  pAVar9 = a->head;\n  a->lastref = (array_element *)0x0;\n  pAVar1 = pAVar9->next;\n  if (pAVar9 != pAVar1) {\n    iVar7 = 0;\n    pAVar2 = pAVar1;\n    while( true ) {\n      pAVar2 = pAVar2->next;\n      iVar7 = iVar7 + 1;\n      if (pAVar9 == pAVar2) break;\n      if (n == iVar7) {\n        pAVar2->prev->next = (array_element *)0x0;\n        pAVar9->next = pAVar2;\n        pAVar2->prev = pAVar9;\n        do {\n          uVar8 = (uint)pAVar2->ind;\n          iVar6 = *(int *)&pAVar2->ind;\n          uVar10 = uVar8 - iVar7;\n          *(uint *)((int)&pAVar2->ind + 4) = uVar10;\n          *(uint *)&pAVar2->ind = (iVar6 - (iVar7 >> 0x1f)) - (uint)(uVar8 < uVar10);\n          pAVar2 = pAVar2->next;\n        } while (pAVar9 != pAVar2);\n        paVar3 = pAVar9->prev;\n        a->num_elements = iVar11 - iVar7;\n        uVar5 = *(undefined4 *)&paVar3->ind;\n        *(int *)((int)&a->max_index + 4) = (int)paVar3->ind;\n        *(undefined4 *)&a->max_index = uVar5;\n        if ((flags & 1U) == 0) {\n          return pAVar1;\n        }\n        while (pAVar1 != (ARRAY_ELEMENT *)0x0) {\n          paVar3 = pAVar1->next;\n          array_dispose_element(pAVar1);\n          pAVar1 = paVar3;\n        }\n        return (ARRAY_ELEMENT *)0x0;\n      }\n    }\n  }\n  pAVar2 = pAVar1;\n  if ((flags & 1U) == 0) {\n    do {\n      pAVar4 = pAVar2;\n      pAVar2 = pAVar4->next;\n    } while (pAVar9 != pAVar2);\n    pAVar4->next = (array_element *)0x0;\n    pAVar9->prev = pAVar9;\n    pAVar9->next = pAVar9;\n    *(undefined4 *)((int)&a->max_index + 4) = 0xffffffff;\n    *(undefined4 *)&a->max_index = 0xffffffff;\n    a->num_elements = 0;\n    return pAVar1;\n  }\n  array_flush(a);\n  pAVar1 = (ARRAY_ELEMENT *)FUN_00090f04();\n  return pAVar1;\n}" { (declaration "ARRAY_ELEMENT *pAVar1;" type_identifier (pointer_declarator "*pAVar1" * identifier) ;) (declaration "ARRAY_ELEMENT *pAVar2;" type_identifier (pointer_declarator "*pAVar2" * identifier) ;) (declaration "array_element *paVar3;" type_identifier (pointer_declarator "*paVar3" * identifier) ;) (declaration "ARRAY_ELEMENT *pAVar4;" type_identifier (pointer_declarator "*pAVar4" * identifier) ;) (declaration "undefined4 uVar5;" type_identifier identifier ;) (declaration "int iVar6;" primitive_type identifier ;) (declaration "int iVar7;" primitive_type identifier ;) (declaration "uint uVar8;" type_identifier identifier ;) (declaration "ARRAY_ELEMENT *pAVar9;" type_identifier (pointer_declarator "*pAVar9" * identifier) ;) (declaration "uint uVar10;" type_identifier identifier ;) (declaration "int iVar11;" primitive_type identifier ;) (if_statement "if (((a == (ARRAY *)0x0) || (iVar11 = a->num_elements, iVar11 == 0)) || (n < 1)) {\n    return (ARRAY_ELEMENT *)0x0;\n  }" if (parenthesized_expression "(((a == (ARRAY *)0x0) || (iVar11 = a->num_elements, iVar11 == 0)) || (n < 1))" ( (binary_expression "((a == (ARRAY *)0x0) || (iVar11 = a->num_elements, iVar11 == 0)) || (n < 1)" (parenthesized_expression "((a == (ARRAY *)0x0) || (iVar11 = a->num_elements, iVar11 == 0))" ( (binary_expression "(a == (ARRAY *)0x0) || (iVar11 = a->num_elements, iVar11 == 0)" (parenthesized_expression "(a == (ARRAY *)0x0)" ( (binary_expression "a == (ARRAY *)0x0" identifier == (cast_expression "(ARRAY *)0x0" ( (type_descriptor "ARRAY *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) || (parenthesized_expression "(iVar11 = a->num_elements, iVar11 == 0)" ( (comma_expression "iVar11 = a->num_elements, iVar11 == 0" (assignment_expression "iVar11 = a->num_elements" identifier = (field_expression "a->num_elements" identifier -> field_identifier)) , (binary_expression "iVar11 == 0" identifier == number_literal)) ))) )) || (parenthesized_expression "(n < 1)" ( (binary_expression "n < 1" identifier < number_literal) ))) )) (compound_statement "{\n    return (ARRAY_ELEMENT *)0x0;\n  }" { (return_statement "return (ARRAY_ELEMENT *)0x0;" return (cast_expression "(ARRAY_ELEMENT *)0x0" ( (type_descriptor "ARRAY_ELEMENT *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal) ;) })) (expression_statement "pAVar9 = a->head;" (assignment_expression "pAVar9 = a->head" identifier = (field_expression "a->head" identifier -> field_identifier)) ;) (expression_statement "a->lastref = (array_element *)0x0;" (assignment_expression "a->lastref = (array_element *)0x0" (field_expression "a->lastref" identifier -> field_identifier) = (cast_expression "(array_element *)0x0" ( (type_descriptor "array_element *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (expression_statement "pAVar1 = pAVar9->next;" (assignment_expression "pAVar1 = pAVar9->next" identifier = (field_expression "pAVar9->next" identifier -> field_identifier)) ;) (if_statement "if (pAVar9 != pAVar1) {\n    iVar7 = 0;\n    pAVar2 = pAVar1;\n    while( true ) {\n      pAVar2 = pAVar2->next;\n      iVar7 = iVar7 + 1;\n      if (pAVar9 == pAVar2) break;\n      if (n == iVar7) {\n        pAVar2->prev->next = (array_element *)0x0;\n        pAVar9->next = pAVar2;\n        pAVar2->prev = pAVar9;\n        do {\n          uVar8 = (uint)pAVar2->ind;\n          iVar6 = *(int *)&pAVar2->ind;\n          uVar10 = uVar8 - iVar7;\n          *(uint *)((int)&pAVar2->ind + 4) = uVar10;\n          *(uint *)&pAVar2->ind = (iVar6 - (iVar7 >> 0x1f)) - (uint)(uVar8 < uVar10);\n          pAVar2 = pAVar2->next;\n        } while (pAVar9 != pAVar2);\n        paVar3 = pAVar9->prev;\n        a->num_elements = iVar11 - iVar7;\n        uVar5 = *(undefined4 *)&paVar3->ind;\n        *(int *)((int)&a->max_index + 4) = (int)paVar3->ind;\n        *(undefined4 *)&a->max_index = uVar5;\n        if ((flags & 1U) == 0) {\n          return pAVar1;\n        }\n        while (pAVar1 != (ARRAY_ELEMENT *)0x0) {\n          paVar3 = pAVar1->next;\n          array_dispose_element(pAVar1);\n          pAVar1 = paVar3;\n        }\n        return (ARRAY_ELEMENT *)0x0;\n      }\n    }\n  }" if (parenthesized_expression "(pAVar9 != pAVar1)" ( (binary_expression "pAVar9 != pAVar1" identifier != identifier) )) (compound_statement "{\n    iVar7 = 0;\n    pAVar2 = pAVar1;\n    while( true ) {\n      pAVar2 = pAVar2->next;\n      iVar7 = iVar7 + 1;\n      if (pAVar9 == pAVar2) break;\n      if (n == iVar7) {\n        pAVar2->prev->next = (array_element *)0x0;\n        pAVar9->next = pAVar2;\n        pAVar2->prev = pAVar9;\n        do {\n          uVar8 = (uint)pAVar2->ind;\n          iVar6 = *(int *)&pAVar2->ind;\n          uVar10 = uVar8 - iVar7;\n          *(uint *)((int)&pAVar2->ind + 4) = uVar10;\n          *(uint *)&pAVar2->ind = (iVar6 - (iVar7 >> 0x1f)) - (uint)(uVar8 < uVar10);\n          pAVar2 = pAVar2->next;\n        } while (pAVar9 != pAVar2);\n        paVar3 = pAVar9->prev;\n        a->num_elements = iVar11 - iVar7;\n        uVar5 = *(undefined4 *)&paVar3->ind;\n        *(int *)((int)&a->max_index + 4) = (int)paVar3->ind;\n        *(undefined4 *)&a->max_index = uVar5;\n        if ((flags & 1U) == 0) {\n          return pAVar1;\n        }\n        while (pAVar1 != (ARRAY_ELEMENT *)0x0) {\n          paVar3 = pAVar1->next;\n          array_dispose_element(pAVar1);\n          pAVar1 = paVar3;\n        }\n        return (ARRAY_ELEMENT *)0x0;\n      }\n    }\n  }" { (expression_statement "iVar7 = 0;" (assignment_expression "iVar7 = 0" identifier = number_literal) ;) (expression_statement "pAVar2 = pAVar1;" (assignment_expression "pAVar2 = pAVar1" identifier = identifier) ;) (while_statement "while( true ) {\n      pAVar2 = pAVar2->next;\n      iVar7 = iVar7 + 1;\n      if (pAVar9 == pAVar2) break;\n      if (n == iVar7) {\n        pAVar2->prev->next = (array_element *)0x0;\n        pAVar9->next = pAVar2;\n        pAVar2->prev = pAVar9;\n        do {\n          uVar8 = (uint)pAVar2->ind;\n          iVar6 = *(int *)&pAVar2->ind;\n          uVar10 = uVar8 - iVar7;\n          *(uint *)((int)&pAVar2->ind + 4) = uVar10;\n          *(uint *)&pAVar2->ind = (iVar6 - (iVar7 >> 0x1f)) - (uint)(uVar8 < uVar10);\n          pAVar2 = pAVar2->next;\n        } while (pAVar9 != pAVar2);\n        paVar3 = pAVar9->prev;\n        a->num_elements = iVar11 - iVar7;\n        uVar5 = *(undefined4 *)&paVar3->ind;\n        *(int *)((int)&a->max_index + 4) = (int)paVar3->ind;\n        *(undefined4 *)&a->max_index = uVar5;\n        if ((flags & 1U) == 0) {\n          return pAVar1;\n        }\n        while (pAVar1 != (ARRAY_ELEMENT *)0x0) {\n          paVar3 = pAVar1->next;\n          array_dispose_element(pAVar1);\n          pAVar1 = paVar3;\n        }\n        return (ARRAY_ELEMENT *)0x0;\n      }\n    }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n      pAVar2 = pAVar2->next;\n      iVar7 = iVar7 + 1;\n      if (pAVar9 == pAVar2) break;\n      if (n == iVar7) {\n        pAVar2->prev->next = (array_element *)0x0;\n        pAVar9->next = pAVar2;\n        pAVar2->prev = pAVar9;\n        do {\n          uVar8 = (uint)pAVar2->ind;\n          iVar6 = *(int *)&pAVar2->ind;\n          uVar10 = uVar8 - iVar7;\n          *(uint *)((int)&pAVar2->ind + 4) = uVar10;\n          *(uint *)&pAVar2->ind = (iVar6 - (iVar7 >> 0x1f)) - (uint)(uVar8 < uVar10);\n          pAVar2 = pAVar2->next;\n        } while (pAVar9 != pAVar2);\n        paVar3 = pAVar9->prev;\n        a->num_elements = iVar11 - iVar7;\n        uVar5 = *(undefined4 *)&paVar3->ind;\n        *(int *)((int)&a->max_index + 4) = (int)paVar3->ind;\n        *(undefined4 *)&a->max_index = uVar5;\n        if ((flags & 1U) == 0) {\n          return pAVar1;\n        }\n        while (pAVar1 != (ARRAY_ELEMENT *)0x0) {\n          paVar3 = pAVar1->next;\n          array_dispose_element(pAVar1);\n          pAVar1 = paVar3;\n        }\n        return (ARRAY_ELEMENT *)0x0;\n      }\n    }" { (expression_statement "pAVar2 = pAVar2->next;" (assignment_expression "pAVar2 = pAVar2->next" identifier = (field_expression "pAVar2->next" identifier -> field_identifier)) ;) (expression_statement "iVar7 = iVar7 + 1;" (assignment_expression "iVar7 = iVar7 + 1" identifier = (binary_expression "iVar7 + 1" identifier + number_literal)) ;) (if_statement "if (pAVar9 == pAVar2) break;" if (parenthesized_expression "(pAVar9 == pAVar2)" ( (binary_expression "pAVar9 == pAVar2" identifier == identifier) )) (break_statement "break;" break ;)) (if_statement "if (n == iVar7) {\n        pAVar2->prev->next = (array_element *)0x0;\n        pAVar9->next = pAVar2;\n        pAVar2->prev = pAVar9;\n        do {\n          uVar8 = (uint)pAVar2->ind;\n          iVar6 = *(int *)&pAVar2->ind;\n          uVar10 = uVar8 - iVar7;\n          *(uint *)((int)&pAVar2->ind + 4) = uVar10;\n          *(uint *)&pAVar2->ind = (iVar6 - (iVar7 >> 0x1f)) - (uint)(uVar8 < uVar10);\n          pAVar2 = pAVar2->next;\n        } while (pAVar9 != pAVar2);\n        paVar3 = pAVar9->prev;\n        a->num_elements = iVar11 - iVar7;\n        uVar5 = *(undefined4 *)&paVar3->ind;\n        *(int *)((int)&a->max_index + 4) = (int)paVar3->ind;\n        *(undefined4 *)&a->max_index = uVar5;\n        if ((flags & 1U) == 0) {\n          return pAVar1;\n        }\n        while (pAVar1 != (ARRAY_ELEMENT *)0x0) {\n          paVar3 = pAVar1->next;\n          array_dispose_element(pAVar1);\n          pAVar1 = paVar3;\n        }\n        return (ARRAY_ELEMENT *)0x0;\n      }" if (parenthesized_expression "(n == iVar7)" ( (binary_expression "n == iVar7" identifier == identifier) )) (compound_statement "{\n        pAVar2->prev->next = (array_element *)0x0;\n        pAVar9->next = pAVar2;\n        pAVar2->prev = pAVar9;\n        do {\n          uVar8 = (uint)pAVar2->ind;\n          iVar6 = *(int *)&pAVar2->ind;\n          uVar10 = uVar8 - iVar7;\n          *(uint *)((int)&pAVar2->ind + 4) = uVar10;\n          *(uint *)&pAVar2->ind = (iVar6 - (iVar7 >> 0x1f)) - (uint)(uVar8 < uVar10);\n          pAVar2 = pAVar2->next;\n        } while (pAVar9 != pAVar2);\n        paVar3 = pAVar9->prev;\n        a->num_elements = iVar11 - iVar7;\n        uVar5 = *(undefined4 *)&paVar3->ind;\n        *(int *)((int)&a->max_index + 4) = (int)paVar3->ind;\n        *(undefined4 *)&a->max_index = uVar5;\n        if ((flags & 1U) == 0) {\n          return pAVar1;\n        }\n        while (pAVar1 != (ARRAY_ELEMENT *)0x0) {\n          paVar3 = pAVar1->next;\n          array_dispose_element(pAVar1);\n          pAVar1 = paVar3;\n        }\n        return (ARRAY_ELEMENT *)0x0;\n      }" { (expression_statement "pAVar2->prev->next = (array_element *)0x0;" (assignment_expression "pAVar2->prev->next = (array_element *)0x0" (field_expression "pAVar2->prev->next" (field_expression "pAVar2->prev" identifier -> field_identifier) -> field_identifier) = (cast_expression "(array_element *)0x0" ( (type_descriptor "array_element *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (expression_statement "pAVar9->next = pAVar2;" (assignment_expression "pAVar9->next = pAVar2" (field_expression "pAVar9->next" identifier -> field_identifier) = identifier) ;) (expression_statement "pAVar2->prev = pAVar9;" (assignment_expression "pAVar2->prev = pAVar9" (field_expression "pAVar2->prev" identifier -> field_identifier) = identifier) ;) (do_statement "do {\n          uVar8 = (uint)pAVar2->ind;\n          iVar6 = *(int *)&pAVar2->ind;\n          uVar10 = uVar8 - iVar7;\n          *(uint *)((int)&pAVar2->ind + 4) = uVar10;\n          *(uint *)&pAVar2->ind = (iVar6 - (iVar7 >> 0x1f)) - (uint)(uVar8 < uVar10);\n          pAVar2 = pAVar2->next;\n        } while (pAVar9 != pAVar2);" do (compound_statement "{\n          uVar8 = (uint)pAVar2->ind;\n          iVar6 = *(int *)&pAVar2->ind;\n          uVar10 = uVar8 - iVar7;\n          *(uint *)((int)&pAVar2->ind + 4) = uVar10;\n          *(uint *)&pAVar2->ind = (iVar6 - (iVar7 >> 0x1f)) - (uint)(uVar8 < uVar10);\n          pAVar2 = pAVar2->next;\n        }" { (expression_statement "uVar8 = (uint)pAVar2->ind;" (assignment_expression "uVar8 = (uint)pAVar2->ind" identifier = (cast_expression "(uint)pAVar2->ind" ( (type_descriptor "uint" type_identifier) ) (field_expression "pAVar2->ind" identifier -> field_identifier))) ;) (expression_statement "iVar6 = *(int *)&pAVar2->ind;" (assignment_expression "iVar6 = *(int *)&pAVar2->ind" identifier = (pointer_expression "*(int *)&pAVar2->ind" * (cast_expression "(int *)&pAVar2->ind" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "&pAVar2->ind" & (field_expression "pAVar2->ind" identifier -> field_identifier))))) ;) (expression_statement "uVar10 = uVar8 - iVar7;" (assignment_expression "uVar10 = uVar8 - iVar7" identifier = (binary_expression "uVar8 - iVar7" identifier - identifier)) ;) (expression_statement "*(uint *)((int)&pAVar2->ind + 4) = uVar10;" (assignment_expression "*(uint *)((int)&pAVar2->ind + 4) = uVar10" (pointer_expression "*(uint *)((int)&pAVar2->ind + 4)" * (cast_expression "(uint *)((int)&pAVar2->ind + 4)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)&pAVar2->ind + 4)" ( (binary_expression "(int)&pAVar2->ind + 4" (cast_expression "(int)&pAVar2->ind" ( (type_descriptor "int" primitive_type) ) (pointer_expression "&pAVar2->ind" & (field_expression "pAVar2->ind" identifier -> field_identifier))) + number_literal) )))) = identifier) ;) (expression_statement "*(uint *)&pAVar2->ind = (iVar6 - (iVar7 >> 0x1f)) - (uint)(uVar8 < uVar10);" (assignment_expression "*(uint *)&pAVar2->ind = (iVar6 - (iVar7 >> 0x1f)) - (uint)(uVar8 < uVar10)" (pointer_expression "*(uint *)&pAVar2->ind" * (cast_expression "(uint *)&pAVar2->ind" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "&pAVar2->ind" & (field_expression "pAVar2->ind" identifier -> field_identifier)))) = (binary_expression "(iVar6 - (iVar7 >> 0x1f)) - (uint)(uVar8 < uVar10)" (parenthesized_expression "(iVar6 - (iVar7 >> 0x1f))" ( (binary_expression "iVar6 - (iVar7 >> 0x1f)" identifier - (parenthesized_expression "(iVar7 >> 0x1f)" ( (binary_expression "iVar7 >> 0x1f" identifier >> number_literal) ))) )) - (call_expression "(uint)(uVar8 < uVar10)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(uVar8 < uVar10)" ( (binary_expression "uVar8 < uVar10" identifier < identifier) ))))) ;) (expression_statement "pAVar2 = pAVar2->next;" (assignment_expression "pAVar2 = pAVar2->next" identifier = (field_expression "pAVar2->next" identifier -> field_identifier)) ;) }) while (parenthesized_expression "(pAVar9 != pAVar2)" ( (binary_expression "pAVar9 != pAVar2" identifier != identifier) )) ;) (expression_statement "paVar3 = pAVar9->prev;" (assignment_expression "paVar3 = pAVar9->prev" identifier = (field_expression "pAVar9->prev" identifier -> field_identifier)) ;) (expression_statement "a->num_elements = iVar11 - iVar7;" (assignment_expression "a->num_elements = iVar11 - iVar7" (field_expression "a->num_elements" identifier -> field_identifier) = (binary_expression "iVar11 - iVar7" identifier - identifier)) ;) (expression_statement "uVar5 = *(undefined4 *)&paVar3->ind;" (assignment_expression "uVar5 = *(undefined4 *)&paVar3->ind" identifier = (pointer_expression "*(undefined4 *)&paVar3->ind" * (cast_expression "(undefined4 *)&paVar3->ind" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "&paVar3->ind" & (field_expression "paVar3->ind" identifier -> field_identifier))))) ;) (expression_statement "*(int *)((int)&a->max_index + 4) = (int)paVar3->ind;" (assignment_expression "*(int *)((int)&a->max_index + 4) = (int)paVar3->ind" (pointer_expression "*(int *)((int)&a->max_index + 4)" * (cast_expression "(int *)((int)&a->max_index + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)&a->max_index + 4)" ( (binary_expression "(int)&a->max_index + 4" (cast_expression "(int)&a->max_index" ( (type_descriptor "int" primitive_type) ) (pointer_expression "&a->max_index" & (field_expression "a->max_index" identifier -> field_identifier))) + number_literal) )))) = (cast_expression "(int)paVar3->ind" ( (type_descriptor "int" primitive_type) ) (field_expression "paVar3->ind" identifier -> field_identifier))) ;) (expression_statement "*(undefined4 *)&a->max_index = uVar5;" (assignment_expression "*(undefined4 *)&a->max_index = uVar5" (pointer_expression "*(undefined4 *)&a->max_index" * (cast_expression "(undefined4 *)&a->max_index" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "&a->max_index" & (field_expression "a->max_index" identifier -> field_identifier)))) = identifier) ;) (if_statement "if ((flags & 1U) == 0) {\n          return pAVar1;\n        }" if (parenthesized_expression "((flags & 1U) == 0)" ( (binary_expression "(flags & 1U) == 0" (parenthesized_expression "(flags & 1U)" ( (binary_expression "flags & 1U" identifier & number_literal) )) == number_literal) )) (compound_statement "{\n          return pAVar1;\n        }" { (return_statement "return pAVar1;" return identifier ;) })) (while_statement "while (pAVar1 != (ARRAY_ELEMENT *)0x0) {\n          paVar3 = pAVar1->next;\n          array_dispose_element(pAVar1);\n          pAVar1 = paVar3;\n        }" while (parenthesized_expression "(pAVar1 != (ARRAY_ELEMENT *)0x0)" ( (binary_expression "pAVar1 != (ARRAY_ELEMENT *)0x0" identifier != (cast_expression "(ARRAY_ELEMENT *)0x0" ( (type_descriptor "ARRAY_ELEMENT *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n          paVar3 = pAVar1->next;\n          array_dispose_element(pAVar1);\n          pAVar1 = paVar3;\n        }" { (expression_statement "paVar3 = pAVar1->next;" (assignment_expression "paVar3 = pAVar1->next" identifier = (field_expression "pAVar1->next" identifier -> field_identifier)) ;) (expression_statement "array_dispose_element(pAVar1);" (call_expression "array_dispose_element(pAVar1)" identifier (argument_list "(pAVar1)" ( identifier ))) ;) (expression_statement "pAVar1 = paVar3;" (assignment_expression "pAVar1 = paVar3" identifier = identifier) ;) })) (return_statement "return (ARRAY_ELEMENT *)0x0;" return (cast_expression "(ARRAY_ELEMENT *)0x0" ( (type_descriptor "ARRAY_ELEMENT *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal) ;) })) })) })) (expression_statement "pAVar2 = pAVar1;" (assignment_expression "pAVar2 = pAVar1" identifier = identifier) ;) (if_statement "if ((flags & 1U) == 0) {\n    do {\n      pAVar4 = pAVar2;\n      pAVar2 = pAVar4->next;\n    } while (pAVar9 != pAVar2);\n    pAVar4->next = (array_element *)0x0;\n    pAVar9->prev = pAVar9;\n    pAVar9->next = pAVar9;\n    *(undefined4 *)((int)&a->max_index + 4) = 0xffffffff;\n    *(undefined4 *)&a->max_index = 0xffffffff;\n    a->num_elements = 0;\n    return pAVar1;\n  }" if (parenthesized_expression "((flags & 1U) == 0)" ( (binary_expression "(flags & 1U) == 0" (parenthesized_expression "(flags & 1U)" ( (binary_expression "flags & 1U" identifier & number_literal) )) == number_literal) )) (compound_statement "{\n    do {\n      pAVar4 = pAVar2;\n      pAVar2 = pAVar4->next;\n    } while (pAVar9 != pAVar2);\n    pAVar4->next = (array_element *)0x0;\n    pAVar9->prev = pAVar9;\n    pAVar9->next = pAVar9;\n    *(undefined4 *)((int)&a->max_index + 4) = 0xffffffff;\n    *(undefined4 *)&a->max_index = 0xffffffff;\n    a->num_elements = 0;\n    return pAVar1;\n  }" { (do_statement "do {\n      pAVar4 = pAVar2;\n      pAVar2 = pAVar4->next;\n    } while (pAVar9 != pAVar2);" do (compound_statement "{\n      pAVar4 = pAVar2;\n      pAVar2 = pAVar4->next;\n    }" { (expression_statement "pAVar4 = pAVar2;" (assignment_expression "pAVar4 = pAVar2" identifier = identifier) ;) (expression_statement "pAVar2 = pAVar4->next;" (assignment_expression "pAVar2 = pAVar4->next" identifier = (field_expression "pAVar4->next" identifier -> field_identifier)) ;) }) while (parenthesized_expression "(pAVar9 != pAVar2)" ( (binary_expression "pAVar9 != pAVar2" identifier != identifier) )) ;) (expression_statement "pAVar4->next = (array_element *)0x0;" (assignment_expression "pAVar4->next = (array_element *)0x0" (field_expression "pAVar4->next" identifier -> field_identifier) = (cast_expression "(array_element *)0x0" ( (type_descriptor "array_element *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (expression_statement "pAVar9->prev = pAVar9;" (assignment_expression "pAVar9->prev = pAVar9" (field_expression "pAVar9->prev" identifier -> field_identifier) = identifier) ;) (expression_statement "pAVar9->next = pAVar9;" (assignment_expression "pAVar9->next = pAVar9" (field_expression "pAVar9->next" identifier -> field_identifier) = identifier) ;) (expression_statement "*(undefined4 *)((int)&a->max_index + 4) = 0xffffffff;" (assignment_expression "*(undefined4 *)((int)&a->max_index + 4) = 0xffffffff" (pointer_expression "*(undefined4 *)((int)&a->max_index + 4)" * (cast_expression "(undefined4 *)((int)&a->max_index + 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)&a->max_index + 4)" ( (binary_expression "(int)&a->max_index + 4" (cast_expression "(int)&a->max_index" ( (type_descriptor "int" primitive_type) ) (pointer_expression "&a->max_index" & (field_expression "a->max_index" identifier -> field_identifier))) + number_literal) )))) = number_literal) ;) (expression_statement "*(undefined4 *)&a->max_index = 0xffffffff;" (assignment_expression "*(undefined4 *)&a->max_index = 0xffffffff" (pointer_expression "*(undefined4 *)&a->max_index" * (cast_expression "(undefined4 *)&a->max_index" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "&a->max_index" & (field_expression "a->max_index" identifier -> field_identifier)))) = number_literal) ;) (expression_statement "a->num_elements = 0;" (assignment_expression "a->num_elements = 0" (field_expression "a->num_elements" identifier -> field_identifier) = number_literal) ;) (return_statement "return pAVar1;" return identifier ;) })) (expression_statement "array_flush(a);" (call_expression "array_flush(a)" identifier (argument_list "(a)" ( identifier ))) ;) (expression_statement "pAVar1 = (ARRAY_ELEMENT *)FUN_00090f04();" (assignment_expression "pAVar1 = (ARRAY_ELEMENT *)FUN_00090f04()" identifier = (cast_expression "(ARRAY_ELEMENT *)FUN_00090f04()" ( (type_descriptor "ARRAY_ELEMENT *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_00090f04()" identifier (argument_list "()" ( ))))) ;) (return_statement "return pAVar1;" return identifier ;) })))
(translation_unit "int * array_shift(int param_1,int param_2,uint param_3)\n\n{\n  int *piVar1;\n  int *piVar2;\n  undefined4 *puVar3;\n  int *piVar4;\n  undefined4 uVar5;\n  int iVar6;\n  uint uVar7;\n  int *piVar8;\n  uint uVar9;\n  int iVar10;\n  \n  if (((param_1 == 0) || (iVar10 = *(int *)(param_1 + 0x10), iVar10 == 0)) || (param_2 < 1)) {\n    return (int *)0x0;\n  }\n  piVar8 = *(int **)(param_1 + 0x18);\n  *(undefined4 *)(param_1 + 0x14) = 0;\n  piVar1 = (int *)piVar8[3];\n  if (piVar8 == piVar1) {\nLAB_00090e18:\n    piVar2 = piVar1;\n    if ((param_3 & 1) == 0) {\n      do {\n        piVar4 = piVar2;\n        piVar2 = (int *)piVar4[3];\n      } while (piVar8 != piVar2);\n      piVar4[3] = 0;\n      piVar8[4] = (int)piVar8;\n      piVar8[3] = (int)piVar8;\n      *(undefined4 *)(param_1 + 0xc) = 0xffffffff;\n      *(undefined4 *)(param_1 + 8) = 0xffffffff;\n      *(undefined4 *)(param_1 + 0x10) = 0;\n      return piVar1;\n    }\n    array_flush(param_1);\n  }\n  else {\n    iVar6 = 0;\n    piVar2 = piVar1;\n    do {\n      piVar2 = (int *)piVar2[3];\n      iVar6 = iVar6 + 1;\n      if (piVar8 == piVar2) goto LAB_00090e18;\n    } while (param_2 != iVar6);\n    *(undefined4 *)(piVar2[4] + 0xc) = 0;\n    piVar8[3] = (int)piVar2;\n    piVar2[4] = (int)piVar8;\n    do {\n      uVar7 = piVar2[1];\n      uVar9 = uVar7 - iVar6;\n      piVar2[1] = uVar9;\n      *piVar2 = (*piVar2 - (iVar6 >> 0x1f)) - (uint)(uVar7 < uVar9);\n      piVar2 = (int *)piVar2[3];\n    } while (piVar8 != piVar2);\n    puVar3 = (undefined4 *)piVar8[4];\n    *(int *)(param_1 + 0x10) = iVar10 - iVar6;\n    uVar5 = *puVar3;\n    *(undefined4 *)(param_1 + 0xc) = puVar3[1];\n    *(undefined4 *)(param_1 + 8) = uVar5;\n    if ((param_3 & 1) == 0) {\n      return piVar1;\n    }\n    while (piVar1 != (int *)0x0) {\n      piVar8 = (int *)piVar1[3];\n      array_dispose_element(piVar1);\n      piVar1 = piVar8;\n    }\n  }\n  return (int *)0x0;\n}\n\n" (function_definition "int * array_shift(int param_1,int param_2,uint param_3)\n\n{\n  int *piVar1;\n  int *piVar2;\n  undefined4 *puVar3;\n  int *piVar4;\n  undefined4 uVar5;\n  int iVar6;\n  uint uVar7;\n  int *piVar8;\n  uint uVar9;\n  int iVar10;\n  \n  if (((param_1 == 0) || (iVar10 = *(int *)(param_1 + 0x10), iVar10 == 0)) || (param_2 < 1)) {\n    return (int *)0x0;\n  }\n  piVar8 = *(int **)(param_1 + 0x18);\n  *(undefined4 *)(param_1 + 0x14) = 0;\n  piVar1 = (int *)piVar8[3];\n  if (piVar8 == piVar1) {\nLAB_00090e18:\n    piVar2 = piVar1;\n    if ((param_3 & 1) == 0) {\n      do {\n        piVar4 = piVar2;\n        piVar2 = (int *)piVar4[3];\n      } while (piVar8 != piVar2);\n      piVar4[3] = 0;\n      piVar8[4] = (int)piVar8;\n      piVar8[3] = (int)piVar8;\n      *(undefined4 *)(param_1 + 0xc) = 0xffffffff;\n      *(undefined4 *)(param_1 + 8) = 0xffffffff;\n      *(undefined4 *)(param_1 + 0x10) = 0;\n      return piVar1;\n    }\n    array_flush(param_1);\n  }\n  else {\n    iVar6 = 0;\n    piVar2 = piVar1;\n    do {\n      piVar2 = (int *)piVar2[3];\n      iVar6 = iVar6 + 1;\n      if (piVar8 == piVar2) goto LAB_00090e18;\n    } while (param_2 != iVar6);\n    *(undefined4 *)(piVar2[4] + 0xc) = 0;\n    piVar8[3] = (int)piVar2;\n    piVar2[4] = (int)piVar8;\n    do {\n      uVar7 = piVar2[1];\n      uVar9 = uVar7 - iVar6;\n      piVar2[1] = uVar9;\n      *piVar2 = (*piVar2 - (iVar6 >> 0x1f)) - (uint)(uVar7 < uVar9);\n      piVar2 = (int *)piVar2[3];\n    } while (piVar8 != piVar2);\n    puVar3 = (undefined4 *)piVar8[4];\n    *(int *)(param_1 + 0x10) = iVar10 - iVar6;\n    uVar5 = *puVar3;\n    *(undefined4 *)(param_1 + 0xc) = puVar3[1];\n    *(undefined4 *)(param_1 + 8) = uVar5;\n    if ((param_3 & 1) == 0) {\n      return piVar1;\n    }\n    while (piVar1 != (int *)0x0) {\n      piVar8 = (int *)piVar1[3];\n      array_dispose_element(piVar1);\n      piVar1 = piVar8;\n    }\n  }\n  return (int *)0x0;\n}" primitive_type (pointer_declarator "* array_shift(int param_1,int param_2,uint param_3)" * (function_declarator "array_shift(int param_1,int param_2,uint param_3)" identifier (parameter_list "(int param_1,int param_2,uint param_3)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "uint param_3" type_identifier identifier) )))) (compound_statement "{\n  int *piVar1;\n  int *piVar2;\n  undefined4 *puVar3;\n  int *piVar4;\n  undefined4 uVar5;\n  int iVar6;\n  uint uVar7;\n  int *piVar8;\n  uint uVar9;\n  int iVar10;\n  \n  if (((param_1 == 0) || (iVar10 = *(int *)(param_1 + 0x10), iVar10 == 0)) || (param_2 < 1)) {\n    return (int *)0x0;\n  }\n  piVar8 = *(int **)(param_1 + 0x18);\n  *(undefined4 *)(param_1 + 0x14) = 0;\n  piVar1 = (int *)piVar8[3];\n  if (piVar8 == piVar1) {\nLAB_00090e18:\n    piVar2 = piVar1;\n    if ((param_3 & 1) == 0) {\n      do {\n        piVar4 = piVar2;\n        piVar2 = (int *)piVar4[3];\n      } while (piVar8 != piVar2);\n      piVar4[3] = 0;\n      piVar8[4] = (int)piVar8;\n      piVar8[3] = (int)piVar8;\n      *(undefined4 *)(param_1 + 0xc) = 0xffffffff;\n      *(undefined4 *)(param_1 + 8) = 0xffffffff;\n      *(undefined4 *)(param_1 + 0x10) = 0;\n      return piVar1;\n    }\n    array_flush(param_1);\n  }\n  else {\n    iVar6 = 0;\n    piVar2 = piVar1;\n    do {\n      piVar2 = (int *)piVar2[3];\n      iVar6 = iVar6 + 1;\n      if (piVar8 == piVar2) goto LAB_00090e18;\n    } while (param_2 != iVar6);\n    *(undefined4 *)(piVar2[4] + 0xc) = 0;\n    piVar8[3] = (int)piVar2;\n    piVar2[4] = (int)piVar8;\n    do {\n      uVar7 = piVar2[1];\n      uVar9 = uVar7 - iVar6;\n      piVar2[1] = uVar9;\n      *piVar2 = (*piVar2 - (iVar6 >> 0x1f)) - (uint)(uVar7 < uVar9);\n      piVar2 = (int *)piVar2[3];\n    } while (piVar8 != piVar2);\n    puVar3 = (undefined4 *)piVar8[4];\n    *(int *)(param_1 + 0x10) = iVar10 - iVar6;\n    uVar5 = *puVar3;\n    *(undefined4 *)(param_1 + 0xc) = puVar3[1];\n    *(undefined4 *)(param_1 + 8) = uVar5;\n    if ((param_3 & 1) == 0) {\n      return piVar1;\n    }\n    while (piVar1 != (int *)0x0) {\n      piVar8 = (int *)piVar1[3];\n      array_dispose_element(piVar1);\n      piVar1 = piVar8;\n    }\n  }\n  return (int *)0x0;\n}" { (declaration "int *piVar1;" primitive_type (pointer_declarator "*piVar1" * identifier) ;) (declaration "int *piVar2;" primitive_type (pointer_declarator "*piVar2" * identifier) ;) (declaration "undefined4 *puVar3;" type_identifier (pointer_declarator "*puVar3" * identifier) ;) (declaration "int *piVar4;" primitive_type (pointer_declarator "*piVar4" * identifier) ;) (declaration "undefined4 uVar5;" type_identifier identifier ;) (declaration "int iVar6;" primitive_type identifier ;) (declaration "uint uVar7;" type_identifier identifier ;) (declaration "int *piVar8;" primitive_type (pointer_declarator "*piVar8" * identifier) ;) (declaration "uint uVar9;" type_identifier identifier ;) (declaration "int iVar10;" primitive_type identifier ;) (if_statement "if (((param_1 == 0) || (iVar10 = *(int *)(param_1 + 0x10), iVar10 == 0)) || (param_2 < 1)) {\n    return (int *)0x0;\n  }" if (parenthesized_expression "(((param_1 == 0) || (iVar10 = *(int *)(param_1 + 0x10), iVar10 == 0)) || (param_2 < 1))" ( (binary_expression "((param_1 == 0) || (iVar10 = *(int *)(param_1 + 0x10), iVar10 == 0)) || (param_2 < 1)" (parenthesized_expression "((param_1 == 0) || (iVar10 = *(int *)(param_1 + 0x10), iVar10 == 0))" ( (binary_expression "(param_1 == 0) || (iVar10 = *(int *)(param_1 + 0x10), iVar10 == 0)" (parenthesized_expression "(param_1 == 0)" ( (binary_expression "param_1 == 0" identifier == number_literal) )) || (parenthesized_expression "(iVar10 = *(int *)(param_1 + 0x10), iVar10 == 0)" ( (comma_expression "iVar10 = *(int *)(param_1 + 0x10), iVar10 == 0" (assignment_expression "iVar10 = *(int *)(param_1 + 0x10)" identifier = (pointer_expression "*(int *)(param_1 + 0x10)" * (cast_expression "(int *)(param_1 + 0x10)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) ))))) , (binary_expression "iVar10 == 0" identifier == number_literal)) ))) )) || (parenthesized_expression "(param_2 < 1)" ( (binary_expression "param_2 < 1" identifier < number_literal) ))) )) (compound_statement "{\n    return (int *)0x0;\n  }" { (return_statement "return (int *)0x0;" return (cast_expression "(int *)0x0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) ;) })) (expression_statement "piVar8 = *(int **)(param_1 + 0x18);" (assignment_expression "piVar8 = *(int **)(param_1 + 0x18)" identifier = (pointer_expression "*(int **)(param_1 + 0x18)" * (cast_expression "(int **)(param_1 + 0x18)" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0x18)" ( (binary_expression "param_1 + 0x18" identifier + number_literal) ))))) ;) (expression_statement "*(undefined4 *)(param_1 + 0x14) = 0;" (assignment_expression "*(undefined4 *)(param_1 + 0x14) = 0" (pointer_expression "*(undefined4 *)(param_1 + 0x14)" * (cast_expression "(undefined4 *)(param_1 + 0x14)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x14)" ( (binary_expression "param_1 + 0x14" identifier + number_literal) )))) = number_literal) ;) (expression_statement "piVar1 = (int *)piVar8[3];" (assignment_expression "piVar1 = (int *)piVar8[3]" identifier = (cast_expression "(int *)piVar8[3]" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (subscript_expression "piVar8[3]" identifier [ number_literal ]))) ;) (if_statement "if (piVar8 == piVar1) {\nLAB_00090e18:\n    piVar2 = piVar1;\n    if ((param_3 & 1) == 0) {\n      do {\n        piVar4 = piVar2;\n        piVar2 = (int *)piVar4[3];\n      } while (piVar8 != piVar2);\n      piVar4[3] = 0;\n      piVar8[4] = (int)piVar8;\n      piVar8[3] = (int)piVar8;\n      *(undefined4 *)(param_1 + 0xc) = 0xffffffff;\n      *(undefined4 *)(param_1 + 8) = 0xffffffff;\n      *(undefined4 *)(param_1 + 0x10) = 0;\n      return piVar1;\n    }\n    array_flush(param_1);\n  }\n  else {\n    iVar6 = 0;\n    piVar2 = piVar1;\n    do {\n      piVar2 = (int *)piVar2[3];\n      iVar6 = iVar6 + 1;\n      if (piVar8 == piVar2) goto LAB_00090e18;\n    } while (param_2 != iVar6);\n    *(undefined4 *)(piVar2[4] + 0xc) = 0;\n    piVar8[3] = (int)piVar2;\n    piVar2[4] = (int)piVar8;\n    do {\n      uVar7 = piVar2[1];\n      uVar9 = uVar7 - iVar6;\n      piVar2[1] = uVar9;\n      *piVar2 = (*piVar2 - (iVar6 >> 0x1f)) - (uint)(uVar7 < uVar9);\n      piVar2 = (int *)piVar2[3];\n    } while (piVar8 != piVar2);\n    puVar3 = (undefined4 *)piVar8[4];\n    *(int *)(param_1 + 0x10) = iVar10 - iVar6;\n    uVar5 = *puVar3;\n    *(undefined4 *)(param_1 + 0xc) = puVar3[1];\n    *(undefined4 *)(param_1 + 8) = uVar5;\n    if ((param_3 & 1) == 0) {\n      return piVar1;\n    }\n    while (piVar1 != (int *)0x0) {\n      piVar8 = (int *)piVar1[3];\n      array_dispose_element(piVar1);\n      piVar1 = piVar8;\n    }\n  }" if (parenthesized_expression "(piVar8 == piVar1)" ( (binary_expression "piVar8 == piVar1" identifier == identifier) )) (compound_statement "{\nLAB_00090e18:\n    piVar2 = piVar1;\n    if ((param_3 & 1) == 0) {\n      do {\n        piVar4 = piVar2;\n        piVar2 = (int *)piVar4[3];\n      } while (piVar8 != piVar2);\n      piVar4[3] = 0;\n      piVar8[4] = (int)piVar8;\n      piVar8[3] = (int)piVar8;\n      *(undefined4 *)(param_1 + 0xc) = 0xffffffff;\n      *(undefined4 *)(param_1 + 8) = 0xffffffff;\n      *(undefined4 *)(param_1 + 0x10) = 0;\n      return piVar1;\n    }\n    array_flush(param_1);\n  }" { (labeled_statement "LAB_00090e18:\n    piVar2 = piVar1;" statement_identifier : (expression_statement "piVar2 = piVar1;" (assignment_expression "piVar2 = piVar1" identifier = identifier) ;)) (if_statement "if ((param_3 & 1) == 0) {\n      do {\n        piVar4 = piVar2;\n        piVar2 = (int *)piVar4[3];\n      } while (piVar8 != piVar2);\n      piVar4[3] = 0;\n      piVar8[4] = (int)piVar8;\n      piVar8[3] = (int)piVar8;\n      *(undefined4 *)(param_1 + 0xc) = 0xffffffff;\n      *(undefined4 *)(param_1 + 8) = 0xffffffff;\n      *(undefined4 *)(param_1 + 0x10) = 0;\n      return piVar1;\n    }" if (parenthesized_expression "((param_3 & 1) == 0)" ( (binary_expression "(param_3 & 1) == 0" (parenthesized_expression "(param_3 & 1)" ( (binary_expression "param_3 & 1" identifier & number_literal) )) == number_literal) )) (compound_statement "{\n      do {\n        piVar4 = piVar2;\n        piVar2 = (int *)piVar4[3];\n      } while (piVar8 != piVar2);\n      piVar4[3] = 0;\n      piVar8[4] = (int)piVar8;\n      piVar8[3] = (int)piVar8;\n      *(undefined4 *)(param_1 + 0xc) = 0xffffffff;\n      *(undefined4 *)(param_1 + 8) = 0xffffffff;\n      *(undefined4 *)(param_1 + 0x10) = 0;\n      return piVar1;\n    }" { (do_statement "do {\n        piVar4 = piVar2;\n        piVar2 = (int *)piVar4[3];\n      } while (piVar8 != piVar2);" do (compound_statement "{\n        piVar4 = piVar2;\n        piVar2 = (int *)piVar4[3];\n      }" { (expression_statement "piVar4 = piVar2;" (assignment_expression "piVar4 = piVar2" identifier = identifier) ;) (expression_statement "piVar2 = (int *)piVar4[3];" (assignment_expression "piVar2 = (int *)piVar4[3]" identifier = (cast_expression "(int *)piVar4[3]" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (subscript_expression "piVar4[3]" identifier [ number_literal ]))) ;) }) while (parenthesized_expression "(piVar8 != piVar2)" ( (binary_expression "piVar8 != piVar2" identifier != identifier) )) ;) (expression_statement "piVar4[3] = 0;" (assignment_expression "piVar4[3] = 0" (subscript_expression "piVar4[3]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "piVar8[4] = (int)piVar8;" (assignment_expression "piVar8[4] = (int)piVar8" (subscript_expression "piVar8[4]" identifier [ number_literal ]) = (cast_expression "(int)piVar8" ( (type_descriptor "int" primitive_type) ) identifier)) ;) (expression_statement "piVar8[3] = (int)piVar8;" (assignment_expression "piVar8[3] = (int)piVar8" (subscript_expression "piVar8[3]" identifier [ number_literal ]) = (cast_expression "(int)piVar8" ( (type_descriptor "int" primitive_type) ) identifier)) ;) (expression_statement "*(undefined4 *)(param_1 + 0xc) = 0xffffffff;" (assignment_expression "*(undefined4 *)(param_1 + 0xc) = 0xffffffff" (pointer_expression "*(undefined4 *)(param_1 + 0xc)" * (cast_expression "(undefined4 *)(param_1 + 0xc)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xc)" ( (binary_expression "param_1 + 0xc" identifier + number_literal) )))) = number_literal) ;) (expression_statement "*(undefined4 *)(param_1 + 8) = 0xffffffff;" (assignment_expression "*(undefined4 *)(param_1 + 8) = 0xffffffff" (pointer_expression "*(undefined4 *)(param_1 + 8)" * (cast_expression "(undefined4 *)(param_1 + 8)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) )))) = number_literal) ;) (expression_statement "*(undefined4 *)(param_1 + 0x10) = 0;" (assignment_expression "*(undefined4 *)(param_1 + 0x10) = 0" (pointer_expression "*(undefined4 *)(param_1 + 0x10)" * (cast_expression "(undefined4 *)(param_1 + 0x10)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) )))) = number_literal) ;) (return_statement "return piVar1;" return identifier ;) })) (expression_statement "array_flush(param_1);" (call_expression "array_flush(param_1)" identifier (argument_list "(param_1)" ( identifier ))) ;) }) (else_clause "else {\n    iVar6 = 0;\n    piVar2 = piVar1;\n    do {\n      piVar2 = (int *)piVar2[3];\n      iVar6 = iVar6 + 1;\n      if (piVar8 == piVar2) goto LAB_00090e18;\n    } while (param_2 != iVar6);\n    *(undefined4 *)(piVar2[4] + 0xc) = 0;\n    piVar8[3] = (int)piVar2;\n    piVar2[4] = (int)piVar8;\n    do {\n      uVar7 = piVar2[1];\n      uVar9 = uVar7 - iVar6;\n      piVar2[1] = uVar9;\n      *piVar2 = (*piVar2 - (iVar6 >> 0x1f)) - (uint)(uVar7 < uVar9);\n      piVar2 = (int *)piVar2[3];\n    } while (piVar8 != piVar2);\n    puVar3 = (undefined4 *)piVar8[4];\n    *(int *)(param_1 + 0x10) = iVar10 - iVar6;\n    uVar5 = *puVar3;\n    *(undefined4 *)(param_1 + 0xc) = puVar3[1];\n    *(undefined4 *)(param_1 + 8) = uVar5;\n    if ((param_3 & 1) == 0) {\n      return piVar1;\n    }\n    while (piVar1 != (int *)0x0) {\n      piVar8 = (int *)piVar1[3];\n      array_dispose_element(piVar1);\n      piVar1 = piVar8;\n    }\n  }" else (compound_statement "{\n    iVar6 = 0;\n    piVar2 = piVar1;\n    do {\n      piVar2 = (int *)piVar2[3];\n      iVar6 = iVar6 + 1;\n      if (piVar8 == piVar2) goto LAB_00090e18;\n    } while (param_2 != iVar6);\n    *(undefined4 *)(piVar2[4] + 0xc) = 0;\n    piVar8[3] = (int)piVar2;\n    piVar2[4] = (int)piVar8;\n    do {\n      uVar7 = piVar2[1];\n      uVar9 = uVar7 - iVar6;\n      piVar2[1] = uVar9;\n      *piVar2 = (*piVar2 - (iVar6 >> 0x1f)) - (uint)(uVar7 < uVar9);\n      piVar2 = (int *)piVar2[3];\n    } while (piVar8 != piVar2);\n    puVar3 = (undefined4 *)piVar8[4];\n    *(int *)(param_1 + 0x10) = iVar10 - iVar6;\n    uVar5 = *puVar3;\n    *(undefined4 *)(param_1 + 0xc) = puVar3[1];\n    *(undefined4 *)(param_1 + 8) = uVar5;\n    if ((param_3 & 1) == 0) {\n      return piVar1;\n    }\n    while (piVar1 != (int *)0x0) {\n      piVar8 = (int *)piVar1[3];\n      array_dispose_element(piVar1);\n      piVar1 = piVar8;\n    }\n  }" { (expression_statement "iVar6 = 0;" (assignment_expression "iVar6 = 0" identifier = number_literal) ;) (expression_statement "piVar2 = piVar1;" (assignment_expression "piVar2 = piVar1" identifier = identifier) ;) (do_statement "do {\n      piVar2 = (int *)piVar2[3];\n      iVar6 = iVar6 + 1;\n      if (piVar8 == piVar2) goto LAB_00090e18;\n    } while (param_2 != iVar6);" do (compound_statement "{\n      piVar2 = (int *)piVar2[3];\n      iVar6 = iVar6 + 1;\n      if (piVar8 == piVar2) goto LAB_00090e18;\n    }" { (expression_statement "piVar2 = (int *)piVar2[3];" (assignment_expression "piVar2 = (int *)piVar2[3]" identifier = (cast_expression "(int *)piVar2[3]" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (subscript_expression "piVar2[3]" identifier [ number_literal ]))) ;) (expression_statement "iVar6 = iVar6 + 1;" (assignment_expression "iVar6 = iVar6 + 1" identifier = (binary_expression "iVar6 + 1" identifier + number_literal)) ;) (if_statement "if (piVar8 == piVar2) goto LAB_00090e18;" if (parenthesized_expression "(piVar8 == piVar2)" ( (binary_expression "piVar8 == piVar2" identifier == identifier) )) (goto_statement "goto LAB_00090e18;" goto statement_identifier ;)) }) while (parenthesized_expression "(param_2 != iVar6)" ( (binary_expression "param_2 != iVar6" identifier != identifier) )) ;) (expression_statement "*(undefined4 *)(piVar2[4] + 0xc) = 0;" (assignment_expression "*(undefined4 *)(piVar2[4] + 0xc) = 0" (pointer_expression "*(undefined4 *)(piVar2[4] + 0xc)" * (cast_expression "(undefined4 *)(piVar2[4] + 0xc)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(piVar2[4] + 0xc)" ( (binary_expression "piVar2[4] + 0xc" (subscript_expression "piVar2[4]" identifier [ number_literal ]) + number_literal) )))) = number_literal) ;) (expression_statement "piVar8[3] = (int)piVar2;" (assignment_expression "piVar8[3] = (int)piVar2" (subscript_expression "piVar8[3]" identifier [ number_literal ]) = (cast_expression "(int)piVar2" ( (type_descriptor "int" primitive_type) ) identifier)) ;) (expression_statement "piVar2[4] = (int)piVar8;" (assignment_expression "piVar2[4] = (int)piVar8" (subscript_expression "piVar2[4]" identifier [ number_literal ]) = (cast_expression "(int)piVar8" ( (type_descriptor "int" primitive_type) ) identifier)) ;) (do_statement "do {\n      uVar7 = piVar2[1];\n      uVar9 = uVar7 - iVar6;\n      piVar2[1] = uVar9;\n      *piVar2 = (*piVar2 - (iVar6 >> 0x1f)) - (uint)(uVar7 < uVar9);\n      piVar2 = (int *)piVar2[3];\n    } while (piVar8 != piVar2);" do (compound_statement "{\n      uVar7 = piVar2[1];\n      uVar9 = uVar7 - iVar6;\n      piVar2[1] = uVar9;\n      *piVar2 = (*piVar2 - (iVar6 >> 0x1f)) - (uint)(uVar7 < uVar9);\n      piVar2 = (int *)piVar2[3];\n    }" { (expression_statement "uVar7 = piVar2[1];" (assignment_expression "uVar7 = piVar2[1]" identifier = (subscript_expression "piVar2[1]" identifier [ number_literal ])) ;) (expression_statement "uVar9 = uVar7 - iVar6;" (assignment_expression "uVar9 = uVar7 - iVar6" identifier = (binary_expression "uVar7 - iVar6" identifier - identifier)) ;) (expression_statement "piVar2[1] = uVar9;" (assignment_expression "piVar2[1] = uVar9" (subscript_expression "piVar2[1]" identifier [ number_literal ]) = identifier) ;) (expression_statement "*piVar2 = (*piVar2 - (iVar6 >> 0x1f)) - (uint)(uVar7 < uVar9);" (assignment_expression "*piVar2 = (*piVar2 - (iVar6 >> 0x1f)) - (uint)(uVar7 < uVar9)" (pointer_expression "*piVar2" * identifier) = (binary_expression "(*piVar2 - (iVar6 >> 0x1f)) - (uint)(uVar7 < uVar9)" (parenthesized_expression "(*piVar2 - (iVar6 >> 0x1f))" ( (binary_expression "*piVar2 - (iVar6 >> 0x1f)" (pointer_expression "*piVar2" * identifier) - (parenthesized_expression "(iVar6 >> 0x1f)" ( (binary_expression "iVar6 >> 0x1f" identifier >> number_literal) ))) )) - (call_expression "(uint)(uVar7 < uVar9)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(uVar7 < uVar9)" ( (binary_expression "uVar7 < uVar9" identifier < identifier) ))))) ;) (expression_statement "piVar2 = (int *)piVar2[3];" (assignment_expression "piVar2 = (int *)piVar2[3]" identifier = (cast_expression "(int *)piVar2[3]" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (subscript_expression "piVar2[3]" identifier [ number_literal ]))) ;) }) while (parenthesized_expression "(piVar8 != piVar2)" ( (binary_expression "piVar8 != piVar2" identifier != identifier) )) ;) (expression_statement "puVar3 = (undefined4 *)piVar8[4];" (assignment_expression "puVar3 = (undefined4 *)piVar8[4]" identifier = (cast_expression "(undefined4 *)piVar8[4]" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (subscript_expression "piVar8[4]" identifier [ number_literal ]))) ;) (expression_statement "*(int *)(param_1 + 0x10) = iVar10 - iVar6;" (assignment_expression "*(int *)(param_1 + 0x10) = iVar10 - iVar6" (pointer_expression "*(int *)(param_1 + 0x10)" * (cast_expression "(int *)(param_1 + 0x10)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) )))) = (binary_expression "iVar10 - iVar6" identifier - identifier)) ;) (expression_statement "uVar5 = *puVar3;" (assignment_expression "uVar5 = *puVar3" identifier = (pointer_expression "*puVar3" * identifier)) ;) (expression_statement "*(undefined4 *)(param_1 + 0xc) = puVar3[1];" (assignment_expression "*(undefined4 *)(param_1 + 0xc) = puVar3[1]" (pointer_expression "*(undefined4 *)(param_1 + 0xc)" * (cast_expression "(undefined4 *)(param_1 + 0xc)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xc)" ( (binary_expression "param_1 + 0xc" identifier + number_literal) )))) = (subscript_expression "puVar3[1]" identifier [ number_literal ])) ;) (expression_statement "*(undefined4 *)(param_1 + 8) = uVar5;" (assignment_expression "*(undefined4 *)(param_1 + 8) = uVar5" (pointer_expression "*(undefined4 *)(param_1 + 8)" * (cast_expression "(undefined4 *)(param_1 + 8)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) )))) = identifier) ;) (if_statement "if ((param_3 & 1) == 0) {\n      return piVar1;\n    }" if (parenthesized_expression "((param_3 & 1) == 0)" ( (binary_expression "(param_3 & 1) == 0" (parenthesized_expression "(param_3 & 1)" ( (binary_expression "param_3 & 1" identifier & number_literal) )) == number_literal) )) (compound_statement "{\n      return piVar1;\n    }" { (return_statement "return piVar1;" return identifier ;) })) (while_statement "while (piVar1 != (int *)0x0) {\n      piVar8 = (int *)piVar1[3];\n      array_dispose_element(piVar1);\n      piVar1 = piVar8;\n    }" while (parenthesized_expression "(piVar1 != (int *)0x0)" ( (binary_expression "piVar1 != (int *)0x0" identifier != (cast_expression "(int *)0x0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      piVar8 = (int *)piVar1[3];\n      array_dispose_element(piVar1);\n      piVar1 = piVar8;\n    }" { (expression_statement "piVar8 = (int *)piVar1[3];" (assignment_expression "piVar8 = (int *)piVar1[3]" identifier = (cast_expression "(int *)piVar1[3]" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (subscript_expression "piVar1[3]" identifier [ number_literal ]))) ;) (expression_statement "array_dispose_element(piVar1);" (call_expression "array_dispose_element(piVar1)" identifier (argument_list "(piVar1)" ( identifier ))) ;) (expression_statement "piVar1 = piVar8;" (assignment_expression "piVar1 = piVar8" identifier = identifier) ;) })) }))) (return_statement "return (int *)0x0;" return (cast_expression "(int *)0x0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) ;) })))
(translation_unit (function_definition TYPE (pointer_declarator * (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) )))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT == LIT) )) || (parenthesized_expression ( (comma_expression (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) , (binary_expression IDENT == LIT)) ))) )) || (parenthesized_expression ( (binary_expression IDENT < LIT) ))) )) (compound_statement { (return_statement return (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT) ;) })) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = LIT) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (subscript_expression IDENT [ LIT ]))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == IDENT) )) (compound_statement { (labeled_statement statement_identifier : (expression_statement (assignment_expression IDENT = IDENT) ;)) (if_statement if (parenthesized_expression ( (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 = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (subscript_expression IDENT [ LIT ]))) ;) }) while (parenthesized_expression ( (binary_expression IDENT != IDENT) )) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = LIT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (cast_expression ( (type_descriptor TYPE) ) IDENT)) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (cast_expression ( (type_descriptor TYPE) ) IDENT)) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = LIT) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = LIT) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = LIT) ;) (return_statement return IDENT ;) })) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (subscript_expression IDENT [ LIT ]))) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == IDENT) )) (goto_statement goto statement_identifier ;)) }) while (parenthesized_expression ( (binary_expression IDENT != IDENT) )) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (subscript_expression IDENT [ LIT ]) + LIT) )))) = LIT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (cast_expression ( (type_descriptor TYPE) ) IDENT)) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (cast_expression ( (type_descriptor TYPE) ) IDENT)) ;) (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT - IDENT)) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = (binary_expression (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) - (parenthesized_expression ( (binary_expression IDENT >> LIT) ))) )) - (call_expression (parenthesized_expression ( IDENT )) (argument_list ( (binary_expression IDENT < IDENT) ))))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (subscript_expression IDENT [ LIT ]))) ;) }) while (parenthesized_expression ( (binary_expression IDENT != IDENT) )) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (subscript_expression IDENT [ LIT ]))) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = (binary_expression IDENT - IDENT)) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = (subscript_expression IDENT [ LIT ])) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT & LIT) )) == LIT) )) (compound_statement { (return_statement return IDENT ;) })) (while_statement while (parenthesized_expression ( (binary_expression IDENT != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (subscript_expression IDENT [ LIT ]))) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) })) }))) (return_statement return (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT) ;) })))
(function_definition "int * array_shift(int param_1,int param_2,uint param_3)\n\n{\n  int *piVar1;\n  int *piVar2;\n  undefined4 *puVar3;\n  int *piVar4;\n  undefined4 uVar5;\n  int iVar6;\n  uint uVar7;\n  int *piVar8;\n  uint uVar9;\n  int iVar10;\n  \n  if (((param_1 == 0) || (iVar10 = *(int *)(param_1 + 0x10), iVar10 == 0)) || (param_2 < 1)) {\n    return (int *)0x0;\n  }\n  piVar8 = *(int **)(param_1 + 0x18);\n  *(undefined4 *)(param_1 + 0x14) = 0;\n  piVar1 = (int *)piVar8[3];\n  if (piVar8 == piVar1) {\nLAB_00090e18:\n    piVar2 = piVar1;\n    if ((param_3 & 1) == 0) {\n      do {\n        piVar4 = piVar2;\n        piVar2 = (int *)piVar4[3];\n      } while (piVar8 != piVar2);\n      piVar4[3] = 0;\n      piVar8[4] = (int)piVar8;\n      piVar8[3] = (int)piVar8;\n      *(undefined4 *)(param_1 + 0xc) = 0xffffffff;\n      *(undefined4 *)(param_1 + 8) = 0xffffffff;\n      *(undefined4 *)(param_1 + 0x10) = 0;\n      return piVar1;\n    }\n    array_flush(param_1);\n  }\n  else {\n    iVar6 = 0;\n    piVar2 = piVar1;\n    do {\n      piVar2 = (int *)piVar2[3];\n      iVar6 = iVar6 + 1;\n      if (piVar8 == piVar2) goto LAB_00090e18;\n    } while (param_2 != iVar6);\n    *(undefined4 *)(piVar2[4] + 0xc) = 0;\n    piVar8[3] = (int)piVar2;\n    piVar2[4] = (int)piVar8;\n    do {\n      uVar7 = piVar2[1];\n      uVar9 = uVar7 - iVar6;\n      piVar2[1] = uVar9;\n      *piVar2 = (*piVar2 - (iVar6 >> 0x1f)) - (uint)(uVar7 < uVar9);\n      piVar2 = (int *)piVar2[3];\n    } while (piVar8 != piVar2);\n    puVar3 = (undefined4 *)piVar8[4];\n    *(int *)(param_1 + 0x10) = iVar10 - iVar6;\n    uVar5 = *puVar3;\n    *(undefined4 *)(param_1 + 0xc) = puVar3[1];\n    *(undefined4 *)(param_1 + 8) = uVar5;\n    if ((param_3 & 1) == 0) {\n      return piVar1;\n    }\n    while (piVar1 != (int *)0x0) {\n      piVar8 = (int *)piVar1[3];\n      array_dispose_element(piVar1);\n      piVar1 = piVar8;\n    }\n  }\n  return (int *)0x0;\n}" (primitive_type "int") (pointer_declarator "* array_shift(int param_1,int param_2,uint param_3)" (* "*") (function_declarator "array_shift(int param_1,int param_2,uint param_3)" (identifier "array_shift") (parameter_list "(int param_1,int param_2,uint param_3)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) (, ",") (parameter_declaration "int param_2" (primitive_type "int") (identifier "param_2")) (, ",") (parameter_declaration "uint param_3" (type_identifier "uint") (identifier "param_3")) () ")")))) (compound_statement "{\n  int *piVar1;\n  int *piVar2;\n  undefined4 *puVar3;\n  int *piVar4;\n  undefined4 uVar5;\n  int iVar6;\n  uint uVar7;\n  int *piVar8;\n  uint uVar9;\n  int iVar10;\n  \n  if (((param_1 == 0) || (iVar10 = *(int *)(param_1 + 0x10), iVar10 == 0)) || (param_2 < 1)) {\n    return (int *)0x0;\n  }\n  piVar8 = *(int **)(param_1 + 0x18);\n  *(undefined4 *)(param_1 + 0x14) = 0;\n  piVar1 = (int *)piVar8[3];\n  if (piVar8 == piVar1) {\nLAB_00090e18:\n    piVar2 = piVar1;\n    if ((param_3 & 1) == 0) {\n      do {\n        piVar4 = piVar2;\n        piVar2 = (int *)piVar4[3];\n      } while (piVar8 != piVar2);\n      piVar4[3] = 0;\n      piVar8[4] = (int)piVar8;\n      piVar8[3] = (int)piVar8;\n      *(undefined4 *)(param_1 + 0xc) = 0xffffffff;\n      *(undefined4 *)(param_1 + 8) = 0xffffffff;\n      *(undefined4 *)(param_1 + 0x10) = 0;\n      return piVar1;\n    }\n    array_flush(param_1);\n  }\n  else {\n    iVar6 = 0;\n    piVar2 = piVar1;\n    do {\n      piVar2 = (int *)piVar2[3];\n      iVar6 = iVar6 + 1;\n      if (piVar8 == piVar2) goto LAB_00090e18;\n    } while (param_2 != iVar6);\n    *(undefined4 *)(piVar2[4] + 0xc) = 0;\n    piVar8[3] = (int)piVar2;\n    piVar2[4] = (int)piVar8;\n    do {\n      uVar7 = piVar2[1];\n      uVar9 = uVar7 - iVar6;\n      piVar2[1] = uVar9;\n      *piVar2 = (*piVar2 - (iVar6 >> 0x1f)) - (uint)(uVar7 < uVar9);\n      piVar2 = (int *)piVar2[3];\n    } while (piVar8 != piVar2);\n    puVar3 = (undefined4 *)piVar8[4];\n    *(int *)(param_1 + 0x10) = iVar10 - iVar6;\n    uVar5 = *puVar3;\n    *(undefined4 *)(param_1 + 0xc) = puVar3[1];\n    *(undefined4 *)(param_1 + 8) = uVar5;\n    if ((param_3 & 1) == 0) {\n      return piVar1;\n    }\n    while (piVar1 != (int *)0x0) {\n      piVar8 = (int *)piVar1[3];\n      array_dispose_element(piVar1);\n      piVar1 = piVar8;\n    }\n  }\n  return (int *)0x0;\n}" ({ "{") (declaration "int *piVar1;" (primitive_type "int") (pointer_declarator "*piVar1" (* "*") (identifier "piVar1")) (; ";")) (declaration "int *piVar2;" (primitive_type "int") (pointer_declarator "*piVar2" (* "*") (identifier "piVar2")) (; ";")) (declaration "undefined4 *puVar3;" (type_identifier "undefined4") (pointer_declarator "*puVar3" (* "*") (identifier "puVar3")) (; ";")) (declaration "int *piVar4;" (primitive_type "int") (pointer_declarator "*piVar4" (* "*") (identifier "piVar4")) (; ";")) (declaration "undefined4 uVar5;" (type_identifier "undefined4") (identifier "uVar5") (; ";")) (declaration "int iVar6;" (primitive_type "int") (identifier "iVar6") (; ";")) (declaration "uint uVar7;" (type_identifier "uint") (identifier "uVar7") (; ";")) (declaration "int *piVar8;" (primitive_type "int") (pointer_declarator "*piVar8" (* "*") (identifier "piVar8")) (; ";")) (declaration "uint uVar9;" (type_identifier "uint") (identifier "uVar9") (; ";")) (declaration "int iVar10;" (primitive_type "int") (identifier "iVar10") (; ";")) (if_statement "if (((param_1 == 0) || (iVar10 = *(int *)(param_1 + 0x10), iVar10 == 0)) || (param_2 < 1)) {\n    return (int *)0x0;\n  }" (if "if") (parenthesized_expression "(((param_1 == 0) || (iVar10 = *(int *)(param_1 + 0x10), iVar10 == 0)) || (param_2 < 1))" (( "(") (binary_expression "((param_1 == 0) || (iVar10 = *(int *)(param_1 + 0x10), iVar10 == 0)) || (param_2 < 1)" (parenthesized_expression "((param_1 == 0) || (iVar10 = *(int *)(param_1 + 0x10), iVar10 == 0))" (( "(") (binary_expression "(param_1 == 0) || (iVar10 = *(int *)(param_1 + 0x10), iVar10 == 0)" (parenthesized_expression "(param_1 == 0)" (( "(") (binary_expression "param_1 == 0" (identifier "param_1") (== "==") (number_literal "0")) () ")")) (|| "||") (parenthesized_expression "(iVar10 = *(int *)(param_1 + 0x10), iVar10 == 0)" (( "(") (comma_expression "iVar10 = *(int *)(param_1 + 0x10), iVar10 == 0" (assignment_expression "iVar10 = *(int *)(param_1 + 0x10)" (identifier "iVar10") (= "=") (pointer_expression "*(int *)(param_1 + 0x10)" (* "*") (cast_expression "(int *)(param_1 + 0x10)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x10)" (( "(") (binary_expression "param_1 + 0x10" (identifier "param_1") (+ "+") (number_literal "0x10")) () ")"))))) (, ",") (binary_expression "iVar10 == 0" (identifier "iVar10") (== "==") (number_literal "0"))) () ")"))) () ")")) (|| "||") (parenthesized_expression "(param_2 < 1)" (( "(") (binary_expression "param_2 < 1" (identifier "param_2") (< "<") (number_literal "1")) () ")"))) () ")")) (compound_statement "{\n    return (int *)0x0;\n  }" ({ "{") (return_statement "return (int *)0x0;" (return "return") (cast_expression "(int *)0x0" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0")) (; ";")) (} "}"))) (expression_statement "piVar8 = *(int **)(param_1 + 0x18);" (assignment_expression "piVar8 = *(int **)(param_1 + 0x18)" (identifier "piVar8") (= "=") (pointer_expression "*(int **)(param_1 + 0x18)" (* "*") (cast_expression "(int **)(param_1 + 0x18)" (( "(") (type_descriptor "int **" (primitive_type "int") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(param_1 + 0x18)" (( "(") (binary_expression "param_1 + 0x18" (identifier "param_1") (+ "+") (number_literal "0x18")) () ")"))))) (; ";")) (expression_statement "*(undefined4 *)(param_1 + 0x14) = 0;" (assignment_expression "*(undefined4 *)(param_1 + 0x14) = 0" (pointer_expression "*(undefined4 *)(param_1 + 0x14)" (* "*") (cast_expression "(undefined4 *)(param_1 + 0x14)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x14)" (( "(") (binary_expression "param_1 + 0x14" (identifier "param_1") (+ "+") (number_literal "0x14")) () ")")))) (= "=") (number_literal "0")) (; ";")) (expression_statement "piVar1 = (int *)piVar8[3];" (assignment_expression "piVar1 = (int *)piVar8[3]" (identifier "piVar1") (= "=") (cast_expression "(int *)piVar8[3]" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (subscript_expression "piVar8[3]" (identifier "piVar8") ([ "[") (number_literal "3") (] "]")))) (; ";")) (if_statement "if (piVar8 == piVar1) {\nLAB_00090e18:\n    piVar2 = piVar1;\n    if ((param_3 & 1) == 0) {\n      do {\n        piVar4 = piVar2;\n        piVar2 = (int *)piVar4[3];\n      } while (piVar8 != piVar2);\n      piVar4[3] = 0;\n      piVar8[4] = (int)piVar8;\n      piVar8[3] = (int)piVar8;\n      *(undefined4 *)(param_1 + 0xc) = 0xffffffff;\n      *(undefined4 *)(param_1 + 8) = 0xffffffff;\n      *(undefined4 *)(param_1 + 0x10) = 0;\n      return piVar1;\n    }\n    array_flush(param_1);\n  }\n  else {\n    iVar6 = 0;\n    piVar2 = piVar1;\n    do {\n      piVar2 = (int *)piVar2[3];\n      iVar6 = iVar6 + 1;\n      if (piVar8 == piVar2) goto LAB_00090e18;\n    } while (param_2 != iVar6);\n    *(undefined4 *)(piVar2[4] + 0xc) = 0;\n    piVar8[3] = (int)piVar2;\n    piVar2[4] = (int)piVar8;\n    do {\n      uVar7 = piVar2[1];\n      uVar9 = uVar7 - iVar6;\n      piVar2[1] = uVar9;\n      *piVar2 = (*piVar2 - (iVar6 >> 0x1f)) - (uint)(uVar7 < uVar9);\n      piVar2 = (int *)piVar2[3];\n    } while (piVar8 != piVar2);\n    puVar3 = (undefined4 *)piVar8[4];\n    *(int *)(param_1 + 0x10) = iVar10 - iVar6;\n    uVar5 = *puVar3;\n    *(undefined4 *)(param_1 + 0xc) = puVar3[1];\n    *(undefined4 *)(param_1 + 8) = uVar5;\n    if ((param_3 & 1) == 0) {\n      return piVar1;\n    }\n    while (piVar1 != (int *)0x0) {\n      piVar8 = (int *)piVar1[3];\n      array_dispose_element(piVar1);\n      piVar1 = piVar8;\n    }\n  }" (if "if") (parenthesized_expression "(piVar8 == piVar1)" (( "(") (binary_expression "piVar8 == piVar1" (identifier "piVar8") (== "==") (identifier "piVar1")) () ")")) (compound_statement "{\nLAB_00090e18:\n    piVar2 = piVar1;\n    if ((param_3 & 1) == 0) {\n      do {\n        piVar4 = piVar2;\n        piVar2 = (int *)piVar4[3];\n      } while (piVar8 != piVar2);\n      piVar4[3] = 0;\n      piVar8[4] = (int)piVar8;\n      piVar8[3] = (int)piVar8;\n      *(undefined4 *)(param_1 + 0xc) = 0xffffffff;\n      *(undefined4 *)(param_1 + 8) = 0xffffffff;\n      *(undefined4 *)(param_1 + 0x10) = 0;\n      return piVar1;\n    }\n    array_flush(param_1);\n  }" ({ "{") (labeled_statement "LAB_00090e18:\n    piVar2 = piVar1;" (statement_identifier "LAB_00090e18") (: ":") (expression_statement "piVar2 = piVar1;" (assignment_expression "piVar2 = piVar1" (identifier "piVar2") (= "=") (identifier "piVar1")) (; ";"))) (if_statement "if ((param_3 & 1) == 0) {\n      do {\n        piVar4 = piVar2;\n        piVar2 = (int *)piVar4[3];\n      } while (piVar8 != piVar2);\n      piVar4[3] = 0;\n      piVar8[4] = (int)piVar8;\n      piVar8[3] = (int)piVar8;\n      *(undefined4 *)(param_1 + 0xc) = 0xffffffff;\n      *(undefined4 *)(param_1 + 8) = 0xffffffff;\n      *(undefined4 *)(param_1 + 0x10) = 0;\n      return piVar1;\n    }" (if "if") (parenthesized_expression "((param_3 & 1) == 0)" (( "(") (binary_expression "(param_3 & 1) == 0" (parenthesized_expression "(param_3 & 1)" (( "(") (binary_expression "param_3 & 1" (identifier "param_3") (& "&") (number_literal "1")) () ")")) (== "==") (number_literal "0")) () ")")) (compound_statement "{\n      do {\n        piVar4 = piVar2;\n        piVar2 = (int *)piVar4[3];\n      } while (piVar8 != piVar2);\n      piVar4[3] = 0;\n      piVar8[4] = (int)piVar8;\n      piVar8[3] = (int)piVar8;\n      *(undefined4 *)(param_1 + 0xc) = 0xffffffff;\n      *(undefined4 *)(param_1 + 8) = 0xffffffff;\n      *(undefined4 *)(param_1 + 0x10) = 0;\n      return piVar1;\n    }" ({ "{") (do_statement "do {\n        piVar4 = piVar2;\n        piVar2 = (int *)piVar4[3];\n      } while (piVar8 != piVar2);" (do "do") (compound_statement "{\n        piVar4 = piVar2;\n        piVar2 = (int *)piVar4[3];\n      }" ({ "{") (expression_statement "piVar4 = piVar2;" (assignment_expression "piVar4 = piVar2" (identifier "piVar4") (= "=") (identifier "piVar2")) (; ";")) (expression_statement "piVar2 = (int *)piVar4[3];" (assignment_expression "piVar2 = (int *)piVar4[3]" (identifier "piVar2") (= "=") (cast_expression "(int *)piVar4[3]" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (subscript_expression "piVar4[3]" (identifier "piVar4") ([ "[") (number_literal "3") (] "]")))) (; ";")) (} "}")) (while "while") (parenthesized_expression "(piVar8 != piVar2)" (( "(") (binary_expression "piVar8 != piVar2" (identifier "piVar8") (!= "!=") (identifier "piVar2")) () ")")) (; ";")) (expression_statement "piVar4[3] = 0;" (assignment_expression "piVar4[3] = 0" (subscript_expression "piVar4[3]" (identifier "piVar4") ([ "[") (number_literal "3") (] "]")) (= "=") (number_literal "0")) (; ";")) (expression_statement "piVar8[4] = (int)piVar8;" (assignment_expression "piVar8[4] = (int)piVar8" (subscript_expression "piVar8[4]" (identifier "piVar8") ([ "[") (number_literal "4") (] "]")) (= "=") (cast_expression "(int)piVar8" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "piVar8"))) (; ";")) (expression_statement "piVar8[3] = (int)piVar8;" (assignment_expression "piVar8[3] = (int)piVar8" (subscript_expression "piVar8[3]" (identifier "piVar8") ([ "[") (number_literal "3") (] "]")) (= "=") (cast_expression "(int)piVar8" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "piVar8"))) (; ";")) (expression_statement "*(undefined4 *)(param_1 + 0xc) = 0xffffffff;" (assignment_expression "*(undefined4 *)(param_1 + 0xc) = 0xffffffff" (pointer_expression "*(undefined4 *)(param_1 + 0xc)" (* "*") (cast_expression "(undefined4 *)(param_1 + 0xc)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0xc)" (( "(") (binary_expression "param_1 + 0xc" (identifier "param_1") (+ "+") (number_literal "0xc")) () ")")))) (= "=") (number_literal "0xffffffff")) (; ";")) (expression_statement "*(undefined4 *)(param_1 + 8) = 0xffffffff;" (assignment_expression "*(undefined4 *)(param_1 + 8) = 0xffffffff" (pointer_expression "*(undefined4 *)(param_1 + 8)" (* "*") (cast_expression "(undefined4 *)(param_1 + 8)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 8)" (( "(") (binary_expression "param_1 + 8" (identifier "param_1") (+ "+") (number_literal "8")) () ")")))) (= "=") (number_literal "0xffffffff")) (; ";")) (expression_statement "*(undefined4 *)(param_1 + 0x10) = 0;" (assignment_expression "*(undefined4 *)(param_1 + 0x10) = 0" (pointer_expression "*(undefined4 *)(param_1 + 0x10)" (* "*") (cast_expression "(undefined4 *)(param_1 + 0x10)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x10)" (( "(") (binary_expression "param_1 + 0x10" (identifier "param_1") (+ "+") (number_literal "0x10")) () ")")))) (= "=") (number_literal "0")) (; ";")) (return_statement "return piVar1;" (return "return") (identifier "piVar1") (; ";")) (} "}"))) (expression_statement "array_flush(param_1);" (call_expression "array_flush(param_1)" (identifier "array_flush") (argument_list "(param_1)" (( "(") (identifier "param_1") () ")"))) (; ";")) (} "}")) (else_clause "else {\n    iVar6 = 0;\n    piVar2 = piVar1;\n    do {\n      piVar2 = (int *)piVar2[3];\n      iVar6 = iVar6 + 1;\n      if (piVar8 == piVar2) goto LAB_00090e18;\n    } while (param_2 != iVar6);\n    *(undefined4 *)(piVar2[4] + 0xc) = 0;\n    piVar8[3] = (int)piVar2;\n    piVar2[4] = (int)piVar8;\n    do {\n      uVar7 = piVar2[1];\n      uVar9 = uVar7 - iVar6;\n      piVar2[1] = uVar9;\n      *piVar2 = (*piVar2 - (iVar6 >> 0x1f)) - (uint)(uVar7 < uVar9);\n      piVar2 = (int *)piVar2[3];\n    } while (piVar8 != piVar2);\n    puVar3 = (undefined4 *)piVar8[4];\n    *(int *)(param_1 + 0x10) = iVar10 - iVar6;\n    uVar5 = *puVar3;\n    *(undefined4 *)(param_1 + 0xc) = puVar3[1];\n    *(undefined4 *)(param_1 + 8) = uVar5;\n    if ((param_3 & 1) == 0) {\n      return piVar1;\n    }\n    while (piVar1 != (int *)0x0) {\n      piVar8 = (int *)piVar1[3];\n      array_dispose_element(piVar1);\n      piVar1 = piVar8;\n    }\n  }" (else "else") (compound_statement "{\n    iVar6 = 0;\n    piVar2 = piVar1;\n    do {\n      piVar2 = (int *)piVar2[3];\n      iVar6 = iVar6 + 1;\n      if (piVar8 == piVar2) goto LAB_00090e18;\n    } while (param_2 != iVar6);\n    *(undefined4 *)(piVar2[4] + 0xc) = 0;\n    piVar8[3] = (int)piVar2;\n    piVar2[4] = (int)piVar8;\n    do {\n      uVar7 = piVar2[1];\n      uVar9 = uVar7 - iVar6;\n      piVar2[1] = uVar9;\n      *piVar2 = (*piVar2 - (iVar6 >> 0x1f)) - (uint)(uVar7 < uVar9);\n      piVar2 = (int *)piVar2[3];\n    } while (piVar8 != piVar2);\n    puVar3 = (undefined4 *)piVar8[4];\n    *(int *)(param_1 + 0x10) = iVar10 - iVar6;\n    uVar5 = *puVar3;\n    *(undefined4 *)(param_1 + 0xc) = puVar3[1];\n    *(undefined4 *)(param_1 + 8) = uVar5;\n    if ((param_3 & 1) == 0) {\n      return piVar1;\n    }\n    while (piVar1 != (int *)0x0) {\n      piVar8 = (int *)piVar1[3];\n      array_dispose_element(piVar1);\n      piVar1 = piVar8;\n    }\n  }" ({ "{") (expression_statement "iVar6 = 0;" (assignment_expression "iVar6 = 0" (identifier "iVar6") (= "=") (number_literal "0")) (; ";")) (expression_statement "piVar2 = piVar1;" (assignment_expression "piVar2 = piVar1" (identifier "piVar2") (= "=") (identifier "piVar1")) (; ";")) (do_statement "do {\n      piVar2 = (int *)piVar2[3];\n      iVar6 = iVar6 + 1;\n      if (piVar8 == piVar2) goto LAB_00090e18;\n    } while (param_2 != iVar6);" (do "do") (compound_statement "{\n      piVar2 = (int *)piVar2[3];\n      iVar6 = iVar6 + 1;\n      if (piVar8 == piVar2) goto LAB_00090e18;\n    }" ({ "{") (expression_statement "piVar2 = (int *)piVar2[3];" (assignment_expression "piVar2 = (int *)piVar2[3]" (identifier "piVar2") (= "=") (cast_expression "(int *)piVar2[3]" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (subscript_expression "piVar2[3]" (identifier "piVar2") ([ "[") (number_literal "3") (] "]")))) (; ";")) (expression_statement "iVar6 = iVar6 + 1;" (assignment_expression "iVar6 = iVar6 + 1" (identifier "iVar6") (= "=") (binary_expression "iVar6 + 1" (identifier "iVar6") (+ "+") (number_literal "1"))) (; ";")) (if_statement "if (piVar8 == piVar2) goto LAB_00090e18;" (if "if") (parenthesized_expression "(piVar8 == piVar2)" (( "(") (binary_expression "piVar8 == piVar2" (identifier "piVar8") (== "==") (identifier "piVar2")) () ")")) (goto_statement "goto LAB_00090e18;" (goto "goto") (statement_identifier "LAB_00090e18") (; ";"))) (} "}")) (while "while") (parenthesized_expression "(param_2 != iVar6)" (( "(") (binary_expression "param_2 != iVar6" (identifier "param_2") (!= "!=") (identifier "iVar6")) () ")")) (; ";")) (expression_statement "*(undefined4 *)(piVar2[4] + 0xc) = 0;" (assignment_expression "*(undefined4 *)(piVar2[4] + 0xc) = 0" (pointer_expression "*(undefined4 *)(piVar2[4] + 0xc)" (* "*") (cast_expression "(undefined4 *)(piVar2[4] + 0xc)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(piVar2[4] + 0xc)" (( "(") (binary_expression "piVar2[4] + 0xc" (subscript_expression "piVar2[4]" (identifier "piVar2") ([ "[") (number_literal "4") (] "]")) (+ "+") (number_literal "0xc")) () ")")))) (= "=") (number_literal "0")) (; ";")) (expression_statement "piVar8[3] = (int)piVar2;" (assignment_expression "piVar8[3] = (int)piVar2" (subscript_expression "piVar8[3]" (identifier "piVar8") ([ "[") (number_literal "3") (] "]")) (= "=") (cast_expression "(int)piVar2" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "piVar2"))) (; ";")) (expression_statement "piVar2[4] = (int)piVar8;" (assignment_expression "piVar2[4] = (int)piVar8" (subscript_expression "piVar2[4]" (identifier "piVar2") ([ "[") (number_literal "4") (] "]")) (= "=") (cast_expression "(int)piVar8" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "piVar8"))) (; ";")) (do_statement "do {\n      uVar7 = piVar2[1];\n      uVar9 = uVar7 - iVar6;\n      piVar2[1] = uVar9;\n      *piVar2 = (*piVar2 - (iVar6 >> 0x1f)) - (uint)(uVar7 < uVar9);\n      piVar2 = (int *)piVar2[3];\n    } while (piVar8 != piVar2);" (do "do") (compound_statement "{\n      uVar7 = piVar2[1];\n      uVar9 = uVar7 - iVar6;\n      piVar2[1] = uVar9;\n      *piVar2 = (*piVar2 - (iVar6 >> 0x1f)) - (uint)(uVar7 < uVar9);\n      piVar2 = (int *)piVar2[3];\n    }" ({ "{") (expression_statement "uVar7 = piVar2[1];" (assignment_expression "uVar7 = piVar2[1]" (identifier "uVar7") (= "=") (subscript_expression "piVar2[1]" (identifier "piVar2") ([ "[") (number_literal "1") (] "]"))) (; ";")) (expression_statement "uVar9 = uVar7 - iVar6;" (assignment_expression "uVar9 = uVar7 - iVar6" (identifier "uVar9") (= "=") (binary_expression "uVar7 - iVar6" (identifier "uVar7") (- "-") (identifier "iVar6"))) (; ";")) (expression_statement "piVar2[1] = uVar9;" (assignment_expression "piVar2[1] = uVar9" (subscript_expression "piVar2[1]" (identifier "piVar2") ([ "[") (number_literal "1") (] "]")) (= "=") (identifier "uVar9")) (; ";")) (expression_statement "*piVar2 = (*piVar2 - (iVar6 >> 0x1f)) - (uint)(uVar7 < uVar9);" (assignment_expression "*piVar2 = (*piVar2 - (iVar6 >> 0x1f)) - (uint)(uVar7 < uVar9)" (pointer_expression "*piVar2" (* "*") (identifier "piVar2")) (= "=") (binary_expression "(*piVar2 - (iVar6 >> 0x1f)) - (uint)(uVar7 < uVar9)" (parenthesized_expression "(*piVar2 - (iVar6 >> 0x1f))" (( "(") (binary_expression "*piVar2 - (iVar6 >> 0x1f)" (pointer_expression "*piVar2" (* "*") (identifier "piVar2")) (- "-") (parenthesized_expression "(iVar6 >> 0x1f)" (( "(") (binary_expression "iVar6 >> 0x1f" (identifier "iVar6") (>> ">>") (number_literal "0x1f")) () ")"))) () ")")) (- "-") (call_expression "(uint)(uVar7 < uVar9)" (parenthesized_expression "(uint)" (( "(") (identifier "uint") () ")")) (argument_list "(uVar7 < uVar9)" (( "(") (binary_expression "uVar7 < uVar9" (identifier "uVar7") (< "<") (identifier "uVar9")) () ")"))))) (; ";")) (expression_statement "piVar2 = (int *)piVar2[3];" (assignment_expression "piVar2 = (int *)piVar2[3]" (identifier "piVar2") (= "=") (cast_expression "(int *)piVar2[3]" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (subscript_expression "piVar2[3]" (identifier "piVar2") ([ "[") (number_literal "3") (] "]")))) (; ";")) (} "}")) (while "while") (parenthesized_expression "(piVar8 != piVar2)" (( "(") (binary_expression "piVar8 != piVar2" (identifier "piVar8") (!= "!=") (identifier "piVar2")) () ")")) (; ";")) (expression_statement "puVar3 = (undefined4 *)piVar8[4];" (assignment_expression "puVar3 = (undefined4 *)piVar8[4]" (identifier "puVar3") (= "=") (cast_expression "(undefined4 *)piVar8[4]" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (subscript_expression "piVar8[4]" (identifier "piVar8") ([ "[") (number_literal "4") (] "]")))) (; ";")) (expression_statement "*(int *)(param_1 + 0x10) = iVar10 - iVar6;" (assignment_expression "*(int *)(param_1 + 0x10) = iVar10 - iVar6" (pointer_expression "*(int *)(param_1 + 0x10)" (* "*") (cast_expression "(int *)(param_1 + 0x10)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x10)" (( "(") (binary_expression "param_1 + 0x10" (identifier "param_1") (+ "+") (number_literal "0x10")) () ")")))) (= "=") (binary_expression "iVar10 - iVar6" (identifier "iVar10") (- "-") (identifier "iVar6"))) (; ";")) (expression_statement "uVar5 = *puVar3;" (assignment_expression "uVar5 = *puVar3" (identifier "uVar5") (= "=") (pointer_expression "*puVar3" (* "*") (identifier "puVar3"))) (; ";")) (expression_statement "*(undefined4 *)(param_1 + 0xc) = puVar3[1];" (assignment_expression "*(undefined4 *)(param_1 + 0xc) = puVar3[1]" (pointer_expression "*(undefined4 *)(param_1 + 0xc)" (* "*") (cast_expression "(undefined4 *)(param_1 + 0xc)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0xc)" (( "(") (binary_expression "param_1 + 0xc" (identifier "param_1") (+ "+") (number_literal "0xc")) () ")")))) (= "=") (subscript_expression "puVar3[1]" (identifier "puVar3") ([ "[") (number_literal "1") (] "]"))) (; ";")) (expression_statement "*(undefined4 *)(param_1 + 8) = uVar5;" (assignment_expression "*(undefined4 *)(param_1 + 8) = uVar5" (pointer_expression "*(undefined4 *)(param_1 + 8)" (* "*") (cast_expression "(undefined4 *)(param_1 + 8)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 8)" (( "(") (binary_expression "param_1 + 8" (identifier "param_1") (+ "+") (number_literal "8")) () ")")))) (= "=") (identifier "uVar5")) (; ";")) (if_statement "if ((param_3 & 1) == 0) {\n      return piVar1;\n    }" (if "if") (parenthesized_expression "((param_3 & 1) == 0)" (( "(") (binary_expression "(param_3 & 1) == 0" (parenthesized_expression "(param_3 & 1)" (( "(") (binary_expression "param_3 & 1" (identifier "param_3") (& "&") (number_literal "1")) () ")")) (== "==") (number_literal "0")) () ")")) (compound_statement "{\n      return piVar1;\n    }" ({ "{") (return_statement "return piVar1;" (return "return") (identifier "piVar1") (; ";")) (} "}"))) (while_statement "while (piVar1 != (int *)0x0) {\n      piVar8 = (int *)piVar1[3];\n      array_dispose_element(piVar1);\n      piVar1 = piVar8;\n    }" (while "while") (parenthesized_expression "(piVar1 != (int *)0x0)" (( "(") (binary_expression "piVar1 != (int *)0x0" (identifier "piVar1") (!= "!=") (cast_expression "(int *)0x0" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n      piVar8 = (int *)piVar1[3];\n      array_dispose_element(piVar1);\n      piVar1 = piVar8;\n    }" ({ "{") (expression_statement "piVar8 = (int *)piVar1[3];" (assignment_expression "piVar8 = (int *)piVar1[3]" (identifier "piVar8") (= "=") (cast_expression "(int *)piVar1[3]" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (subscript_expression "piVar1[3]" (identifier "piVar1") ([ "[") (number_literal "3") (] "]")))) (; ";")) (expression_statement "array_dispose_element(piVar1);" (call_expression "array_dispose_element(piVar1)" (identifier "array_dispose_element") (argument_list "(piVar1)" (( "(") (identifier "piVar1") () ")"))) (; ";")) (expression_statement "piVar1 = piVar8;" (assignment_expression "piVar1 = piVar8" (identifier "piVar1") (= "=") (identifier "piVar8")) (; ";")) (} "}"))) (} "}")))) (return_statement "return (int *)0x0;" (return "return") (cast_expression "(int *)0x0" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0")) (; ";")) (} "}")))

type_1 * function_1(type_2 *var_1,int var_3,int var_11)

{
  type_1 *var_5;
  type_1 *var_7;
  type_3 *paVar3;
  type_1 *pAVar4;
  type_4 uVar5;
  int var_9;
  int var_6;
  type_5 var_8;
  type_1 *var_4;
  type_5 var_10;
  int var_2;
  
  if (((var_1 == (type_2 *)0x0) || (var_2 = var_1->num_elements, var_2 == 0)) || (var_3 < 1)) {
    return (type_1 *)0x0;
  }
  var_4 = var_1->head;
  var_1->lastref = (type_3 *)0x0;
  var_5 = var_4->next;
  if (var_4 != var_5) {
    var_6 = 0;
    var_7 = var_5;
    while( true ) {
      var_7 = var_7->next;
      var_6 = var_6 + 1;
      if (var_4 == var_7) break;
      if (var_3 == var_6) {
        var_7->prev->next = (type_3 *)0x0;
        var_4->next = var_7;
        var_7->prev = var_4;
        do {
          var_8 = (type_5)var_7->ind;
          var_9 = *(int *)&var_7->ind;
          var_10 = var_8 - var_6;
          *(type_5 *)((int)&var_7->ind + 4) = var_10;
          *(type_5 *)&var_7->ind = (var_9 - (var_6 >> 0x1f)) - (type_5)(var_8 < var_10);
          var_7 = var_7->next;
        } while (var_4 != var_7);
        paVar3 = var_4->prev;
        var_1->num_elements = var_2 - var_6;
        uVar5 = *(type_4 *)&paVar3->ind;
        *(int *)((int)&var_1->max_index + 4) = (int)paVar3->ind;
        *(type_4 *)&var_1->max_index = uVar5;
        if ((var_11 & 1U) == 0) {
          return var_5;
        }
        while (var_5 != (type_1 *)0x0) {
          paVar3 = var_5->next;
          var_12(var_5);
          var_5 = paVar3;
        }
        return (type_1 *)0x0;
      }
    }
  }
  var_7 = var_5;
  if ((var_11 & 1U) == 0) {
    do {
      pAVar4 = var_7;
      var_7 = pAVar4->next;
    } while (var_4 != var_7);
    pAVar4->next = (type_3 *)0x0;
    var_4->prev = var_4;
    var_4->next = var_4;
    *(type_4 *)((int)&var_1->max_index + 4) = 0xffffffff;
    *(type_4 *)&var_1->max_index = 0xffffffff;
    var_1->num_elements = 0;
    return var_5;
  }
  var_13(var_1);
  var_5 = (type_1 *)var_14();
  return var_5;
}


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

int * MASKED(int param_1,int param_2,uint param_3)

{
  int *piVar1;
  int *piVar2;
  undefined4 *puVar3;
  int *piVar4;
  undefined4 uVar5;
  int iVar6;
  uint uVar7;
  int *piVar8;
  uint uVar9;
  int iVar10;
  
  if (((param_1 == 0) || (iVar10 = *(int *)(param_1 + 0x10), iVar10 == 0)) || (param_2 < 1)) {
    return (int *)0x0;
  }
  piVar8 = *(int **)(param_1 + 0x18);
  *(undefined4 *)(param_1 + 0x14) = 0;
  piVar1 = (int *)piVar8[3];
  if (piVar8 == piVar1) {
LAB_00090e18:
    piVar2 = piVar1;
    if ((param_3 & 1) == 0) {
      do {
        piVar4 = piVar2;
        piVar2 = (int *)piVar4[3];
      } while (piVar8 != piVar2);
      piVar4[3] = 0;
      piVar8[4] = (int)piVar8;
      piVar8[3] = (int)piVar8;
      *(undefined4 *)(param_1 + 0xc) = 0xffffffff;
      *(undefined4 *)(param_1 + 8) = 0xffffffff;
      *(undefined4 *)(param_1 + 0x10) = 0;
      return piVar1;
    }
    array_flush(param_1);
  }
  else {
    iVar6 = 0;
    piVar2 = piVar1;
    do {
      piVar2 = (int *)piVar2[3];
      iVar6 = iVar6 + 1;
      if (piVar8 == piVar2) goto LAB_00090e18;
    } while (param_2 != iVar6);
    *(undefined4 *)(piVar2[4] + 0xc) = 0;
    piVar8[3] = (int)piVar2;
    piVar2[4] = (int)piVar8;
    do {
      uVar7 = piVar2[1];
      uVar9 = uVar7 - iVar6;
      piVar2[1] = uVar9;
      *piVar2 = (*piVar2 - (iVar6 >> 0x1f)) - (uint)(uVar7 < uVar9);
      piVar2 = (int *)piVar2[3];
    } while (piVar8 != piVar2);
    puVar3 = (undefined4 *)piVar8[4];
    *(int *)(param_1 + 0x10) = iVar10 - iVar6;
    uVar5 = *puVar3;
    *(undefined4 *)(param_1 + 0xc) = puVar3[1];
    *(undefined4 *)(param_1 + 8) = uVar5;
    if ((param_3 & 1) == 0) {
      return piVar1;
    }
    while (piVar1 != (int *)0x0) {
      piVar8 = (int *)piVar1[3];
      array_dispose_element(piVar1);
      piVar1 = piVar8;
    }
  }
  return (int *)0x0;
}

