// Decompiled from acclient.exe — chunk 0x00610000
// Ghidra 12.0.4 + pyghidra headless

// --- FUN_00610610 at 0x00610610 (size: 822) ---


/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */



undefined8 * FUN_00610610(undefined8 *param_1,undefined4 *param_2,undefined8 *param_3)



{

  undefined8 *puVar1;

  undefined4 uVar2;

  undefined4 uVar4;

  undefined8 uVar3;

  undefined4 uVar5;

  undefined8 uVar6;

  undefined8 uVar7;

  undefined4 uVar8;

  undefined4 uVar11;

  undefined8 uVar9;

  undefined8 uVar10;

  undefined4 uVar12;

  undefined8 uVar13;

  undefined8 uVar14;

  undefined8 uVar15;

  undefined4 uVar16;

  undefined8 uVar17;

  undefined8 uVar18;

  undefined8 uVar19;

  undefined4 uVar21;

  undefined8 uVar20;

  undefined4 uStack_34;

  

  uVar11 = (undefined4)((ulonglong)*param_3 >> 0x20);

  uVar2 = (undefined4)param_3[4];

  uVar16 = (undefined4)param_3[2];

  uVar12 = (undefined4)*param_3;

  uVar21 = (undefined4)((ulonglong)param_3[2] >> 0x20);

  uVar4 = (undefined4)((ulonglong)param_3[4] >> 0x20);

  uVar9 = PackedFloatingMUL(CONCAT44(uVar11,uVar11),CONCAT44(uVar2,uVar16));

  uVar13 = PackedFloatingMUL(CONCAT44(uVar12,uVar12),CONCAT44(uVar4,uVar21));

  uVar14 = PackedFloatingSUB(uVar13,uVar9);

  uVar5 = (undefined4)((ulonglong)param_3[6] >> 0x20);

  uVar8 = (undefined4)param_3[6];

  uVar17 = PackedFloatingMUL(CONCAT44(uVar4,uVar5),CONCAT44(uVar16,uVar12));

  uVar20 = PackedFloatingMUL(CONCAT44(uVar21,uVar11),CONCAT44(uVar2,uVar8));

  uVar9 = PackedFloatingMUL(CONCAT44(uVar2,uVar16),CONCAT44(uVar5,uVar5));

  uVar13 = PackedFloatingMUL(CONCAT44(uVar4,uVar21),CONCAT44(uVar8,uVar8));

  uVar18 = PackedFloatingSUB(uVar17,uVar20);

  uVar17 = PackedFloatingSUBR(uVar13,uVar9);

  uVar9 = param_3[7];

  uVar13 = param_3[5];

  uVar2 = (undefined4)((ulonglong)uVar18 >> 0x20);

  uVar11 = (undefined4)((ulonglong)uVar17 >> 0x20);

  uVar20 = PackedFloatingMUL(CONCAT44(uVar2,uVar2),uVar9);

  uVar5 = (undefined4)uVar17;

  uVar17 = PackedFloatingMUL(CONCAT44(uVar11,uVar11),param_3[3]);

  uVar6 = PackedFloatingMUL(CONCAT44(uVar5,uVar5),uVar13);

  uVar17 = PackedFloatingADD(uVar20,uVar17);

  uVar3 = PackedFloatingSUB(uVar17,uVar6);

  uVar8 = (undefined4)uVar18;

  uVar4 = (undefined4)((ulonglong)uVar14 >> 0x20);

  uVar20 = PackedFloatingMUL(CONCAT44(uVar11,uVar11),param_3[1]);

  uVar17 = PackedFloatingMUL(CONCAT44(uVar4,uVar4),uVar9);

  uVar6 = PackedFloatingMUL(CONCAT44(uVar8,uVar8),uVar13);

  uVar17 = PackedFloatingSUB(uVar17,uVar6);

  uVar18 = PackedFloatingADD(uVar17,uVar20);

  uVar20 = CONCAT44((int)uVar14,(int)uVar14);

  uVar17 = PackedFloatingMUL(CONCAT44(uVar5,uVar5),param_3[1]);

  uVar9 = PackedFloatingMUL(uVar9,uVar20);

  uVar6 = PackedFloatingMUL(CONCAT44(uVar8,uVar8),param_3[3]);

  uVar9 = PackedFloatingADD(uVar9,uVar17);

  uVar17 = PackedFloatingSUB(uVar9,uVar6);

  uVar9 = PackedFloatingMUL(uVar20,uVar13);

  uVar13 = PackedFloatingMUL(CONCAT44(uVar4,uVar4),param_3[3]);

  uVar20 = PackedFloatingMUL(CONCAT44(uVar2,uVar2),param_3[1]);

  uVar9 = PackedFloatingSUB(uVar9,uVar13);

  uVar14 = PackedFloatingADD(uVar9,uVar20);

  uVar11 = (undefined4)((ulonglong)param_3[1] >> 0x20);

  uVar2 = (undefined4)param_3[5];

  uVar16 = (undefined4)param_3[3];

  uVar12 = (undefined4)param_3[1];

  uVar21 = (undefined4)((ulonglong)param_3[3] >> 0x20);

  uVar4 = (undefined4)((ulonglong)param_3[5] >> 0x20);

  uVar9 = PackedFloatingMUL(CONCAT44(uVar11,uVar11),CONCAT44(uVar2,uVar16));

  uVar13 = PackedFloatingMUL(CONCAT44(uVar12,uVar12),CONCAT44(uVar4,uVar21));

  uVar15 = PackedFloatingSUB(uVar13,uVar9);

  uVar5 = (undefined4)((ulonglong)param_3[7] >> 0x20);

  uVar8 = (undefined4)param_3[7];

  uVar20 = PackedFloatingMUL(CONCAT44(uVar4,uVar5),CONCAT44(uVar16,uVar12));

  uVar6 = PackedFloatingMUL(CONCAT44(uVar21,uVar11),CONCAT44(uVar2,uVar8));

  uVar9 = PackedFloatingMUL(CONCAT44(uVar2,uVar16),CONCAT44(uVar5,uVar5));

  uVar13 = PackedFloatingMUL(CONCAT44(uVar4,uVar21),CONCAT44(uVar8,uVar8));

  uVar19 = PackedFloatingSUB(uVar20,uVar6);

  uVar20 = PackedFloatingSUBR(uVar13,uVar9);

  uVar9 = param_3[6];

  uVar13 = param_3[4];

  uVar11 = (undefined4)((ulonglong)uVar20 >> 0x20);

  uVar5 = (undefined4)uVar20;

  uVar2 = (undefined4)((ulonglong)uVar19 >> 0x20);

  uVar10 = PackedFloatingMUL(CONCAT44(uVar11,uVar11),param_3[2]);

  uVar20 = PackedFloatingMUL(CONCAT44(uVar2,uVar2),uVar9);

  uVar6 = PackedFloatingMUL(CONCAT44(uVar5,uVar5),uVar13);

  uVar20 = PackedFloatingADD(uVar20,uVar10);

  uVar10 = PackedFloatingSUB(uVar20,uVar6);

  uVar8 = (undefined4)uVar19;

  uVar4 = (undefined4)((ulonglong)uVar15 >> 0x20);

  uVar6 = PackedFloatingMUL(CONCAT44(uVar11,uVar11),*param_3);

  uVar20 = PackedFloatingMUL(CONCAT44(uVar4,uVar4),uVar9);

  uVar19 = PackedFloatingMUL(CONCAT44(uVar8,uVar8),uVar13);

  uVar20 = PackedFloatingSUB(uVar20,uVar19);

  uVar19 = PackedFloatingADD(uVar20,uVar6);

  uVar15 = CONCAT44((int)uVar15,(int)uVar15);

  uVar6 = PackedFloatingMUL(CONCAT44(uVar5,uVar5),*param_3);

  uVar20 = PackedFloatingMUL(uVar9,uVar15);

  uVar7 = PackedFloatingMUL(CONCAT44(uVar8,uVar8),param_3[2]);

  uVar20 = PackedFloatingADD(uVar20,uVar6);

  uVar20 = PackedFloatingSUB(uVar20,uVar7);

  uVar6 = PackedFloatingMUL(uVar15,uVar13);

  uVar15 = PackedFloatingMUL(CONCAT44(uVar4,uVar4),param_3[2]);

  uVar7 = PackedFloatingMUL(CONCAT44(uVar2,uVar2),*param_3);

  uVar6 = PackedFloatingSUB(uVar6,uVar15);

  uVar6 = PackedFloatingADD(uVar6,uVar7);

  uVar9 = PackedFloatingMUL(CONCAT44((int)uVar9,(int)uVar13),_DAT_007f2fa8);

  uStack_34 = (undefined4)((ulonglong)uVar19 >> 0x20);

  uVar13 = CONCAT44(uStack_34,(int)((ulonglong)uVar10 >> 0x20));

  uVar15 = PackedFloatingMUL(CONCAT44(*(undefined4 *)(param_3 + 2),(int)*param_3),_DAT_007f2fa8);

  uVar9 = PackedFloatingMUL(CONCAT44((int)((ulonglong)uVar6 >> 0x20),

                                     (int)((ulonglong)uVar20 >> 0x20)),uVar9);

  uVar15 = PackedFloatingMUL(uVar15,uVar13);

  uVar9 = PackedFloatingADD(uVar9,uVar15);

  uVar9 = PackedFloatingAccumulate(uVar9,uVar9);

  uVar2 = (undefined4)uVar9;

  if (param_2 != (undefined4 *)0x0) {

    *param_2 = uVar2;

  }

  uVar13 = FloatingReciprocalAprox(uVar13,uVar9);

  uVar15 = PackedFloatingCompareEQ(0,uVar9);

  uVar9 = PackedFloatingReciprocalIter1(CONCAT44(uVar2,uVar2),uVar13);

  uVar9 = PackedFloatingReciprocalIter2(uVar9,uVar13);

  uVar13 = PackedFloatingMUL(uVar9,_DAT_007f2fa8);

  uVar9 = CONCAT44((int)uVar13,(int)((ulonglong)uVar13 >> 0x20));

  puVar1 = (undefined8 *)uVar15;

  if ((undefined8 *)uVar15 == (undefined8 *)0x0) {

    uVar10 = PackedFloatingMUL(uVar10,uVar9);

    uVar19 = PackedFloatingMUL(uVar19,uVar13);

    uVar3 = PackedFloatingMUL(uVar3,uVar9);

    uVar18 = PackedFloatingMUL(uVar18,uVar13);

    *param_1 = CONCAT44((int)((ulonglong)uVar19 >> 0x20),(int)((ulonglong)uVar10 >> 0x20));

    param_1[2] = CONCAT44((int)uVar19,(int)uVar10);

    param_1[4] = CONCAT44((int)((ulonglong)uVar18 >> 0x20),(int)((ulonglong)uVar3 >> 0x20));

    param_1[6] = CONCAT44((int)uVar18,(int)uVar3);

    uVar20 = PackedFloatingMUL(uVar20,uVar9);

    uVar6 = PackedFloatingMUL(uVar6,uVar13);

    uVar9 = PackedFloatingMUL(uVar17,uVar9);

    uVar13 = PackedFloatingMUL(uVar14,uVar13);

    param_1[1] = CONCAT44((int)((ulonglong)uVar6 >> 0x20),(int)((ulonglong)uVar20 >> 0x20));

    param_1[3] = CONCAT44((int)uVar6,(int)uVar20);

    param_1[5] = CONCAT44((int)((ulonglong)uVar13 >> 0x20),(int)((ulonglong)uVar9 >> 0x20));

    param_1[7] = CONCAT44((int)uVar13,(int)uVar9);

    puVar1 = param_1;

  }

  return puVar1;

}





// --- FUN_00610946 at 0x00610946 (size: 30) ---


undefined4 FUN_00610946(undefined4 param_1,undefined4 param_2,undefined4 param_3)



{

  FastExitMediaState();

  FUN_00610610(param_1,param_2,param_3);

  FastExitMediaState();

  return param_1;

}





// --- FUN_00610964 at 0x00610964 (size: 115) ---


undefined8 * FUN_00610964(undefined8 *param_1,undefined8 *param_2,undefined8 *param_3)



{

  undefined4 uVar1;

  undefined8 uVar2;

  undefined8 uVar3;

  undefined8 uVar4;

  undefined8 uVar5;

  undefined8 uVar6;

  undefined8 uVar7;

  undefined8 uVar8;

  

  FastExitMediaState();

  uVar1 = (undefined4)*param_2;

  uVar4 = CONCAT44(uVar1,uVar1);

  uVar1 = (undefined4)((ulonglong)*param_2 >> 0x20);

  uVar7 = CONCAT44(uVar1,uVar1);

  uVar8 = CONCAT44(*(undefined4 *)(param_2 + 1),*(undefined4 *)(param_2 + 1));

  uVar2 = PackedFloatingMUL(uVar4,*param_3);

  uVar3 = PackedFloatingMUL(uVar7,param_3[2]);

  uVar5 = PackedFloatingMUL(uVar8,param_3[4]);

  uVar2 = PackedFloatingADD(uVar2,param_3[6]);

  uVar6 = PackedFloatingMUL(uVar4,param_3[1]);

  uVar4 = PackedFloatingADD(uVar3,uVar5);

  uVar3 = PackedFloatingMUL(uVar7,param_3[3]);

  uVar8 = PackedFloatingMUL(uVar8,param_3[5]);

  uVar7 = PackedFloatingADD(uVar6,param_3[7]);

  uVar4 = PackedFloatingADD(uVar2,uVar4);

  uVar2 = PackedFloatingADD(uVar3,uVar8);

  uVar2 = PackedFloatingADD(uVar7,uVar2);

  *param_1 = uVar4;

  param_1[1] = uVar2;

  FastExitMediaState();

  return param_1;

}





// --- FUN_006109d7 at 0x006109D7 (size: 105) ---


undefined8 * FUN_006109d7(undefined8 *param_1,undefined8 *param_2,undefined8 *param_3)



{

  undefined4 uVar1;

  undefined8 uVar2;

  undefined8 uVar3;

  undefined8 uVar4;

  undefined8 uVar5;

  undefined8 uVar6;

  undefined8 uVar7;

  undefined8 uVar8;

  

  FastExitMediaState();

  uVar1 = (undefined4)*param_2;

  uVar4 = CONCAT44(uVar1,uVar1);

  uVar1 = (undefined4)((ulonglong)*param_2 >> 0x20);

  uVar8 = CONCAT44(uVar1,uVar1);

  uVar5 = CONCAT44(*(undefined4 *)(param_2 + 1),*(undefined4 *)(param_2 + 1));

  uVar2 = PackedFloatingMUL(uVar4,*param_3);

  uVar3 = PackedFloatingMUL(uVar8,param_3[2]);

  uVar6 = PackedFloatingMUL(uVar5,param_3[4]);

  uVar7 = PackedFloatingMUL(uVar4,param_3[1]);

  uVar4 = PackedFloatingADD(uVar3,uVar6);

  uVar8 = PackedFloatingMUL(uVar8,param_3[3]);

  uVar3 = PackedFloatingMUL(uVar5,param_3[5]);

  uVar4 = PackedFloatingADD(uVar2,uVar4);

  uVar2 = PackedFloatingADD(uVar8,uVar3);

  uVar2 = PackedFloatingADD(uVar7,uVar2);

  *param_1 = uVar4;

  *(int *)(param_1 + 1) = (int)uVar2;

  FastExitMediaState();

  return param_1;

}





// --- FUN_00610a40 at 0x00610A40 (size: 95) ---


/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */



void FUN_00610a40(undefined8 *param_1,ulonglong *param_2)



{

  ulonglong uVar1;

  undefined8 uVar2;

  ulonglong uVar3;

  undefined8 uVar4;

  undefined8 in_MM4;

  undefined8 uVar5;

  ulonglong uVar6;

  

  FastExitMediaState();

  uVar1 = *param_2;

  uVar3 = (ulonglong)(uint)param_2[1];

  uVar2 = PackedFloatingMUL(uVar1,uVar1);

  uVar4 = PackedFloatingMUL(uVar3,uVar3);

  uVar2 = PackedFloatingADD(uVar2,uVar4);

  uVar2 = PackedFloatingAccumulate(uVar2,uVar2);

  uVar5 = PackedFloatingReciprocalSQRAprox(in_MM4,uVar2);

  uVar6 = PackedFloatingCompareGT(uVar2,_DAT_007f3028);

  uVar4 = PackedFloatingMUL(uVar5,uVar5);

  uVar2 = PackedFloatingReciprocalSQRIter1(uVar2,uVar4);

  uVar2 = PackedFloatingReciprocalIter2(uVar2,uVar5);

  uVar4 = PackedFloatingMUL(uVar1 & uVar6,uVar2);

  uVar2 = PackedFloatingMUL(uVar3 & uVar6,uVar2);

  *param_1 = uVar4;

  *(int *)(param_1 + 1) = (int)uVar2;

  FastExitMediaState();

  return;

}





// --- FUN_00610cce at 0x00610CCE (size: 141) ---


undefined8 * FUN_00610cce(undefined8 *param_1,undefined8 *param_2,undefined8 *param_3)



{

  undefined4 uVar1;

  undefined8 uVar2;

  undefined8 uVar3;

  undefined8 uVar4;

  undefined8 uVar5;

  undefined8 uVar6;

  undefined8 uVar7;

  undefined8 uVar8;

  

  FastExitMediaState();

  uVar1 = (undefined4)*param_2;

  uVar4 = CONCAT44(uVar1,uVar1);

  uVar1 = (undefined4)((ulonglong)*param_2 >> 0x20);

  uVar7 = CONCAT44(uVar1,uVar1);

  uVar8 = CONCAT44(*(undefined4 *)(param_2 + 1),*(undefined4 *)(param_2 + 1));

  uVar2 = PackedFloatingMUL(uVar4,*param_3);

  uVar3 = PackedFloatingMUL(uVar7,param_3[2]);

  uVar5 = PackedFloatingMUL(uVar8,param_3[4]);

  uVar2 = PackedFloatingADD(uVar2,param_3[6]);

  uVar6 = PackedFloatingMUL(uVar4,param_3[1]);

  uVar4 = PackedFloatingADD(uVar3,uVar5);

  uVar3 = PackedFloatingMUL(uVar7,param_3[3]);

  uVar8 = PackedFloatingMUL(uVar8,param_3[5]);

  uVar7 = PackedFloatingADD(uVar6,param_3[7]);

  uVar4 = PackedFloatingADD(uVar2,uVar4);

  uVar3 = PackedFloatingADD(uVar3,uVar8);

  uVar2 = PackedFloatingADD(uVar7,uVar3);

  uVar1 = (undefined4)((ulonglong)uVar2 >> 0x20);

  uVar8 = CONCAT44(uVar1,uVar1);

  uVar7 = FloatingReciprocalAprox(uVar3,uVar8);

  uVar3 = PackedFloatingReciprocalIter1(uVar8,uVar7);

  uVar7 = PackedFloatingReciprocalIter2(uVar3,uVar7);

  uVar4 = PackedFloatingMUL(uVar4,uVar7);

  uVar2 = PackedFloatingMUL(uVar2,uVar7);

  *param_1 = uVar4;

  *(int *)(param_1 + 1) = (int)uVar2;

  FastExitMediaState();

  return param_1;

}





// --- FUN_00610d5b at 0x00610D5B (size: 457) ---


undefined8 * FUN_00610d5b(undefined8 *param_1,undefined8 *param_2,undefined8 *param_3)



{

  undefined4 uVar1;

  undefined4 uVar2;

  undefined4 uVar3;

  undefined8 uVar4;

  undefined8 uVar5;

  undefined8 uVar6;

  undefined8 uVar7;

  undefined8 uVar8;

  undefined8 uVar9;

  

  uVar1 = (undefined4)((ulonglong)*param_2 >> 0x20);

  uVar2 = (undefined4)((ulonglong)param_2[1] >> 0x20);

  uVar3 = (undefined4)*param_2;

  uVar6 = CONCAT44(uVar3,uVar3);

  uVar3 = (undefined4)param_2[1];

  uVar9 = CONCAT44(uVar3,uVar3);

  uVar7 = PackedFloatingMUL(*param_3,uVar6);

  uVar5 = CONCAT44(uVar1,uVar1);

  uVar4 = PackedFloatingMUL(uVar6,param_3[1]);

  uVar8 = PackedFloatingMUL(param_3[2],uVar5);

  uVar6 = CONCAT44(uVar2,uVar2);

  uVar5 = PackedFloatingMUL(uVar5,param_3[3]);

  uVar7 = PackedFloatingADD(uVar8,uVar7);

  uVar8 = PackedFloatingMUL(param_3[4],uVar9);

  uVar4 = PackedFloatingADD(uVar5,uVar4);

  uVar5 = PackedFloatingMUL(uVar9,param_3[5]);

  uVar9 = PackedFloatingADD(uVar8,uVar7);

  uVar7 = PackedFloatingMUL(param_3[6],uVar6);

  uVar4 = PackedFloatingADD(uVar4,uVar5);

  uVar6 = PackedFloatingMUL(uVar6,param_3[7]);

  uVar7 = PackedFloatingADD(uVar7,uVar9);

  uVar5 = param_2[2];

  uVar9 = PackedFloatingADD(uVar6,uVar4);

  uVar6 = param_2[3];

  *param_1 = uVar7;

  uVar4 = *param_3;

  param_1[1] = uVar9;

  uVar1 = (undefined4)((ulonglong)uVar5 >> 0x20);

  uVar2 = (undefined4)((ulonglong)uVar6 >> 0x20);

  uVar3 = (undefined4)uVar5;

  uVar9 = CONCAT44(uVar3,uVar3);

  uVar3 = (undefined4)uVar6;

  uVar7 = CONCAT44(uVar3,uVar3);

  uVar8 = PackedFloatingMUL(uVar4,uVar9);

  uVar5 = CONCAT44(uVar1,uVar1);

  uVar4 = PackedFloatingMUL(uVar9,param_3[1]);

  uVar9 = PackedFloatingMUL(param_3[2],uVar5);

  uVar6 = CONCAT44(uVar2,uVar2);

  uVar5 = PackedFloatingMUL(uVar5,param_3[3]);

  uVar9 = PackedFloatingADD(uVar9,uVar8);

  uVar8 = PackedFloatingMUL(param_3[4],uVar7);

  uVar4 = PackedFloatingADD(uVar5,uVar4);

  uVar5 = PackedFloatingMUL(uVar7,param_3[5]);

  uVar9 = PackedFloatingADD(uVar8,uVar9);

  uVar7 = PackedFloatingMUL(param_3[6],uVar6);

  uVar4 = PackedFloatingADD(uVar4,uVar5);

  uVar6 = PackedFloatingMUL(uVar6,param_3[7]);

  uVar7 = PackedFloatingADD(uVar7,uVar9);

  uVar5 = param_2[4];

  uVar9 = PackedFloatingADD(uVar6,uVar4);

  uVar6 = param_2[5];

  param_1[2] = uVar7;

  uVar4 = *param_3;

  param_1[3] = uVar9;

  uVar1 = (undefined4)((ulonglong)uVar5 >> 0x20);

  uVar2 = (undefined4)((ulonglong)uVar6 >> 0x20);

  uVar3 = (undefined4)uVar5;

  uVar9 = CONCAT44(uVar3,uVar3);

  uVar3 = (undefined4)uVar6;

  uVar7 = CONCAT44(uVar3,uVar3);

  uVar8 = PackedFloatingMUL(uVar4,uVar9);

  uVar5 = CONCAT44(uVar1,uVar1);

  uVar4 = PackedFloatingMUL(uVar9,param_3[1]);

  uVar9 = PackedFloatingMUL(param_3[2],uVar5);

  uVar6 = CONCAT44(uVar2,uVar2);

  uVar5 = PackedFloatingMUL(uVar5,param_3[3]);

  uVar9 = PackedFloatingADD(uVar9,uVar8);

  uVar8 = PackedFloatingMUL(param_3[4],uVar7);

  uVar4 = PackedFloatingADD(uVar5,uVar4);

  uVar5 = PackedFloatingMUL(uVar7,param_3[5]);

  uVar9 = PackedFloatingADD(uVar8,uVar9);

  uVar7 = PackedFloatingMUL(param_3[6],uVar6);

  uVar4 = PackedFloatingADD(uVar4,uVar5);

  uVar6 = PackedFloatingMUL(uVar6,param_3[7]);

  uVar7 = PackedFloatingADD(uVar7,uVar9);

  uVar5 = param_2[6];

  uVar9 = PackedFloatingADD(uVar6,uVar4);

  uVar6 = param_2[7];

  param_1[4] = uVar7;

  uVar4 = *param_3;

  param_1[5] = uVar9;

  uVar1 = (undefined4)((ulonglong)uVar5 >> 0x20);

  uVar2 = (undefined4)((ulonglong)uVar6 >> 0x20);

  uVar3 = (undefined4)uVar5;

  uVar9 = CONCAT44(uVar3,uVar3);

  uVar3 = (undefined4)uVar6;

  uVar7 = CONCAT44(uVar3,uVar3);

  uVar8 = PackedFloatingMUL(uVar4,uVar9);

  uVar5 = CONCAT44(uVar1,uVar1);

  uVar4 = PackedFloatingMUL(uVar9,param_3[1]);

  uVar9 = PackedFloatingMUL(param_3[2],uVar5);

  uVar6 = CONCAT44(uVar2,uVar2);

  uVar5 = PackedFloatingMUL(uVar5,param_3[3]);

  uVar9 = PackedFloatingADD(uVar9,uVar8);

  uVar8 = PackedFloatingMUL(param_3[4],uVar7);

  uVar4 = PackedFloatingADD(uVar5,uVar4);

  uVar5 = PackedFloatingMUL(uVar7,param_3[5]);

  uVar9 = PackedFloatingADD(uVar8,uVar9);

  uVar7 = PackedFloatingMUL(param_3[6],uVar6);

  uVar5 = PackedFloatingADD(uVar4,uVar5);

  uVar6 = PackedFloatingMUL(uVar6,param_3[7]);

  uVar4 = PackedFloatingADD(uVar7,uVar9);

  uVar5 = PackedFloatingADD(uVar6,uVar5);

  param_1[6] = uVar4;

  param_1[7] = uVar5;

  FastExitMediaState();

  return param_1;

}





// --- FUN_00610f24 at 0x00610F24 (size: 11) ---


void FUN_00610f24(void)



{

  FUN_00610cce();

  return;

}





// --- FUN_00610f2f at 0x00610F2F (size: 184) ---


/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */



ulonglong *

FUN_00610f2f(ulonglong *param_1,undefined4 param_2,undefined8 *param_3,undefined4 *param_4,

            undefined4 *param_5,undefined4 *param_6)



{

  undefined4 *puVar1;

  undefined8 uVar2;

  ulonglong uVar3;

  undefined8 uVar4;

  undefined8 uVar5;

  undefined8 uVar6;

  undefined4 uVar8;

  undefined8 uVar7;

  undefined4 local_44;

  undefined4 uStack_40;

  undefined4 uStack_3c;

  undefined4 uStack_38;

  undefined4 uStack_34;

  undefined4 uStack_30;

  undefined4 uStack_2c;

  undefined4 uStack_28;

  undefined4 uStack_24;

  undefined4 uStack_20;

  undefined4 uStack_1c;

  undefined4 uStack_18;

  undefined4 uStack_14;

  undefined4 uStack_10;

  undefined4 uStack_c;

  undefined4 uStack_8;

  

  puVar1 = &local_44;

  switch(((param_6 != (undefined4 *)0x0) << 1 | param_5 != (undefined4 *)0x0) << 1 |

         param_4 != (undefined4 *)0x0) {

  case '\0':

    uStack_c = 0;

    uStack_10 = 0;

    uStack_14 = 0;

    uStack_18 = 0;

    uStack_20 = 0;

    uStack_24 = 0;

    uStack_28 = 0;

    uStack_2c = 0;

    uStack_34 = 0;

    uStack_38 = 0;

    uStack_3c = 0;

    uStack_40 = 0;

    uStack_8 = 0x3f800000;

    uStack_1c = 0x3f800000;

    uStack_30 = 0x3f800000;

    local_44 = 0x3f800000;

    break;

  case '\x01':

    puVar1 = param_4;

    break;

  case '\x02':

    puVar1 = param_5;

    break;

  case '\x03':

    FastExitMediaState();

    FUN_00610d5b(&local_44,param_5,param_4);

    FastExitMediaState();

    break;

  case '\x04':

    puVar1 = param_6;

    break;

  case '\x05':

    FastExitMediaState();

    FUN_00610d5b(&local_44,param_6,param_4);

    FastExitMediaState();

    break;

  case '\x06':

    FastExitMediaState();

    FUN_00610d5b(&local_44,param_6,param_5);

    FastExitMediaState();

    break;

  case '\a':

    FastExitMediaState();

    FUN_00610d5b(&local_44,param_6,param_5);

    FUN_00610d5b(&local_44,&local_44,param_4);

    FastExitMediaState();

  }

  FUN_00610cce(param_1,param_2,puVar1);

  if (param_3 != (undefined8 *)0x0) {

    FastExitMediaState();

    uVar4 = param_3[2];

    uVar5 = PackedIntToFloatingDwordConv(*param_3,*param_3);

    uVar6 = PackedIntToFloatingDwordConv(param_3[1],param_3[1]);

    uVar2 = PackedFloatingADD(*param_1 ^ DAT_007f3038,_DAT_007f3040);

    uVar6 = PackedFloatingMUL(uVar6,DAT_007f3048);

    uVar8 = (undefined4)((ulonglong)uVar4 >> 0x20);

    uVar7 = PackedFloatingSUB(CONCAT44(uVar8,uVar8),uVar4);

    uVar2 = PackedFloatingMUL(uVar2,uVar6);

    uVar6 = PackedFloatingMUL((ulonglong)(uint)param_1[1],uVar7);

    uVar4 = PackedFloatingADD(uVar6,uVar4);

    uVar3 = PackedFloatingADD(uVar2,uVar5);

    *param_1 = uVar3;

    *(int *)(param_1 + 1) = (int)uVar4;

    FastExitMediaState();

  }

  return param_1;

}





// --- FUN_006112d8 at 0x006112D8 (size: 387) ---


/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */



ulonglong *

FUN_006112d8(ulonglong *param_1,ulonglong *param_2,undefined8 *param_3,undefined4 *param_4,

            undefined4 *param_5,undefined4 *param_6)



{

  undefined8 uVar1;

  undefined8 uVar2;

  ulonglong uVar3;

  undefined8 uVar4;

  undefined8 uVar5;

  undefined4 uVar7;

  undefined8 uVar6;

  undefined8 uVar8;

  unkbyte10 in_ST5;

  undefined8 uVar9;

  unkbyte10 in_ST6;

  undefined4 local_44;

  undefined4 local_40;

  undefined4 local_3c;

  undefined4 local_38;

  undefined4 local_34;

  undefined4 local_30;

  undefined4 local_2c;

  undefined4 local_28;

  undefined4 local_24;

  undefined4 local_20;

  undefined4 local_1c;

  undefined4 local_18;

  undefined4 local_14;

  undefined4 local_10;

  undefined4 local_c;

  undefined4 local_8;

  

  uVar2 = (undefined8)in_ST5;

  uVar9 = (undefined8)in_ST6;

  switch(((param_6 != (undefined4 *)0x0) << 1 | param_5 != (undefined4 *)0x0) << 1 |

         param_4 != (undefined4 *)0x0) {

  case '\0':

    local_c = 0;

    local_10 = 0;

    local_14 = 0;

    local_18 = 0;

    local_20 = 0;

    local_24 = 0;

    local_28 = 0;

    local_2c = 0;

    local_34 = 0;

    local_38 = 0;

    local_3c = 0;

    local_40 = 0;

    local_8 = 0x3f800000;

    local_1c = 0x3f800000;

    local_30 = 0x3f800000;

    local_44 = 0x3f800000;

    goto switchD_00611311_default;

  case '\x01':

    param_6 = param_4;

    goto LAB_006113a3;

  case '\x02':

    param_6 = param_5;

    goto LAB_006113a3;

  case '\x03':

    param_6 = param_5;

    break;

  case '\x04':

    goto LAB_006113a3;

  case '\x05':

    break;

  case '\x06':

    param_4 = param_5;

    break;

  case '\a':

    FUN_00610d5b(&local_44,param_6,param_5);

    param_6 = &local_44;

    break;

  default:

    goto switchD_00611311_default;

  }

  FUN_00610d5b(&local_44,param_6,param_4);

  param_6 = &local_44;

LAB_006113a3:

  FUN_0060ff36(&local_44,0,param_6);

  uVar2 = (undefined8)in_ST5;

  uVar9 = (undefined8)in_ST6;

switchD_00611311_default:

  if (param_3 != (undefined8 *)0x0) {

    FastExitMediaState();

    uVar4 = PackedIntToFloatingDwordConv(*param_3,*param_3);

    uVar1 = param_3[2];

    uVar5 = PackedIntToFloatingDwordConv(param_3[1],param_3[1]);

    uVar7 = (undefined4)((ulonglong)uVar5 >> 0x20);

    uVar6 = CONCAT44(uVar7,uVar7);

    uVar8 = FloatingReciprocalAprox(uVar2,uVar5);

    uVar6 = FloatingReciprocalAprox(uVar6,uVar6);

    uVar2 = PackedFloatingSUB(*param_2,uVar4);

    uVar6 = CONCAT44((int)uVar6,(int)uVar8);

    uVar4 = PackedFloatingReciprocalIter1(uVar5,uVar6);

    uVar4 = PackedFloatingReciprocalIter2(uVar4,uVar6);

    uVar4 = PackedFloatingMUL(uVar4,DAT_007f3050);

    uVar2 = PackedFloatingMUL(uVar2,uVar4);

    uVar7 = (undefined4)((ulonglong)uVar1 >> 0x20);

    uVar3 = PackedFloatingSUB(uVar2,_DAT_007f3040);

    uVar2 = PackedFloatingSUB(CONCAT44(uVar7,uVar7),uVar1);

    uVar9 = FloatingReciprocalAprox(uVar9,uVar2);

    uVar2 = PackedFloatingReciprocalIter1(uVar2,uVar9);

    uVar9 = PackedFloatingReciprocalIter2(uVar2,uVar9);

    uVar2 = PackedFloatingSUB((ulonglong)(uint)param_2[1],uVar1);

    uVar2 = PackedFloatingMUL(uVar2,uVar9);

    *param_1 = uVar3 ^ DAT_007f3038;

    *(int *)(param_1 + 1) = (int)uVar2;

    FastExitMediaState();

    param_2 = param_1;

  }

  FUN_00610cce(param_1,param_2,&local_44);

  return param_1;

}





// --- FUN_00612000 at 0x00612000 (size: 298) ---


/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */



ulonglong * FUN_00612000(ulonglong *param_1,undefined4 *param_2,int param_3)



{

  ulonglong *puVar1;

  ulonglong uVar2;

  ulonglong uVar3;

  ulonglong uVar4;

  ulonglong uVar5;

  ulonglong uVar6;

  ulonglong uVar7;

  ulonglong uVar8;

  ulonglong uVar9;

  int iVar10;

  

  puVar1 = param_1;

  if (param_3 < 4) {

    if (param_3 != 0) {

      FUN_005e03a8(param_1,param_2,param_3);

    }

  }

  else {

    while( true ) {

      for (; 3 < param_3; param_3 = param_3 + -4) {

        uVar7 = (ulonglong)CONCAT24((short)((uint)*param_2 >> 0x10),*param_2) & 0xffffffff0000ffff;

        uVar3 = (ulonglong)CONCAT24((short)((uint)param_2[1] >> 0x10),param_2[1]) &

                0xffffffff0000ffff;

        uVar9 = CONCAT44(-(uint)((int)((uVar7 & DAT_0082c000) >> 0x20) == 0),

                         -(uint)((int)(uVar7 & DAT_0082c000) == 0));

        uVar4 = CONCAT44(-(uint)((int)((uVar3 & DAT_0082c000) >> 0x20) == 0),

                         -(uint)((int)(uVar3 & DAT_0082c000) == 0));

        uVar6 = uVar7 & DAT_0082c020;

        uVar8 = uVar3 & DAT_0082c020;

        iVar10 = (int)((ulonglong)DAT_0082c010 >> 0x20);

        uVar2 = uVar9 & _DAT_0082c030;

        uVar5 = uVar4 & _DAT_0082c030;

        uVar7 = PackedFloatingSUB(CONCAT44(((int)((uVar7 ^ uVar6) >> 0x20) + iVar10 +

                                           (int)(uVar2 >> 0x20)) * 0x2000,

                                           ((int)(uVar7 ^ uVar6) + (int)DAT_0082c010 + (int)uVar2) *

                                           0x2000),uVar9 & _DAT_0082c040);

        uVar9 = PackedFloatingSUB(CONCAT44(((int)((uVar3 ^ uVar8) >> 0x20) + iVar10 +

                                           (int)(uVar5 >> 0x20)) * 0x2000,

                                           ((int)(uVar3 ^ uVar8) + (int)DAT_0082c010 + (int)uVar5) *

                                           0x2000),uVar4 & _DAT_0082c040);

        *puVar1 = uVar7 | CONCAT44((int)(uVar6 >> 0x20) << 0x10,(int)uVar6 << 0x10);

        puVar1[1] = uVar9 | CONCAT44((int)(uVar8 >> 0x20) << 0x10,(int)uVar8 << 0x10);

        puVar1 = puVar1 + 2;

        param_2 = param_2 + 2;

      }

      if (param_3 == 0) break;

      param_2 = (undefined4 *)((int)param_2 + (param_3 + -4) * 2);

      puVar1 = (ulonglong *)((int)puVar1 + (param_3 + -4) * 4);

      param_3 = 4;

    }

  }

  FastExitMediaState();

  return param_1;

}





// --- FUN_006122bb at 0x006122BB (size: 87) ---


undefined8 * FUN_006122bb(undefined8 *param_1,undefined8 *param_2,undefined8 *param_3)



{

  undefined4 uVar1;

  undefined8 uVar2;

  undefined8 uVar3;

  undefined8 uVar4;

  undefined8 uVar5;

  undefined8 uVar6;

  

  FastExitMediaState();

  uVar1 = (undefined4)*param_2;

  uVar3 = CONCAT44(uVar1,uVar1);

  uVar1 = (undefined4)((ulonglong)*param_2 >> 0x20);

  uVar6 = CONCAT44(uVar1,uVar1);

  uVar2 = PackedFloatingMUL(uVar3,*param_3);

  uVar4 = PackedFloatingMUL(uVar6,param_3[2]);

  uVar2 = PackedFloatingADD(uVar2,param_3[6]);

  uVar5 = PackedFloatingMUL(uVar3,param_3[1]);

  uVar6 = PackedFloatingMUL(uVar6,param_3[3]);

  uVar3 = PackedFloatingADD(uVar2,uVar4);

  uVar2 = PackedFloatingADD(uVar5,param_3[7]);

  uVar2 = PackedFloatingADD(uVar2,uVar6);

  *param_1 = uVar3;

  param_1[1] = uVar2;

  FastExitMediaState();

  return param_1;

}





// --- FUN_00612312 at 0x00612312 (size: 59) ---


undefined8 * FUN_00612312(undefined8 *param_1,undefined8 *param_2,undefined8 *param_3)



{

  undefined4 uVar1;

  undefined8 uVar2;

  undefined4 uVar4;

  undefined8 uVar3;

  

  FastExitMediaState();

  uVar1 = (undefined4)*param_2;

  uVar4 = (undefined4)((ulonglong)*param_2 >> 0x20);

  uVar2 = PackedFloatingMUL(CONCAT44(uVar1,uVar1),*param_3);

  uVar3 = PackedFloatingMUL(CONCAT44(uVar4,uVar4),param_3[2]);

  uVar2 = PackedFloatingADD(uVar2,uVar3);

  *param_1 = uVar2;

  FastExitMediaState();

  return param_1;

}





// --- FUN_0061234d at 0x0061234D (size: 102) ---


undefined8 * FUN_0061234d(undefined8 *param_1,undefined8 *param_2,undefined8 *param_3)



{

  undefined4 uVar1;

  undefined8 uVar2;

  undefined8 uVar3;

  undefined8 uVar4;

  undefined8 uVar5;

  undefined8 uVar6;

  

  FastExitMediaState();

  uVar1 = (undefined4)*param_2;

  uVar3 = CONCAT44(uVar1,uVar1);

  uVar1 = (undefined4)((ulonglong)*param_2 >> 0x20);

  uVar6 = CONCAT44(uVar1,uVar1);

  uVar2 = PackedFloatingMUL(uVar3,*param_3);

  uVar4 = PackedFloatingMUL(uVar6,param_3[2]);

  uVar2 = PackedFloatingADD(uVar2,param_3[6]);

  uVar5 = PackedFloatingMUL(uVar3,param_3[1]);

  uVar6 = PackedFloatingMUL(uVar6,param_3[3]);

  uVar3 = PackedFloatingADD(uVar2,uVar4);

  uVar2 = PackedFloatingADD(uVar5,param_3[7]);

  uVar2 = PackedFloatingADD(uVar2,uVar6);

  uVar1 = (undefined4)((ulonglong)uVar2 >> 0x20);

  uVar2 = CONCAT44(uVar1,uVar1);

  uVar6 = FloatingReciprocalAprox(uVar6,uVar2);

  uVar2 = PackedFloatingReciprocalIter1(uVar2,uVar6);

  uVar2 = PackedFloatingReciprocalIter2(uVar2,uVar6);

  uVar3 = PackedFloatingMUL(uVar3,uVar2);

  *param_1 = uVar3;

  FastExitMediaState();

  return param_1;

}





// --- FUN_00612582 at 0x00612582 (size: 132) ---


undefined8 * FUN_00612582(undefined8 *param_1,undefined8 *param_2,undefined8 *param_3)



{

  undefined4 uVar1;

  undefined8 uVar2;

  undefined8 uVar3;

  undefined8 uVar4;

  undefined8 uVar5;

  undefined8 uVar6;

  undefined8 uVar7;

  undefined8 uVar8;

  undefined8 uVar9;

  

  FastExitMediaState();

  uVar1 = (undefined4)*param_2;

  uVar5 = CONCAT44(uVar1,uVar1);

  uVar1 = (undefined4)((ulonglong)*param_2 >> 0x20);

  uVar8 = CONCAT44(uVar1,uVar1);

  uVar1 = (undefined4)param_2[1];

  uVar9 = CONCAT44(uVar1,uVar1);

  uVar1 = (undefined4)((ulonglong)param_2[1] >> 0x20);

  uVar6 = CONCAT44(uVar1,uVar1);

  uVar2 = PackedFloatingMUL(uVar5,*param_3);

  uVar3 = PackedFloatingMUL(uVar8,param_3[2]);

  uVar4 = PackedFloatingMUL(uVar9,param_3[4]);

  uVar7 = PackedFloatingMUL(uVar6,param_3[6]);

  uVar2 = PackedFloatingADD(uVar2,uVar3);

  uVar3 = PackedFloatingMUL(uVar5,param_3[1]);

  uVar5 = PackedFloatingADD(uVar4,uVar7);

  uVar8 = PackedFloatingMUL(uVar8,param_3[3]);

  uVar9 = PackedFloatingMUL(uVar9,param_3[5]);

  uVar4 = PackedFloatingMUL(uVar6,param_3[7]);

  uVar5 = PackedFloatingADD(uVar2,uVar5);

  uVar2 = PackedFloatingADD(uVar3,uVar8);

  uVar8 = PackedFloatingADD(uVar9,uVar4);

  uVar2 = PackedFloatingADD(uVar2,uVar8);

  *param_1 = uVar5;

  param_1[1] = uVar2;

  FastExitMediaState();

  return param_1;

}





// --- FUN_00612b95 at 0x00612B95 (size: 100) ---


/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */



void FUN_00612b95(undefined8 *param_1,ulonglong *param_2)



{

  ulonglong uVar1;

  undefined8 uVar2;

  ulonglong uVar3;

  undefined8 uVar4;

  undefined8 in_MM4;

  undefined8 uVar5;

  

  uVar1 = *param_2;

  uVar3 = param_2[1] & _DAT_007f3008;

  uVar2 = PackedFloatingMUL(uVar1,uVar1);

  uVar4 = PackedFloatingMUL(uVar3,uVar3);

  uVar2 = PackedFloatingADD(uVar2,uVar4);

  uVar2 = PackedFloatingAccumulate(uVar2,uVar2);

  uVar5 = PackedFloatingReciprocalSQRAprox(in_MM4,uVar2);

  uVar3 = PackedFloatingCompareGT(uVar2,_DAT_007f3028);

  uVar4 = PackedFloatingMUL(uVar5,uVar5);

  uVar2 = PackedFloatingReciprocalSQRIter1(uVar2,uVar4);

  uVar2 = PackedFloatingReciprocalIter2(uVar2,uVar5);

  uVar4 = PackedFloatingMUL(uVar1 & uVar3,uVar2);

  uVar2 = PackedFloatingMUL(param_2[1] & uVar3,uVar2);

  *param_1 = uVar4;

  param_1[1] = uVar2;

  FastExitMediaState();

  return;

}





// --- FUN_00612c77 at 0x00612C77 (size: 285) ---


uint FUN_00612c77(uint param_1,byte *param_2,uint param_3)



{

  uint uVar1;

  uint uVar2;

  uint uVar3;

  int iVar4;

  int iVar5;

  int iVar6;

  int iVar7;

  int iVar8;

  int iVar9;

  int iVar10;

  int iVar11;

  int iVar12;

  int iVar13;

  int iVar14;

  int iVar15;

  int iVar16;

  int iVar17;

  int iVar18;

  

  uVar3 = param_1 & 0xffff;

  param_1 = param_1 >> 0x10;

  if (param_2 == (byte *)0x0) {

    uVar3 = 1;

  }

  else {

    while (param_3 != 0) {

      uVar2 = 0x15b0;

      if (param_3 < 0x15b0) {

        uVar2 = param_3;

      }

      param_3 = param_3 - uVar2;

      if (0xf < (int)uVar2) {

        uVar1 = uVar2 >> 4;

        uVar2 = uVar2 + uVar1 * -0x10;

        do {

          iVar4 = uVar3 + *param_2;

          iVar5 = iVar4 + (uint)param_2[1];

          iVar6 = iVar5 + (uint)param_2[2];

          iVar7 = iVar6 + (uint)param_2[3];

          iVar8 = iVar7 + (uint)param_2[4];

          iVar9 = iVar8 + (uint)param_2[5];

          iVar10 = iVar9 + (uint)param_2[6];

          iVar11 = iVar10 + (uint)param_2[7];

          iVar12 = iVar11 + (uint)param_2[8];

          iVar13 = iVar12 + (uint)param_2[9];

          iVar14 = iVar13 + (uint)param_2[10];

          iVar15 = iVar14 + (uint)param_2[0xb];

          iVar16 = iVar15 + (uint)param_2[0xc];

          iVar17 = iVar16 + (uint)param_2[0xd];

          iVar18 = iVar17 + (uint)param_2[0xe];

          uVar3 = iVar18 + (uint)param_2[0xf];

          param_1 = param_1 + iVar4 + iVar5 + iVar6 + iVar7 + iVar8 + iVar9 + iVar10 + iVar11 +

                    iVar12 + iVar13 + iVar14 + iVar15 + iVar16 + iVar17 + iVar18 + uVar3;

          param_2 = param_2 + 0x10;

          uVar1 = uVar1 - 1;

        } while (uVar1 != 0);

      }

      for (; uVar2 != 0; uVar2 = uVar2 - 1) {

        uVar3 = uVar3 + *param_2;

        param_2 = param_2 + 1;

        param_1 = param_1 + uVar3;

      }

      uVar3 = uVar3 % 0xfff1;

      param_1 = param_1 % 0xfff1;

    }

    uVar3 = param_1 << 0x10 | uVar3;

  }

  return uVar3;

}





// --- FUN_00612d94 at 0x00612D94 (size: 96) ---


void FUN_00612d94(void)



{

  int in_EAX;

  undefined2 *puVar1;

  int iVar2;

  

  puVar1 = (undefined2 *)(in_EAX + 0x8c);

  iVar2 = 0x11e;

  do {

    *puVar1 = 0;

    puVar1 = puVar1 + 2;

    iVar2 = iVar2 + -1;

  } while (iVar2 != 0);

  puVar1 = (undefined2 *)(in_EAX + 0x980);

  iVar2 = 0x1e;

  do {

    *puVar1 = 0;

    puVar1 = puVar1 + 2;

    iVar2 = iVar2 + -1;

  } while (iVar2 != 0);

  puVar1 = (undefined2 *)(in_EAX + 0xa74);

  iVar2 = 0x13;

  do {

    *puVar1 = 0;

    puVar1 = puVar1 + 2;

    iVar2 = iVar2 + -1;

  } while (iVar2 != 0);

  *(undefined2 *)(in_EAX + 0x48c) = 1;

  *(undefined4 *)(in_EAX + 0x16a4) = 0;

  *(undefined4 *)(in_EAX + 0x16a0) = 0;

  *(undefined4 *)(in_EAX + 0x16a8) = 0;

  *(undefined4 *)(in_EAX + 0x1698) = 0;

  return;

}





// --- FUN_00612df4 at 0x00612DF4 (size: 180) ---


void FUN_00612df4(int param_1)



{

  ushort uVar1;

  ushort uVar2;

  int iVar3;

  int iVar4;

  int iVar5;

  int in_EAX;

  int iVar6;

  int iVar7;

  int unaff_EDI;

  bool bVar8;

  

  iVar3 = *(int *)(in_EAX + 0xb54 + param_1 * 4);

  iVar6 = *(int *)(in_EAX + 0x1448);

  iVar7 = param_1 * 2;

  bVar8 = SBORROW4(iVar7,iVar6);

  iVar5 = iVar7 - iVar6;

  if (iVar7 <= iVar6) {

    do {

      iVar6 = iVar7;

      if (bVar8 != iVar5 < 0) {

        iVar5 = *(int *)(in_EAX + 0xb58 + iVar7 * 4);

        uVar1 = *(ushort *)(unaff_EDI + iVar5 * 4);

        uVar2 = *(ushort *)(unaff_EDI + *(int *)(in_EAX + 0xb54 + iVar7 * 4) * 4);

        if ((uVar1 < uVar2) ||

           ((uVar1 == uVar2 &&

            (*(byte *)(iVar5 + 0x1450 + in_EAX) <=

             *(byte *)(*(int *)(in_EAX + 0xb54 + iVar7 * 4) + 0x1450 + in_EAX))))) {

          iVar6 = iVar7 + 1;

        }

      }

      iVar5 = *(int *)(in_EAX + 0xb54 + iVar6 * 4);

      uVar1 = *(ushort *)(unaff_EDI + iVar3 * 4);

      uVar2 = *(ushort *)(unaff_EDI + iVar5 * 4);

      if ((uVar1 < uVar2) ||

         ((uVar1 == uVar2 &&

          (*(byte *)(iVar3 + 0x1450 + in_EAX) <= *(byte *)(iVar5 + 0x1450 + in_EAX))))) break;

      *(int *)(in_EAX + 0xb54 + param_1 * 4) = iVar5;

      iVar4 = *(int *)(in_EAX + 0x1448);

      iVar7 = iVar6 * 2;

      bVar8 = SBORROW4(iVar7,iVar4);

      iVar5 = iVar7 - iVar4;

      param_1 = iVar6;

    } while (iVar5 == 0 || iVar7 < iVar4);

  }

  *(int *)(in_EAX + 0xb54 + param_1 * 4) = iVar3;

  return;

}





// --- FUN_00612ea8 at 0x00612EA8 (size: 442) ---


void __fastcall FUN_00612ea8(undefined4 param_1,int param_2)



{

  ushort *puVar1;

  ushort *puVar2;

  ushort uVar3;

  int iVar4;

  int iVar5;

  int iVar6;

  int iVar7;

  uint uVar8;

  int iVar9;

  int *in_EAX;

  int iVar10;

  int iVar11;

  uint uVar12;

  int iVar13;

  int *piVar14;

  undefined4 *puVar15;

  short *psVar16;

  int local_20;

  int *local_18;

  int local_14;

  int local_8;

  

  iVar4 = in_EAX[1];

  local_8 = 0;

  iVar5 = *in_EAX;

  piVar14 = (int *)in_EAX[2];

  iVar13 = *piVar14;

  iVar6 = piVar14[1];

  iVar7 = piVar14[2];

  uVar8 = piVar14[4];

  puVar15 = (undefined4 *)(param_2 + 0xb34);

  for (iVar10 = 8; iVar10 != 0; iVar10 = iVar10 + -1) {

    *puVar15 = 0;

    puVar15 = puVar15 + 1;

  }

  *(undefined2 *)(iVar5 + 2 + *(int *)(param_2 + 0xb54 + *(int *)(param_2 + 0x144c) * 4) * 4) = 0;

  iVar10 = *(int *)(param_2 + 0x144c) + 1;

  if (iVar10 < 0x23d) {

    local_18 = (int *)(param_2 + 0xb54 + iVar10 * 4);

    local_20 = 0x23d - iVar10;

    iVar10 = iVar10 + local_20;

    do {

      iVar9 = *local_18;

      iVar11 = iVar9 * 4;

      uVar12 = *(ushort *)(iVar5 + 2 + (uint)*(ushort *)(iVar11 + 2 + iVar5) * 4) + 1;

      if ((int)uVar8 < (int)uVar12) {

        local_8 = local_8 + 1;

        uVar12 = uVar8;

      }

      *(short *)(iVar11 + 2 + iVar5) = (short)uVar12;

      if (iVar9 <= iVar4) {

        psVar16 = (short *)(param_2 + 0xb34 + uVar12 * 2);

        *psVar16 = *psVar16 + 1;

        local_14 = 0;

        if (iVar7 <= iVar9) {

          local_14 = *(int *)(iVar6 + (iVar9 - iVar7) * 4);

        }

        uVar3 = *(ushort *)(iVar11 + iVar5);

        *(int *)(param_2 + 0x16a0) = *(int *)(param_2 + 0x16a0) + (local_14 + uVar12) * (uint)uVar3;

        if (iVar13 != 0) {

          *(int *)(param_2 + 0x16a4) =

               *(int *)(param_2 + 0x16a4) +

               ((uint)*(ushort *)(iVar11 + 2 + iVar13) + local_14) * (uint)uVar3;

        }

      }

      local_18 = local_18 + 1;

      local_20 = local_20 + -1;

    } while (local_20 != 0);

    if (local_8 != 0) {

      puVar2 = (ushort *)(param_2 + 0xb34 + uVar8 * 2);

      do {

        iVar13 = uVar8 - 1;

        for (psVar16 = (short *)(param_2 + 0xb34 + iVar13 * 2); *psVar16 == 0;

            psVar16 = psVar16 + -1) {

          iVar13 = iVar13 + -1;

        }

        psVar16 = (short *)(param_2 + 0xb34 + iVar13 * 2);

        *psVar16 = *psVar16 + -1;

        local_8 = local_8 + -2;

        psVar16 = (short *)(param_2 + 0xb36 + iVar13 * 2);

        *psVar16 = *psVar16 + 2;

        *puVar2 = *puVar2 - 1;

      } while (0 < local_8);

      for (; uVar8 != 0; uVar8 = uVar8 - 1) {

        local_18 = (int *)(uint)*puVar2;

        if (local_18 != (int *)0x0) {

          piVar14 = (int *)(param_2 + 0xb54 + iVar10 * 4);

          do {

            piVar14 = piVar14 + -1;

            iVar10 = iVar10 + -1;

            if (*piVar14 <= iVar4) {

              puVar1 = (ushort *)(iVar5 + *piVar14 * 4);

              if (puVar1[1] != uVar8) {

                local_8._0_2_ = (ushort)uVar8;

                *(int *)(param_2 + 0x16a0) =

                     *(int *)(param_2 + 0x16a0) + (uVar8 - puVar1[1]) * (uint)*puVar1;

                puVar1[1] = (ushort)local_8;

              }

              local_18 = (int *)((int)local_18 - 1);

            }

          } while (local_18 != (int *)0x0);

        }

        puVar2 = puVar2 + -1;

      }

    }

  }

  return;

}





// --- scan_tree at 0x00613062 (size: 192) ---


/* Library Function - Single Match

    _scan_tree@12

   

   Library: Visual Studio 2005 Release

   __stdcall scan_tree,12 */



void scan_tree(int param_1)



{

  short *psVar1;

  ushort uVar2;

  int in_EAX;

  int in_ECX;

  uint uVar3;

  uint uVar4;

  int iVar5;

  int iVar6;

  int iVar7;

  int iStack_1c;

  uint local_c;

  ushort *local_8;

  

  local_c = 0xffffffff;

  uVar2 = *(ushort *)(in_EAX + 2);

  iVar5 = 7;

  iVar6 = 0;

  iStack_1c = 4;

  if (uVar2 == 0) {

    iVar5 = 0x8a;

    iStack_1c = 3;

  }

  *(undefined2 *)(in_EAX + 6 + in_ECX * 4) = 0xffff;

  if (-1 < in_ECX) {

    local_8 = (ushort *)(in_EAX + 6);

    iVar7 = in_ECX + 1;

    uVar3 = (uint)uVar2;

    do {

      uVar4 = (uint)*local_8;

      iVar6 = iVar6 + 1;

      if ((iVar5 <= iVar6) || (uVar3 != uVar4)) {

        if (iVar6 < iStack_1c) {

          psVar1 = (short *)(param_1 + 0xa74 + uVar3 * 4);

          *psVar1 = *psVar1 + (short)iVar6;

        }

        else if (uVar3 == 0) {

          if (iVar6 < 0xb) {

            *(short *)(param_1 + 0xab8) = *(short *)(param_1 + 0xab8) + 1;

          }

          else {

            *(short *)(param_1 + 0xabc) = *(short *)(param_1 + 0xabc) + 1;

          }

        }

        else {

          if (uVar3 != local_c) {

            psVar1 = (short *)(param_1 + 0xa74 + uVar3 * 4);

            *psVar1 = *psVar1 + 1;

          }

          *(short *)(param_1 + 0xab4) = *(short *)(param_1 + 0xab4) + 1;

        }

        iVar6 = 0;

        local_c = uVar3;

        if (uVar4 == 0) {

          iVar5 = 0x8a;

        }

        else {

          if (uVar3 != uVar4) {

            iVar5 = 7;

            iStack_1c = 4;

            goto LAB_00613114;

          }

          iVar5 = 6;

        }

        iStack_1c = 3;

      }

LAB_00613114:

      local_8 = local_8 + 2;

      iVar7 = iVar7 + -1;

      uVar3 = uVar4;

    } while (iVar7 != 0);

  }

  return;

}





// --- FUN_00613122 at 0x00613122 (size: 1183) ---


void __fastcall FUN_00613122(int param_1,int param_2)



{

  ushort uVar1;

  int in_EAX;

  byte bVar2;

  uint uVar3;

  ushort uVar4;

  int iVar5;

  int iVar6;

  int iVar7;

  uint uVar8;

  int iStack_2c;

  int local_1c;

  uint local_18;

  ushort *local_10;

  uint local_c;

  

  local_18 = 0xffffffff;

  iVar7 = 7;

  iStack_2c = 4;

  if (*(ushort *)(param_1 + 2) == 0) {

    iVar7 = 0x8a;

    iStack_2c = 3;

  }

  if (-1 < param_2) {

    local_10 = (ushort *)(param_1 + 6);

    local_1c = param_2 + 1;

    iVar6 = 0;

    local_c = (uint)*(ushort *)(param_1 + 2);

    do {

      uVar3 = (uint)*local_10;

      iVar5 = iVar6 + 1;

      if ((iVar7 <= iVar5) || (local_c != uVar3)) {

        if (iVar5 < iStack_2c) {

          do {

            uVar8 = (uint)*(ushort *)(in_EAX + 0xa76 + local_c * 4);

            bVar2 = (byte)*(int *)(in_EAX + 0x16b4);

            if ((int)(0x10 - uVar8) < *(int *)(in_EAX + 0x16b4)) {

              uVar4 = *(ushort *)(in_EAX + 0xa74 + local_c * 4);

              *(ushort *)(in_EAX + 0x16b0) = *(ushort *)(in_EAX + 0x16b0) | uVar4 << (bVar2 & 0x1f);

              *(undefined1 *)(*(int *)(in_EAX + 8) + *(int *)(in_EAX + 0x14)) =

                   *(undefined1 *)(in_EAX + 0x16b0);

              *(int *)(in_EAX + 0x14) = *(int *)(in_EAX + 0x14) + 1;

              *(undefined1 *)(*(int *)(in_EAX + 0x14) + *(int *)(in_EAX + 8)) =

                   *(undefined1 *)(in_EAX + 0x16b1);

              *(int *)(in_EAX + 0x14) = *(int *)(in_EAX + 0x14) + 1;

              iVar7 = *(int *)(in_EAX + 0x16b4) + -0x10;

              *(ushort *)(in_EAX + 0x16b0) =

                   uVar4 >> (0x10U - (char)*(int *)(in_EAX + 0x16b4) & 0x1f);

            }

            else {

              iVar7 = *(int *)(in_EAX + 0x16b4);

              *(ushort *)(in_EAX + 0x16b0) =

                   *(ushort *)(in_EAX + 0x16b0) |

                   *(short *)(in_EAX + 0xa74 + local_c * 4) << (bVar2 & 0x1f);

            }

            iVar5 = iVar5 + -1;

            *(uint *)(in_EAX + 0x16b4) = iVar7 + uVar8;

          } while (iVar5 != 0);

        }

        else {

          if (local_c == 0) {

            iVar7 = *(int *)(in_EAX + 0x16b4);

            bVar2 = (byte)iVar7;

            if (iVar5 < 0xb) {

              uVar4 = *(ushort *)(in_EAX + 0xaba);

              if ((int)(0x10 - (uint)uVar4) < iVar7) {

                uVar1 = *(ushort *)(in_EAX + 0xab8);

                *(ushort *)(in_EAX + 0x16b0) =

                     *(ushort *)(in_EAX + 0x16b0) | uVar1 << (bVar2 & 0x1f);

                *(undefined1 *)(*(int *)(in_EAX + 8) + *(int *)(in_EAX + 0x14)) =

                     *(undefined1 *)(in_EAX + 0x16b0);

                *(int *)(in_EAX + 0x14) = *(int *)(in_EAX + 0x14) + 1;

                *(undefined1 *)(*(int *)(in_EAX + 0x14) + *(int *)(in_EAX + 8)) =

                     *(undefined1 *)(in_EAX + 0x16b1);

                *(int *)(in_EAX + 0x14) = *(int *)(in_EAX + 0x14) + 1;

                iVar7 = *(int *)(in_EAX + 0x16b4) + -0x10;

                *(ushort *)(in_EAX + 0x16b0) =

                     uVar1 >> (0x10U - (char)*(int *)(in_EAX + 0x16b4) & 0x1f);

              }

              else {

                *(ushort *)(in_EAX + 0x16b0) =

                     *(ushort *)(in_EAX + 0x16b0) | *(short *)(in_EAX + 0xab8) << (bVar2 & 0x1f);

              }

              iVar7 = iVar7 + (uint)uVar4;

              iVar6 = iVar6 + -2;

              *(int *)(in_EAX + 0x16b4) = iVar7;

              if (iVar7 < 0xe) {

                *(ushort *)(in_EAX + 0x16b0) =

                     *(ushort *)(in_EAX + 0x16b0) | (ushort)(iVar6 << ((byte)iVar7 & 0x1f));

                iVar7 = iVar7 + 3;

LAB_00613586:

                *(int *)(in_EAX + 0x16b4) = iVar7;

                goto LAB_0061358c;

              }

              *(ushort *)(in_EAX + 0x16b0) =

                   *(ushort *)(in_EAX + 0x16b0) | (ushort)(iVar6 << ((byte)iVar7 & 0x1f));

              *(undefined1 *)(*(int *)(in_EAX + 8) + *(int *)(in_EAX + 0x14)) =

                   *(undefined1 *)(in_EAX + 0x16b0);

              *(int *)(in_EAX + 0x14) = *(int *)(in_EAX + 0x14) + 1;

              *(undefined1 *)(*(int *)(in_EAX + 0x14) + *(int *)(in_EAX + 8)) =

                   *(undefined1 *)(in_EAX + 0x16b1);

              *(int *)(in_EAX + 0x14) = *(int *)(in_EAX + 0x14) + 1;

              uVar4 = (ushort)iVar6 >> (0x10U - (char)*(int *)(in_EAX + 0x16b4) & 0x1f);

              iVar7 = *(int *)(in_EAX + 0x16b4) + -0xd;

            }

            else {

              uVar4 = *(ushort *)(in_EAX + 0xabe);

              if ((int)(0x10 - (uint)uVar4) < iVar7) {

                uVar1 = *(ushort *)(in_EAX + 0xabc);

                *(ushort *)(in_EAX + 0x16b0) =

                     *(ushort *)(in_EAX + 0x16b0) | uVar1 << (bVar2 & 0x1f);

                *(undefined1 *)(*(int *)(in_EAX + 8) + *(int *)(in_EAX + 0x14)) =

                     *(undefined1 *)(in_EAX + 0x16b0);

                *(int *)(in_EAX + 0x14) = *(int *)(in_EAX + 0x14) + 1;

                *(undefined1 *)(*(int *)(in_EAX + 0x14) + *(int *)(in_EAX + 8)) =

                     *(undefined1 *)(in_EAX + 0x16b1);

                *(int *)(in_EAX + 0x14) = *(int *)(in_EAX + 0x14) + 1;

                iVar7 = *(int *)(in_EAX + 0x16b4) + -0x10;

                *(ushort *)(in_EAX + 0x16b0) =

                     uVar1 >> (0x10U - (char)*(int *)(in_EAX + 0x16b4) & 0x1f);

              }

              else {

                *(ushort *)(in_EAX + 0x16b0) =

                     *(ushort *)(in_EAX + 0x16b0) | *(short *)(in_EAX + 0xabc) << (bVar2 & 0x1f);

              }

              iVar7 = iVar7 + (uint)uVar4;

              iVar6 = iVar6 + -10;

              *(int *)(in_EAX + 0x16b4) = iVar7;

              if (iVar7 < 10) {

                *(ushort *)(in_EAX + 0x16b0) =

                     *(ushort *)(in_EAX + 0x16b0) | (ushort)(iVar6 << ((byte)iVar7 & 0x1f));

                iVar7 = iVar7 + 7;

                goto LAB_00613586;

              }

              *(ushort *)(in_EAX + 0x16b0) =

                   *(ushort *)(in_EAX + 0x16b0) | (ushort)(iVar6 << ((byte)iVar7 & 0x1f));

              *(undefined1 *)(*(int *)(in_EAX + 8) + *(int *)(in_EAX + 0x14)) =

                   *(undefined1 *)(in_EAX + 0x16b0);

              *(int *)(in_EAX + 0x14) = *(int *)(in_EAX + 0x14) + 1;

              *(undefined1 *)(*(int *)(in_EAX + 0x14) + *(int *)(in_EAX + 8)) =

                   *(undefined1 *)(in_EAX + 0x16b1);

              *(int *)(in_EAX + 0x14) = *(int *)(in_EAX + 0x14) + 1;

              uVar4 = (ushort)iVar6 >> (0x10U - (char)*(int *)(in_EAX + 0x16b4) & 0x1f);

              iVar7 = *(int *)(in_EAX + 0x16b4) + -9;

            }

          }

          else {

            if (local_c != local_18) {

              uVar8 = (uint)*(ushort *)(in_EAX + 0xa76 + local_c * 4);

              bVar2 = (byte)*(int *)(in_EAX + 0x16b4);

              if ((int)(0x10 - uVar8) < *(int *)(in_EAX + 0x16b4)) {

                uVar4 = *(ushort *)(in_EAX + 0xa74 + local_c * 4);

                *(ushort *)(in_EAX + 0x16b0) =

                     *(ushort *)(in_EAX + 0x16b0) | uVar4 << (bVar2 & 0x1f);

                *(undefined1 *)(*(int *)(in_EAX + 8) + *(int *)(in_EAX + 0x14)) =

                     *(undefined1 *)(in_EAX + 0x16b0);

                *(int *)(in_EAX + 0x14) = *(int *)(in_EAX + 0x14) + 1;

                *(undefined1 *)(*(int *)(in_EAX + 0x14) + *(int *)(in_EAX + 8)) =

                     *(undefined1 *)(in_EAX + 0x16b1);

                *(int *)(in_EAX + 0x14) = *(int *)(in_EAX + 0x14) + 1;

                iVar7 = *(int *)(in_EAX + 0x16b4) + -0x10;

                *(ushort *)(in_EAX + 0x16b0) =

                     uVar4 >> (0x10U - (char)*(int *)(in_EAX + 0x16b4) & 0x1f);

              }

              else {

                iVar7 = *(int *)(in_EAX + 0x16b4);

                *(ushort *)(in_EAX + 0x16b0) =

                     *(ushort *)(in_EAX + 0x16b0) |

                     *(short *)(in_EAX + 0xa74 + local_c * 4) << (bVar2 & 0x1f);

              }

              *(uint *)(in_EAX + 0x16b4) = iVar7 + uVar8;

              iVar5 = iVar6;

            }

            uVar4 = *(ushort *)(in_EAX + 0xab6);

            iVar7 = *(int *)(in_EAX + 0x16b4);

            if ((int)(0x10 - (uint)uVar4) < iVar7) {

              uVar1 = *(ushort *)(in_EAX + 0xab4);

              *(ushort *)(in_EAX + 0x16b0) =

                   *(ushort *)(in_EAX + 0x16b0) | uVar1 << ((byte)iVar7 & 0x1f);

              *(undefined1 *)(*(int *)(in_EAX + 8) + *(int *)(in_EAX + 0x14)) =

                   *(undefined1 *)(in_EAX + 0x16b0);

              *(int *)(in_EAX + 0x14) = *(int *)(in_EAX + 0x14) + 1;

              *(undefined1 *)(*(int *)(in_EAX + 0x14) + *(int *)(in_EAX + 8)) =

                   *(undefined1 *)(in_EAX + 0x16b1);

              *(int *)(in_EAX + 0x14) = *(int *)(in_EAX + 0x14) + 1;

              iVar7 = *(int *)(in_EAX + 0x16b4) + -0x10;

              *(ushort *)(in_EAX + 0x16b0) =

                   uVar1 >> (0x10U - (char)*(int *)(in_EAX + 0x16b4) & 0x1f);

            }

            else {

              *(ushort *)(in_EAX + 0x16b0) =

                   *(ushort *)(in_EAX + 0x16b0) | *(short *)(in_EAX + 0xab4) << ((byte)iVar7 & 0x1f)

              ;

            }

            iVar7 = iVar7 + (uint)uVar4;

            iVar5 = iVar5 + -3;

            *(int *)(in_EAX + 0x16b4) = iVar7;

            if (iVar7 < 0xf) {

              *(ushort *)(in_EAX + 0x16b0) =

                   *(ushort *)(in_EAX + 0x16b0) | (ushort)(iVar5 << ((byte)iVar7 & 0x1f));

              iVar7 = iVar7 + 2;

              goto LAB_00613586;

            }

            *(ushort *)(in_EAX + 0x16b0) =

                 *(ushort *)(in_EAX + 0x16b0) | (ushort)(iVar5 << ((byte)iVar7 & 0x1f));

            *(undefined1 *)(*(int *)(in_EAX + 8) + *(int *)(in_EAX + 0x14)) =

                 *(undefined1 *)(in_EAX + 0x16b0);

            *(int *)(in_EAX + 0x14) = *(int *)(in_EAX + 0x14) + 1;

            *(undefined1 *)(*(int *)(in_EAX + 0x14) + *(int *)(in_EAX + 8)) =

                 *(undefined1 *)(in_EAX + 0x16b1);

            *(int *)(in_EAX + 0x14) = *(int *)(in_EAX + 0x14) + 1;

            uVar4 = (ushort)iVar5 >> (0x10U - (char)*(int *)(in_EAX + 0x16b4) & 0x1f);

            iVar7 = *(int *)(in_EAX + 0x16b4) + -0xe;

          }

          *(ushort *)(in_EAX + 0x16b0) = uVar4;

          *(int *)(in_EAX + 0x16b4) = iVar7;

        }

LAB_0061358c:

        iVar5 = 0;

        local_18 = local_c;

        if (uVar3 == 0) {

          iVar7 = 0x8a;

        }

        else {

          if (local_c != uVar3) {

            iVar7 = 7;

            iStack_2c = 4;

            goto LAB_006135af;

          }

          iVar7 = 6;

        }

        iStack_2c = 3;

      }

LAB_006135af:

      local_10 = local_10 + 2;

      local_1c = local_1c + -1;

      iVar6 = iVar5;

      local_c = uVar3;

    } while (local_1c != 0);

  }

  return;

}





// --- FUN_006135c1 at 0x006135C1 (size: 573) ---


void FUN_006135c1(int param_1,int param_2,int param_3)



{

  ushort uVar1;

  int iVar2;

  int in_EAX;

  int iVar3;

  

  iVar3 = *(int *)(in_EAX + 0x16b4);

  if (iVar3 < 0xc) {

    *(ushort *)(in_EAX + 0x16b0) =

         *(ushort *)(in_EAX + 0x16b0) | (ushort)(param_1 + -0x101 << ((byte)iVar3 & 0x1f));

    *(int *)(in_EAX + 0x16b4) = iVar3 + 5;

  }

  else {

    *(ushort *)(in_EAX + 0x16b0) =

         *(ushort *)(in_EAX + 0x16b0) | (ushort)(param_1 + -0x101 << ((byte)iVar3 & 0x1f));

    *(undefined1 *)(*(int *)(in_EAX + 0x14) + *(int *)(in_EAX + 8)) =

         *(undefined1 *)(in_EAX + 0x16b0);

    *(int *)(in_EAX + 0x14) = *(int *)(in_EAX + 0x14) + 1;

    *(undefined1 *)(*(int *)(in_EAX + 0x14) + *(int *)(in_EAX + 8)) =

         *(undefined1 *)(in_EAX + 0x16b1);

    iVar3 = *(int *)(in_EAX + 0x16b4);

    *(int *)(in_EAX + 0x14) = *(int *)(in_EAX + 0x14) + 1;

    *(int *)(in_EAX + 0x16b4) = iVar3 + -0xb;

    *(ushort *)(in_EAX + 0x16b0) = (ushort)(param_1 + -0x101) >> (0x10U - (char)iVar3 & 0x1f);

  }

  iVar3 = *(int *)(in_EAX + 0x16b4);

  if (iVar3 < 0xc) {

    *(ushort *)(in_EAX + 0x16b0) =

         *(ushort *)(in_EAX + 0x16b0) | (ushort)(param_2 + -1 << ((byte)iVar3 & 0x1f));

    *(int *)(in_EAX + 0x16b4) = iVar3 + 5;

  }

  else {

    *(ushort *)(in_EAX + 0x16b0) =

         *(ushort *)(in_EAX + 0x16b0) | (ushort)(param_2 + -1 << ((byte)iVar3 & 0x1f));

    *(undefined1 *)(*(int *)(in_EAX + 0x14) + *(int *)(in_EAX + 8)) =

         *(undefined1 *)(in_EAX + 0x16b0);

    *(int *)(in_EAX + 0x14) = *(int *)(in_EAX + 0x14) + 1;

    *(undefined1 *)(*(int *)(in_EAX + 0x14) + *(int *)(in_EAX + 8)) =

         *(undefined1 *)(in_EAX + 0x16b1);

    iVar3 = *(int *)(in_EAX + 0x16b4);

    *(int *)(in_EAX + 0x14) = *(int *)(in_EAX + 0x14) + 1;

    *(int *)(in_EAX + 0x16b4) = iVar3 + -0xb;

    *(ushort *)(in_EAX + 0x16b0) = (ushort)(param_2 + -1) >> (0x10U - (char)iVar3 & 0x1f);

  }

  iVar3 = *(int *)(in_EAX + 0x16b4);

  if (iVar3 < 0xd) {

    *(ushort *)(in_EAX + 0x16b0) =

         *(ushort *)(in_EAX + 0x16b0) | (ushort)(param_3 + -4 << ((byte)iVar3 & 0x1f));

    *(int *)(in_EAX + 0x16b4) = iVar3 + 4;

  }

  else {

    *(ushort *)(in_EAX + 0x16b0) =

         *(ushort *)(in_EAX + 0x16b0) | (ushort)(param_3 + -4 << ((byte)iVar3 & 0x1f));

    *(undefined1 *)(*(int *)(in_EAX + 0x14) + *(int *)(in_EAX + 8)) =

         *(undefined1 *)(in_EAX + 0x16b0);

    *(int *)(in_EAX + 0x14) = *(int *)(in_EAX + 0x14) + 1;

    *(undefined1 *)(*(int *)(in_EAX + 0x14) + *(int *)(in_EAX + 8)) =

         *(undefined1 *)(in_EAX + 0x16b1);

    iVar3 = *(int *)(in_EAX + 0x16b4);

    *(int *)(in_EAX + 0x14) = *(int *)(in_EAX + 0x14) + 1;

    *(int *)(in_EAX + 0x16b4) = iVar3 + -0xc;

    *(ushort *)(in_EAX + 0x16b0) = (ushort)(param_3 + -4) >> (0x10U - (char)iVar3 & 0x1f);

  }

  iVar3 = 0;

  if (0 < param_3) {

    do {

      iVar2 = *(int *)(in_EAX + 0x16b4);

      if (iVar2 < 0xe) {

        *(ushort *)(in_EAX + 0x16b0) =

             *(ushort *)(in_EAX + 0x16b0) |

             *(short *)(in_EAX + 0xa76 + (uint)(byte)(&DAT_007f5c44)[iVar3] * 4) <<

             ((byte)iVar2 & 0x1f);

        *(int *)(in_EAX + 0x16b4) = iVar2 + 3;

      }

      else {

        uVar1 = *(ushort *)(in_EAX + 0xa76 + (uint)(byte)(&DAT_007f5c44)[iVar3] * 4);

        *(ushort *)(in_EAX + 0x16b0) = *(ushort *)(in_EAX + 0x16b0) | uVar1 << ((byte)iVar2 & 0x1f);

        *(undefined1 *)(*(int *)(in_EAX + 0x14) + *(int *)(in_EAX + 8)) =

             *(undefined1 *)(in_EAX + 0x16b0);

        *(int *)(in_EAX + 0x14) = *(int *)(in_EAX + 0x14) + 1;

        *(undefined1 *)(*(int *)(in_EAX + 0x14) + *(int *)(in_EAX + 8)) =

             *(undefined1 *)(in_EAX + 0x16b1);

        iVar2 = *(int *)(in_EAX + 0x16b4);

        *(int *)(in_EAX + 0x14) = *(int *)(in_EAX + 0x14) + 1;

        *(int *)(in_EAX + 0x16b4) = iVar2 + -0xd;

        *(ushort *)(in_EAX + 0x16b0) = uVar1 >> (0x10U - (char)iVar2 & 0x1f);

      }

      iVar3 = iVar3 + 1;

    } while (iVar3 < param_3);

  }

  FUN_00613122();

  FUN_00613122();

  return;

}





// --- FUN_006137fe at 0x006137FE (size: 950) ---


void FUN_006137fe(int param_1,int param_2)



{

  ushort *puVar1;

  byte bVar2;

  ushort uVar3;

  ushort uVar4;

  int in_EAX;

  uint uVar5;

  int iVar6;

  int iVar7;

  uint uVar8;

  int iVar9;

  uint uVar10;

  uint uVar11;

  uint uVar12;

  

  uVar5 = 0;

  if (*(int *)(in_EAX + 0x1698) != 0) {

    do {

      uVar12 = (uint)*(ushort *)(*(int *)(in_EAX + 0x169c) + uVar5 * 2);

      uVar11 = (uint)*(byte *)(uVar5 + *(int *)(in_EAX + 0x1690));

      uVar5 = uVar5 + 1;

      if (uVar12 == 0) {

        iVar6 = *(int *)(in_EAX + 0x16b4);

        puVar1 = (ushort *)(param_1 + uVar11 * 4);

        uVar11 = (uint)puVar1[1];

        if ((int)(0x10 - uVar11) < iVar6) {

          uVar3 = *puVar1;

          *(ushort *)(in_EAX + 0x16b0) =

               *(ushort *)(in_EAX + 0x16b0) | uVar3 << ((byte)iVar6 & 0x1f);

          *(undefined1 *)(*(int *)(in_EAX + 8) + *(int *)(in_EAX + 0x14)) =

               *(undefined1 *)(in_EAX + 0x16b0);

          *(int *)(in_EAX + 0x14) = *(int *)(in_EAX + 0x14) + 1;

          *(undefined1 *)(*(int *)(in_EAX + 0x14) + *(int *)(in_EAX + 8)) =

               *(undefined1 *)(in_EAX + 0x16b1);

          *(int *)(in_EAX + 0x14) = *(int *)(in_EAX + 0x14) + 1;

          iVar6 = *(int *)(in_EAX + 0x16b4) + -0x10 + uVar11;

          *(ushort *)(in_EAX + 0x16b0) = uVar3 >> (0x10U - (char)*(int *)(in_EAX + 0x16b4) & 0x1f);

        }

        else {

          *(ushort *)(in_EAX + 0x16b0) =

               *(ushort *)(in_EAX + 0x16b0) | *puVar1 << ((byte)iVar6 & 0x1f);

          iVar6 = iVar6 + uVar11;

        }

LAB_00613b00:

        *(int *)(in_EAX + 0x16b4) = iVar6;

      }

      else {

        uVar10 = (uint)(byte)(&DAT_007f6350)[uVar11];

        iVar7 = uVar10 * 4;

        uVar8 = (uint)*(ushort *)(iVar7 + 0x406 + param_1);

        iVar9 = *(int *)(in_EAX + 0x16b4);

        if ((int)(0x10 - uVar8) < iVar9) {

          uVar3 = *(ushort *)(param_1 + 0x404 + uVar10 * 4);

          *(ushort *)(in_EAX + 0x16b0) =

               *(ushort *)(in_EAX + 0x16b0) | uVar3 << ((byte)iVar9 & 0x1f);

          *(undefined1 *)(*(int *)(in_EAX + 8) + *(int *)(in_EAX + 0x14)) =

               *(undefined1 *)(in_EAX + 0x16b0);

          *(int *)(in_EAX + 0x14) = *(int *)(in_EAX + 0x14) + 1;

          *(undefined1 *)(*(int *)(in_EAX + 0x14) + *(int *)(in_EAX + 8)) =

               *(undefined1 *)(in_EAX + 0x16b1);

          *(int *)(in_EAX + 0x14) = *(int *)(in_EAX + 0x14) + 1;

          iVar9 = *(int *)(in_EAX + 0x16b4) + -0x10;

          *(ushort *)(in_EAX + 0x16b0) = uVar3 >> (0x10U - (char)*(int *)(in_EAX + 0x16b4) & 0x1f);

        }

        else {

          *(ushort *)(in_EAX + 0x16b0) =

               *(ushort *)(in_EAX + 0x16b0) |

               *(short *)(param_1 + 0x404 + uVar10 * 4) << ((byte)iVar9 & 0x1f);

        }

        *(uint *)(in_EAX + 0x16b4) = iVar9 + uVar8;

        iVar9 = *(int *)(&DAT_007f5b08 + iVar7);

        if (iVar9 != 0) {

          iVar6 = uVar11 - *(int *)(&DAT_007f6450 + iVar7);

          iVar7 = *(int *)(in_EAX + 0x16b4);

          if (0x10 - iVar9 < iVar7) {

            *(ushort *)(in_EAX + 0x16b0) =

                 *(ushort *)(in_EAX + 0x16b0) | (ushort)(iVar6 << ((byte)iVar7 & 0x1f));

            *(undefined1 *)(*(int *)(in_EAX + 8) + *(int *)(in_EAX + 0x14)) =

                 *(undefined1 *)(in_EAX + 0x16b0);

            *(int *)(in_EAX + 0x14) = *(int *)(in_EAX + 0x14) + 1;

            *(undefined1 *)(*(int *)(in_EAX + 0x14) + *(int *)(in_EAX + 8)) =

                 *(undefined1 *)(in_EAX + 0x16b1);

            *(int *)(in_EAX + 0x14) = *(int *)(in_EAX + 0x14) + 1;

            iVar7 = *(int *)(in_EAX + 0x16b4) + -0x10;

            *(ushort *)(in_EAX + 0x16b0) =

                 (ushort)iVar6 >> (0x10U - (char)*(int *)(in_EAX + 0x16b4) & 0x1f);

          }

          else {

            *(ushort *)(in_EAX + 0x16b0) =

                 *(ushort *)(in_EAX + 0x16b0) | (ushort)(iVar6 << ((byte)iVar7 & 0x1f));

          }

          *(int *)(in_EAX + 0x16b4) = iVar7 + iVar9;

        }

        uVar11 = uVar12 - 1;

        if (uVar11 < 0x100) {

          bVar2 = (&DAT_007f614f)[uVar12];

        }

        else {

          bVar2 = (&DAT_007f6250)[uVar11 >> 7];

        }

        iVar7 = (uint)bVar2 * 4;

        puVar1 = (ushort *)(iVar7 + param_2);

        uVar3 = puVar1[1];

        iVar9 = *(int *)(in_EAX + 0x16b4);

        if ((int)(0x10 - (uint)uVar3) < iVar9) {

          uVar4 = *puVar1;

          *(ushort *)(in_EAX + 0x16b0) =

               *(ushort *)(in_EAX + 0x16b0) | uVar4 << ((byte)iVar9 & 0x1f);

          *(undefined1 *)(*(int *)(in_EAX + 8) + *(int *)(in_EAX + 0x14)) =

               *(undefined1 *)(in_EAX + 0x16b0);

          *(int *)(in_EAX + 0x14) = *(int *)(in_EAX + 0x14) + 1;

          *(undefined1 *)(*(int *)(in_EAX + 0x14) + *(int *)(in_EAX + 8)) =

               *(undefined1 *)(in_EAX + 0x16b1);

          *(int *)(in_EAX + 0x14) = *(int *)(in_EAX + 0x14) + 1;

          iVar9 = *(int *)(in_EAX + 0x16b4) + -0x10;

          *(ushort *)(in_EAX + 0x16b0) = uVar4 >> (0x10U - (char)*(int *)(in_EAX + 0x16b4) & 0x1f);

        }

        else {

          *(ushort *)(in_EAX + 0x16b0) =

               *(ushort *)(in_EAX + 0x16b0) | *puVar1 << ((byte)iVar9 & 0x1f);

        }

        iVar9 = iVar9 + (uint)uVar3;

        *(int *)(in_EAX + 0x16b4) = iVar9;

        iVar6 = *(int *)(&DAT_007f5b80 + iVar7);

        if (iVar6 != 0) {

          iVar7 = uVar11 - *(int *)(&DAT_007f64c8 + iVar7);

          if (0x10 - iVar6 < iVar9) {

            *(ushort *)(in_EAX + 0x16b0) =

                 *(ushort *)(in_EAX + 0x16b0) | (ushort)(iVar7 << ((byte)iVar9 & 0x1f));

            *(undefined1 *)(*(int *)(in_EAX + 8) + *(int *)(in_EAX + 0x14)) =

                 *(undefined1 *)(in_EAX + 0x16b0);

            *(int *)(in_EAX + 0x14) = *(int *)(in_EAX + 0x14) + 1;

            *(undefined1 *)(*(int *)(in_EAX + 0x14) + *(int *)(in_EAX + 8)) =

                 *(undefined1 *)(in_EAX + 0x16b1);

            *(int *)(in_EAX + 0x14) = *(int *)(in_EAX + 0x14) + 1;

            iVar6 = *(int *)(in_EAX + 0x16b4) + -0x10 + iVar6;

            *(ushort *)(in_EAX + 0x16b0) =

                 (ushort)iVar7 >> (0x10U - (char)*(int *)(in_EAX + 0x16b4) & 0x1f);

          }

          else {

            *(ushort *)(in_EAX + 0x16b0) =

                 *(ushort *)(in_EAX + 0x16b0) | (ushort)(iVar7 << ((byte)iVar9 & 0x1f));

            iVar6 = iVar9 + iVar6;

          }

          goto LAB_00613b00;

        }

      }

    } while (uVar5 < *(uint *)(in_EAX + 0x1698));

  }

  uVar3 = *(ushort *)(param_1 + 0x402);

  iVar9 = *(int *)(in_EAX + 0x16b4);

  if ((int)(0x10 - (uint)uVar3) < iVar9) {

    uVar4 = *(ushort *)(param_1 + 0x400);

    *(ushort *)(in_EAX + 0x16b0) = *(ushort *)(in_EAX + 0x16b0) | uVar4 << ((byte)iVar9 & 0x1f);

    *(undefined1 *)(*(int *)(in_EAX + 8) + *(int *)(in_EAX + 0x14)) =

         *(undefined1 *)(in_EAX + 0x16b0);

    *(int *)(in_EAX + 0x14) = *(int *)(in_EAX + 0x14) + 1;

    *(undefined1 *)(*(int *)(in_EAX + 0x14) + *(int *)(in_EAX + 8)) =

         *(undefined1 *)(in_EAX + 0x16b1);

    *(int *)(in_EAX + 0x14) = *(int *)(in_EAX + 0x14) + 1;

    iVar9 = *(int *)(in_EAX + 0x16b4) + -0x10;

    *(ushort *)(in_EAX + 0x16b0) = uVar4 >> (0x10U - (char)*(int *)(in_EAX + 0x16b4) & 0x1f);

  }

  else {

    *(ushort *)(in_EAX + 0x16b0) =

         *(ushort *)(in_EAX + 0x16b0) | *(short *)(param_1 + 0x400) << ((byte)iVar9 & 0x1f);

  }

  *(uint *)(in_EAX + 0x16b4) = iVar9 + (uint)uVar3;

  *(uint *)(in_EAX + 0x16ac) = (uint)*(ushort *)(param_1 + 0x402);

  return;

}





// --- FUN_00613bb4 at 0x00613BB4 (size: 87) ---


void __fastcall FUN_00613bb4(int param_1)



{

  ushort *puVar1;

  uint uVar2;

  int iVar3;

  uint uVar4;

  

  uVar2 = 0;

  uVar4 = 0;

  puVar1 = (ushort *)(param_1 + 0x8c);

  iVar3 = 7;

  do {

    uVar4 = uVar4 + *puVar1;

    puVar1 = puVar1 + 2;

    iVar3 = iVar3 + -1;

  } while (iVar3 != 0);

  puVar1 = (ushort *)(param_1 + 0xa8);

  iVar3 = 0x79;

  do {

    uVar2 = uVar2 + *puVar1;

    puVar1 = puVar1 + 2;

    iVar3 = iVar3 + -1;

  } while (iVar3 != 0);

  puVar1 = (ushort *)(param_1 + 0x28c);

  iVar3 = 0x80;

  do {

    uVar4 = uVar4 + *puVar1;

    puVar1 = puVar1 + 2;

    iVar3 = iVar3 + -1;

  } while (iVar3 != 0);

  *(char *)(param_1 + 0x1c) = '\x01' - (uVar2 >> 2 < uVar4);

  return;

}





// --- FUN_00613c0b at 0x00613C0B (size: 87) ---


void FUN_00613c0b(void)



{

  int in_EAX;

  

  if (*(int *)(in_EAX + 0x16b4) < 9) {

    if (*(int *)(in_EAX + 0x16b4) < 1) goto LAB_00613c51;

    *(undefined1 *)(*(int *)(in_EAX + 8) + *(int *)(in_EAX + 0x14)) =

         *(undefined1 *)(in_EAX + 0x16b0);

  }

  else {

    *(undefined1 *)(*(int *)(in_EAX + 8) + *(int *)(in_EAX + 0x14)) =

         *(undefined1 *)(in_EAX + 0x16b0);

    *(int *)(in_EAX + 0x14) = *(int *)(in_EAX + 0x14) + 1;

    *(undefined1 *)(*(int *)(in_EAX + 0x14) + *(int *)(in_EAX + 8)) =

         *(undefined1 *)(in_EAX + 0x16b1);

  }

  *(int *)(in_EAX + 0x14) = *(int *)(in_EAX + 0x14) + 1;

LAB_00613c51:

  *(undefined2 *)(in_EAX + 0x16b0) = 0;

  *(undefined4 *)(in_EAX + 0x16b4) = 0;

  return;

}





// --- FUN_00613c62 at 0x00613C62 (size: 124) ---


void __fastcall FUN_00613c62(int param_1,undefined1 *param_2,int param_3)



{

  int iVar1;

  byte bVar2;

  

  iVar1 = FUN_00613c0b();

  *(undefined4 *)(iVar1 + 0x16ac) = 8;

  if (param_3 != 0) {

    *(byte *)(*(int *)(iVar1 + 0x14) + *(int *)(iVar1 + 8)) = (byte)param_1;

    *(int *)(iVar1 + 0x14) = *(int *)(iVar1 + 0x14) + 1;

    bVar2 = (byte)((uint)param_1 >> 8);

    *(byte *)(*(int *)(iVar1 + 0x14) + *(int *)(iVar1 + 8)) = bVar2;

    *(int *)(iVar1 + 0x14) = *(int *)(iVar1 + 0x14) + 1;

    *(byte *)(*(int *)(iVar1 + 0x14) + *(int *)(iVar1 + 8)) = ~(byte)param_1;

    *(int *)(iVar1 + 0x14) = *(int *)(iVar1 + 0x14) + 1;

    *(byte *)(*(int *)(iVar1 + 0x14) + *(int *)(iVar1 + 8)) = ~bVar2;

    *(int *)(iVar1 + 0x14) = *(int *)(iVar1 + 0x14) + 1;

  }

  for (; param_1 != 0; param_1 = param_1 + -1) {

    *(undefined1 *)(*(int *)(iVar1 + 0x14) + *(int *)(iVar1 + 8)) = *param_2;

    *(int *)(iVar1 + 0x14) = *(int *)(iVar1 + 0x14) + 1;

    param_2 = param_2 + 1;

  }

  return;

}





// --- FUN_00613cde at 0x00613CDE (size: 133) ---


/* WARNING: Function: __security_check_cookie replaced with injection: security_check_cookie */



void FUN_00613cde(int param_1,int param_2)



{

  uint uVar1;

  uint uVar2;

  ushort uVar3;

  uint uVar4;

  int iVar5;

  uint uVar6;

  int iVar7;

  uint uVar8;

  int unaff_EDI;

  ushort auStack_28 [16];

  undefined4 local_8;

  

  local_8 = DAT_00836f40;

  iVar7 = 0;

  uVar3 = 0;

  iVar5 = 1;

  do {

    uVar3 = (*(short *)(param_2 + iVar5 * 2 + -2) + uVar3) * 2;

    auStack_28[iVar5] = uVar3;

    iVar5 = iVar5 + 1;

  } while (iVar5 < 0x10);

  if (-1 < param_1) {

    do {

      uVar6 = (uint)*(ushort *)(unaff_EDI + 2 + iVar7 * 4);

      if (uVar6 != 0) {

        uVar3 = auStack_28[uVar6];

        uVar8 = (uint)uVar3;

        auStack_28[uVar6] = uVar3 + 1;

        uVar1 = 0;

        do {

          uVar2 = uVar1;

          uVar4 = uVar8 & 1;

          uVar8 = uVar8 >> 1;

          uVar6 = uVar6 - 1;

          uVar1 = (uVar2 | uVar4) << 1;

        } while (0 < (int)uVar6);

        *(ushort *)(unaff_EDI + iVar7 * 4) = (ushort)uVar2 | (ushort)uVar4;

      }

      iVar7 = iVar7 + 1;

    } while (iVar7 <= param_1);

  }

  return;

}





// --- FUN_00613d63 at 0x00613D63 (size: 488) ---


void FUN_00613d63(int *param_1)



{

  short *psVar1;

  short *psVar2;

  byte bVar3;

  int iVar4;

  undefined4 uVar5;

  byte bVar6;

  int in_EAX;

  int iVar7;

  int iVar8;

  int local_10;

  int local_c;

  

  local_c = -1;

  local_10 = ((int *)param_1[2])[3];

  iVar8 = *(int *)param_1[2];

  iVar7 = 0;

  iVar4 = *param_1;

  *(undefined4 *)(in_EAX + 0x1448) = 0;

  *(undefined4 *)(in_EAX + 0x144c) = 0x23d;

  if (0 < local_10) {

    do {

      if (*(short *)(iVar4 + iVar7 * 4) == 0) {

        *(undefined2 *)(iVar4 + 2 + iVar7 * 4) = 0;

      }

      else {

        *(int *)(in_EAX + 0x1448) = *(int *)(in_EAX + 0x1448) + 1;

        *(int *)(in_EAX + 0xb54 + *(int *)(in_EAX + 0x1448) * 4) = iVar7;

        *(undefined1 *)(iVar7 + 0x1450 + in_EAX) = 0;

        local_c = iVar7;

      }

      iVar7 = iVar7 + 1;

    } while (iVar7 < local_10);

  }

  while (*(int *)(in_EAX + 0x1448) < 2) {

    if (local_c < 2) {

      iVar7 = local_c + 1;

      local_c = iVar7;

    }

    else {

      iVar7 = 0;

    }

    *(int *)(in_EAX + 0x1448) = *(int *)(in_EAX + 0x1448) + 1;

    *(int *)(in_EAX + 0xb54 + *(int *)(in_EAX + 0x1448) * 4) = iVar7;

    *(undefined2 *)(iVar7 * 4 + iVar4) = 1;

    *(undefined1 *)(in_EAX + 0x1450 + iVar7) = 0;

    *(int *)(in_EAX + 0x16a0) = *(int *)(in_EAX + 0x16a0) + -1;

    if (iVar8 != 0) {

      *(int *)(in_EAX + 0x16a4) =

           *(int *)(in_EAX + 0x16a4) - (uint)*(ushort *)(iVar7 * 4 + 2 + iVar8);

    }

  }

  param_1[1] = local_c;

  for (iVar8 = *(int *)(in_EAX + 0x1448) / 2; 0 < iVar8; iVar8 = iVar8 + -1) {

    FUN_00612df4(iVar8);

  }

  do {

    uVar5 = *(undefined4 *)(in_EAX + 0xb54 + *(int *)(in_EAX + 0x1448) * 4);

    iVar8 = *(int *)(in_EAX + 0xb58);

    *(int *)(in_EAX + 0x1448) = *(int *)(in_EAX + 0x1448) + -1;

    *(undefined4 *)(in_EAX + 0xb58) = uVar5;

    FUN_00612df4(1);

    *(int *)(in_EAX + 0x144c) = *(int *)(in_EAX + 0x144c) + -1;

    iVar7 = *(int *)(in_EAX + 0xb58);

    *(int *)(in_EAX + 0xb54 + *(int *)(in_EAX + 0x144c) * 4) = iVar8;

    *(int *)(in_EAX + 0x144c) = *(int *)(in_EAX + 0x144c) + -1;

    *(int *)(in_EAX + 0xb54 + *(int *)(in_EAX + 0x144c) * 4) = iVar7;

    psVar1 = (short *)(iVar4 + iVar7 * 4);

    psVar2 = (short *)(iVar4 + iVar8 * 4);

    *(short *)(iVar4 + local_10 * 4) = *psVar1 + *psVar2;

    bVar3 = *(byte *)(in_EAX + 0x1450 + iVar8);

    bVar6 = *(byte *)(in_EAX + 0x1450 + iVar7);

    if (bVar6 <= bVar3) {

      bVar6 = bVar3;

    }

    *(byte *)(in_EAX + 0x1450 + local_10) = bVar6 + 1;

    psVar1[1] = (short)local_10;

    psVar2[1] = (short)local_10;

    *(int *)(in_EAX + 0xb58) = local_10;

    local_10 = local_10 + 1;

    FUN_00612df4(1);

  } while (1 < *(int *)(in_EAX + 0x1448));

  *(int *)(in_EAX + 0x144c) = *(int *)(in_EAX + 0x144c) + -1;

  *(undefined4 *)(in_EAX + 0xb54 + *(int *)(in_EAX + 0x144c) * 4) = *(undefined4 *)(in_EAX + 0xb58);

  FUN_00612ea8();

  FUN_00613cde(local_c,in_EAX + 0xb34);

  return;

}





// --- FUN_00613f4b at 0x00613F4B (size: 88) ---


void FUN_00613f4b(void)



{

  int iVar1;

  int unaff_ESI;

  

  scan_tree(unaff_ESI);

  scan_tree(unaff_ESI);

  FUN_00613d63(unaff_ESI + 0xb28);

  iVar1 = 0x12;

  do {

    if (*(short *)(unaff_ESI + 0xa76 + (uint)(byte)(&DAT_007f5c44)[iVar1] * 4) != 0) break;

    iVar1 = iVar1 + -1;

  } while (2 < iVar1);

  *(int *)(unaff_ESI + 0x16a0) = *(int *)(unaff_ESI + 0x16a0) + iVar1 * 3 + 0x11;

  return;

}





// --- FUN_00613fa3 at 0x00613FA3 (size: 142) ---


void FUN_00613fa3(int param_1,undefined4 param_2,undefined4 param_3,int param_4)



{

  int iVar1;

  

  iVar1 = *(int *)(param_1 + 0x16b4);

  if (iVar1 < 0xe) {

    *(ushort *)(param_1 + 0x16b0) =

         *(ushort *)(param_1 + 0x16b0) | (ushort)(param_4 << ((byte)iVar1 & 0x1f));

    *(int *)(param_1 + 0x16b4) = iVar1 + 3;

  }

  else {

    *(ushort *)(param_1 + 0x16b0) =

         *(ushort *)(param_1 + 0x16b0) | (ushort)(param_4 << ((byte)iVar1 & 0x1f));

    *(undefined1 *)(*(int *)(param_1 + 8) + *(int *)(param_1 + 0x14)) =

         *(undefined1 *)(param_1 + 0x16b0);

    *(int *)(param_1 + 0x14) = *(int *)(param_1 + 0x14) + 1;

    *(undefined1 *)(*(int *)(param_1 + 0x14) + *(int *)(param_1 + 8)) =

         *(undefined1 *)(param_1 + 0x16b1);

    iVar1 = *(int *)(param_1 + 0x16b4);

    *(int *)(param_1 + 0x14) = *(int *)(param_1 + 0x14) + 1;

    *(int *)(param_1 + 0x16b4) = iVar1 + -0xd;

    *(ushort *)(param_1 + 0x16b0) = (ushort)param_4 >> (0x10U - (char)iVar1 & 0x1f);

  }

  FUN_00613c62(1);

  return;

}





// --- FUN_00614031 at 0x00614031 (size: 443) ---


void FUN_00614031(int param_1,int param_2,int param_3,int param_4)



{

  int iVar1;

  int iVar2;

  byte bVar3;

  uint uVar4;

  uint uVar5;

  int iVar6;

  undefined *puVar7;

  undefined *puVar8;

  

  iVar2 = 0;

  if (*(int *)(param_1 + 0x7c) < 1) {

    uVar4 = param_3 + 5;

  }

  else {

    if (*(char *)(param_1 + 0x1c) == '\x02') {

      FUN_00613bb4();

    }

    FUN_00613d63(param_1 + 0xb10);

    FUN_00613d63(param_1 + 0xb1c);

    iVar2 = FUN_00613f4b();

    uVar5 = *(int *)(param_1 + 0x16a0) + 10U >> 3;

    uVar4 = *(int *)(param_1 + 0x16a4) + 10U >> 3;

    if (uVar5 < uVar4) goto LAB_00614096;

  }

  uVar5 = uVar4;

LAB_00614096:

  if ((uVar5 < param_3 + 4U) || (param_2 == 0)) {

    iVar1 = *(int *)(param_1 + 0x16b4);

    bVar3 = (byte)iVar1;

    if (uVar4 == uVar5) {

      iVar2 = param_4 + 2;

      if (iVar1 < 0xe) {

        *(ushort *)(param_1 + 0x16b0) =

             *(ushort *)(param_1 + 0x16b0) | (ushort)(iVar2 << (bVar3 & 0x1f));

        *(int *)(param_1 + 0x16b4) = iVar1 + 3;

      }

      else {

        *(ushort *)(param_1 + 0x16b0) =

             *(ushort *)(param_1 + 0x16b0) | (ushort)(iVar2 << (bVar3 & 0x1f));

        *(undefined1 *)(*(int *)(param_1 + 8) + *(int *)(param_1 + 0x14)) =

             *(undefined1 *)(param_1 + 0x16b0);

        *(int *)(param_1 + 0x14) = *(int *)(param_1 + 0x14) + 1;

        *(undefined1 *)(*(int *)(param_1 + 0x14) + *(int *)(param_1 + 8)) =

             *(undefined1 *)(param_1 + 0x16b1);

        iVar1 = *(int *)(param_1 + 0x16b4);

        *(int *)(param_1 + 0x14) = *(int *)(param_1 + 0x14) + 1;

        *(int *)(param_1 + 0x16b4) = iVar1 + -0xd;

        *(ushort *)(param_1 + 0x16b0) = (ushort)iVar2 >> (0x10U - (char)iVar1 & 0x1f);

      }

      puVar8 = &DAT_007f60d8;

      puVar7 = &DAT_007f5c58;

    }

    else {

      iVar6 = param_4 + 4;

      if (iVar1 < 0xe) {

        *(ushort *)(param_1 + 0x16b0) =

             *(ushort *)(param_1 + 0x16b0) | (ushort)(iVar6 << (bVar3 & 0x1f));

        *(int *)(param_1 + 0x16b4) = iVar1 + 3;

      }

      else {

        *(ushort *)(param_1 + 0x16b0) =

             *(ushort *)(param_1 + 0x16b0) | (ushort)(iVar6 << (bVar3 & 0x1f));

        *(undefined1 *)(*(int *)(param_1 + 8) + *(int *)(param_1 + 0x14)) =

             *(undefined1 *)(param_1 + 0x16b0);

        *(int *)(param_1 + 0x14) = *(int *)(param_1 + 0x14) + 1;

        *(undefined1 *)(*(int *)(param_1 + 0x14) + *(int *)(param_1 + 8)) =

             *(undefined1 *)(param_1 + 0x16b1);

        iVar1 = *(int *)(param_1 + 0x16b4);

        *(int *)(param_1 + 0x14) = *(int *)(param_1 + 0x14) + 1;

        *(int *)(param_1 + 0x16b4) = iVar1 + -0xd;

        *(ushort *)(param_1 + 0x16b0) = (ushort)iVar6 >> (0x10U - (char)iVar1 & 0x1f);

      }

      FUN_006135c1(*(int *)(param_1 + 0xb14) + 1,*(int *)(param_1 + 0xb20) + 1,iVar2 + 1);

      puVar8 = (undefined *)(param_1 + 0x980);

      puVar7 = (undefined *)(param_1 + 0x8c);

    }

    FUN_006137fe(puVar7,puVar8);

  }

  else {

    FUN_00613fa3(param_1,param_2,param_3,param_4);

  }

  FUN_00612d94();

  if (param_4 != 0) {

    FUN_00613c0b();

  }

  return;

}





// --- FUN_006141ec at 0x006141EC (size: 492) ---


/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */



void FUN_006141ec(uint *param_1,uint *param_2,uint *param_3)



{

  uint uVar1;

  uint uVar2;

  uint uVar3;

  uint uVar4;

  uint uVar5;

  float fVar6;

  float fVar7;

  float fVar8;

  uint uVar9;

  float fVar10;

  float fVar11;

  float fVar12;

  uint uVar13;

  float fVar14;

  float fVar15;

  float fVar16;

  uint uVar17;

  float fVar18;

  float fVar19;

  float fVar20;

  uint uVar21;

  uint uVar22;

  uint uVar23;

  uint uVar24;

  uint uVar25;

  uint uVar26;

  uint uVar27;

  uint uVar28;

  

  fVar6 = (float)(*param_1 & _DAT_008321f0);

  fVar10 = (float)(param_1[1] & uRam008321f4);

  fVar14 = (float)(param_1[2] & uRam008321f8);

  fVar18 = (float)(param_1[3] & uRam008321fc);

  uVar22 = param_1[1] & uRam008321e4;

  uVar23 = param_1[2] & uRam008321e8;

  uVar24 = param_1[3] & uRam008321ec;

  fVar7 = fVar6 * _DAT_008321d0 + _DAT_00832180;

  fVar11 = fVar10 * fRam008321d4 + fRam00832184;

  fVar15 = fVar14 * fRam008321d8 + fRam00832188;

  fVar19 = fVar18 * fRam008321dc + fRam0083218c;

  fVar8 = fVar7 - _DAT_00832180;

  fVar12 = fVar11 - fRam00832184;

  fVar16 = fVar15 - fRam00832188;

  fVar20 = fVar19 - fRam0083218c;

  fVar6 = (((fVar6 - _DAT_008321c0 * fVar8) - _DAT_008321b0 * fVar8) - _DAT_008321a0 * fVar8) -

          _DAT_00832190 * fVar8;

  fVar8 = (((fVar10 - fRam008321c4 * fVar12) - fRam008321b4 * fVar12) - fRam008321a4 * fVar12) -

          fRam00832194 * fVar12;

  fVar10 = (((fVar14 - fRam008321c8 * fVar16) - fRam008321b8 * fVar16) - fRam008321a8 * fVar16) -

           fRam00832198 * fVar16;

  fVar12 = (((fVar18 - fRam008321cc * fVar20) - fRam008321bc * fVar20) - fRam008321ac * fVar20) -

           fRam0083219c * fVar20;

  fVar14 = fVar6 * fVar6;

  fVar16 = fVar8 * fVar8;

  fVar18 = fVar10 * fVar10;

  fVar20 = fVar12 * fVar12;

  uVar25 = (uint)fVar7 & _DAT_00832150;

  uVar26 = (uint)fVar11 & uRam00832154;

  uVar27 = (uint)fVar15 & uRam00832158;

  uVar28 = (uint)fVar19 & uRam0083215c;

  uVar9 = uVar25 & _DAT_00832140;

  uVar13 = uVar26 & uRam00832144;

  uVar17 = uVar27 & uRam00832148;

  uVar21 = uVar28 & uRam0083214c;

  uVar1 = uVar26 - uVar13 & _DAT_00832130;

  uVar2 = uVar27 - uVar17 & _DAT_00832130;

  uVar3 = uVar28 - uVar21 & _DAT_00832130;

  uVar4 = uVar25 + uVar9 & _DAT_00832130;

  uVar26 = uVar26 + uVar13 & _DAT_00832130;

  uVar27 = uVar27 + uVar17 & _DAT_00832130;

  uVar28 = uVar28 + uVar21 & _DAT_00832130;

  uVar5 = -(uint)((float)(uVar9 << 0x1e) != 0.0);

  uVar13 = -(uint)((float)(uVar13 << 0x1e) != 0.0);

  uVar17 = -(uint)((float)(uVar17 << 0x1e) != 0.0);

  uVar21 = -(uint)((float)(uVar21 << 0x1e) != 0.0);

  fVar6 = (((_DAT_00832170 * fVar14 + _DAT_00832120) * fVar14 + _DAT_00832100) * fVar14 +

          _DAT_008320e0) * fVar6;

  fVar8 = (((fRam00832174 * fVar16 + fRam00832124) * fVar16 + fRam00832104) * fVar16 + fRam008320e4)

          * fVar8;

  fVar10 = (((fRam00832178 * fVar18 + fRam00832128) * fVar18 + fRam00832108) * fVar18 + fRam008320e8

           ) * fVar10;

  fVar12 = (((fRam0083217c * fVar20 + fRam0083212c) * fVar20 + fRam0083210c) * fVar20 + fRam008320ec

           ) * fVar12;

  fVar7 = (((_DAT_00832160 * fVar14 + _DAT_00832110) * fVar14 + _DAT_008320f0) * fVar14 +

          _DAT_008320d0) * fVar14 + _DAT_008320c0;

  fVar11 = (((fRam00832164 * fVar16 + fRam00832114) * fVar16 + fRam008320f4) * fVar16 + fRam008320d4

           ) * fVar16 + fRam008320c4;

  fVar14 = (((fRam00832168 * fVar18 + fRam00832118) * fVar18 + fRam008320f8) * fVar18 + fRam008320d8

           ) * fVar18 + fRam008320c8;

  fVar15 = (((fRam0083216c * fVar20 + fRam0083211c) * fVar20 + fRam008320fc) * fVar20 + fRam008320dc

           ) * fVar20 + fRam008320cc;

  *param_2 = (~uVar5 & (uint)fVar6 | uVar5 & (uint)fVar7) ^

             (uVar25 - uVar9 & _DAT_00832130) << 0x1e ^ *param_1 & _DAT_008321e0;

  param_2[1] = (~uVar13 & (uint)fVar8 | uVar13 & (uint)fVar11) ^ uVar1 << 0x1e ^ uVar22;

  param_2[2] = (~uVar17 & (uint)fVar10 | uVar17 & (uint)fVar14) ^ uVar2 << 0x1e ^ uVar23;

  param_2[3] = (~uVar21 & (uint)fVar12 | uVar21 & (uint)fVar15) ^ uVar3 << 0x1e ^ uVar24;

  *param_3 = (uVar5 & (uint)fVar6 | ~uVar5 & (uint)fVar7) ^ uVar4 << 0x1e;

  param_3[1] = (uVar13 & (uint)fVar8 | ~uVar13 & (uint)fVar11) ^ uVar26 << 0x1e;

  param_3[2] = (uVar17 & (uint)fVar10 | ~uVar17 & (uint)fVar14) ^ uVar27 << 0x1e;

  param_3[3] = (uVar21 & (uint)fVar12 | ~uVar21 & (uint)fVar15) ^ uVar28 << 0x1e;

  return;

}





// --- FUN_006143d8 at 0x006143D8 (size: 329) ---


/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */



void FUN_006143d8(uint *param_1,uint *param_2,uint *param_3)



{

  float fVar1;

  float fVar2;

  uint uVar3;

  float fVar4;

  float fVar5;

  uint uVar6;

  float fVar7;

  float fVar8;

  uint uVar9;

  float fVar10;

  float fVar11;

  uint uVar12;

  uint uVar13;

  uint uVar14;

  uint uVar15;

  float fVar16;

  float fVar17;

  uint uVar18;

  uint uVar19;

  uint uVar20;

  uint uVar21;

  uint uVar22;

  uint uVar23;

  uint uVar24;

  float fVar25;

  float fVar26;

  uint uVar27;

  uint uVar28;

  

  fVar16 = (float)(*param_1 & _DAT_00832330);

  fVar17 = (float)(param_1[1] & uRam00832334);

  fVar25 = (float)(param_1[2] & uRam00832338);

  fVar26 = (float)(param_1[3] & uRam0083233c);

  uVar13 = param_1[1] & uRam00832324;

  uVar14 = param_1[2] & uRam00832328;

  uVar15 = param_1[3] & uRam0083232c;

  fVar1 = fVar16 * _DAT_00832310 + _DAT_008322c0;

  fVar4 = fVar17 * fRam00832314 + fRam008322c4;

  fVar7 = fVar25 * fRam00832318 + fRam008322c8;

  fVar10 = fVar26 * fRam0083231c + fRam008322cc;

  fVar2 = fVar1 - _DAT_008322c0;

  fVar5 = fVar4 - fRam008322c4;

  fVar8 = fVar7 - fRam008322c8;

  fVar11 = fVar10 - fRam008322cc;

  fVar16 = (((fVar16 - _DAT_00832300 * fVar2) - _DAT_008322f0 * fVar2) - _DAT_008322e0 * fVar2) -

           _DAT_008322d0 * fVar2;

  fVar2 = (((fVar17 - fRam00832304 * fVar5) - fRam008322f4 * fVar5) - fRam008322e4 * fVar5) -

          fRam008322d4 * fVar5;

  fVar17 = (((fVar25 - fRam00832308 * fVar8) - fRam008322f8 * fVar8) - fRam008322e8 * fVar8) -

           fRam008322d8 * fVar8;

  fVar5 = (((fVar26 - fRam0083230c * fVar11) - fRam008322fc * fVar11) - fRam008322ec * fVar11) -

          fRam008322dc * fVar11;

  fVar25 = fVar16 * fVar16;

  fVar8 = fVar2 * fVar2;

  fVar26 = fVar17 * fVar17;

  fVar11 = fVar5 * fVar5;

  uVar18 = (uint)fVar1 & _DAT_00832290;

  uVar19 = (uint)fVar4 & uRam00832294;

  uVar21 = (uint)fVar7 & uRam00832298;

  uVar23 = (uint)fVar10 & uRam0083229c;

  uVar3 = uVar18 & _DAT_00832280;

  uVar6 = uVar19 & uRam00832284;

  uVar9 = uVar21 & uRam00832288;

  uVar12 = uVar23 & uRam0083228c;

  uVar20 = uVar19 - uVar6 & uRam00832274;

  uVar22 = uVar21 - uVar9 & uRam00832278;

  uVar24 = uVar23 - uVar12 & uRam0083227c;

  uVar27 = uVar18 + uVar3 & _DAT_00832270;

  uVar28 = uVar19 + uVar6 & uRam00832274;

  uVar21 = uVar21 + uVar9 & uRam00832278;

  uVar23 = uVar23 + uVar12 & uRam0083227c;

  uVar19 = -(uint)((float)(uVar3 << 0x1e) != 0.0);

  uVar6 = -(uint)((float)(uVar6 << 0x1e) != 0.0);

  uVar9 = -(uint)((float)(uVar9 << 0x1e) != 0.0);

  uVar12 = -(uint)((float)(uVar12 << 0x1e) != 0.0);

  fVar16 = (((_DAT_008322b0 * fVar25 + _DAT_00832260) * fVar25 + _DAT_00832240) * fVar25 +

           _DAT_00832220) * fVar16;

  fVar2 = (((fRam008322b4 * fVar8 + fRam00832264) * fVar8 + fRam00832244) * fVar8 + fRam00832224) *

          fVar2;

  fVar17 = (((fRam008322b8 * fVar26 + fRam00832268) * fVar26 + fRam00832248) * fVar26 + fRam00832228

           ) * fVar17;

  fVar5 = (((fRam008322bc * fVar11 + fRam0083226c) * fVar11 + fRam0083224c) * fVar11 + fRam0083222c)

          * fVar5;

  fVar1 = (((_DAT_008322a0 * fVar25 + _DAT_00832250) * fVar25 + _DAT_00832230) * fVar25 +

          _DAT_00832210) * fVar25 + _DAT_00832200;

  fVar4 = (((fRam008322a4 * fVar8 + fRam00832254) * fVar8 + fRam00832234) * fVar8 + fRam00832214) *

          fVar8 + fRam00832204;

  fVar25 = (((fRam008322a8 * fVar26 + fRam00832258) * fVar26 + fRam00832238) * fVar26 + fRam00832218

           ) * fVar26 + fRam00832208;

  fVar7 = (((fRam008322ac * fVar11 + fRam0083225c) * fVar11 + fRam0083223c) * fVar11 + fRam0083221c)

          * fVar11 + fRam0083220c;

  *param_2 = (~uVar19 & (uint)fVar16 | uVar19 & (uint)fVar1) ^

             (uVar18 - uVar3 & _DAT_00832270) << 0x1e ^ *param_1 & _DAT_00832320;

  param_2[1] = (~uVar6 & (uint)fVar2 | uVar6 & (uint)fVar4) ^ uVar20 << 0x1e ^ uVar13;

  param_2[2] = (~uVar9 & (uint)fVar17 | uVar9 & (uint)fVar25) ^ uVar22 << 0x1e ^ uVar14;

  param_2[3] = (~uVar12 & (uint)fVar5 | uVar12 & (uint)fVar7) ^ uVar24 << 0x1e ^ uVar15;

  *param_3 = (uVar19 & (uint)fVar16 | ~uVar19 & (uint)fVar1) ^ uVar27 << 0x1e;

  param_3[1] = (uVar6 & (uint)fVar2 | ~uVar6 & (uint)fVar4) ^ uVar28 << 0x1e;

  param_3[2] = (uVar9 & (uint)fVar17 | ~uVar9 & (uint)fVar25) ^ uVar21 << 0x1e;

  param_3[3] = (uVar12 & (uint)fVar5 | ~uVar12 & (uint)fVar7) ^ uVar23 << 0x1e;

  return;

}





// --- FUN_006150c0 at 0x006150C0 (size: 245) ---


ulonglong FUN_006150c0(void)



{

  ulonglong in_MM0;

  ulonglong uVar1;

  undefined8 uVar2;

  ulonglong in_MM1;

  ulonglong uVar3;

  undefined8 uVar4;

  undefined8 uVar5;

  undefined8 uVar6;

  uint uVar7;

  uint uVar8;

  ulonglong uVar9;

  

  uVar9 = (DAT_00833098 & in_MM0) >> 1 | DAT_00833098 & in_MM1;

  uVar3 = in_MM1 & DAT_0083309c;

  uVar1 = in_MM0 & DAT_0083309c;

  uVar2 = PackedFloatingMAX(uVar1,uVar3);

  uVar7 = (uint)((int)uVar1 < (int)uVar3) * -0x80000000;

  uVar4 = PackedFloatingMIN(uVar3,uVar1);

  uVar5 = FloatingReciprocalAprox(uVar1,uVar2);

  uVar2 = PackedFloatingReciprocalIter1(uVar2,uVar5);

  uVar2 = PackedFloatingReciprocalIter2(uVar2,uVar5);

  uVar2 = PackedFloatingMUL(uVar2,uVar4);

  uVar4 = PackedFloatingMUL(uVar2,uVar2);

  uVar5 = PackedFloatingADD((ulonglong)DAT_008330d0,uVar4);

  uVar6 = PackedFloatingMUL((ulonglong)DAT_008330dc,uVar4);

  uVar5 = PackedFloatingMUL(uVar5,uVar4);

  uVar6 = PackedFloatingADD(uVar6,(ulonglong)DAT_008330d8);

  uVar5 = PackedFloatingADD(uVar5,(ulonglong)DAT_008330cc);

  uVar6 = PackedFloatingMUL(uVar6,uVar4);

  uVar5 = PackedFloatingMUL(uVar5,uVar4);

  uVar6 = PackedFloatingADD(uVar6,(ulonglong)DAT_008330d4);

  uVar5 = PackedFloatingADD(uVar5,(ulonglong)DAT_008330c8);

  uVar4 = PackedFloatingMUL(uVar4,uVar6);

  uVar4 = PackedFloatingMUL(uVar4,uVar2);

  uVar6 = FloatingReciprocalAprox((ulonglong)DAT_008330d4,uVar5);

  uVar8 = (int)uVar9 << 1;

  uVar5 = PackedFloatingReciprocalIter1(uVar5,uVar6);

  uVar5 = PackedFloatingReciprocalIter2(uVar5,uVar6);

  uVar4 = PackedFloatingMUL(uVar4,uVar5);

  uVar1 = PackedFloatingADD(uVar4,uVar2);

  uVar2 = PackedFloatingSUB(~(ulonglong)(uint)((int)uVar7 >> 0x1f) &

                            (ulonglong)(uVar8 ^ DAT_008330f8),(ulonglong)DAT_008330f8);

  uVar1 = PackedFloatingADD(uVar1 | uVar8 ^ uVar7,uVar2);

  return uVar1 | DAT_00833098 & uVar9;

}





// --- FUN_006151c0 at 0x006151C0 (size: 247) ---


ulonglong FUN_006151c0(void)



{

  uint uVar1;

  ulonglong in_MM0;

  ulonglong uVar2;

  undefined8 uVar3;

  uint uVar4;

  uint uVar6;

  undefined8 uVar7;

  undefined8 uVar8;

  ulonglong uVar9;

  ulonglong uVar5;

  

  uVar2 = in_MM0 & DAT_0083309c;

  uVar6 = -(uint)(DAT_008330a8 < (int)uVar2);

  uVar3 = PackedFloatingMUL(uVar2,(ulonglong)DAT_008330ac);

  uVar3 = PackedFloatingSUBR(uVar3,(ulonglong)DAT_008330ac);

  uVar7 = PackedFloatingReciprocalSQRAprox((ulonglong)DAT_0083309c,uVar3);

  uVar8 = PackedFloatingMUL(uVar7,uVar7);

  uVar1 = (uint)((int)uVar2 < DAT_008330e0);

  uVar4 = -uVar1;

  uVar5 = (ulonglong)uVar4;

  uVar8 = PackedFloatingReciprocalSQRIter1(uVar8,uVar3);

  uVar7 = PackedFloatingReciprocalIter2(uVar8,uVar7);

  uVar9 = PackedFloatingMUL(uVar7,uVar3);

  uVar2 = ~uVar5 & uVar9 | uVar2 & uVar4;

  uVar3 = PackedFloatingMUL(uVar2,uVar2);

  uVar8 = PackedFloatingMUL((ulonglong)DAT_008330e8,uVar3);

  uVar7 = PackedFloatingADD((ulonglong)DAT_008330f0,uVar3);

  uVar8 = PackedFloatingADD(uVar8,(ulonglong)DAT_008330e4);

  uVar8 = PackedFloatingMUL(uVar8,uVar3);

  uVar3 = PackedFloatingMUL(uVar3,uVar7);

  uVar3 = PackedFloatingADD(uVar3,(ulonglong)DAT_008330ec);

  uVar8 = PackedFloatingMUL(uVar8,uVar2);

  uVar7 = FloatingReciprocalAprox(uVar7,uVar3);

  uVar3 = PackedFloatingReciprocalIter1(uVar3,uVar7);

  uVar3 = PackedFloatingReciprocalIter2(uVar3,uVar7);

  uVar3 = PackedFloatingMUL(uVar3,uVar8);

  uVar2 = PackedFloatingADD(uVar2,uVar3);

  uVar3 = PackedFloatingADD(~uVar5 & (ulonglong)DAT_008330f8 ^ DAT_00833098 & in_MM0,

                            (ulonglong)DAT_008330f4);

  uVar2 = PackedFloatingADD(uVar2,~uVar5 & uVar2);

  uVar2 = PackedFloatingADD(uVar3,uVar2 | (ulonglong)(uVar1 * -0x80000000) ^ DAT_00833098 & in_MM0);

  return (ulonglong)(DAT_008330b4 & uVar6) | ~(ulonglong)uVar6 & uVar2;

}





// --- FUN_006157a0 at 0x006157A0 (size: 252) ---


uint FUN_006157a0(void)



{

  ulonglong in_MM0;

  undefined8 uVar1;

  ulonglong uVar2;

  undefined4 uVar3;

  undefined8 uVar4;

  undefined8 uVar5;

  undefined8 uVar6;

  undefined8 uVar7;

  

  uVar1 = PackedFloatingMUL(in_MM0 & DAT_0083309c,(ulonglong)DAT_00833150);

  uVar2 = PackedFloatingToIntDwordConv(uVar1,uVar1);

  uVar1 = PackedIntToFloatingDwordConv(uVar2,uVar2);

  uVar1 = PackedFloatingMUL(CONCAT44((int)uVar1,(int)uVar1),DAT_00833060);

  uVar4 = PackedFloatingADD(in_MM0 & DAT_0083309c,uVar1);

  uVar3 = (undefined4)((ulonglong)uVar1 >> 0x20);

  uVar1 = PackedFloatingADD(uVar4,CONCAT44(uVar3,uVar3));

  uVar1 = CONCAT44((int)uVar1,(int)uVar1);

  if ((uVar2 & 1) != 0) {

    uVar1 = PackedFloatingSUBR(uVar1,DAT_00833070);

  }

  uVar4 = PackedFloatingMUL(uVar1,uVar1);

  uVar6 = PackedFloatingMUL(DAT_00833068,uVar4);

  uVar5 = PackedFloatingMUL(DAT_00833078,uVar4);

  uVar7 = PackedFloatingADD(uVar6,DAT_00833018);

  uVar6 = PackedFloatingMUL(DAT_00833080,uVar4);

  uVar5 = PackedFloatingMUL(uVar7,uVar5);

  uVar7 = PackedFloatingADD(uVar5,DAT_00833018);

  uVar5 = PackedFloatingMUL(DAT_00833088,uVar4);

  uVar4 = PackedFloatingMUL(uVar6,uVar7);

  uVar4 = PackedFloatingADD(uVar4,DAT_00833018);

  uVar4 = PackedFloatingMUL(uVar4,CONCAT44((int)DAT_00833018,(int)uVar5));

  uVar4 = PackedFloatingADD(uVar4,DAT_00833018 >> 0x20);

  PackedFloatingMUL(uVar4,CONCAT44((int)uVar1,(int)DAT_00833018));

  return (uint)in_MM0 ^ (uint)in_MM0 & 0x80000000;

}





// --- FUN_006158a0 at 0x006158A0 (size: 254) ---


uint FUN_006158a0(void)



{

  ulonglong in_MM0;

  undefined8 uVar1;

  ulonglong uVar2;

  undefined4 uVar3;

  undefined8 uVar4;

  undefined8 uVar5;

  undefined8 uVar6;

  undefined8 uVar7;

  

  uVar1 = PackedFloatingMUL(in_MM0 & DAT_0083309c,(ulonglong)DAT_00833150);

  uVar2 = PackedFloatingToIntDwordConv(uVar1,uVar1);

  uVar1 = PackedIntToFloatingDwordConv(uVar2,uVar2);

  uVar1 = PackedFloatingMUL(CONCAT44((int)uVar1,(int)uVar1),DAT_00833060);

  uVar4 = PackedFloatingADD(in_MM0 & DAT_0083309c,uVar1);

  uVar3 = (undefined4)((ulonglong)uVar1 >> 0x20);

  uVar1 = PackedFloatingADD(uVar4,CONCAT44(uVar3,uVar3));

  uVar1 = CONCAT44((int)uVar1,(int)uVar1);

  if ((uVar2 & 1) != 0) {

    uVar1 = PackedFloatingSUBR(uVar1,DAT_00833070);

  }

  uVar4 = PackedFloatingMUL(uVar1,uVar1);

  uVar6 = PackedFloatingMUL(DAT_00833068,uVar4);

  uVar5 = PackedFloatingMUL(DAT_00833078,uVar4);

  uVar7 = PackedFloatingADD(uVar6,DAT_00833018);

  uVar6 = PackedFloatingMUL(DAT_00833080,uVar4);

  uVar5 = PackedFloatingMUL(uVar7,uVar5);

  uVar7 = PackedFloatingADD(uVar5,DAT_00833018);

  uVar5 = PackedFloatingMUL(DAT_00833088,uVar4);

  uVar4 = PackedFloatingMUL(uVar6,uVar7);

  uVar4 = PackedFloatingADD(uVar4,DAT_00833018);

  uVar4 = PackedFloatingMUL(uVar4,CONCAT44((int)DAT_00833018,(int)uVar5));

  uVar4 = PackedFloatingADD(uVar4,DAT_00833018 >> 0x20);

  PackedFloatingMUL(uVar4,CONCAT44((int)uVar1,(int)DAT_00833018));

  return (uint)in_MM0 ^ (uint)in_MM0 & 0x80000000;

}





// --- FUN_00615c60 at 0x00615C60 (size: 1907) ---


int FUN_00615c60(undefined4 *param_1)



{

  int iVar1;

  undefined4 uVar2;

  int local_44;

  int local_40;

  undefined4 *local_3c;

  undefined4 *local_38;

  undefined4 *local_34;

  undefined4 *local_30;

  undefined4 *local_2c;

  void *local_14;

  undefined *puStack_10;

  undefined *puStack_c;

  undefined4 local_8;

  

  puStack_c = &DAT_0090700c;

  puStack_10 = &DAT_005df82c;

  local_14 = ExceptionList;

  local_44 = 0;

  local_40 = 0;

  local_8 = 0;

  local_3c = param_1 + 0x16;

  ExceptionList = &local_14;

  local_40 = FUN_005df0f5(0x114,&local_44);

  if (local_40 == 0) {

    local_44 = -5;

  }

  else {

    *(undefined4 *)(local_40 + 4) = 0;

    *(undefined4 *)(local_40 + 8) = 0;

    *(undefined4 *)(local_40 + 0xc) = 0;

    *(undefined4 *)(local_40 + 0x10) = 0;

    *(undefined4 *)(local_40 + 0x14) = 0;

    local_3c[0xdfc] = local_40;

    FUN_00619170(local_40,&local_44);

    *param_1 = 0;

    param_1[1] = 0;

    param_1[2] = 0;

    param_1[3] = 0;

    param_1[4] = 0;

    param_1[5] = 3;

    param_1[6] = 2;

    param_1[7] = 0;

    param_1[9] = 0;

    param_1[8] = 0;

    param_1[10] = 0;

    param_1[0xb] = 0;

    param_1[0xc] = 0;

    param_1[0xd] = 3;

    param_1[0xe] = 3;

    param_1[0xf] = 1;

    param_1[0x10] = 0;

    param_1[0x11] = 0;

    param_1[0x12] = 1;

    param_1[0x13] = 1;

    param_1[0x14] = 0x4b;

    local_3c[0x1d] = 0;

    local_3c[6] = 0;

    local_3c[7] = 0;

    *local_3c = 0xffffffff;

    local_3c[1] = 0;

    local_3c[2] = 0;

    local_3c[3] = 0;

    local_3c[4] = 0;

    local_3c[5] = 1;

    local_3c[8] = param_1[1];

    local_3c[9] = param_1[2];

    local_3c[10] = param_1[3];

    local_3c[0xb] = param_1[4];

    local_3c[0xc] = param_1[5];

    local_3c[0xd] = param_1[6];

    local_3c[0xe] = param_1[7];

    local_3c[0xf] = 0;

    local_3c[0x11] = param_1[9];

    local_3c[0x10] = param_1[8];

    local_3c[0x12] = param_1[10];

    local_3c[0x13] = param_1[0xb];

    local_3c[0x14] = param_1[0xc];

    local_3c[0x15] = param_1[0xd];

    local_3c[0x16] = param_1[0xe];

    local_3c[0x17] = param_1[0xf];

    local_3c[0x18] = param_1[0x10];

    local_3c[0x19] = param_1[0x11];

    local_3c[0x1a] = param_1[0x12];

    local_3c[0x1b] = param_1[0x13];

    local_3c[0x1c] = param_1[0x14];

    local_3c[0x1e] = 0;

    local_3c[0x1f] = 0;

    local_3c[0xdc5] = 0;

    local_3c[0xdc6] = 0;

    local_3c[0xdb9] = 0;

    local_3c[0xdba] = 0;

    local_3c[0xdbb] = 0;

    local_3c[0xdbc] = 0;

    local_3c[0xdbd] = 0;

    local_3c[0xdbe] = 0;

    local_3c[0xdbf] = 0;

    local_3c[0xdc0] = 0;

    local_3c[0xdc1] = 0;

    local_3c[0xdc2] = 0;

    local_3c[0xdc3] = 0;

    local_3c[0xdc4] = 0;

    (*DAT_008f85a4)(local_3c + 0x25,0xb4);

    (*DAT_008f85a4)(local_3c + 0x52,0xb4);

    (*DAT_008f85a4)(local_3c + 0x7f,0xb4);

    (*DAT_008f85a4)(local_3c + 0xac,0xb4);

    local_38 = local_3c + 0x28;

    local_34 = local_3c + 0x55;

    local_30 = local_3c + 0x82;

    local_2c = local_3c + 0xaf;

    local_3c[0x27] = (int)local_3c + 0xa7U & 0xfffffff8;

    local_3c[0x54] = (int)local_3c + 0x15bU & 0xfffffff8;

    local_3c[0x81] = (int)local_3c + 0x20fU & 0xfffffff8;

    local_3c[0xae] = (int)local_3c + 0x2c3U & 0xfffffff8;

    (*DAT_008f85a4)(local_3c + 0x749,0x670);

    (*DAT_008f85a4)(local_3c + 0x8e5,0x670);

    (*DAT_008f85a4)(local_3c + 0xa81,0x670);

    (*DAT_008f85a4)(local_3c + 0xc1d,0x670);

    (*DAT_008f85a4)(local_3c + 0xd9,0x670);

    (*DAT_008f85a4)(local_3c + 0x275,0x670);

    (*DAT_008f85a4)(local_3c + 0x411,0x670);

    (*DAT_008f85a4)(local_3c + 0x5ad,0x670);

    local_3c[0xdf7] = 1;

    local_3c[0xde9] = 0;

    local_3c[0xdea] = 0;

    local_3c[0xdeb] = 0;

    local_3c[0xdec] = 0;

    local_3c[0xded] = 0;

    local_3c[0xdee] = 0;

    local_3c[0xdef] = 0;

    local_3c[0xdf0] = 4;

    local_3c[0xdf1] = 0;

    local_3c[0xdf2] = 0;

    iVar1 = FUN_005df0f5(0x40,&local_44);

    local_3c[0xdf3] = iVar1;

    if (iVar1 == 0) {

      local_44 = -5;

    }

    else {

      (*DAT_008f85a4)(iVar1,local_3c[0xdf0] << 4);

      local_3c[0xdf4] = 0;

      local_3c[0xdf5] = 0;

      local_3c[0xdf6] = 0;

      local_3c[0x120a] = 0;

      local_3c[0x120b] = 0;

      local_3c[0xdf8] = 0;

      local_3c[0x120c] = 0;

      local_3c[0xdc7] = 0;

      *(undefined1 *)(local_3c + 0xdc8) = 0;

      local_3c[0xdc9] = 0;

      *(undefined1 *)(local_3c + 0xdca) = 0;

      local_3c[0xdcb] = 0;

      *(undefined1 *)(local_3c + 0xdcc) = 0;

      local_3c[0xdcd] = 0;

      *(undefined1 *)(local_3c + 0xdce) = 0;

      local_3c[0xdcf] = 0;

      local_3c[0xdd0] = 0;

      *(undefined1 *)(local_3c + 0xdd1) = 0;

      *(undefined1 *)((int)local_3c + 0x3745) = 0;

      local_3c[0xdd2] = 0;

      local_3c[0xdd3] = 0;

      *(undefined1 *)(local_3c + 0xdd4) = 0;

      *(undefined1 *)((int)local_3c + 0x3751) = 0;

      local_3c[0xdd5] = 0;

      local_3c[0xdd6] = 0;

      *(undefined1 *)(local_3c + 0xdd7) = 0;

      *(undefined1 *)((int)local_3c + 0x375d) = 0;

      local_3c[0xdd8] = 0;

      local_3c[0xdd9] = 0;

      *(undefined1 *)(local_3c + 0xdda) = 0;

      *(undefined1 *)((int)local_3c + 0x3769) = 0;

      local_3c[0xddb] = 0;

      local_3c[0xddc] = 0;

      *(undefined1 *)(local_3c + 0xddd) = 0;

      *(undefined1 *)((int)local_3c + 0x3775) = 0;

      local_3c[0xdde] = 0;

      local_3c[0xddf] = 0;

      *(undefined1 *)(local_3c + 0xde0) = 0;

      *(undefined1 *)((int)local_3c + 0x3781) = 0;

      local_3c[0xde1] = 0;

      local_3c[0xde2] = 0;

      *(undefined1 *)(local_3c + 0xde3) = 0;

      *(undefined1 *)((int)local_3c + 0x378d) = 0;

      local_3c[0xde4] = 0;

      local_3c[0xde5] = 0;

      *(undefined1 *)(local_3c + 0xde6) = 0;

      *(undefined1 *)((int)local_3c + 0x3799) = 0;

      local_3c[0x22] = 0;

      local_3c[0x23] = 0;

      local_3c[0x24] = 0;

      local_3c[0x21] = 0;

      local_3c[0x20] = 0;

      *(undefined1 *)(local_3c + 0xde7) = 0;

      *(undefined1 *)(local_3c + 0xde8) = 0;

      *(undefined1 *)((int)local_3c + 0x379d) = 1;

      *(undefined1 *)((int)local_3c + 0x37a1) = 1;

      *(undefined1 *)((int)local_3c + 0x379e) = 1;

      *(undefined1 *)((int)local_3c + 0x37a2) = 1;

      *(undefined1 *)((int)local_3c + 0x379f) = 1;

      *(undefined1 *)((int)local_3c + 0x37a3) = 1;

      *(undefined4 *)(local_3c[0xdf3] + 0xc) = 0;

      *(undefined4 *)(local_3c[0xdf3] + 0x1c) = 1;

      *(undefined4 *)(local_3c[0xdf3] + 0x2c) = 1;

      *(undefined4 *)(local_3c[0xdf3] + 0x3c) = 1;

      local_3c[0xe09] = 0;

      local_3c[0xdfe] = 0;

      local_3c[0xdff] = 0;

      local_3c[0xe00] = 0;

      local_3c[0xe01] = 0;

      local_3c[0xe05] = 0;

      local_3c[0xe03] = 0;

      local_3c[0xe04] = 0;

      uVar2 = FUN_006193f0(local_40,&local_44);

      local_3c[0xe07] = uVar2;

      local_3c[0xdfd] = 0;

      local_3c[0xe02] = 0;

      local_3c[0xdfa] = 0;

      local_3c[0xdfb] = 0;

      *(undefined1 *)(local_3c + 0xe06) = 0;

      local_3c[0xe08] = 0;

      local_3c[0x120d] = 0;

      local_3c[0x1376] = uVar2;

      local_3c[0x1377] = 0;

      local_3c[0x1378] = 0;

      local_3c[0x1379] = 0;

      local_3c[0x137a] = 0;

      local_3c[0x137b] = 0;

      *(undefined2 *)(local_3c + 0x137c) = 100;

      *(undefined2 *)((int)local_3c + 0x4df2) = 0;

      *(undefined2 *)(local_3c + 0x137d) = 0;

      local_3c[0x137e] = 0;

      *(undefined2 *)(local_3c + 0x137f) = 0x101;

      *(undefined1 *)((int)local_3c + 0x4dfe) = 0;

      *(undefined2 *)(local_3c + 0x1380) = 1;

      *(undefined2 *)((int)local_3c + 0x4e02) = 1;

      local_3c[0x1381] = 0;

      *(undefined2 *)(local_3c + 0x1382) = 0;

      local_8 = 0xffffffff;

    }

  }

  if (local_44 < 0) {

    if (param_1[0xe09] != 0) {

      operator_delete((void *)param_1[0xe09]);

      param_1[0xe09] = 0;

      param_1[0xe06] = 0;

    }

    if (param_1[0x138f] != 0) {

      operator_delete((void *)param_1[0x138f]);

      param_1[0x138f] = 0;

    }

    if (param_1[0x1222] != 0) {

      operator_delete((void *)param_1[0x1222]);

      param_1[0x1222] = 0;

    }

    if (param_1[0xe0e] != 0) {

      if (*(int *)(param_1[0xe0e] + 0x34) != 0) {

        operator_delete(*(void **)(param_1[0xe0e] + 0x34));

        *(undefined4 *)(param_1[0xe0e] + 0x34) = 0;

      }

      operator_delete((void *)param_1[0xe0e]);

      param_1[0xe0e] = 0;

    }

  }

  ExceptionList = local_14;

  return local_44;

}





// --- FUN_006163f0 at 0x006163F0 (size: 662) ---


undefined4 FUN_006163f0(int param_1)



{

  int iVar1;

  int *piVar2;

  void *pvVar3;

  undefined4 local_3c;

  int local_38;

  undefined4 local_34;

  void *local_30;

  void *local_14;

  undefined *puStack_10;

  undefined *puStack_c;

  undefined4 local_8;

  

  puStack_c = &DAT_00907024;

  puStack_10 = &DAT_005df82c;

  local_14 = ExceptionList;

  local_3c = 0;

  local_8 = 0;

  local_38 = param_1 + 0x58;

  ExceptionList = &local_14;

  if (*(int *)(param_1 + 0x387c) != 0) {

    ExceptionList = &local_14;

    iVar1 = FUN_00619520(*(int *)(param_1 + 0x387c),&local_3c);

    if (iVar1 == 0) {

      local_3c = 0xfffffff7;

      goto LAB_006165b8;

    }

    *(undefined4 *)(local_38 + 0x3824) = 0;

  }

  *(undefined4 *)(local_38 + 0x36e4) = 0;

  *(undefined4 *)(local_38 + 0x36e8) = 0;

  *(undefined4 *)(local_38 + 0x36ec) = 0;

  *(undefined4 *)(local_38 + 0x36f0) = 0;

  local_34 = 4;

  if (*(int *)(local_38 + 0x37c0) < 0x100) {

    if (*(void **)(local_38 + 0x37cc) != (void *)0x0) {

      operator_delete(*(void **)(local_38 + 0x37cc));

      *(undefined4 *)(local_38 + 0x37cc) = 0;

      *(undefined4 *)(local_38 + 0x37c0) = 0;

    }

    if (*(void **)(local_38 + 0x4de4) != (void *)0x0) {

      operator_delete(*(void **)(local_38 + 0x4de4));

      *(undefined4 *)(local_38 + 0x4de4) = 0;

    }

    if ((*(int *)(local_38 + 0x4de8) == 1) &&

       (piVar2 = *(int **)(local_38 + 0x4dec), piVar2 != (int *)0x0)) {

      pvVar3 = (void *)*piVar2;

      if (piVar2[1] < (int)pvVar3) {

        *piVar2 = piVar2[1];

        piVar2 = *(int **)(local_38 + 0x4dec);

        pvVar3 = (void *)*piVar2;

      }

      if (piVar2[2] < (int)pvVar3) {

        *piVar2 = piVar2[2];

        piVar2 = *(int **)(local_38 + 0x4dec);

        pvVar3 = (void *)*piVar2;

      }

      if (piVar2[3] < (int)pvVar3) {

        *piVar2 = piVar2[3];

        pvVar3 = (void *)**(undefined4 **)(local_38 + 0x4dec);

      }

      operator_delete(pvVar3);

      operator_delete(*(void **)(local_38 + 0x4dec));

      *(undefined4 *)(local_38 + 0x4dec) = 0;

    }

    if (*(void **)(local_38 + 0x4830) != (void *)0x0) {

      operator_delete(*(void **)(local_38 + 0x4830));

      *(undefined4 *)(local_38 + 0x4830) = 0;

    }

    pvVar3 = *(void **)(local_38 + 0x37e0);

    if (pvVar3 != (void *)0x0) {

      if (*(void **)((int)pvVar3 + 0x34) != (void *)0x0) {

        operator_delete(*(void **)((int)pvVar3 + 0x34));

        *(undefined4 *)(*(int *)(local_38 + 0x37e0) + 0x34) = 0;

        pvVar3 = *(void **)(local_38 + 0x37e0);

      }

      operator_delete(pvVar3);

      *(undefined4 *)(local_38 + 0x37e0) = 0;

    }

    (*DAT_008f85a4)(local_38 + 0x371c,0x20);

    (*DAT_008f85a4)(local_38 + 0x373c,0x60);

    *(undefined4 *)(local_38 + 0x80) = 0;

    *(undefined4 *)(local_38 + 0x84) = 0;

    *(undefined4 *)(local_38 + 0x90) = 0;

    *(undefined4 *)(local_38 + 0x88) = 0;

    *(undefined4 *)(local_38 + 0x8c) = 0;

    *(undefined4 *)(local_38 + 0x3714) = 0;

    *(undefined4 *)(local_38 + 0x3718) = 0;

    local_8 = 0xffffffff;

  }

  else {

    local_3c = 0xfffffff8;

  }

LAB_006165b8:

  FUN_00619240(*(undefined4 *)(param_1 + 0x3848),&local_3c);

  local_30 = *(void **)(param_1 + 0x3848);

  if (local_30 != (void *)0x0) {

    operator_delete(local_30);

    *(undefined4 *)(param_1 + 0x3848) = 0;

  }

  ExceptionList = local_14;

  return local_3c;

}





// --- FUN_006166a0 at 0x006166A0 (size: 1846) ---


undefined4 FUN_006166a0(int *param_1)



{

  int iVar1;

  int iVar2;

  int iVar3;

  bool bVar4;

  bool bVar5;

  bool bVar6;

  bool bVar7;

  bool bVar8;

  

  bVar7 = false;

  bVar4 = false;

  bVar5 = false;

  bVar6 = false;

  bVar8 = false;

  if (*param_1 != 0) {

    return 0;

  }

  iVar1 = param_1[0x16];

  if (iVar1 == -1) {

    return 0xfffffff8;

  }

  if (((((((iVar1 == 0) || (iVar1 == 1)) || (iVar1 == 2)) || ((iVar1 == 3 || (iVar1 == 4)))) ||

       ((iVar1 == 5 || ((iVar1 == 6 || (iVar1 == 7)))))) || (iVar1 == 0xe)) ||

     ((((iVar1 == 0xf || (iVar1 == 0x10)) || (iVar1 == 0x11)) ||

      (((iVar1 == 0x12 || (iVar1 == 0x13)) || ((iVar1 == 0x14 || (iVar1 == 0x15)))))))) {

    bVar7 = true;

  }

  else {

    if (((iVar1 != 8) && (iVar1 != 9)) &&

       ((iVar1 != 10 && (((iVar1 != 0xb && (iVar1 != 0xc)) && (iVar1 != 0xd)))))) {

      return 0xfffffff8;

    }

    bVar5 = true;

  }

  if ((((iVar1 == 0) || (iVar1 == 2)) || ((iVar1 == 4 || ((iVar1 == 6 || (iVar1 == 0xe)))))) ||

     ((iVar1 == 0x10 ||

      ((((iVar1 == 0x12 || (iVar1 == 0x14)) || (iVar1 == 8)) || ((iVar1 == 10 || (iVar1 == 0xc))))))

     )) {

    bVar4 = true;

  }

  if ((((iVar1 == 2) || (iVar1 == 3)) ||

      ((((iVar1 == 6 || (((iVar1 == 7 || (iVar1 == 8)) || (iVar1 == 9)))) ||

        (((iVar1 == 0xc || (iVar1 == 0xd)) || (iVar1 == 0x12)))) ||

       (((iVar1 == 0x13 || (iVar1 == 0x10)) ||

        ((iVar1 == 0x11 || (((iVar1 == 0xf || (iVar1 == 0x14)) || (iVar1 == 0x15)))))))))) &&

     (bVar6 = true, param_1[0x138d] == 0)) {

    if (param_1[1] == 0) {

      return 0xfffffff8;

    }

    if (0xffff < param_1[2]) {

      return 0xfffffff8;

    }

    if (param_1[2] < 1) {

      return 0xfffffff8;

    }

    if (0xffff < param_1[3]) {

      return 0xfffffff8;

    }

    if (param_1[3] < -0xffff) {

      return 0xfffffff8;

    }

    if (((iVar1 == 0x14) || (iVar1 == 0x15)) && ((param_1[6] != 1 && (param_1[6] != 2)))) {

      return 0xffffffe5;

    }

    if (param_1[4] < 0) {

      return 0xfffffff8;

    }

    if (param_1[5] < 1) {

      return 0xfffffff8;

    }

    if (0xff < param_1[5]) {

      return 0xfffffff8;

    }

    if ((param_1[7] != 0) && ((param_1[7] != 2 || (param_1[6] != 3)))) {

      return 0xfffffffd;

    }

  }

  if (bVar4) {

    iVar1 = param_1[8];

  }

  else {

    if (param_1[9] == 0) {

      return 0xfffffff8;

    }

    iVar1 = param_1[10];

  }

  if (iVar1 == 0) {

    return 0xfffffff8;

  }

  iVar1 = param_1[0xd];

  if (iVar1 < 1) {

    return 0xfffffff8;

  }

  if (0x100 < iVar1) {

    return 0xfffffff8;

  }

  if (bVar5) {

    if (bVar6) {

      if (param_1[0xb] < 1) {

        return 0xfffffff8;

      }

      if (0xffff < param_1[0xb]) {

        return 0xfffffff8;

      }

      if (param_1[0xc] < 1) {

        return 0xfffffff8;

      }

      if (0xffff < param_1[0xc]) {

        return 0xfffffff8;

      }

      if (((param_1[6] != 4) && (param_1[0xe] != 3)) && (param_1[5] < iVar1)) {

        return 0xfffffff8;

      }

    }

    if ((iVar1 == 1) && (param_1[0xf] != 0)) {

      return 0xfffffffd;

    }

    if (((iVar1 == 3) && (iVar2 = param_1[0xf], iVar2 != 1)) && ((iVar2 != 2 && (iVar2 != 0)))) {

      return 0xfffffffd;

    }

    if ((((iVar1 == 4) && (iVar2 = param_1[0xf], iVar2 != 3)) && (iVar2 != 4)) && (iVar2 != 0)) {

      return 0xfffffffd;

    }

    if (((iVar1 != 1) && (iVar1 != 3)) && ((iVar1 != 4 && (param_1[0xf] != 0)))) {

      return 0xfffffffd;

    }

  }

  if (bVar7) {

    iVar2 = param_1[0xe];

    if (((iVar2 == 4) && (iVar1 == 1)) &&

       ((((iVar3 = param_1[6], iVar3 == 4 && (param_1[5] == 1)) ||

         (((iVar3 == 1 && (param_1[5] == 3)) || ((iVar3 == 2 && (param_1[5] == 3)))))) ||

        ((iVar3 == 5 && (param_1[5] == 4)))))) {

      bVar8 = true;

    }

    if (((iVar2 == 1) && (iVar1 == 3)) &&

       (((iVar3 = param_1[6], iVar3 == 1 && (param_1[5] == 3)) ||

        (((iVar3 == 2 && (param_1[5] == 3)) || ((iVar3 == 5 && (param_1[5] == 4)))))))) {

      bVar8 = true;

    }

    if ((((iVar2 == 5) && (iVar1 == 4)) && (param_1[6] == 5)) && (param_1[5] == 4)) {

      bVar8 = true;

    }

    if ((iVar2 == 3) && (iVar1 == 3)) {

      iVar3 = param_1[6];

      if (((((iVar3 == 4) && (param_1[5] == 1)) || ((iVar3 == 1 && (param_1[5] == 3)))) ||

          ((iVar3 == 2 && (param_1[5] == 3)))) || ((iVar3 == 5 && (param_1[5] == 4)))) {

        bVar8 = true;

      }

      if (iVar3 == 3) {

        bVar8 = true;

      }

    }

    if ((((iVar2 == 6) && (iVar1 == 4)) && (param_1[6] == 5)) && (param_1[5] == 4)) {

      bVar8 = true;

    }

    if (iVar2 == 0xff) {

      iVar1 = param_1[6];

joined_r0x00616bae:

      if (iVar1 == 0xff) goto LAB_0061697c;

    }

  }

  else {

    iVar2 = param_1[6];

    if (((iVar2 == 4) && (param_1[5] == 1)) &&

       (((param_1[0xe] == 4 && (iVar1 == 1)) || ((param_1[0xe] == 3 && (iVar1 == 3)))))) {

      bVar8 = true;

    }

    if (((iVar2 == 1) && (param_1[5] == 3)) &&

       (((iVar3 = param_1[0xe], iVar3 == 4 && (iVar1 == 1)) ||

        (((iVar3 == 1 && (iVar1 == 3)) || ((iVar3 == 3 && (iVar1 == 3)))))))) {

      bVar8 = true;

    }

    if ((((iVar2 == 1) && (param_1[5] == 4)) && (param_1[0xe] == 3)) && (iVar1 == 3)) {

      bVar8 = true;

    }

    if (((iVar2 == 2) && (param_1[5] == 3)) &&

       (((iVar3 = param_1[0xe], iVar3 == 4 && (iVar1 == 1)) ||

        (((iVar3 == 1 && (iVar1 == 3)) || ((iVar3 == 3 && (iVar1 == 3)))))))) {

      bVar8 = true;

    }

    if (((iVar2 == 5) && (param_1[5] == 4)) &&

       (((param_1[0xe] == 5 && (iVar1 == 4)) || ((param_1[0xe] == 6 && (iVar1 == 4)))))) {

      bVar8 = true;

    }

    if ((((iVar2 == 3) && (param_1[5] == 3)) && (param_1[0xe] == 3)) && (iVar1 == 3)) {

      bVar8 = true;

    }

    if ((iVar2 == 0xff) && (iVar1 <= param_1[5])) {

      iVar1 = param_1[0xe];

      goto joined_r0x00616bae;

    }

  }

  if (!bVar8) {

    return 0xfffffff8;

  }

LAB_0061697c:

  if ((param_1[0x1b] != 0) && (param_1[0x1b] != 1)) {

    return 0xfffffff8;

  }

  if ((param_1[0x1390] == 1) && (param_1[0x138d] != 0)) {

    return 0xfffffff8;

  }

  return 0;

}





// --- FUN_00616de0 at 0x00616DE0 (size: 2794) ---


int FUN_00616de0(int *param_1,int param_2)



{

  int iVar1;

  int iVar2;

  int iVar3;

  int iVar4;

  int local_7c;

  int *local_78;

  int *local_74;

  int local_70;

  int local_6c;

  uint local_68;

  uint local_64;

  int local_60;

  int local_5c;

  int local_58;

  int local_54;

  int *local_38;

  int local_34;

  int local_24;

  void *local_14;

  undefined *puStack_10;

  undefined *puStack_c;

  undefined4 local_8;

  

  puStack_c = &DAT_0090703c;

  puStack_10 = &DAT_005df82c;

  local_14 = ExceptionList;

  local_7c = 0;

  local_8 = 0;

  local_74 = param_1 + 0x16;

  ExceptionList = &local_14;

  param_1[0x16] = param_2;

  local_78 = (int *)param_1[0xe12];

  local_7c = FUN_006166a0(param_1,&local_7c);

  if (local_7c == 0) {

    local_38 = local_74;

    iVar2 = *local_74;

    if (((((iVar2 == 4) || (iVar2 == 5)) || (iVar2 == 0)) || ((iVar2 == 1 || (iVar2 == 0x14)))) ||

       (iVar2 == 0x15)) {

      local_74[0xdf7] = 1;

    }

    if ((((((iVar2 == 6) || (iVar2 == 7)) ||

          ((iVar2 == 2 || (((iVar2 == 3 || (iVar2 == 0x12)) || (iVar2 == 0x13)))))) ||

         ((iVar2 == 0x10 || (iVar2 == 0x11)))) || (iVar2 == 0xe)) || (iVar2 == 0xf)) {

      if (local_74[0xdc5] != 0) {

        local_24 = 0;

        local_70 = 0;

        if (0 < local_74[0x21]) {

          do {

            local_74[local_24 * 0x2d + 0x26] = (uint)*(byte *)(local_74 + local_24 * 2 + 0xdc8);

            local_74[local_24 * 0x2d + 0x25] = 0;

            local_34 = 0;

            do {

              *(ushort *)(local_74[local_24 * 0x2d + 0x27] + local_34 * 2) =

                   (ushort)*(byte *)(local_34 + local_74[local_24 * 2 + 0xdc7]);

              *(ushort *)(local_74[local_24 * 0x2d + 0x27] + 2 + local_34 * 2) =

                   (ushort)*(byte *)(local_34 + 1 + local_74[local_24 * 2 + 0xdc7]);

              *(ushort *)(local_74[local_24 * 0x2d + 0x27] + 4 + local_34 * 2) =

                   (ushort)*(byte *)(local_34 + 2 + local_74[local_24 * 2 + 0xdc7]);

              *(ushort *)(local_74[local_24 * 0x2d + 0x27] + 6 + local_34 * 2) =

                   (ushort)*(byte *)(local_34 + 3 + local_74[local_24 * 2 + 0xdc7]);

              local_6c = local_34 + 4;

              local_34 = local_6c;

            } while (local_6c < 0x40);

            local_70 = local_24 + 1;

            local_24 = local_70;

          } while (local_70 < local_74[0x21]);

        }

      }

      if (local_74[0xdc6] != 0) {

        local_70 = 0;

        iVar2 = 0;

        if (0 < local_74[0x24]) {

          do {

            local_7c = iVar2;

            local_68 = (uint)*(byte *)(local_74 + local_70 * 3 + 0xdd1);

            local_64 = (uint)*(byte *)(local_70 * 0xc + 0x3745 + (int)local_74);

            local_60 = local_74[local_70 * 3 + 0xdcf];

            local_5c = local_74[local_70 * 3 + 0xdd0];

            if (local_68 == 0) {

              local_7c = FUN_0061a690(local_60,local_5c,0,local_64,

                                      local_74 + local_64 * 0x19c + 0x749,&local_7c);

              if (local_7c != 0) {

                local_7c = -6;

                goto LAB_0061719a;

              }

            }

            else {

              iVar2 = FUN_0061a690(local_60,local_5c,local_68,local_64,

                                   local_74 + local_64 * 0x19c + 0xd9,&local_7c);

              if (iVar2 != 0) {

                local_7c = -6;

                goto LAB_0061719a;

              }

              local_7c = 0;

            }

            local_70 = local_70 + 1;

            local_38 = local_74;

            iVar2 = local_7c;

          } while (local_70 < local_74[0x24]);

        }

      }

    }

    else {

      param_1[0x36] = 0;

      param_1[0x37] = 0;

      param_1[0x3a] = 0;

      param_1[0x38] = 0;

      param_1[0x39] = 0;

    }

    iVar2 = *local_38;

    if (((((iVar2 == 2) || (iVar2 == 4)) ||

         ((iVar2 == 6 || (((iVar2 == 0 || (iVar2 == 0x12)) || (iVar2 == 0x10)))))) ||

        ((iVar2 == 0xe || (iVar2 == 0x14)))) && (local_38[0xe09] == 0)) {

      local_74 = local_38;

      local_58 = FUN_006194e0(param_1[8],0x80000000);

      if (local_58 == 0) {

        local_7c = -10;

        goto LAB_0061719a;

      }

      local_38 = local_74;

      local_74[0xe09] = local_58;

    }

    if (*param_1 == 0) {

      iVar2 = param_1[1];

      local_38[8] = iVar2;

      local_38[9] = param_1[2];

      iVar3 = param_1[3];

      local_38[10] = iVar3;

      local_38[0xb] = param_1[4];

      local_38[0xc] = param_1[5];

      local_38[0xd] = param_1[6];

      local_38[0xe] = param_1[7];

      iVar4 = param_1[2] * param_1[5] + param_1[4];

      local_38[0xf] = iVar4;

      if (iVar3 < 0) {

        local_38[0xf] = -iVar4;

      }

      iVar3 = param_1[9];

      local_38[0x11] = iVar3;

      local_38[0x10] = param_1[8];

      iVar4 = param_1[10];

      local_38[0x12] = iVar4;

      local_38[0x16] = param_1[0xe];

      local_38[0x1a] = param_1[0x12];

      local_38[0x1b] = param_1[0x13];

      local_38[0x1c] = param_1[0x14];

      if (local_38[0xdf8] == 0) {

        local_38[0xdfa] = 0;

        local_38[0xdfb] = 0;

        local_38[0xdfd] = 0;

        *(undefined1 *)(local_38 + 0xe06) = 0;

        iVar1 = *local_38;

        if (((iVar1 != 2) && (iVar1 != 4)) &&

           ((iVar1 != 0 &&

            ((((iVar1 != 6 && (iVar1 != 0x12)) && (iVar1 != 0x10)) &&

             ((iVar1 != 0xe && (iVar1 != 0x14)))))))) {

          local_38[0xdff] = iVar3;

          local_38[0xe00] = iVar3 + iVar4;

          local_38[0xdfe] = iVar3;

          local_38[0xe03] = iVar4;

          local_38[0xe02] = iVar4;

        }

        if (((iVar1 == 2) || (iVar1 == 4)) ||

           (((iVar1 == 0 || (((iVar1 == 6 || (iVar1 == 0x12)) || (iVar1 == 0x10)))) ||

            ((iVar1 == 0xe || (iVar1 == 0x14)))))) {

          local_38[0xdff] = (int)(local_38 + 0xe0a);

          local_38[0xe00] = (int)(local_38 + 0x120a);

          local_38[0xdfe] = (int)(local_38 + 0xe0a);

          local_38[0xe03] = 0x1000;

          local_38[0xe02] = 0x1000;

        }

        if (iVar1 == 0x14) {

          local_74 = local_38;

          local_54 = FUN_00619570(local_38[0xe09],0,0,&local_7c);

          if (local_54 == 0) goto LAB_0061719a;

          local_38 = local_74;

          iVar2 = local_74[8];

        }

      }

    }

    else {

      iVar2 = local_38[8];

    }

    if (param_1[3] < 0) {

      iVar2 = iVar2 + (param_1[3] + 1) * local_38[0xf];

      local_38[8] = iVar2;

    }

    local_38[0xe05] = iVar2;

    local_38[0x120d] = (int)local_38 + 0x4857U & 0xffffffe0;

    local_74 = local_38;

    local_7c = FUN_00619650(local_38,&local_7c);

    if (local_7c == 0) {

      if (local_74[0x120a] == 0) {

        if (local_74[0x15] == 1) {

          local_74[0x16] = 4;

        }

        if (local_74[0x137e] == 0) {

          iVar2 = local_74[0xd];

          iVar3 = *local_74;

        }

        else if (local_74[0x15] == 3) {

          local_74[0x16] = 3;

          iVar2 = local_74[0xd];

          iVar3 = *local_74;

        }

        else {

          iVar2 = local_74[0xd];

          iVar3 = *local_74;

        }

      }

      else {

        iVar3 = *local_74;

        if ((iVar3 == 0) || (iVar3 == 1)) {

          iVar2 = local_74[0x15];

          local_74[0xc] = iVar2;

          if (iVar2 == 1) {

            local_74[0x16] = 4;

          }

          if (iVar2 == 3) {

            if (local_74[0x120b] == 0) {

              iVar4 = 1;

            }

            else {

              iVar4 = 3;

            }

            local_74[0x16] = iVar4;

          }

          if (iVar2 == 4) {

            if (local_74[0x120b] == 0) {

              iVar2 = 5;

            }

            else {

              iVar2 = 6;

            }

            local_74[0x16] = iVar2;

            iVar2 = 5;

            local_74[0xd] = 5;

          }

          else {

            iVar2 = local_74[0xd];

          }

        }

        else {

          iVar2 = local_74[0xd];

        }

      }

      if ((iVar2 == 3) && (local_74[0x16] == 3)) {

        local_74[0xe] = 2;

      }

      if ((((iVar3 == 4) || (iVar3 == 6)) || (iVar3 == 0)) ||

         (((iVar3 == 0x12 || (iVar3 == 0x10)) || ((iVar3 == 0xe || (iVar3 == 0x14)))))) {

        local_54 = FUN_00619570(local_74[0xe09],-(local_74[0xe03] + *local_78),1,&local_7c);

        if (local_54 == 0) {

          local_7c = -0x17;

          goto LAB_0061719a;

        }

        iVar3 = *local_74;

      }

      if ((iVar3 == 1) || (iVar3 == 0x15)) {

        local_74[0xdff] = local_74[0xdfe] - *local_78;

      }

      param_1[0xb] = local_74[0x13];

      param_1[0xc] = local_74[0x14];

      param_1[0xd] = local_74[0x15];

      param_1[0x10] = local_74[0x18];

      param_1[0x11] = local_74[0x19];

      param_1[0x12] = local_74[0x1a];

      param_1[0x13] = local_74[0x1b];

      iVar3 = 0xff;

      param_1[0xf] = 0xff;

      iVar2 = local_74[0xdf0];

      if (iVar2 == 1) {

        iVar3 = 0;

        param_1[0xf] = 0;

      }

      else if (iVar2 == 2) {

        iVar2 = local_74[0xdf3];

        if ((((*(int *)(iVar2 + 4) == 1) && (*(int *)(iVar2 + 8) == 1)) &&

            (*(int *)(iVar2 + 0x14) == 1)) && (*(int *)(iVar2 + 0x18) == 1)) {

          iVar3 = 0;

          param_1[0xf] = 0;

        }

      }

      else if (iVar2 == 3) {

        iVar2 = local_74[0xdf3];

        iVar4 = *(int *)(iVar2 + 4);

        if ((((iVar4 == 1) && (*(int *)(iVar2 + 8) == 1)) &&

            ((*(int *)(iVar2 + 0x14) == 1 &&

             ((*(int *)(iVar2 + 0x18) == 1 && (*(int *)(iVar2 + 0x24) == 1)))))) &&

           (*(int *)(iVar2 + 0x28) == 1)) {

          iVar3 = 0;

          param_1[0xf] = 0;

        }

        else if (((((iVar4 == 2) && (*(int *)(iVar2 + 8) == 2)) && (*(int *)(iVar2 + 0x14) == 1)) &&

                 ((*(int *)(iVar2 + 0x18) == 1 && (*(int *)(iVar2 + 0x24) == 1)))) &&

                (*(int *)(iVar2 + 0x28) == 1)) {

          iVar3 = 1;

          param_1[0xf] = 1;

        }

        else if (((iVar4 == 2) && (*(int *)(iVar2 + 8) == 1)) &&

                ((*(int *)(iVar2 + 0x14) == 1 &&

                 (((*(int *)(iVar2 + 0x18) == 1 && (*(int *)(iVar2 + 0x24) == 1)) &&

                  (*(int *)(iVar2 + 0x28) == 1)))))) {

          iVar3 = 2;

          param_1[0xf] = 2;

        }

      }

      else if (iVar2 == 4) {

        iVar2 = local_74[0xdf3];

        iVar4 = *(int *)(iVar2 + 4);

        if ((((iVar4 == 1) && (*(int *)(iVar2 + 8) == 1)) &&

            ((*(int *)(iVar2 + 0x14) == 1 &&

             ((*(int *)(iVar2 + 0x18) == 1 && (*(int *)(iVar2 + 0x24) == 1)))))) &&

           ((*(int *)(iVar2 + 0x28) == 1 &&

            ((*(int *)(iVar2 + 0x34) == 1 && (*(int *)(iVar2 + 0x38) == 1)))))) {

          iVar3 = 0;

          param_1[0xf] = 0;

        }

        else if (((iVar4 == 2) &&

                 (((((*(int *)(iVar2 + 8) == 2 && (*(int *)(iVar2 + 0x14) == 1)) &&

                    (*(int *)(iVar2 + 0x18) == 1)) &&

                   ((*(int *)(iVar2 + 0x24) == 1 && (*(int *)(iVar2 + 0x28) == 1)))) &&

                  (*(int *)(iVar2 + 0x34) == 2)))) && (*(int *)(iVar2 + 0x38) == 2)) {

          iVar3 = 3;

          param_1[0xf] = 3;

        }

        else if ((((iVar4 == 2) && (*(int *)(iVar2 + 8) == 1)) &&

                 ((*(int *)(iVar2 + 0x14) == 1 &&

                  (((*(int *)(iVar2 + 0x18) == 1 && (*(int *)(iVar2 + 0x24) == 1)) &&

                   (*(int *)(iVar2 + 0x28) == 1)))))) &&

                ((*(int *)(iVar2 + 0x34) == 2 && (*(int *)(iVar2 + 0x38) == 1)))) {

          iVar3 = 4;

          param_1[0xf] = 4;

        }

      }

      local_74[0x17] = iVar3;

      param_1[0xe] = local_74[0x16];

      param_1[6] = local_74[0xd];

      param_1[5] = local_74[0xc];

      iVar2 = *local_74;

      if ((((iVar2 == 2) || (iVar2 == 4)) || (iVar2 == 6)) && (local_74[0xe09] != 0)) {

        local_54 = FUN_00619520(local_74[0xe09],&local_7c);

        if (local_54 == 0) {

          local_7c = -9;

        }

        else {

          local_74[0xe09] = 0;

        }

      }

    }

    else if (local_7c == 1) {

      iVar3 = (local_74[3] * 8 + 8) * local_74[0xdee];

      local_74[3] = iVar3;

      iVar2 = local_74[0x13];

      if (iVar3 - iVar2 != 0 && iVar2 <= iVar3) {

        local_74[3] = iVar2;

      }

      iVar3 = (local_74[4] * 8 + 8) * local_74[0xdef];

      local_74[4] = iVar3;

      iVar2 = local_74[0x14];

      if (iVar3 - iVar2 != 0 && iVar2 <= iVar3) {

        local_74[4] = iVar2;

      }

    }

  }

LAB_0061719a:

  (*(code *)local_78[6])();

  local_8 = 0xffffffff;

  if ((local_7c < 0) && (param_1[0xe1f] != 0)) {

    FUN_00619520(param_1[0xe1f],&local_7c);

    param_1[0xe1f] = 0;

  }

  ExceptionList = local_14;

  return local_7c;

}





// --- FUN_00617900 at 0x00617900 (size: 2535) ---


int FUN_00617900(int *param_1,int param_2)



{

  int iVar1;

  int iVar2;

  int iVar3;

  int iVar4;

  int iVar5;

  int iVar6;

  int local_54;

  int local_50;

  int *local_4c;

  int local_48;

  int local_44;

  int local_40;

  int local_3c;

  int local_2c;

  int local_28;

  int local_20;

  void *local_14;

  undefined *puStack_10;

  undefined *puStack_c;

  undefined4 local_8;

  

  puStack_c = &DAT_00907054;

  puStack_10 = &DAT_005df82c;

  local_14 = ExceptionList;

  local_54 = 0;

  local_50 = 0;

  local_8 = 0;

  local_4c = param_1 + 0x16;

  local_48 = 0;

  ExceptionList = &local_14;

  param_1[0x16] = param_2;

  local_54 = FUN_006166a0(param_1,&local_54);

  if (local_54 == 0) {

    iVar5 = *local_4c;

    if ((((iVar5 == 8) || (iVar5 == 10)) || (iVar5 == 0xc)) && (local_4c[0xe09] == 0)) {

      local_50 = FUN_006194e0(param_1[8],0xc0000000);

      if (local_50 == 0) {

        local_54 = -10;

        goto LAB_006179aa;

      }

      local_4c[0xe09] = local_50;

    }

    if ((*param_1 == 0) && (local_4c[0xdf8] == 0)) {

      local_4c[0x13] = param_1[0xb];

      local_4c[0x14] = param_1[0xc];

      local_4c[0x15] = param_1[0xd];

      iVar5 = param_1[0xe];

      local_4c[0x16] = iVar5;

      local_4c[0x17] = param_1[0xf];

      local_4c[0x11] = param_1[9];

      local_4c[0x12] = param_1[10];

      local_4c[0x10] = param_1[8];

      local_4c[8] = param_1[1];

      local_4c[9] = param_1[2];

      iVar4 = param_1[3];

      local_4c[10] = iVar4;

      local_4c[0xb] = param_1[4];

      local_4c[0xc] = param_1[5];

      iVar1 = param_1[6];

      local_4c[0xd] = iVar1;

      iVar3 = param_1[7];

      local_4c[0xe] = iVar3;

      iVar2 = param_1[4];

      if (iVar3 == 2) {

        iVar6 = param_1[2] * 2;

      }

      else {

        iVar6 = param_1[5] * param_1[2];

      }

      local_4c[0xf] = iVar6 + iVar2;

      if (iVar4 < 0) {

        local_4c[0xf] = -(iVar6 + iVar2);

      }

      local_4c[0x1a] = param_1[0x12];

      local_4c[0x1b] = param_1[0x13];

      local_4c[0x1c] = param_1[0x14];

      if (((iVar3 == 2) && (iVar1 == 3)) && (iVar5 == 3)) {

        local_4c[0x17] = 2;

      }

    }

    local_54 = FUN_0061a140(local_4c,&local_54);

    if (local_54 == 0) {

      local_4c[0x1a] = 1;

      if ((((local_4c[0x16] == 1) || (local_4c[0x16] == 5)) || (iVar5 = local_4c[0xd], iVar5 == 4))

         || ((iVar5 == 0xff || (iVar5 == 3)))) {

        local_4c[0x1a] = 0;

      }

      local_20 = param_1[0xd];

      local_4c[0xdf0] = local_20;

      iVar5 = param_1[0xf];

      if (iVar5 == 0) {

        iVar5 = 0;

        if (0 < local_20) {

          do {

            iVar4 = iVar5 * 0x10;

            *(int *)(iVar4 + local_4c[0xdf3]) = iVar5;

            *(undefined4 *)(iVar4 + 4 + local_4c[0xdf3]) = 1;

            *(undefined4 *)(iVar4 + 8 + local_4c[0xdf3]) = 1;

            iVar5 = iVar5 + 1;

            local_20 = local_4c[0xdf0];

          } while (iVar5 < local_20);

        }

        if (local_4c[0xdc5] == 0) {

          *(undefined4 *)(local_4c[0xdf3] + 0xc) = 0;

          if (local_4c[0x1a] == 0) {

            local_20 = local_4c[0xdf0];

          }

          else {

            local_20 = local_4c[0xdf0];

            if ((1 < local_20) && (iVar5 = 1, 1 < local_20)) {

              do {

                *(undefined4 *)(iVar5 * 0x10 + 0xc + local_4c[0xdf3]) = 1;

                iVar5 = iVar5 + 1;

                local_20 = local_4c[0xdf0];

              } while (iVar5 < local_20);

            }

          }

        }

      }

      else if (iVar5 == 1) {

        *(undefined4 *)local_4c[0xdf3] = 0;

        *(undefined4 *)(local_4c[0xdf3] + 4) = 2;

        *(undefined4 *)(local_4c[0xdf3] + 8) = 2;

        *(undefined4 *)(local_4c[0xdf3] + 0x10) = 1;

        *(undefined4 *)(local_4c[0xdf3] + 0x14) = 1;

        *(undefined4 *)(local_4c[0xdf3] + 0x18) = 1;

        *(undefined4 *)(local_4c[0xdf3] + 0x20) = 2;

        *(undefined4 *)(local_4c[0xdf3] + 0x24) = 1;

        *(undefined4 *)(local_4c[0xdf3] + 0x28) = 1;

        if (local_4c[0xdc5] == 0) {

          if (param_1[0x12] == 0) {

            *(undefined4 *)(local_4c[0xdf3] + 0xc) = 0;

            *(undefined4 *)(local_4c[0xdf3] + 0x1c) = 0;

            *(undefined4 *)(local_4c[0xdf3] + 0x2c) = 0;

            local_20 = local_4c[0xdf0];

          }

          else {

            *(undefined4 *)(local_4c[0xdf3] + 0xc) = 0;

            *(undefined4 *)(local_4c[0xdf3] + 0x1c) = 1;

            *(undefined4 *)(local_4c[0xdf3] + 0x2c) = 1;

            local_20 = local_4c[0xdf0];

          }

        }

        else {

          local_20 = local_4c[0xdf0];

        }

      }

      else if (iVar5 == 2) {

        *(undefined4 *)local_4c[0xdf3] = 0;

        *(undefined4 *)(local_4c[0xdf3] + 4) = 2;

        *(undefined4 *)(local_4c[0xdf3] + 8) = 1;

        *(undefined4 *)(local_4c[0xdf3] + 0x10) = 1;

        *(undefined4 *)(local_4c[0xdf3] + 0x14) = 1;

        *(undefined4 *)(local_4c[0xdf3] + 0x18) = 1;

        *(undefined4 *)(local_4c[0xdf3] + 0x20) = 2;

        *(undefined4 *)(local_4c[0xdf3] + 0x24) = 1;

        *(undefined4 *)(local_4c[0xdf3] + 0x28) = 1;

        if (local_4c[0xdc5] == 0) {

          if (param_1[0x12] == 0) {

            *(undefined4 *)(local_4c[0xdf3] + 0xc) = 0;

            *(undefined4 *)(local_4c[0xdf3] + 0x1c) = 0;

            *(undefined4 *)(local_4c[0xdf3] + 0x2c) = 0;

            local_20 = local_4c[0xdf0];

          }

          else {

            *(undefined4 *)(local_4c[0xdf3] + 0xc) = 0;

            *(undefined4 *)(local_4c[0xdf3] + 0x1c) = 1;

            *(undefined4 *)(local_4c[0xdf3] + 0x2c) = 1;

            local_20 = local_4c[0xdf0];

          }

        }

        else {

          local_20 = local_4c[0xdf0];

        }

      }

      else if (iVar5 == 3) {

        *(undefined4 *)local_4c[0xdf3] = 0;

        *(undefined4 *)(local_4c[0xdf3] + 4) = 2;

        *(undefined4 *)(local_4c[0xdf3] + 8) = 2;

        *(undefined4 *)(local_4c[0xdf3] + 0x10) = 1;

        *(undefined4 *)(local_4c[0xdf3] + 0x14) = 1;

        *(undefined4 *)(local_4c[0xdf3] + 0x18) = 1;

        *(undefined4 *)(local_4c[0xdf3] + 0x20) = 2;

        *(undefined4 *)(local_4c[0xdf3] + 0x24) = 1;

        *(undefined4 *)(local_4c[0xdf3] + 0x28) = 1;

        *(undefined4 *)(local_4c[0xdf3] + 0x30) = 3;

        *(undefined4 *)(local_4c[0xdf3] + 0x34) = 2;

        *(undefined4 *)(local_4c[0xdf3] + 0x38) = 2;

        if (local_4c[0xdc5] == 0) {

          if (param_1[0x12] == 0) {

            *(undefined4 *)(local_4c[0xdf3] + 0xc) = 0;

            *(undefined4 *)(local_4c[0xdf3] + 0x1c) = 0;

            *(undefined4 *)(local_4c[0xdf3] + 0x2c) = 0;

            *(undefined4 *)(local_4c[0xdf3] + 0x3c) = 0;

            local_20 = local_4c[0xdf0];

          }

          else {

            *(undefined4 *)(local_4c[0xdf3] + 0xc) = 0;

            *(undefined4 *)(local_4c[0xdf3] + 0x1c) = 1;

            *(undefined4 *)(local_4c[0xdf3] + 0x2c) = 1;

            *(undefined4 *)(local_4c[0xdf3] + 0x3c) = 0;

            local_20 = local_4c[0xdf0];

          }

        }

        else {

          local_20 = local_4c[0xdf0];

        }

      }

      else if (iVar5 == 4) {

        *(undefined4 *)local_4c[0xdf3] = 0;

        *(undefined4 *)(local_4c[0xdf3] + 4) = 2;

        *(undefined4 *)(local_4c[0xdf3] + 8) = 1;

        *(undefined4 *)(local_4c[0xdf3] + 0x10) = 1;

        *(undefined4 *)(local_4c[0xdf3] + 0x14) = 1;

        *(undefined4 *)(local_4c[0xdf3] + 0x18) = 1;

        *(undefined4 *)(local_4c[0xdf3] + 0x20) = 2;

        *(undefined4 *)(local_4c[0xdf3] + 0x24) = 1;

        *(undefined4 *)(local_4c[0xdf3] + 0x28) = 1;

        *(undefined4 *)(local_4c[0xdf3] + 0x30) = 3;

        *(undefined4 *)(local_4c[0xdf3] + 0x34) = 2;

        *(undefined4 *)(local_4c[0xdf3] + 0x38) = 1;

        if (local_4c[0xdc5] == 0) {

          if (param_1[0x12] == 0) {

            *(undefined4 *)(local_4c[0xdf3] + 0xc) = 0;

            *(undefined4 *)(local_4c[0xdf3] + 0x1c) = 0;

            *(undefined4 *)(local_4c[0xdf3] + 0x2c) = 0;

            *(undefined4 *)(local_4c[0xdf3] + 0x3c) = 0;

            local_20 = local_4c[0xdf0];

          }

          else {

            *(undefined4 *)(local_4c[0xdf3] + 0xc) = 0;

            *(undefined4 *)(local_4c[0xdf3] + 0x1c) = 1;

            *(undefined4 *)(local_4c[0xdf3] + 0x2c) = 1;

            *(undefined4 *)(local_4c[0xdf3] + 0x3c) = 0;

            local_20 = local_4c[0xdf0];

          }

        }

        else {

          local_20 = local_4c[0xdf0];

        }

      }

      local_4c[0xde9] = 8;

      local_4c[0xdea] = param_1[0xb];

      local_4c[0xdeb] = param_1[0xc];

      local_4c[0x1b] = 0;

      local_28 = 0;

      local_4c[0xdee] = 0;

      local_2c = 0;

      local_4c[0xdef] = 0;

      iVar5 = 0;

      local_44 = 0;

      if (0 < local_20) {

        iVar4 = local_4c[0xdf3];

        do {

          iVar3 = iVar5 * 0x10;

          iVar1 = *(int *)(iVar3 + 4 + iVar4);

          if (local_28 < iVar1) {

            local_4c[0xdee] = iVar1;

            local_28 = iVar1;

          }

          iVar1 = *(int *)(iVar3 + 8 + iVar4);

          if (local_2c < iVar1) {

            local_4c[0xdef] = iVar1;

            local_2c = iVar1;

          }

          if ((*(int *)(iVar3 + 4 + iVar4) != 1) || (*(int *)(iVar3 + 8 + iVar4) != 1)) {

            local_4c[0x1b] = 1;

          }

          iVar5 = iVar5 + 1;

          local_44 = iVar5;

        } while (iVar5 < local_20);

      }

      if (local_4c[0x1d] == 1) {

        local_28 = 8;

        local_4c[0xded] = 8;

        local_2c = 8;

        local_4c[0xdec] = 8;

      }

      else {

        local_28 = local_28 * 8;

        local_4c[0xded] = local_28;

        local_2c = local_2c * 8;

        local_4c[0xdec] = local_2c;

      }

      local_28 = (local_28 + -1 + local_4c[0x13]) / local_28;

      local_4c[0x1e] = local_28;

      local_2c = (local_2c + -1 + local_4c[0x14]) / local_2c;

      local_4c[0x1f] = local_2c;

      local_4c[0xdf1] = local_28;

      local_4c[0xdf2] = local_2c * local_28;

      if (local_4c[0xdf8] == 0) {

        local_4c[0xe01] = 0;

        if (param_1[3] < 0) {

          iVar5 = (param_1[3] + 1) * local_4c[0xf] + local_4c[8];

          local_4c[8] = iVar5;

        }

        else {

          iVar5 = local_4c[8];

        }

        local_4c[0xe05] = iVar5;

        local_54 = FUN_0061af00(local_4c,&local_54);

        if (local_54 != 0) goto LAB_006179aa;

        iVar5 = *local_4c;

        if ((iVar5 == 10) || (iVar5 == 0xb)) {

          local_4c[0x12] = local_4c[0xe01];

          param_1[10] = local_4c[0xe01];

          iVar5 = *local_4c;

        }

      }

      else {

        iVar5 = *local_4c;

      }

      if ((((iVar5 == 8) || (iVar5 == 9)) || (iVar5 == 0xc)) || (iVar5 == 0xd)) {

        local_4c[0x120d] = (int)local_4c + 0x4857U & 0xffffffe0;

        if (local_4c[0x1378] == 0) {

          local_54 = FUN_0061b250(local_4c,&local_54);

        }

        else {

          local_54 = FUN_0061c930(local_4c,&local_54);

        }

        local_4c[0xdf7] = 1;

        local_48 = local_48 + local_4c[0xe01];

        local_4c[0x12] = local_48;

        param_1[10] = local_48;

      }

      if ((local_54 == 1) || (local_54 == 2)) {

        iVar4 = (local_4c[3] * 8 + 8) * local_4c[0xdee];

        local_4c[3] = iVar4;

        iVar5 = local_4c[0x13];

        if (iVar4 - iVar5 != 0 && iVar5 <= iVar4) {

          local_4c[3] = iVar5;

        }

        iVar4 = (local_4c[4] * 8 + 8) * local_4c[0xdef];

        local_4c[4] = iVar4;

        iVar5 = local_4c[0x14];

        if (iVar4 - iVar5 != 0 && iVar5 <= iVar4) {

          local_4c[4] = iVar5;

        }

      }

      else {

        if (local_4c[0xe09] != 0) {

          local_40 = FUN_00619520(local_4c[0xe09],&local_54);

          if (local_40 == 0) {

            local_54 = -9;

            goto LAB_006179aa;

          }

          local_4c[0xe09] = 0;

        }

        local_8 = 0xffffffff;

      }

    }

  }

LAB_006179aa:

  if ((local_54 < 0) && (param_1[0xe1f] != 0)) {

    FUN_00619520(param_1[0xe1f],&local_54);

    param_1[0xe1f] = 0;

  }

  local_3c = param_1[0xe12];

  (**(code **)(local_3c + 0x18))();

  ExceptionList = local_14;

  return local_54;

}





// --- FUN_00618490 at 0x00618490 (size: 123) ---


/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */



void FUN_00618490(int param_1)



{

  HMODULE pHVar1;

  

  pHVar1 = *(HMODULE *)(param_1 + 4);

  if (pHVar1 == (HMODULE)0x0) {

    pHVar1 = LoadLibraryA(s_user32_00907700);

    *(HMODULE *)(param_1 + 4) = pHVar1;

    if (pHVar1 == (HMODULE)0x0) {

      return;

    }

  }

  _DAT_008f85b4 = (*(code *)PTR_FUN_00837388)(pHVar1,s_MessageBoxA_00907720);

  if (((_DAT_008f85b4 != 0) &&

      (_DAT_008f85b0 =

            (*(code *)PTR_FUN_00837388)(*(undefined4 *)(param_1 + 4),s_PeekMessageA_00907740),

      _DAT_008f85b0 != 0)) &&

     (_DAT_008f85ac =

           (*(code *)PTR_FUN_00837388)(*(undefined4 *)(param_1 + 4),s_PostQuitMessage_00907760),

     _DAT_008f85ac != 0)) {

    DAT_008f85b8 = (*(code *)PTR_FUN_00837388)(*(undefined4 *)(param_1 + 4),s_wsprintfA_00907780);

  }

  return;

}





// --- FUN_00618510 at 0x00618510 (size: 54) ---


/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */



void FUN_00618510(int param_1)



{

  if (param_1 != 0) {

    if (*(HMODULE *)(param_1 + 4) != (HMODULE)0x0) {

      FreeLibrary(*(HMODULE *)(param_1 + 4));

      *(undefined4 *)(param_1 + 4) = 0;

    }

    _DAT_008f85b4 = 0;

    _DAT_008f85b0 = 0;

    _DAT_008f85ac = 0;

    DAT_008f85b8 = 0;

  }

  return;

}





// --- FUN_00618550 at 0x00618550 (size: 93) ---


void FUN_00618550(int param_1)



{

  int iVar1;

  undefined4 uVar2;

  HMODULE pHVar3;

  

  pHVar3 = *(HMODULE *)(param_1 + 8);

  if (pHVar3 == (HMODULE)0x0) {

    pHVar3 = LoadLibraryA(s_advapi32_009077a0);

    *(HMODULE *)(param_1 + 8) = pHVar3;

    if (pHVar3 == (HMODULE)0x0) {

      return;

    }

  }

  iVar1 = (*(code *)PTR_FUN_00837388)(pHVar3,s_RegOpenKeyExA_009077c0);

  *(int *)(param_1 + 0xc) = iVar1;

  if (iVar1 != 0) {

    iVar1 = (*(code *)PTR_FUN_00837388)(*(undefined4 *)(param_1 + 8),s_RegQueryValueExA_009077e0);

    *(int *)(param_1 + 0x10) = iVar1;

    if (iVar1 != 0) {

      uVar2 = (*(code *)PTR_FUN_00837388)(*(undefined4 *)(param_1 + 8),s_RegCloseKey_00907800);

      *(undefined4 *)(param_1 + 0x14) = uVar2;

    }

  }

  return;

}





// --- FUN_006185b0 at 0x006185B0 (size: 43) ---


void FUN_006185b0(int param_1)



{

  if (param_1 != 0) {

    if (*(HMODULE *)(param_1 + 8) != (HMODULE)0x0) {

      FreeLibrary(*(HMODULE *)(param_1 + 8));

      *(undefined4 *)(param_1 + 8) = 0;

    }

    *(undefined4 *)(param_1 + 0xc) = 0;

    *(undefined4 *)(param_1 + 0x10) = 0;

    *(undefined4 *)(param_1 + 0x14) = 0;

  }

  return;

}





// --- FUN_006185e0 at 0x006185E0 (size: 551) ---


void FUN_006185e0(int param_1)



{

  *(undefined1 **)(param_1 + 0x1c) = &LAB_0061d480;

  *(undefined1 **)(param_1 + 0x20) = &LAB_0061e8f0;

  *(undefined1 **)(param_1 + 0xfc) = &LAB_0061d3f0;

  *(undefined1 **)(param_1 + 0x100) = &LAB_0061e800;

  *(undefined1 **)(param_1 + 0x104) = &LAB_0061d3f0;

  *(undefined1 **)(param_1 + 0xf0) = &LAB_0061f2d0;

  *(undefined1 **)(param_1 + 0xf4) = &LAB_00620c00;

  *(undefined1 **)(param_1 + 0xf8) = &LAB_00620ea0;

  *(undefined1 **)(param_1 + 0x108) = &LAB_0061dad0;

  *(undefined1 **)(param_1 + 0x10c) = &LAB_00621750;

  *(undefined1 **)(param_1 + 0x110) = &LAB_0061dad0;

  *(undefined1 **)(param_1 + 0x24) = &LAB_0061db50;

  *(undefined1 **)(param_1 + 0x28) = &LAB_0061df60;

  *(undefined1 **)(param_1 + 0x2c) = &LAB_0061e4b0;

  *(undefined1 **)(param_1 + 0x30) = &LAB_0061e710;

  *(undefined1 **)(param_1 + 0x34) = &LAB_00621800;

  *(undefined1 **)(param_1 + 0x38) = &LAB_00621d50;

  *(undefined1 **)(param_1 + 0x3c) = &LAB_00622250;

  *(undefined1 **)(param_1 + 0x40) = &LAB_00622540;

  *(undefined4 *)(param_1 + 0x44) = 0;

  *(undefined4 *)(param_1 + 0x48) = 0;

  *(undefined4 *)(param_1 + 0x4c) = 0;

  *(undefined4 *)(param_1 + 0x50) = 0;

  *(undefined4 *)(param_1 + 0x54) = 0;

  *(undefined1 **)(param_1 + 0x58) = &LAB_00622570;

  *(undefined1 **)(param_1 + 0x5c) = &LAB_00622630;

  *(undefined4 *)(param_1 + 0x60) = 0;

  *(undefined1 **)(param_1 + 100) = &LAB_0062d370;

  *(undefined1 **)(param_1 + 0x68) = &LAB_006235a0;

  *(undefined1 **)(param_1 + 0x6c) = &LAB_00626c50;

  *(undefined1 **)(param_1 + 0x70) = &LAB_006253d0;

  *(undefined1 **)(param_1 + 0x74) = &LAB_00623f40;

  *(undefined1 **)(param_1 + 0x78) = &LAB_00627850;

  *(undefined1 **)(param_1 + 0x7c) = &LAB_00626550;

  *(undefined1 **)(param_1 + 0x80) = &LAB_0062b040;

  *(undefined1 **)(param_1 + 0x84) = &LAB_0062c2b0;

  *(undefined1 **)(param_1 + 0x88) = &LAB_0062bca0;

  *(undefined1 **)(param_1 + 0x8c) = &LAB_0062cbc0;

  *(undefined1 **)(param_1 + 0x90) = &LAB_00628270;

  *(undefined1 **)(param_1 + 0x94) = &LAB_00628c50;

  *(undefined1 **)(param_1 + 0x98) = &LAB_0062a630;

  *(undefined1 **)(param_1 + 0x9c) = &LAB_0062ab00;

  *(undefined4 *)(param_1 + 0xa0) = 0;

  *(undefined1 **)(param_1 + 0xa4) = &LAB_0063f630;

  *(undefined1 **)(param_1 + 0xa8) = &LAB_00636d50;

  *(undefined1 **)(param_1 + 0xac) = &LAB_00637ca0;

  *(undefined1 **)(param_1 + 0xb0) = &LAB_00635650;

  *(undefined1 **)(param_1 + 0xb4) = &LAB_00637170;

  *(undefined1 **)(param_1 + 0xb8) = &LAB_006387e0;

  *(undefined1 **)(param_1 + 0xbc) = &LAB_006366f0;

  *(undefined1 **)(param_1 + 0xc0) = &LAB_00638bf0;

  *(undefined1 **)(param_1 + 0xc4) = &LAB_00639c70;

  *(undefined1 **)(param_1 + 200) = &LAB_0063aab0;

  *(code **)(param_1 + 0xcc) = FUN_0063e2f0;

  *(undefined1 **)(param_1 + 0xd0) = &LAB_0063ee60;

  *(undefined1 **)(param_1 + 0xd4) = &LAB_0063e800;

  *(undefined1 **)(param_1 + 0xd8) = &LAB_0063db40;

  *(undefined1 **)(param_1 + 0xdc) = &LAB_0063f200;

  *(undefined1 **)(param_1 + 0xe0) = &LAB_0063b0f0;

  *(undefined1 **)(param_1 + 0xe4) = &LAB_0063c490;

  *(undefined1 **)(param_1 + 0xe8) = &LAB_0063d5a0;

  *(undefined1 **)(param_1 + 0xec) = &LAB_0063df00;

  *(undefined **)(param_1 + 0x18) = &DAT_00619270;

  return;

}





// --- FUN_00618810 at 0x00618810 (size: 551) ---


void FUN_00618810(int param_1)



{

  *(undefined1 **)(param_1 + 0x1c) = &LAB_0061d7b0;

  *(undefined1 **)(param_1 + 0x20) = &LAB_0061ec40;

  *(undefined1 **)(param_1 + 0xfc) = &LAB_0061d790;

  *(undefined1 **)(param_1 + 0x100) = &LAB_0061e890;

  *(undefined1 **)(param_1 + 0x104) = &LAB_0061d790;

  *(undefined1 **)(param_1 + 0xf0) = &LAB_0061f700;

  *(undefined1 **)(param_1 + 0xf4) = &LAB_00620de0;

  *(undefined1 **)(param_1 + 0xf8) = &LAB_00620e60;

  *(undefined1 **)(param_1 + 0x108) = &LAB_0061dad0;

  *(undefined1 **)(param_1 + 0x10c) = &LAB_006217c0;

  *(undefined1 **)(param_1 + 0x110) = &LAB_0061dad0;

  *(undefined1 **)(param_1 + 0x24) = &LAB_0061df40;

  *(undefined1 **)(param_1 + 0x28) = &LAB_0061df60;

  *(undefined1 **)(param_1 + 0x2c) = &LAB_0061e4b0;

  *(undefined1 **)(param_1 + 0x30) = &LAB_0061e710;

  *(undefined1 **)(param_1 + 0x34) = &LAB_00621cf0;

  *(undefined1 **)(param_1 + 0x38) = &LAB_00621d50;

  *(undefined1 **)(param_1 + 0x3c) = &LAB_00622250;

  *(undefined1 **)(param_1 + 0x40) = &LAB_00622540;

  *(undefined4 *)(param_1 + 0x44) = 0;

  *(undefined4 *)(param_1 + 0x48) = 0;

  *(undefined4 *)(param_1 + 0x4c) = 0;

  *(undefined4 *)(param_1 + 0x50) = 0;

  *(undefined4 *)(param_1 + 0x54) = 0;

  *(undefined1 **)(param_1 + 0x58) = &LAB_006225e0;

  *(undefined1 **)(param_1 + 0x5c) = &LAB_006228a0;

  *(undefined4 *)(param_1 + 0x60) = 0;

  *(undefined1 **)(param_1 + 100) = &LAB_0062d3f0;

  *(undefined1 **)(param_1 + 0x68) = &LAB_00623970;

  *(undefined1 **)(param_1 + 0x6c) = &LAB_00627210;

  *(undefined1 **)(param_1 + 0x70) = &LAB_00625440;

  *(undefined1 **)(param_1 + 0x74) = &LAB_00624310;

  *(undefined1 **)(param_1 + 0x78) = &LAB_00627e10;

  *(undefined1 **)(param_1 + 0x7c) = &LAB_006265c0;

  *(undefined1 **)(param_1 + 0x80) = &LAB_0062b040;

  *(undefined1 **)(param_1 + 0x84) = &LAB_0062c2b0;

  *(undefined1 **)(param_1 + 0x88) = &LAB_0062bca0;

  *(undefined1 **)(param_1 + 0x8c) = &LAB_0062cd80;

  *(undefined1 **)(param_1 + 0x90) = &LAB_00628780;

  *(undefined1 **)(param_1 + 0x94) = &LAB_006293e0;

  *(undefined1 **)(param_1 + 0x98) = &LAB_0062a6b0;

  *(undefined1 **)(param_1 + 0x9c) = &LAB_0062ab00;

  *(undefined4 *)(param_1 + 0xa0) = 0;

  *(undefined1 **)(param_1 + 0xa4) = &LAB_00641240;

  *(undefined1 **)(param_1 + 0xa8) = &LAB_006415a0;

  *(undefined1 **)(param_1 + 0xac) = &LAB_00641520;

  *(undefined1 **)(param_1 + 0xb0) = &LAB_00635710;

  *(undefined1 **)(param_1 + 0xb4) = &LAB_00641560;

  *(undefined1 **)(param_1 + 0xb8) = &LAB_006414a0;

  *(undefined1 **)(param_1 + 0xbc) = &LAB_006367b0;

  *(undefined1 **)(param_1 + 0xc0) = &LAB_00641420;

  *(undefined1 **)(param_1 + 0xc4) = &LAB_006413e0;

  *(undefined1 **)(param_1 + 200) = &LAB_006413a0;

  *(code **)(param_1 + 0xcc) = FUN_0063e2f0;

  *(undefined1 **)(param_1 + 0xd0) = &LAB_0063ee60;

  *(undefined1 **)(param_1 + 0xd4) = &LAB_0063e800;

  *(undefined1 **)(param_1 + 0xd8) = &LAB_0063db40;

  *(undefined1 **)(param_1 + 0xdc) = &LAB_00641270;

  *(undefined1 **)(param_1 + 0xe0) = &LAB_00641350;

  *(undefined1 **)(param_1 + 0xe4) = &LAB_00641300;

  *(undefined1 **)(param_1 + 0xe8) = &LAB_006412b0;

  *(undefined1 **)(param_1 + 0xec) = &LAB_0063df00;

  *(undefined1 **)(param_1 + 0x18) = &LAB_00641660;

  return;

}





// --- FUN_00618a40 at 0x00618A40 (size: 551) ---


void FUN_00618a40(int param_1)



{

  *(undefined1 **)(param_1 + 0x1c) = &LAB_0061d7b0;

  *(undefined1 **)(param_1 + 0x20) = &LAB_0061ec40;

  *(undefined1 **)(param_1 + 0xfc) = &LAB_0061d790;

  *(undefined1 **)(param_1 + 0x100) = &LAB_0061e890;

  *(undefined1 **)(param_1 + 0x104) = &LAB_0061d790;

  *(undefined1 **)(param_1 + 0xf0) = &LAB_0061f700;

  *(undefined1 **)(param_1 + 0xf4) = &LAB_00620e20;

  *(undefined1 **)(param_1 + 0xf8) = &LAB_00620e60;

  *(undefined1 **)(param_1 + 0x108) = &LAB_0061dad0;

  *(undefined1 **)(param_1 + 0x10c) = &LAB_006217c0;

  *(undefined1 **)(param_1 + 0x110) = &LAB_0061dad0;

  *(undefined1 **)(param_1 + 0x24) = &LAB_0061df40;

  *(undefined1 **)(param_1 + 0x28) = &LAB_0061df60;

  *(undefined1 **)(param_1 + 0x2c) = &LAB_0061e4b0;

  *(undefined1 **)(param_1 + 0x30) = &LAB_0061e710;

  *(undefined1 **)(param_1 + 0x34) = &LAB_00621cf0;

  *(undefined1 **)(param_1 + 0x38) = &LAB_00621d50;

  *(undefined1 **)(param_1 + 0x3c) = &LAB_00622250;

  *(undefined1 **)(param_1 + 0x40) = &LAB_00622540;

  *(undefined4 *)(param_1 + 0x44) = 0;

  *(undefined4 *)(param_1 + 0x48) = 0;

  *(undefined4 *)(param_1 + 0x4c) = 0;

  *(undefined4 *)(param_1 + 0x50) = 0;

  *(undefined4 *)(param_1 + 0x54) = 0;

  *(undefined1 **)(param_1 + 0x58) = &LAB_006225e0;

  *(undefined1 **)(param_1 + 0x5c) = &LAB_006228a0;

  *(undefined4 *)(param_1 + 0x60) = 0;

  *(undefined1 **)(param_1 + 100) = &LAB_0062d3f0;

  *(undefined1 **)(param_1 + 0x68) = &LAB_00623970;

  *(undefined1 **)(param_1 + 0x6c) = &LAB_00627210;

  *(undefined1 **)(param_1 + 0x70) = &LAB_00625440;

  *(undefined1 **)(param_1 + 0x74) = &LAB_00624310;

  *(undefined1 **)(param_1 + 0x78) = &LAB_00627e10;

  *(undefined1 **)(param_1 + 0x7c) = &LAB_006265c0;

  *(undefined1 **)(param_1 + 0x80) = &LAB_0062b040;

  *(undefined1 **)(param_1 + 0x84) = &LAB_0062c2b0;

  *(undefined1 **)(param_1 + 0x88) = &LAB_0062bca0;

  *(undefined1 **)(param_1 + 0x8c) = &LAB_0062cd80;

  *(undefined1 **)(param_1 + 0x90) = &LAB_00628780;

  *(undefined1 **)(param_1 + 0x94) = &LAB_006293e0;

  *(undefined1 **)(param_1 + 0x98) = &LAB_0062a6b0;

  *(undefined1 **)(param_1 + 0x9c) = &LAB_0062ab00;

  *(undefined4 *)(param_1 + 0xa0) = 0;

  *(undefined1 **)(param_1 + 0xa4) = &LAB_00641240;

  *(undefined1 **)(param_1 + 0xa8) = &LAB_006415a0;

  *(undefined1 **)(param_1 + 0xac) = &LAB_00641520;

  *(undefined1 **)(param_1 + 0xb0) = &LAB_00635710;

  *(undefined1 **)(param_1 + 0xb4) = &LAB_00641560;

  *(undefined1 **)(param_1 + 0xb8) = &LAB_006414a0;

  *(undefined1 **)(param_1 + 0xbc) = &LAB_006367b0;

  *(undefined1 **)(param_1 + 0xc0) = &LAB_00641420;

  *(undefined1 **)(param_1 + 0xc4) = &LAB_006413e0;

  *(undefined1 **)(param_1 + 200) = &LAB_006413a0;

  *(code **)(param_1 + 0xcc) = FUN_0063e2f0;

  *(undefined1 **)(param_1 + 0xd0) = &LAB_0063ee60;

  *(undefined1 **)(param_1 + 0xd4) = &LAB_0063e800;

  *(undefined1 **)(param_1 + 0xd8) = &LAB_0063db40;

  *(undefined1 **)(param_1 + 0xdc) = &LAB_00641270;

  *(undefined1 **)(param_1 + 0xe0) = &LAB_00641350;

  *(undefined1 **)(param_1 + 0xe4) = &LAB_00641300;

  *(undefined1 **)(param_1 + 0xe8) = &LAB_006412b0;

  *(undefined1 **)(param_1 + 0xec) = &LAB_0063df00;

  *(undefined1 **)(param_1 + 0x18) = &LAB_00641660;

  return;

}





// --- FUN_00618c70 at 0x00618C70 (size: 551) ---


void FUN_00618c70(int param_1)



{

  *(undefined1 **)(param_1 + 0x1c) = &LAB_0061d7b0;

  *(undefined1 **)(param_1 + 0x20) = &LAB_0061ec60;

  *(undefined1 **)(param_1 + 0xfc) = &LAB_0061d790;

  *(undefined1 **)(param_1 + 0x100) = &LAB_0061e8b0;

  *(undefined1 **)(param_1 + 0x104) = &LAB_0061d790;

  *(undefined1 **)(param_1 + 0xf0) = &LAB_0061fa70;

  *(undefined1 **)(param_1 + 0xf4) = &LAB_00620e20;

  *(undefined1 **)(param_1 + 0xf8) = &LAB_00620e60;

  *(undefined1 **)(param_1 + 0x108) = &LAB_0061dad0;

  *(undefined1 **)(param_1 + 0x10c) = &LAB_006217c0;

  *(undefined1 **)(param_1 + 0x110) = &LAB_0061dad0;

  *(undefined1 **)(param_1 + 0x24) = &LAB_0061df40;

  *(undefined1 **)(param_1 + 0x28) = &LAB_0061df60;

  *(undefined1 **)(param_1 + 0x2c) = &LAB_0061e4b0;

  *(undefined1 **)(param_1 + 0x30) = &LAB_0061e710;

  *(undefined1 **)(param_1 + 0x34) = &LAB_00621d10;

  *(undefined1 **)(param_1 + 0x38) = &LAB_00621d50;

  *(undefined1 **)(param_1 + 0x3c) = &LAB_00622250;

  *(undefined1 **)(param_1 + 0x40) = &LAB_00622540;

  *(undefined4 *)(param_1 + 0x44) = 0;

  *(undefined4 *)(param_1 + 0x48) = 0;

  *(undefined4 *)(param_1 + 0x4c) = 0;

  *(undefined4 *)(param_1 + 0x50) = 0;

  *(undefined4 *)(param_1 + 0x54) = 0;

  *(undefined1 **)(param_1 + 0x58) = &LAB_006225e0;

  *(undefined1 **)(param_1 + 0x5c) = &LAB_006228a0;

  *(undefined4 *)(param_1 + 0x60) = 0;

  *(undefined1 **)(param_1 + 100) = &LAB_0062d3f0;

  *(undefined1 **)(param_1 + 0x68) = &LAB_00623970;

  *(undefined1 **)(param_1 + 0x6c) = &LAB_00627210;

  *(undefined1 **)(param_1 + 0x70) = &LAB_00625440;

  *(undefined1 **)(param_1 + 0x74) = &LAB_00624310;

  *(undefined1 **)(param_1 + 0x78) = &LAB_00627e10;

  *(undefined1 **)(param_1 + 0x7c) = &LAB_006265c0;

  *(undefined1 **)(param_1 + 0x80) = &LAB_0062b040;

  *(undefined1 **)(param_1 + 0x84) = &LAB_0062c2b0;

  *(undefined1 **)(param_1 + 0x88) = &LAB_0062bca0;

  *(undefined1 **)(param_1 + 0x8c) = &LAB_0062cdc0;

  *(undefined1 **)(param_1 + 0x90) = &LAB_00628780;

  *(undefined1 **)(param_1 + 0x94) = &LAB_006293e0;

  *(undefined1 **)(param_1 + 0x98) = &LAB_0062a6b0;

  *(undefined1 **)(param_1 + 0x9c) = &LAB_0062ab00;

  *(undefined4 *)(param_1 + 0xa0) = 0;

  *(undefined1 **)(param_1 + 0xa4) = &LAB_00641240;

  *(undefined1 **)(param_1 + 0xa8) = &LAB_006415a0;

  *(undefined1 **)(param_1 + 0xac) = &LAB_006414e0;

  *(undefined1 **)(param_1 + 0xb0) = &LAB_00635710;

  *(undefined1 **)(param_1 + 0xb4) = &LAB_00641560;

  *(undefined1 **)(param_1 + 0xb8) = &LAB_00641460;

  *(undefined1 **)(param_1 + 0xbc) = &LAB_006367b0;

  *(undefined1 **)(param_1 + 0xc0) = &LAB_00641420;

  *(undefined1 **)(param_1 + 0xc4) = &LAB_006413e0;

  *(undefined1 **)(param_1 + 200) = &LAB_006413a0;

  *(code **)(param_1 + 0xcc) = FUN_0063e2f0;

  *(undefined1 **)(param_1 + 0xd0) = &LAB_0063ee60;

  *(undefined1 **)(param_1 + 0xd4) = &LAB_0063e800;

  *(undefined1 **)(param_1 + 0xd8) = &LAB_0063db40;

  *(undefined1 **)(param_1 + 0xdc) = &LAB_00641270;

  *(undefined1 **)(param_1 + 0xe0) = &LAB_00641350;

  *(undefined1 **)(param_1 + 0xe4) = &LAB_00641300;

  *(undefined1 **)(param_1 + 0xe8) = &LAB_006412b0;

  *(undefined1 **)(param_1 + 0xec) = &LAB_0063df00;

  *(undefined1 **)(param_1 + 0x18) = &LAB_00641660;

  return;

}





// --- FUN_00618ea0 at 0x00618EA0 (size: 551) ---


void FUN_00618ea0(int param_1)



{

  *(undefined1 **)(param_1 + 0x1c) = &LAB_0061d7b0;

  *(undefined1 **)(param_1 + 0x20) = &LAB_0061ec80;

  *(undefined1 **)(param_1 + 0xfc) = &LAB_0061d790;

  *(undefined1 **)(param_1 + 0x100) = &LAB_0061e8d0;

  *(undefined1 **)(param_1 + 0x104) = &LAB_0061d790;

  *(undefined1 **)(param_1 + 0xf0) = &LAB_0061f700;

  *(undefined1 **)(param_1 + 0xf4) = &LAB_00620e20;

  *(undefined1 **)(param_1 + 0xf8) = &LAB_00620e60;

  *(undefined1 **)(param_1 + 0x108) = &LAB_0061dad0;

  *(undefined1 **)(param_1 + 0x10c) = &LAB_006217e0;

  *(undefined1 **)(param_1 + 0x110) = &LAB_0061dad0;

  *(undefined1 **)(param_1 + 0x24) = &LAB_0061df40;

  *(undefined1 **)(param_1 + 0x28) = &LAB_0061df60;

  *(undefined1 **)(param_1 + 0x2c) = &LAB_0061e4b0;

  *(undefined1 **)(param_1 + 0x30) = &LAB_0061e710;

  *(undefined1 **)(param_1 + 0x34) = &LAB_00621d30;

  *(undefined1 **)(param_1 + 0x38) = &LAB_00621d50;

  *(undefined1 **)(param_1 + 0x3c) = &LAB_00622250;

  *(undefined1 **)(param_1 + 0x40) = &LAB_00622540;

  *(undefined4 *)(param_1 + 0x44) = 0;

  *(undefined4 *)(param_1 + 0x48) = 0;

  *(undefined4 *)(param_1 + 0x4c) = 0;

  *(undefined4 *)(param_1 + 0x50) = 0;

  *(undefined4 *)(param_1 + 0x54) = 0;

  *(undefined1 **)(param_1 + 0x58) = &LAB_006225e0;

  *(undefined1 **)(param_1 + 0x5c) = &LAB_006228a0;

  *(undefined4 *)(param_1 + 0x60) = 0;

  *(undefined1 **)(param_1 + 100) = &LAB_0062d3f0;

  *(undefined1 **)(param_1 + 0x68) = &LAB_00623970;

  *(undefined1 **)(param_1 + 0x6c) = &LAB_00627210;

  *(undefined1 **)(param_1 + 0x70) = &LAB_00625440;

  *(undefined1 **)(param_1 + 0x74) = &LAB_00624310;

  *(undefined1 **)(param_1 + 0x78) = &LAB_00627e10;

  *(undefined1 **)(param_1 + 0x7c) = &LAB_006265c0;

  *(undefined1 **)(param_1 + 0x80) = &LAB_0062b040;

  *(undefined1 **)(param_1 + 0x84) = &LAB_0062c2b0;

  *(undefined1 **)(param_1 + 0x88) = &LAB_0062bca0;

  *(undefined1 **)(param_1 + 0x8c) = &LAB_0062cdc0;

  *(undefined1 **)(param_1 + 0x90) = &LAB_00628780;

  *(undefined1 **)(param_1 + 0x94) = &LAB_006293e0;

  *(undefined1 **)(param_1 + 0x98) = &LAB_0062a6b0;

  *(undefined1 **)(param_1 + 0x9c) = &LAB_0062ab00;

  *(undefined4 *)(param_1 + 0xa0) = 0;

  *(undefined1 **)(param_1 + 0xa4) = &LAB_00641240;

  *(undefined1 **)(param_1 + 0xa8) = &LAB_006415a0;

  *(undefined1 **)(param_1 + 0xac) = &LAB_006414e0;

  *(undefined1 **)(param_1 + 0xb0) = &LAB_00635710;

  *(undefined1 **)(param_1 + 0xb4) = &LAB_00641560;

  *(undefined1 **)(param_1 + 0xb8) = &LAB_00641460;

  *(undefined1 **)(param_1 + 0xbc) = &LAB_006367b0;

  *(undefined1 **)(param_1 + 0xc0) = &LAB_00641420;

  *(undefined1 **)(param_1 + 0xc4) = &LAB_006413e0;

  *(undefined1 **)(param_1 + 200) = &LAB_006413a0;

  *(code **)(param_1 + 0xcc) = FUN_0063e2f0;

  *(undefined1 **)(param_1 + 0xd0) = &LAB_0063ee60;

  *(undefined1 **)(param_1 + 0xd4) = &LAB_0063e800;

  *(undefined1 **)(param_1 + 0xd8) = &LAB_0063db40;

  *(undefined1 **)(param_1 + 0xdc) = &LAB_00641270;

  *(undefined1 **)(param_1 + 0xe0) = &LAB_00641350;

  *(undefined1 **)(param_1 + 0xe4) = &LAB_00641300;

  *(undefined1 **)(param_1 + 0xe8) = &LAB_006412b0;

  *(undefined1 **)(param_1 + 0xec) = &LAB_0063df00;

  *(undefined1 **)(param_1 + 0x18) = &LAB_00641660;

  return;

}





// --- FUN_006190d0 at 0x006190D0 (size: 150) ---


int FUN_006190d0(int param_1)



{

  int iVar1;

  undefined4 uStack_30;

  undefined *puStack_2c;

  int iStack_28;

  int iStack_24;

  undefined4 *puStack_20;

  undefined4 local_1c;

  undefined4 local_18;

  undefined4 local_14;

  undefined4 local_10;

  

  iStack_24 = -1;

  if (((*(code **)(param_1 + 0xc) != (code *)0x0) && (*(int *)(param_1 + 0x10) != 0)) &&

     (*(int *)(param_1 + 0x14) != 0)) {

    local_1c = 4;

    local_18 = 4;

    local_14 = 0;

    puStack_20 = &local_14;

    local_10 = 0xffffffff;

    iStack_24 = 1;

    iStack_28 = 0;

    puStack_2c = PTR_s_Software_Intel_Corporation_PLSui_008332c0;

    uStack_30 = 0x80000002;

    iVar1 = (**(code **)(param_1 + 0xc))();

    if (iVar1 == 0) {

      (**(code **)(param_1 + 0x10))

                (iStack_28,PTR_s_USECPU_008332c4,0,&uStack_30,&iStack_24,&puStack_2c);

    }

    if (iStack_28 != 0) {

      (**(code **)(param_1 + 0x14))(iStack_28);

      iStack_24 = iStack_28;

    }

  }

  return iStack_24;

}





// --- FUN_00619170 at 0x00619170 (size: 199) ---


/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */



undefined4 FUN_00619170(undefined4 param_1)



{

  int iVar1;

  int iVar2;

  

  FUN_00618490(param_1);

  FUN_00618550(param_1);

  iVar1 = FUN_006193f0(param_1);

  iVar2 = FUN_006193e0();

  DAT_008f85a8 = &LAB_00618460;

  DAT_008f85a4 = &LAB_00618480;

  if ((*(uint *)(iVar2 + 0x14) & 0x10) == 0) {

    _DAT_008f85a0 = &LAB_00619260;

  }

  else {

    _DAT_008f85a0 = &LAB_00641650;

  }

  if (iVar1 == 1) {

    FUN_006185e0(param_1);

  }

  else if (iVar1 == 2) {

    FUN_006185e0(param_1);

  }

  else if (iVar1 == 3) {

    FUN_00618810(param_1);

  }

  else if (iVar1 == 4) {

    FUN_00618a40(param_1);

  }

  else if (iVar1 == 5) {

    FUN_00618c70(param_1);

  }

  else if (iVar1 == 6) {

    FUN_00618ea0(param_1);

  }

  else {

    FUN_006185e0(param_1);

  }

  return 1;

}





// --- FUN_00619240 at 0x00619240 (size: 29) ---


void FUN_00619240(undefined4 param_1)



{

  FUN_00618510(param_1);

  FUN_006185b0(param_1);

  return;

}





// --- FUN_00619280 at 0x00619280 (size: 211) ---


/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */



void FUN_00619280(void)



{

  undefined4 local_34 [2];

  void *local_14;

  undefined *puStack_10;

  undefined *puStack_c;

  undefined4 local_8;

  

  puStack_c = &DAT_0090782c;

  puStack_10 = &DAT_005df82c;

  local_14 = ExceptionList;

  local_8 = 0;

  DAT_008f85d8 = 0x20;

  DAT_008f85d9 = 0x20;

  DAT_008f85da = 0x20;

  DAT_008f85db = 0x20;

  DAT_008f85dc = 0x20;

  DAT_008f85dd = 0x20;

  DAT_008f85de = 0x20;

  DAT_008f85df = 0x20;

  DAT_008f85e0 = 0x20;

  DAT_008f85e1 = 0x20;

  DAT_008f85e2 = 0x20;

  DAT_008f85e3 = 0x20;

  local_34[0] = 0xc;

  DAT_008f85e4 = 0;

  _DAT_008f85c0 = 0;

  _DAT_008f85c4 = 0;

  _DAT_008f85c8 = 0;

  _DAT_008f85cc = 0;

  _DAT_008f85d0 = 0;

  _DAT_008f85d4 = 0;

  ExceptionList = &local_14;

  FUN_006415e0(&DAT_008f85c0,local_34);

  ExceptionList = local_14;

  return;

}





// --- FUN_006193e0 at 0x006193E0 (size: 6) ---


undefined * FUN_006193e0(void)



{

  return &DAT_008f85c0;

}





// --- FUN_006193f0 at 0x006193F0 (size: 229) ---


int FUN_006193f0(undefined4 param_1)



{

  uint uVar1;

  int iVar2;

  int iVar3;

  

  FUN_00619280();

  iVar2 = FUN_006190d0(param_1);

  if (((((iVar2 != 0) && (iVar2 != 1)) && (iVar2 != 2)) && ((iVar2 != 3 && (iVar2 != 4)))) &&

     ((iVar2 != 5 && (iVar2 != 6)))) {

    iVar3 = FUN_006193e0();

    iVar2 = *(int *)(iVar3 + 8);

    if (iVar2 != 5) {

      if (iVar2 == 6) {

        uVar1 = *(uint *)(iVar3 + 0x14);

        if (((uVar1 & 0x800000) != 0) && ((uVar1 & 0x2000000) == 0)) {

          return 4;

        }

        if ((uVar1 & 0x2800000) == 0x2800000) {

          return 5;

        }

        return 2;

      }

      if (iVar2 != 0xf) {

        return 0;

      }

      if ((*(uint *)(iVar3 + 0x14) & 0x4000000) != 0) {

        return 6;

      }

      return 0;

    }

    if ((*(uint *)(iVar3 + 0x14) & 0x800000) != 0) {

      return 3;

    }

    iVar2 = 1;

  }

  return iVar2;

}





// --- FUN_006194e0 at 0x006194E0 (size: 54) ---


HANDLE FUN_006194e0(LPCSTR param_1,uint param_2)



{

  DWORD dwCreationDisposition;

  HANDLE pvVar1;

  

  if ((param_2 & 0x40000000) == 0) {

    dwCreationDisposition = 3;

  }

  else {

    dwCreationDisposition = 2;

  }

  pvVar1 = CreateFileA(param_1,param_2,1,(LPSECURITY_ATTRIBUTES)0x0,dwCreationDisposition,0,

                       (HANDLE)0x0);

  if (pvVar1 == (HANDLE)0xffffffff) {

    pvVar1 = (HANDLE)0x0;

  }

  return pvVar1;

}





// --- FUN_00619520 at 0x00619520 (size: 12) ---


void FUN_00619520(HANDLE param_1)



{

  CloseHandle(param_1);

  return;

}





// --- FUN_00619530 at 0x00619530 (size: 31) ---


void FUN_00619530(HANDLE param_1,LPVOID param_2,DWORD param_3,LPDWORD param_4)



{

  ReadFile(param_1,param_2,param_3,param_4,(LPOVERLAPPED)0x0);

  return;

}





// --- FUN_00619550 at 0x00619550 (size: 31) ---


void FUN_00619550(HANDLE param_1,LPCVOID param_2,DWORD param_3,LPDWORD param_4)



{

  WriteFile(param_1,param_2,param_3,param_4,(LPOVERLAPPED)0x0);

  return;

}





// --- FUN_00619570 at 0x00619570 (size: 40) ---


bool FUN_00619570(HANDLE param_1,LONG param_2,DWORD param_3)



{

  DWORD DVar1;

  

  DVar1 = SetFilePointer(param_1,param_2,(PLONG)0x0,param_3);

  return DVar1 != 0xffffffff;

}





// --- FUN_006195a0 at 0x006195A0 (size: 167) ---


int FUN_006195a0(int param_1,int *param_2,int param_3)



{

  int iVar1;

  int iVar2;

  int iVar3;

  int iVar4;

  

  if (*(int *)(param_3 + 0x37dc) == 0) {

    iVar2 = FUN_00642ef0(param_3,param_1,param_3 + 0x37a4,param_2);

    if (iVar2 == 0) {

      *(undefined4 *)(param_1 + 0x28) = 0;

      iVar3 = 0;

      if (0 < *param_2) {

        iVar1 = param_2[0xd];

        iVar4 = 0;

        do {

          if ((*(int *)(iVar4 + 0xc + iVar1) == 0) || (*(int *)(iVar4 + 0x10 + iVar1) == 0)) {

            return -0x11;

          }

          if (*(int *)(iVar4 + 0x14 + iVar1) == 0) {

            return -0x12;

          }

          iVar4 = iVar4 + 0x18;

          iVar3 = iVar3 + 1;

        } while (iVar3 < *param_2);

      }

    }

  }

  else {

    iVar2 = -0x13;

  }

  return iVar2;

}





// --- FUN_00619650 at 0x00619650 (size: 1924) ---


int FUN_00619650(int *param_1)



{

  int iVar1;

  int iVar2;

  undefined4 uVar3;

  int *piVar4;

  int iVar5;

  int *piVar6;

  uint local_24 [2];

  int *local_1c;

  int *local_18;

  int *local_14;

  

  piVar6 = param_1 + 0xdfa;

  local_18 = (int *)param_1[0xdfc];

  local_24[0] = 0;

  iVar2 = param_1[0xdf8];

  if ((iVar2 == 0) || (iVar1 = param_1[0x1d], iVar1 == 1)) {

    if (iVar2 == 0) {

      FUN_00649520(piVar6);

      iVar2 = param_1[0xdf8];

      iVar1 = param_1[0x1d];

    }

    else if (*(int *)(iVar2 + 0x1c) == 0) {

      if (*(int *)(iVar2 + 0x20) == 0) {

        FUN_00649520(piVar6);

        iVar2 = param_1[0xdf8];

        iVar1 = param_1[0x1d];

      }

      else {

        iVar1 = param_1[0x1d];

      }

    }

    else {

      iVar1 = param_1[0x1d];

    }

  }

  if ((iVar1 == 1) &&

     ((iVar2 == 0 || ((*(int *)(iVar2 + 0x1c) == 0 && (*(int *)(iVar2 + 0x20) == 0)))))) {

    param_1[0xdfa] = 0;

    param_1[0xdfb] = 0;

    iVar2 = *param_1;

    if ((iVar2 == 2) || ((((iVar2 == 6 || (iVar2 == 0xe)) || (iVar2 == 0x12)) || (iVar2 == 0x10))))

    {

      param_1[0xe01] = 0;

      iVar2 = FUN_00619570(param_1[0xe09],0,0);

      if (iVar2 == 0) {

        return -0x17;

      }

      iVar2 = FUN_00649570(piVar6);

      if (iVar2 != 0) {

        return iVar2;

      }

      iVar2 = param_1[0xdf8];

    }

    else {

      param_1[0xdfe] = param_1[0x11];

      param_1[0xe01] = 0;

      param_1[0xe03] = param_1[0xe02];

      iVar2 = param_1[0xdf8];

    }

  }

  iVar1 = *param_1;

  if ((((((iVar1 != 6) && (iVar1 != 7)) && ((iVar1 != 0xe && ((iVar1 != 0xf && (iVar1 != 0x11))))))

       && (iVar1 != 0x10)) &&

      ((((iVar1 != 0x13 && (iVar1 != 0x12)) && (param_1[2] == 0)) &&

       ((param_1[4] == 0 && (param_1[3] == 0)))))) && (param_1[1] == 0)) {

    param_1[0xe01] = 0;

  }

  if ((param_1[0xdf7] == 0) && (iVar1 = FUN_00649730(param_1), iVar1 != 0)) {

    return iVar1;

  }

  iVar1 = *param_1;

  if ((((iVar1 == 1) || (iVar1 == 0)) || (iVar1 == 5)) ||

     (((iVar1 == 4 || (iVar1 == 0x15)) || (iVar1 == 0x14)))) {

    iVar1 = FUN_006418e0(piVar6,local_24);

    if (iVar1 != 0) {

      return iVar1;

    }

    if (local_24[0] != 0xd8) {

      return -0xd;

    }

  }

  if (param_1[0x1378] == 0) {

    param_1[0xdf6] = 0;

    param_1[0xdf5] = 0;

  }

  piVar4 = (int *)param_1[0xdf8];

  local_14 = piVar4;

  if ((piVar4 == (int *)0x0) || (((param_1[0x1d] == 1 && (piVar4[7] == 0)) && (piVar4[8] == 0))))

  goto LAB_00619c3f;

  local_1c = piVar6;

  if ((piVar4 == (int *)0x0) || (iVar2 == 0)) {

    piVar4 = (int *)FUN_005df0f5(0x38);

    if (piVar4 == (int *)0x0) {

      return -5;

    }

    piVar4[7] = 0;

    piVar4[8] = 0;

    piVar4[9] = 0;

    piVar4[10] = 0;

    piVar4[0xb] = 0;

    piVar4[0xc] = 0;

    iVar2 = FUN_006195a0(local_1c,piVar4,param_1);

    if (iVar2 != 0) {

      local_14 = piVar4;

      operator_delete(piVar4);

      return iVar2;

    }

    iVar2 = *param_1;

    if (((((iVar2 == 1) || (iVar2 == 0)) || (iVar2 == 5)) || ((iVar2 == 4 || (iVar2 == 0x15)))) ||

       (iVar2 == 0x14)) {

      param_1[0xe01] = param_1[0xe01] - *local_18;

      local_14 = piVar4;

      operator_delete(piVar4);

      return 0;

    }

    piVar4[6] = param_1[0xdf4];

    if ((*piVar4 < param_1[0xdf0]) && (param_1[0x1378] == 0)) {

      param_1[0x1d] = 1;

    }

    else {

      param_1[0x1d] = 0;

    }

    FUN_00649730(param_1);

    if (piVar4[2] == 0) {

      if (piVar4[3] == 0x3f) {

        if (piVar4[4] == 0) {

          iVar2 = piVar4[5];

          if (iVar2 == 0) {

            iVar1 = param_1[0x1378];

            if (iVar1 == 0) goto LAB_0061979a;

          }

          else {

            iVar1 = param_1[0x1378];

          }

        }

        else {

          iVar1 = param_1[0x1378];

          iVar2 = piVar4[5];

        }

      }

      else {

        iVar1 = param_1[0x1378];

        iVar2 = piVar4[5];

      }

    }

    else {

      iVar1 = param_1[0x1378];

      iVar2 = piVar4[5];

    }

    if ((piVar4[2] == 0) && (piVar4[3] == 0)) {

      if (iVar2 == 0) {

        param_1[0xdf5] = param_1[0xdf5] + *piVar4;

      }

    }

    else if ((iVar2 == 0) && (piVar4[3] == 0x3f)) {

      param_1[0xdf6] = param_1[0xdf6] + 1;

    }

    param_1[0x1378] = iVar1 + 1;

    if (iVar1 + 1 == 1) {

      iVar1 = 0;

      iVar2 = 0;

      if (0 < param_1[0xdf0]) {

        iVar5 = param_1[0xdf3];

        do {

          iVar2 = iVar2 + 1;

          iVar1 = iVar1 + *(int *)(iVar5 + 4) * *(int *)(iVar5 + 8);

          iVar5 = iVar5 + 0x10;

        } while (iVar2 < param_1[0xdf0]);

      }

      iVar2 = FUN_005df0f5(iVar1 * 0x40 * param_1[0x1e] * param_1[0x1f] * 2);

      param_1[0x1379] = iVar2;

      if (iVar2 == 0) {

        local_14 = piVar4;

        operator_delete((void *)piVar4[0xd]);

        piVar4[0xd] = 0;

        operator_delete(piVar4);

        param_1[0xdf8] = 0;

        return -5;

      }

    }

  }

LAB_0061979a:

  if ((param_1[0x1d] == 1) && (param_1[0x1378] == 0)) {

    param_1[0xdf6] = param_1[0xdf6] + *piVar4;

  }

  param_1[0xdf8] = (int)piVar4;

  if (param_1[0x137a] == 1) {

    iVar1 = 0;

    iVar2 = 0;

    if (0 < param_1[0xdf0]) {

      iVar5 = param_1[0xdf3];

      do {

        iVar2 = iVar2 + 1;

        iVar1 = iVar1 + *(int *)(iVar5 + 4) * *(int *)(iVar5 + 8);

        iVar5 = iVar5 + 0x10;

      } while (iVar2 < param_1[0xdf0]);

    }

    iVar2 = iVar1 * 0x80 + iVar1 * 0x40 * param_1[0x1e];

    if (param_1[0x137b] == 0) {

      iVar1 = FUN_005df0f5(0x14);

      param_1[0x137b] = iVar1;

      if (iVar1 == 0) {

        return -5;

      }

      uVar3 = FUN_005df0f5(iVar2 * 8);

      *(undefined4 *)param_1[0x137b] = uVar3;

      piVar6 = (int *)param_1[0x137b];

      if (*piVar6 == 0) {

        operator_delete(piVar6);

        param_1[0x137b] = 0;

        return -5;

      }

      piVar6[1] = *piVar6 + iVar2 * 2;

      *(int *)(param_1[0x137b] + 8) = *(int *)(param_1[0x137b] + 4) + iVar2 * 2;

      *(int *)(param_1[0x137b] + 0xc) = *(int *)(param_1[0x137b] + 8) + iVar2 * 2;

      *(undefined4 *)(param_1[0x137b] + 0x10) = 0;

    }

  }

  iVar2 = FUN_00648fe0(local_24,local_1c,piVar4,param_1);

  if ((iVar2 == 1) || (iVar2 == 2)) {

    if ((param_1[0x1378] != 0) && (param_1[7] == 0)) {

      param_1[0xdf6] = param_1[0xdf6] + 1;

      param_1[0xdf8] = (int)piVar4;

      param_1[7] = 0;

      return iVar2;

    }

    if ((param_1[0x1d] == 1) && (iVar2 == 2)) {

      local_14 = piVar4;

      if (param_1[0x1a] != 0) {

        FUN_00632d80(param_1);

      }

      operator_delete((void *)piVar4[0xd]);

      piVar4[0xd] = 0;

      operator_delete(piVar4);

      param_1[0xdf8] = 0;

      return 2;

    }

    param_1[0xdf8] = (int)piVar4;

    param_1[7] = 0;

    return iVar2;

  }

  if (param_1[0x1378] == 0) {

    param_1[0xe08] = param_1[0xe08] + *piVar4;

  }

  if ((param_1[0xdf8] == 0) || (iVar2 != 0)) {

    if (iVar2 < 0) {

      return iVar2;

    }

  }

  else {

    operator_delete(*(void **)(param_1[0xdf8] + 0x34));

    *(undefined4 *)(param_1[0xdf8] + 0x34) = 0;

    operator_delete((void *)param_1[0xdf8]);

    param_1[0xdf8] = 0;

  }

  piVar6 = local_1c;

  if (local_24[0] != 0) goto LAB_00619940;

LAB_00619c3f:

  do {

    iVar2 = FUN_006418e0(piVar6,local_24);

    if (iVar2 != 0) {

      return iVar2;

    }

    if (local_24[0] == 0x100) {

      return 0;

    }

LAB_00619940:

    if (local_24[0] < 0x101) {

                    /* WARNING: Could not recover jumptable at 0x00619953. Too many branches */

                    /* WARNING: Treating indirect jump as call */

      iVar2 = (*(code *)(&PTR_LAB_00907860)[local_24[0]])();

      return iVar2;

    }

    iVar2 = FUN_00641960(piVar6);

  } while (iVar2 == 0);

  return iVar2;

}





// --- FUN_0061a140 at 0x0061A140 (size: 672) ---


undefined4 FUN_0061a140(int param_1)



{

  int iVar1;

  int iVar2;

  

  iVar2 = 0;

  iVar1 = 0;

  if (*(int *)(param_1 + 0x371c) != 0) {

    iVar2 = *(int *)(param_1 + 0x3714);

  }

  if (*(int *)(param_1 + 0x3724) != 0) {

    iVar2 = *(int *)(param_1 + 0x3714);

  }

  if (*(int *)(param_1 + 0x372c) != 0) {

    iVar2 = *(int *)(param_1 + 0x3714);

  }

  if (*(int *)(param_1 + 0x3734) != 0) {

    iVar2 = *(int *)(param_1 + 0x3714);

  }

  if ((*(int *)(param_1 + 0x373c) != 0) && (*(int *)(param_1 + 0x3740) != 0)) {

    iVar1 = *(int *)(param_1 + 0x3718);

  }

  if ((*(int *)(param_1 + 0x3748) != 0) && (*(int *)(param_1 + 0x374c) != 0)) {

    iVar1 = *(int *)(param_1 + 0x3718);

  }

  if ((*(int *)(param_1 + 0x3754) != 0) && (*(int *)(param_1 + 0x3758) != 0)) {

    iVar1 = *(int *)(param_1 + 0x3718);

  }

  if ((*(int *)(param_1 + 0x3760) != 0) && (*(int *)(param_1 + 0x3764) != 0)) {

    iVar1 = *(int *)(param_1 + 0x3718);

  }

  if ((*(int *)(param_1 + 0x376c) != 0) && (*(int *)(param_1 + 0x3770) != 0)) {

    iVar1 = *(int *)(param_1 + 0x3718);

  }

  if ((*(int *)(param_1 + 0x3778) != 0) && (*(int *)(param_1 + 0x377c) != 0)) {

    iVar1 = *(int *)(param_1 + 0x3718);

  }

  if ((*(int *)(param_1 + 0x3784) != 0) && (*(int *)(param_1 + 0x3788) != 0)) {

    iVar1 = *(int *)(param_1 + 0x3718);

  }

  if ((*(int *)(param_1 + 0x3790) != 0) && (*(int *)(param_1 + 0x3794) != 0)) {

    iVar1 = *(int *)(param_1 + 0x3718);

  }

  if (iVar2 == 0) {

    *(undefined4 *)(param_1 + 0x84) = 2;

    *(undefined4 *)(param_1 + 0x80) = 2;

    *(undefined **)(param_1 + 0x371c) = &DAT_00907e40;

    *(undefined1 *)(param_1 + 0x3720) = 0;

    *(undefined **)(param_1 + 0x3724) = &DAT_00907e00;

    *(undefined1 *)(param_1 + 0x3728) = 1;

    *(undefined4 *)(param_1 + 0x372c) = 0;

    *(undefined1 *)(param_1 + 0x3730) = 0;

    *(undefined4 *)(param_1 + 0x3734) = 0;

    *(undefined1 *)(param_1 + 0x3738) = 0;

  }

  if (iVar1 == 0) {

    *(undefined4 *)(param_1 + 0x88) = 2;

    *(undefined4 *)(param_1 + 0x8c) = 2;

    *(undefined4 *)(param_1 + 0x90) = 2;

    *(undefined **)(param_1 + 0x373c) = &DAT_00907ec8;

    *(undefined **)(param_1 + 0x3740) = &DAT_00907ebc;

    *(undefined1 *)(param_1 + 0x3744) = 0;

    *(undefined1 *)(param_1 + 0x3745) = 0;

    *(undefined **)(param_1 + 0x3748) = &DAT_00907eac;

    *(undefined **)(param_1 + 0x374c) = &DAT_00907d40;

    *(undefined1 *)(param_1 + 0x3750) = 1;

    *(undefined1 *)(param_1 + 0x3751) = 0;

    *(undefined **)(param_1 + 0x3754) = &DAT_00907e9c;

    *(undefined **)(param_1 + 0x3758) = &DAT_00907e90;

    *(undefined1 *)(param_1 + 0x375c) = 0;

    *(undefined1 *)(param_1 + 0x375d) = 1;

    *(undefined **)(param_1 + 0x3760) = &DAT_00907e80;

    *(undefined **)(param_1 + 0x3764) = &DAT_00907c80;

    *(undefined1 *)(param_1 + 0x3768) = 1;

    *(undefined1 *)(param_1 + 0x3769) = 1;

    *(undefined4 *)(param_1 + 0x376c) = 0;

    *(undefined4 *)(param_1 + 0x3770) = 0;

    *(undefined1 *)(param_1 + 0x3774) = 0;

    *(undefined1 *)(param_1 + 0x3775) = 0;

    *(undefined4 *)(param_1 + 0x3778) = 0;

    *(undefined4 *)(param_1 + 0x377c) = 0;

    *(undefined1 *)(param_1 + 0x3780) = 0;

    *(undefined1 *)(param_1 + 0x3781) = 0;

    *(undefined4 *)(param_1 + 0x3784) = 0;

    *(undefined4 *)(param_1 + 0x3788) = 0;

    *(undefined1 *)(param_1 + 0x378c) = 0;

    *(undefined1 *)(param_1 + 0x378d) = 0;

    *(undefined4 *)(param_1 + 0x3790) = 0;

    *(undefined4 *)(param_1 + 0x3794) = 0;

    *(undefined1 *)(param_1 + 0x3798) = 0;

    *(undefined1 *)(param_1 + 0x3799) = 0;

    *(undefined1 *)(param_1 + 0x37a0) = 0;

    *(undefined1 *)(param_1 + 0x37a1) = 1;

    *(undefined1 *)(param_1 + 0x37a2) = 1;

    *(undefined1 *)(param_1 + 0x37a3) = 1;

    *(undefined1 *)(param_1 + 0x379c) = 0;

    *(undefined1 *)(param_1 + 0x379d) = 1;

    *(undefined1 *)(param_1 + 0x379e) = 1;

    *(undefined1 *)(param_1 + 0x379f) = 1;

  }

  return 0;

}





// --- FUN_0061a3e0 at 0x0061A3E0 (size: 174) ---


int FUN_0061a3e0(int param_1,int param_2,int param_3)



{

  int iVar1;

  int iVar2;

  int iVar3;

  int iVar4;

  

  if (param_1 < 1) {

    param_1 = 1;

LAB_0061a3fa:

    iVar2 = (int)(5000 / (longlong)param_1);

  }

  else {

    if (param_1 < 0x65) {

      if (param_1 < 0x32) goto LAB_0061a3fa;

    }

    else {

      param_1 = 100;

    }

    iVar2 = param_1 * -2 + 200;

  }

  iVar3 = 0;

  do {

    iVar4 = (uint)*(byte *)(iVar3 + param_2) * iVar2 + 0x32;

    iVar1 = iVar4 / 100;

    if (iVar1 < 1) {

      *(undefined2 *)(param_3 + iVar3 * 2) = 1;

    }

    else if (iVar1 < 0x100) {

      *(short *)(param_3 + iVar3 * 2) = (short)iVar1;

    }

    else {

      *(undefined2 *)(param_3 + iVar3 * 2) = 0xff;

    }

    iVar3 = iVar3 + 1;

  } while (iVar3 < 0x40);

  return iVar4 * 0x51eb851f;

}





// --- FUN_0061a4a0 at 0x0061A4A0 (size: 473) ---


undefined4 FUN_0061a4a0(int param_1,int param_2,int param_3)



{

  int *piVar1;

  int iVar2;

  int iVar3;

  int iVar4;

  int iVar5;

  uint uVar6;

  int local_82c [260];

  int aiStack_41c [257];

  undefined4 local_18;

  

  iVar3 = 0;

  do {

    local_82c[iVar3] = 0;

    aiStack_41c[iVar3] = 0;

    *(undefined2 *)(param_3 + 0x408 + iVar3 * 2) = 0;

    *(undefined4 *)(param_3 + 8 + iVar3 * 4) = 0;

    local_82c[iVar3 + 1] = 0;

    aiStack_41c[iVar3 + 1] = 0;

    *(undefined2 *)(param_3 + 0x40a + iVar3 * 2) = 0;

    *(undefined4 *)(param_3 + 0xc + iVar3 * 4) = 0;

    iVar3 = iVar3 + 2;

  } while (iVar3 < 0x100);

  iVar5 = 0;

  iVar3 = 1;

  do {

    iVar4 = 1;

    uVar6 = (uint)*(byte *)(param_1 + -1 + iVar3);

    if (uVar6 != 0) {

      do {

        if (0x101 < iVar5) {

          return 0xfffffffa;

        }

        local_82c[iVar5] = iVar3;

        iVar5 = iVar5 + 1;

        iVar4 = iVar4 + 1;

      } while (iVar4 <= (int)uVar6);

    }

    iVar3 = iVar3 + 1;

  } while (iVar3 < 0x11);

  iVar4 = 0;

  iVar3 = 0;

  local_82c[iVar5] = 0;

  while( true ) {

    aiStack_41c[iVar4] = iVar3;

    iVar4 = iVar4 + 1;

    iVar2 = local_82c[iVar4];

    while ((iVar3 = iVar3 + 1, iVar2 == local_82c[0] && (iVar4 < 0x101))) {

      aiStack_41c[iVar4] = iVar3;

      iVar4 = iVar4 + 1;

      iVar2 = local_82c[iVar4];

    }

    if (iVar2 == 0) break;

    do {

      iVar3 = iVar3 * 2;

      local_82c[0] = local_82c[0] + 1;

    } while (iVar2 != local_82c[0]);

  }

  iVar3 = 0;

  if (0 < iVar5) {

    if (3 < iVar5) {

      local_18 = 0;

      do {

        uVar6 = (uint)*(byte *)(param_2 + iVar3);

        if (0x101 < uVar6) {

          return 0xfffffffa;

        }

        *(short *)(param_3 + 0x408 + uVar6 * 2) = (short)aiStack_41c[iVar3];

        *(int *)(param_3 + 8 + uVar6 * 4) = local_82c[iVar3];

        uVar6 = (uint)*(byte *)(param_2 + 1 + iVar3);

        if (0x101 < uVar6) {

          return 0xfffffffa;

        }

        *(short *)(param_3 + 0x408 + uVar6 * 2) = (short)aiStack_41c[iVar3 + 1];

        *(int *)(param_3 + 8 + uVar6 * 4) = local_82c[iVar3 + 1];

        uVar6 = (uint)*(byte *)(param_2 + 2 + iVar3);

        if (0x101 < uVar6) {

          return 0xfffffffa;

        }

        iVar2 = iVar3 + 2;

        iVar4 = local_82c[iVar3 + 2];

        iVar3 = iVar3 + 3;

        *(short *)(param_3 + 0x408 + uVar6 * 2) = (short)aiStack_41c[iVar2];

        *(int *)(param_3 + 8 + uVar6 * 4) = iVar4;

      } while (iVar3 <= iVar5 + -4);

    }

    do {

      uVar6 = (uint)*(byte *)(param_2 + iVar3);

      if (0x101 < uVar6) {

        return 0xfffffffa;

      }

      *(short *)(param_3 + 0x408 + uVar6 * 2) = (short)aiStack_41c[iVar3];

      piVar1 = local_82c + iVar3;

      iVar3 = iVar3 + 1;

      *(int *)(param_3 + 8 + uVar6 * 4) = *piVar1;

    } while (iVar3 < iVar5);

  }

  return 0;

}





// --- FUN_0061a690 at 0x0061A690 (size: 1631) ---


undefined4

FUN_0061a690(int param_1,int param_2,undefined4 param_3,undefined4 param_4,undefined4 *param_5)



{

  int iVar1;

  int iVar2;

  byte bVar3;

  uint uVar4;

  uint uVar5;

  uint uVar6;

  undefined4 *puVar7;

  int aiStack_548 [258];

  byte local_140 [260];

  undefined4 local_3c;

  int local_38;

  int local_34;

  uint local_30;

  uint local_2c;

  int local_28;

  byte local_24;

  char local_20;

  uint local_1c;

  uint local_18;

  

  iVar1 = 1;

  *param_5 = param_3;

  param_5[1] = param_4;

  uVar4 = 0;

  local_3c = 0;

  do {

    uVar6 = (uint)*(byte *)(iVar1 + -1 + param_1);

    uVar5 = 1;

    if (uVar6 != 0) {

      bVar3 = (byte)iVar1;

      if (5 < uVar6 - 1) {

        do {

          local_140[uVar4] = bVar3;

          if (0x101 < uVar4 + 1) {

            return 0xfffffffa;

          }

          local_140[uVar4 + 1] = bVar3;

          if (0x101 < uVar4 + 2) {

            return 0xfffffffa;

          }

          local_140[uVar4 + 2] = bVar3;

          if (0x101 < uVar4 + 3) {

            return 0xfffffffa;

          }

          local_140[uVar4 + 3] = bVar3;

          if (0x101 < uVar4 + 4) {

            return 0xfffffffa;

          }

          local_140[uVar4 + 4] = bVar3;

          uVar4 = uVar4 + 5;

          if (0x101 < uVar4) {

            return 0xfffffffa;

          }

          uVar5 = uVar5 + 5;

        } while (uVar5 <= uVar6 - 6);

      }

      do {

        local_140[uVar4] = bVar3;

        uVar4 = uVar4 + 1;

        if (0x101 < uVar4) {

          return 0xfffffffa;

        }

        uVar5 = uVar5 + 1;

      } while (uVar5 <= uVar6);

    }

    iVar1 = iVar1 + 1;

  } while (iVar1 < 0x11);

  local_140[uVar4] = 0;

  iVar1 = 0;

  uVar5 = (uint)local_140[0];

  uVar4 = 0;

  if (local_140[0] != 0) {

    uVar6 = (uint)local_140[0];

    do {

      while (uVar6 == uVar5) {

        aiStack_548[uVar4 + 1] = iVar1;

        iVar1 = iVar1 + 1;

        if (0x101 < uVar4 + 1) {

          return 0xfffffffa;

        }

        uVar6 = (uint)local_140[uVar4 + 1];

        uVar4 = uVar4 + 1;

      }

      iVar1 = iVar1 * 2;

      uVar5 = uVar5 + 1;

    } while (uVar6 != 0);

  }

  local_18 = 1;

  *(undefined2 *)((int)param_5 + 0x64e) = 0;

  *(undefined2 *)(param_5 + 0x182) = 0;

  *(undefined2 *)((int)param_5 + 0x62a) = 0;

  *(undefined2 *)(param_5 + 0x194) = 0;

  *(undefined2 *)((int)param_5 + 0x60a) = 0;

  *(undefined2 *)(param_5 + 0x18b) = 0;

  *(undefined2 *)((int)param_5 + 0x652) = 0;

  *(undefined2 *)(param_5 + 0x183) = 0;

  *(undefined2 *)((int)param_5 + 0x62e) = 0;

  *(undefined2 *)(param_5 + 0x195) = 0;

  *(undefined2 *)((int)param_5 + 0x60e) = 0;

  *(undefined2 *)(param_5 + 0x18c) = 0;

  *(undefined2 *)((int)param_5 + 0x656) = 0;

  *(undefined2 *)(param_5 + 0x184) = 0;

  *(undefined2 *)((int)param_5 + 0x632) = 0;

  *(undefined2 *)(param_5 + 0x196) = 0;

  *(undefined2 *)((int)param_5 + 0x612) = 0;

  *(undefined2 *)(param_5 + 0x18d) = 0;

  *(undefined2 *)((int)param_5 + 0x65a) = 0;

  *(undefined2 *)(param_5 + 0x185) = 0;

  *(undefined2 *)((int)param_5 + 0x636) = 0;

  *(undefined2 *)(param_5 + 0x197) = 0;

  *(undefined2 *)((int)param_5 + 0x616) = 0;

  *(undefined2 *)(param_5 + 0x18e) = 0;

  *(undefined2 *)((int)param_5 + 0x65e) = 0;

  *(undefined2 *)(param_5 + 0x186) = 0;

  *(undefined2 *)((int)param_5 + 0x63a) = 0;

  *(undefined2 *)(param_5 + 0x198) = 0;

  *(undefined2 *)((int)param_5 + 0x61a) = 0;

  *(undefined2 *)(param_5 + 399) = 0;

  *(undefined2 *)((int)param_5 + 0x662) = 0;

  *(undefined2 *)(param_5 + 0x187) = 0;

  *(undefined2 *)((int)param_5 + 0x63e) = 0;

  *(undefined2 *)(param_5 + 0x199) = 0;

  *(undefined2 *)((int)param_5 + 0x61e) = 0;

  *(undefined2 *)(param_5 + 400) = 0;

  *(undefined2 *)((int)param_5 + 0x666) = 0;

  *(undefined2 *)(param_5 + 0x188) = 0;

  *(undefined2 *)((int)param_5 + 0x642) = 0;

  *(undefined2 *)(param_5 + 0x19a) = 0;

  *(undefined2 *)((int)param_5 + 0x622) = 0;

  *(undefined2 *)(param_5 + 0x191) = 0;

  *(undefined2 *)((int)param_5 + 0x66a) = 0;

  *(undefined2 *)(param_5 + 0x189) = 0;

  *(undefined2 *)((int)param_5 + 0x646) = 0;

  *(undefined2 *)(param_5 + 0x19b) = 0;

  *(undefined2 *)((int)param_5 + 0x626) = 0;

  *(undefined2 *)(param_5 + 0x192) = 0;

  *(undefined2 *)((int)param_5 + 0x66e) = 0;

  *(undefined2 *)(param_5 + 0x18a) = 0;

  *(undefined2 *)((int)param_5 + 0x64a) = 0;

  uVar4 = 0;

  do {

    uVar5 = (uint)*(byte *)(local_18 + -1 + param_1);

    if (uVar5 == 0) {

      *(undefined2 *)((int)param_5 + local_18 * 2 + 0x62a) = 0xffff;

    }

    else {

      *(short *)((int)param_5 + local_18 * 2 + 0x64e) = (short)uVar4;

      uVar5 = uVar5 + uVar4;

      *(short *)((int)param_5 + local_18 * 2 + 0x608) = (short)aiStack_548[uVar4 + 1];

      if (uVar4 < uVar5) {

        if (5 < uVar5 - uVar4) {

          do {

            *(ushort *)((int)param_5 + uVar4 * 2 + 0x408) = (ushort)*(byte *)(param_2 + uVar4);

            if (0x101 < uVar4 + 1) {

              return 0xfffffffa;

            }

            *(ushort *)((int)param_5 + uVar4 * 2 + 0x40a) = (ushort)*(byte *)(param_2 + 1 + uVar4);

            if (0x101 < uVar4 + 2) {

              return 0xfffffffa;

            }

            *(ushort *)((int)param_5 + uVar4 * 2 + 0x40c) = (ushort)*(byte *)(param_2 + 2 + uVar4);

            if (0x101 < uVar4 + 3) {

              return 0xfffffffa;

            }

            *(ushort *)((int)param_5 + uVar4 * 2 + 0x40e) = (ushort)*(byte *)(param_2 + 3 + uVar4);

            if (0x101 < uVar4 + 4) {

              return 0xfffffffa;

            }

            *(ushort *)((int)param_5 + uVar4 * 2 + 0x410) = (ushort)*(byte *)(param_2 + 4 + uVar4);

            uVar4 = uVar4 + 5;

            if (0x101 < uVar4) {

              return 0xfffffffa;

            }

          } while (uVar4 <= uVar5 - 6);

        }

        do {

          *(ushort *)((int)param_5 + uVar4 * 2 + 0x408) = (ushort)*(byte *)(param_2 + uVar4);

          uVar4 = uVar4 + 1;

          if (0x101 < uVar4) {

            return 0xfffffffa;

          }

        } while (uVar4 < uVar5);

      }

      *(short *)((int)param_5 + local_18 * 2 + 0x62a) = (short)aiStack_548[uVar4];

    }

    local_18 = local_18 + 1;

    if (0x10 < (int)local_18) {

      *(undefined2 *)(param_5 + 0x193) = 0xffff;

      puVar7 = param_5;

      do {

        puVar7[2] = 0;

        puVar7[3] = 0;

        puVar7[4] = 0;

        puVar7[5] = 0;

        puVar7 = puVar7 + 4;

      } while ((int)puVar7 < (int)(param_5 + 0x100));

      local_28 = 1;

      local_20 = -1;

      local_18 = 0;

      do {

        local_2c = (uint)*(byte *)(local_28 + -1 + param_1);

        local_30 = 1;

        if (local_2c != 0) {

          local_24 = local_20 + 8;

          local_34 = 1 << (local_24 & 0x1f);

          local_1c = local_28 << 0x10;

          do {

            if (0x101 < local_18) {

              return 0xfffffffa;

            }

            iVar1 = aiStack_548[local_18 + 1] << (local_24 & 0x1f);

            if (0 < local_34) {

              iVar2 = local_34;

              if (5 < local_34) {

                local_38 = local_18 + param_2;

                do {

                  iVar2 = iVar2 + -5;

                  param_5[iVar1 + 2] = *(byte *)(param_2 + local_18) | local_1c;

                  param_5[iVar1 + 3] = *(byte *)(param_2 + local_18) | local_1c;

                  param_5[iVar1 + 4] = *(byte *)(param_2 + local_18) | local_1c;

                  param_5[iVar1 + 5] = *(byte *)(param_2 + local_18) | local_1c;

                  param_5[iVar1 + 6] = *(byte *)(param_2 + local_18) | local_1c;

                  iVar1 = iVar1 + 5;

                } while (5 < iVar2);

              }

              do {

                iVar2 = iVar2 + -1;

                param_5[iVar1 + 2] = *(byte *)(local_18 + param_2) | local_1c;

                iVar1 = iVar1 + 1;

              } while (0 < iVar2);

            }

            local_18 = local_18 + 1;

            local_30 = local_30 + 1;

          } while (local_30 <= local_2c);

        }

        local_20 = local_20 + -1;

        local_28 = local_28 + 1;

      } while (local_28 < 9);

      return local_3c;

    }

  } while( true );

}





// --- FUN_0061ad00 at 0x0061AD00 (size: 494) ---


int FUN_0061ad00(int param_1)



{

  undefined4 uVar1;

  int iVar2;

  int iVar3;

  int iVar4;

  int iVar5;

  int local_18;

  int local_14;

  

  iVar5 = 0;

  for (iVar4 = 0; local_14 = 0, iVar4 < *(int *)(param_1 + 0x84); iVar4 = iVar4 + 1) {

    uVar1 = *(undefined4 *)(iVar5 + 0x9c + param_1);

    *(undefined4 *)(param_1 + 0x36e4 + iVar4 * 4) = uVar1;

    FUN_0061a3e0(*(undefined4 *)(param_1 + 0x70),*(undefined4 *)(param_1 + 0x371c + iVar4 * 8),uVar1

                );

    iVar2 = FUN_0064ad00(param_1 + 0x37e8,0,*(undefined1 *)(param_1 + 0x3720 + iVar4 * 8),

                         *(undefined4 *)(param_1 + 0x36e4 + iVar4 * 4));

    if (iVar2 != 0) {

      return iVar2;

    }

    if (*(int *)(param_1 + 0x14) == 0) {

      FUN_0061d330(*(undefined4 *)(param_1 + 0x36e4 + iVar4 * 4));

    }

    else {

      if (*(int *)(param_1 + 0x14) != 1) {

        return -8;

      }

      FUN_0061e740(*(undefined4 *)(param_1 + 0x36e4 + iVar4 * 4));

    }

    iVar5 = iVar5 + 0xb4;

  }

  if (((*(int *)(param_1 + 0x4de0) == 0) &&

      (local_14 = FUN_0064b160(param_1 + 0x37e8,param_1), local_14 == 0)) &&

     (0 < *(int *)(param_1 + 0x90) * 2)) {

    iVar4 = 0;

    iVar5 = param_1 + 0x364;

    iVar2 = param_1 + 0x1d24;

    local_18 = 0;

    do {

      *(int *)(param_1 + 0x3704 + (uint)*(byte *)(iVar4 + 0x3745 + param_1) * 4) = iVar2;

      *(int *)(param_1 + 0x36f4 + (uint)*(byte *)(iVar4 + 0x3751 + param_1) * 4) = iVar5;

      iVar3 = FUN_0061a4a0(*(undefined4 *)(iVar4 + 0x373c + param_1),

                           *(undefined4 *)(iVar4 + 0x3740 + param_1),

                           *(undefined4 *)

                            (param_1 + 0x3704 + (uint)*(byte *)(iVar4 + 0x3745 + param_1) * 4));

      if (iVar3 != 0) {

        return iVar3;

      }

      iVar3 = FUN_0061a4a0(*(undefined4 *)(iVar4 + 0x3748 + param_1),

                           *(undefined4 *)(iVar4 + 0x374c + param_1),

                           *(undefined4 *)

                            (param_1 + 0x36f4 + (uint)*(byte *)(iVar4 + 0x3751 + param_1) * 4));

      if (iVar3 != 0) {

        return iVar3;

      }

      iVar4 = iVar4 + 0x18;

      iVar5 = iVar5 + 0xce0;

      iVar2 = iVar2 + 0xce0;

      local_18 = local_18 + 2;

      local_14 = 0;

    } while (local_18 < *(int *)(param_1 + 0x90) * 2);

  }

  return local_14;

}





// --- FUN_0061af00 at 0x0061AF00 (size: 811) ---


int FUN_0061af00(int *param_1)



{

  int *piVar1;

  int iVar2;

  int iVar3;

  int *piVar4;

  int iVar5;

  int iVar6;

  int iVar7;

  int *piVar8;

  uint3 uVar9;

  int iStack_14;

  

  piVar1 = param_1 + 0xdfa;

  iVar2 = param_1[0xdfc];

  (**(code **)(iVar2 + 0x58))(piVar1,param_1[0x11],param_1[0x12]);

  piVar4 = piVar1;

  iVar3 = FUN_0064a8d0(piVar1);

  if (iVar3 == 0) {

    iVar6 = *param_1;

    if ((((iVar6 == 8) || (iVar6 == 9)) || (iVar6 == 10)) || (iVar6 == 0xb)) {

      iVar3 = param_1[0x16];

      uVar9 = (uint3)((uint)piVar4 >> 8);

      if ((iVar3 == 1) || (iVar3 == 5)) {

        iVar3 = FUN_0064bb00((uint)uVar9 << 8,param_1);

      }

      else if (iVar3 == 6) {

        iVar3 = FUN_0064bb00(CONCAT31(uVar9,2),param_1);

      }

      else {

        iVar3 = FUN_0064a510(param_1);

      }

      if (iVar3 != 0) {

        return iVar3;

      }

      iVar3 = FUN_0064a630(param_1);

      if (iVar3 != 0) {

        return iVar3;

      }

      iVar3 = FUN_0061ad00(param_1);

      if (iVar3 != 0) {

        return iVar3;

      }

      iVar6 = *param_1;

      iVar3 = 0;

    }

    if ((iVar6 == 0xc) || (iVar6 == 0xd)) {

      iVar6 = param_1[0x21];

      iVar7 = 0;

      for (iVar5 = 0; iVar5 < iVar6; iVar5 = iVar5 + 1) {

        if ((param_1[iVar5 + 0xdb9] == 0) && (param_1[iVar5 * 2 + 0xdc7] != 0)) {

          iVar6 = *(int *)(iVar7 + 0x9c + (int)param_1);

          param_1[iVar5 + 0xdb9] = iVar6;

          FUN_0061a3e0(param_1[0x1c],param_1[iVar5 * 2 + 0xdc7],iVar6);

          if (param_1[5] == 0) {

            FUN_0061d330(param_1[iVar5 + 0xdb9]);

            iVar6 = param_1[0x21];

          }

          else {

            if (param_1[5] != 1) {

              return -8;

            }

            FUN_0061e740(param_1[iVar5 + 0xdb9]);

            iVar6 = param_1[0x21];

          }

        }

        iVar7 = iVar7 + 0xb4;

      }

      if (0 < param_1[0x24] * 2) {

        iVar6 = 0;

        piVar4 = param_1 + 0xd9;

        piVar8 = param_1 + 0x749;

        iStack_14 = 0;

        do {

          param_1[*(byte *)(iVar6 + 0x3745 + (int)param_1) + 0xdc1] = (int)piVar8;

          param_1[*(byte *)(iVar6 + 0x3751 + (int)param_1) + 0xdbd] = (int)piVar4;

          iVar3 = FUN_0061a4a0(*(undefined4 *)(iVar6 + 0x373c + (int)param_1),

                               *(undefined4 *)(iVar6 + 0x3740 + (int)param_1),

                               param_1[*(byte *)(iVar6 + 0x3745 + (int)param_1) + 0xdc1]);

          if (iVar3 != 0) {

            return iVar3;

          }

          iVar3 = FUN_0061a4a0(*(undefined4 *)(iVar6 + 0x3748 + (int)param_1),

                               *(undefined4 *)(iVar6 + 0x374c + (int)param_1),

                               param_1[*(byte *)(iVar6 + 0x3751 + (int)param_1) + 0xdbd]);

          if (iVar3 != 0) {

            return iVar3;

          }

          iVar6 = iVar6 + 0x18;

          piVar4 = piVar4 + 0x338;

          piVar8 = piVar8 + 0x338;

          iStack_14 = iStack_14 + 2;

          iVar3 = 0;

        } while (iStack_14 < param_1[0x24] * 2);

      }

    }

    if (param_1[5] == 0) {

      *(undefined4 *)(iVar2 + 0x44) = *(undefined4 *)(iVar2 + 0x1c);

      *(undefined4 *)(iVar2 + 0x104) = *(undefined4 *)(iVar2 + 0xfc);

    }

    else if (param_1[5] == 1) {

      *(undefined4 *)(iVar2 + 0x44) = *(undefined4 *)(iVar2 + 0x20);

      *(undefined4 *)(iVar2 + 0x104) = *(undefined4 *)(iVar2 + 0x100);

    }

    else {

      *(undefined4 *)(iVar2 + 0x44) = *(undefined4 *)(iVar2 + 0x1c);

      *(undefined4 *)(iVar2 + 0x104) = *(undefined4 *)(iVar2 + 0xfc);

    }

    if ((((*param_1 != 0xb) && (*param_1 != 10)) || (iVar3 = FUN_0064a920(piVar1), iVar3 == 0)) &&

       (param_1[0xe09] != 0)) {

      iVar3 = FUN_006229a0(piVar1);

    }

  }

  return iVar3;

}





// --- FUN_0061b250 at 0x0061B250 (size: 944) ---


int FUN_0061b250(int param_1)



{

  int iVar1;

  int *piVar2;

  int iVar3;

  void *pvVar4;

  int iVar5;

  int *local_3c;

  int local_38;

  int local_34;

  int local_30;

  void *local_14;

  undefined *puStack_10;

  undefined *puStack_c;

  undefined4 local_8;

  

  puStack_c = &DAT_0090814c;

  puStack_10 = &DAT_005df82c;

  local_14 = ExceptionList;

  local_8 = 0;

  local_38 = 0;

  local_34 = param_1 + 0x37e8;

  local_3c = (int *)0x0;

  ExceptionList = &local_14;

  piVar2 = *(int **)(param_1 + 0x37e0);

  if (*(int **)(param_1 + 0x37e0) == (int *)0x0) {

    ExceptionList = &local_14;

    local_3c = (int *)FUN_005df0f5(0x38,&local_3c);

    if (local_3c == (int *)0x0) {

      local_38 = -5;

      goto LAB_0061b386;

    }

    iVar3 = *(int *)(param_1 + 0x54);

    *local_3c = iVar3;

    local_3c[1] = 0;

    local_3c[2] = 1;

    local_3c[3] = 0x3f;

    local_3c[4] = 0;

    local_3c[5] = 0;

    local_3c[6] = 0;

    local_3c[7] = 0;

    local_3c[8] = 0;

    local_3c[9] = 0;

    local_3c[10] = 0;

    local_3c[0xb] = 0;

    local_3c[0xc] = 0;

    iVar3 = FUN_005df0f5(iVar3 * 0x18,&local_3c);

    local_3c[0xd] = iVar3;

    if (iVar3 == 0) {

      local_38 = -5;

      goto LAB_0061b386;

    }

    iVar5 = 0;

    local_30 = 0;

    if (0 < *local_3c) {

      while( true ) {

        iVar1 = iVar5 * 0x18;

        *(int *)(iVar1 + iVar3) = iVar5;

        *(undefined4 *)(iVar1 + 4 + local_3c[0xd]) =

             *(undefined4 *)(iVar5 * 0x10 + 4 + *(int *)(param_1 + 0x37cc));

        *(undefined4 *)(iVar1 + 8 + local_3c[0xd]) =

             *(undefined4 *)(iVar5 * 0x10 + 8 + *(int *)(param_1 + 0x37cc));

        *(undefined4 *)(iVar1 + 0xc + local_3c[0xd]) = 0;

        *(undefined4 *)(iVar1 + 0x10 + local_3c[0xd]) = 0;

        *(undefined4 *)(iVar1 + 0x14 + local_3c[0xd]) = 0;

        iVar5 = iVar5 + 1;

        local_30 = iVar5;

        if (*local_3c <= iVar5) break;

        iVar3 = local_3c[0xd];

      }

    }

    local_38 = FUN_0064a970(local_34,param_1 + 0x37a4);

    if ((local_38 != 0) ||

       ((*(int *)(param_1 + 0x37d0) != 0 &&

        (local_38 = FUN_0064b9f0(*(int *)(param_1 + 0x37d0),local_34), local_38 != 0))))

    goto LAB_0061b386;

    local_38 = 0;

    local_38 = FUN_0064b680(local_34,*(undefined4 *)(param_1 + 0x54),param_1 + 0x37a0,

                            param_1 + 0x379c);

    if ((local_38 != 0) ||

       ((local_38 = FUN_006229a0(local_34,&local_3c), local_38 != 0 ||

        (local_38 = FUN_00622a70(param_1,&local_3c), piVar2 = local_3c, local_38 != 0))))

    goto LAB_0061b386;

  }

  local_3c = piVar2;

  local_38 = 0;

  if (*(int *)(param_1 + 0x37d0) == 0) {

    local_38 = FUN_0064bc00(param_1,local_34,local_3c,&local_3c);

  }

  else {

    local_38 = FUN_0064d230(param_1,local_34,local_3c,&local_3c);

  }

  if ((local_38 == 1) || (local_38 == 2)) {

    *(undefined4 *)(param_1 + 0x1c) = 0;

    *(int **)(param_1 + 0x37e0) = local_3c;

  }

  else if (local_38 == 0) {

    if (local_3c == (int *)0x0) {

      pvVar4 = *(void **)(param_1 + 0x37e0);

    }

    else {

      if ((void *)local_3c[0xd] != (void *)0x0) {

        operator_delete((void *)local_3c[0xd]);

        local_3c[0xd] = 0;

      }

      operator_delete(local_3c);

      local_3c = (int *)0x0;

      pvVar4 = (void *)0x0;

      *(undefined4 *)(param_1 + 0x37e0) = 0;

    }

    if (pvVar4 != (void *)0x0) {

      if (*(void **)((int)pvVar4 + 0x34) != (void *)0x0) {

        operator_delete(*(void **)((int)pvVar4 + 0x34));

        *(undefined4 *)(*(int *)(param_1 + 0x37e0) + 0x34) = 0;

        pvVar4 = *(void **)(param_1 + 0x37e0);

      }

      operator_delete(pvVar4);

      *(undefined4 *)(param_1 + 0x37e0) = 0;

    }

    local_38 = FUN_0064a920(local_34,&local_3c);

    if (local_38 == 0) {

      local_38 = FUN_006229a0(local_34,&local_3c);

      local_8 = 0xffffffff;

    }

  }

LAB_0061b386:

  if ((local_38 < 0) && (local_3c != (int *)0x0)) {

    if (local_3c[0xd] != 0) {

      operator_delete((void *)local_3c[0xd]);

      local_3c[0xd] = 0;

    }

    operator_delete(local_3c);

    *(undefined4 *)(param_1 + 0x37e0) = 0;

  }

  ExceptionList = local_14;

  return local_38;

}





// --- FUN_0061b620 at 0x0061B620 (size: 95) ---


void FUN_0061b620(int param_1,undefined4 *param_2,int param_3,undefined4 param_4,undefined4 param_5,

                 undefined4 param_6,undefined4 param_7)



{

  *param_2 = 1;

  *(int *)param_2[0xd] = param_3;

  *(undefined4 *)(param_2[0xd] + 4) =

       *(undefined4 *)(param_3 * 0x10 + 4 + *(int *)(param_1 + 0x37cc));

  *(undefined4 *)(param_2[0xd] + 8) =

       *(undefined4 *)(param_3 * 0x10 + 8 + *(int *)(param_1 + 0x37cc));

  param_2[2] = param_4;

  param_2[3] = param_5;

  param_2[4] = param_6;

  param_2[5] = param_7;

  return;

}





// --- FUN_0061b680 at 0x0061B680 (size: 368) ---


void FUN_0061b680(int param_1,int *param_2,int param_3,int param_4,int param_5)



{

  int iVar1;

  int iVar2;

  int iVar3;

  int iVar4;

  int local_1c;

  int local_18;

  

  if (param_3 < 5) {

    iVar2 = 0;

    if (0 < param_3) {

      if (3 < param_3) {

        iVar4 = 0;

        iVar3 = 0;

        local_1c = 2;

        local_18 = 1;

        do {

          *(int *)(iVar4 + param_2[0xd]) = iVar2;

          *(undefined4 *)(iVar4 + 4 + param_2[0xd]) =

               *(undefined4 *)(iVar3 + 4 + *(int *)(param_1 + 0x37cc));

          iVar2 = iVar2 + 3;

          *(undefined4 *)(iVar4 + 8 + param_2[0xd]) =

               *(undefined4 *)(iVar3 + 8 + *(int *)(param_1 + 0x37cc));

          *(int *)(iVar4 + 0x18 + param_2[0xd]) = local_18;

          *(undefined4 *)(iVar4 + 0x1c + param_2[0xd]) =

               *(undefined4 *)(iVar3 + 0x14 + *(int *)(param_1 + 0x37cc));

          *(undefined4 *)(iVar4 + 0x20 + param_2[0xd]) =

               *(undefined4 *)(iVar3 + 0x18 + *(int *)(param_1 + 0x37cc));

          *(int *)(iVar4 + 0x30 + param_2[0xd]) = local_1c;

          *(undefined4 *)(iVar4 + 0x34 + param_2[0xd]) =

               *(undefined4 *)(iVar3 + 0x24 + *(int *)(param_1 + 0x37cc));

          *(undefined4 *)(iVar4 + 0x38 + param_2[0xd]) =

               *(undefined4 *)(iVar3 + 0x28 + *(int *)(param_1 + 0x37cc));

          iVar4 = iVar4 + 0x48;

          iVar3 = iVar3 + 0x30;

          local_18 = local_18 + 3;

          local_1c = local_1c + 3;

        } while (iVar2 <= param_3 + -4);

      }

      iVar4 = iVar2 * 0x18;

      iVar3 = iVar2 << 4;

      do {

        *(int *)(iVar4 + param_2[0xd]) = iVar2;

        *(undefined4 *)(iVar4 + 4 + param_2[0xd]) =

             *(undefined4 *)(iVar3 + 4 + *(int *)(param_1 + 0x37cc));

        iVar1 = iVar3 + 8;

        iVar3 = iVar3 + 0x10;

        iVar2 = iVar2 + 1;

        *(undefined4 *)(iVar4 + 8 + param_2[0xd]) =

             *(undefined4 *)(iVar1 + *(int *)(param_1 + 0x37cc));

        iVar4 = iVar4 + 0x18;

      } while (iVar2 < param_3);

    }

    *param_2 = param_3;

    param_2[2] = 0;

    param_2[3] = 0;

    param_2[4] = param_4;

    param_2[5] = param_5;

  }

  return;

}





// --- FUN_0061b7f0 at 0x0061B7F0 (size: 232) ---


undefined4 FUN_0061b7f0(int param_1,undefined4 *param_2)



{

  int iVar1;

  undefined4 uVar2;

  

  uVar2 = 0;

  iVar1 = *(int *)(param_1 + 0x54);

  if (iVar1 == 1) {

    if (*(int *)(param_1 + 0x58) == 4) {

      *param_2 = 6;

      return uVar2;

    }

    *param_2 = 0;

    return 0xfffffff8;

  }

  if (iVar1 == 2) {

    if (*(int *)(param_1 + 0x58) == 0xff) {

      *param_2 = 5;

      return uVar2;

    }

    *param_2 = 0;

    return 0xfffffff8;

  }

  if (iVar1 == 3) {

    iVar1 = *(int *)(param_1 + 0x58);

    if (iVar1 == 1) {

      *param_2 = 8;

      return uVar2;

    }

    if (iVar1 == 3) {

      *param_2 = 10;

      return uVar2;

    }

    if (iVar1 == 0xff) {

      *param_2 = 8;

      return uVar2;

    }

    *param_2 = 0;

    return 0xfffffff8;

  }

  if (iVar1 != 4) {

    *param_2 = 0;

    return 0xfffffff8;

  }

  iVar1 = *(int *)(param_1 + 0x58);

  if (iVar1 == 5) {

    *param_2 = 10;

    return uVar2;

  }

  if (iVar1 == 6) {

    *param_2 = 0xb;

    return uVar2;

  }

  if (iVar1 == 0xff) {

    *param_2 = 10;

    return uVar2;

  }

  *param_2 = 0;

  return 0xfffffff8;

}





// --- FUN_0061b8e0 at 0x0061B8E0 (size: 145) ---


undefined4 FUN_0061b8e0(int param_1,int param_2)



{

  int iVar1;

  undefined4 uVar2;

  int iVar3;

  undefined4 uStack_18;

  

  uStack_18 = 0;

  iVar1 = FUN_005df0f5(param_2 * 0x38);

  *(int *)(param_1 + 0x37e0) = iVar1;

  if (iVar1 == 0) {

    uStack_18 = 0xfffffffb;

  }

  else {

    (*DAT_008f85a4)(iVar1,param_2 * 0x38);

    if (0 < param_2) {

      iVar1 = 0;

      uStack_18 = 0;

      iVar3 = 0;

      do {

        uVar2 = FUN_005df0f5(0x60);

        *(undefined4 *)(iVar1 + 0x34 + *(int *)(param_1 + 0x37e0)) = uVar2;

        if (*(int *)(iVar1 + 0x34 + *(int *)(param_1 + 0x37e0)) == 0) {

          return 0xfffffffb;

        }

        iVar1 = iVar1 + 0x38;

        iVar3 = iVar3 + 1;

      } while (iVar3 < param_2);

    }

  }

  return uStack_18;

}





// --- FUN_0061b980 at 0x0061B980 (size: 4007) ---


int FUN_0061b980(int param_1,int *param_2)



{

  int iVar1;

  int iVar2;

  int iVar3;

  

  iVar1 = FUN_0061b7f0(param_1,param_2);

  if ((iVar1 == 0) && (iVar1 = FUN_0061b8e0(param_1,*param_2), iVar1 == 0)) {

    iVar1 = *(int *)(param_1 + 0x54);

    if ((iVar1 == 1) && (*(int *)(param_1 + 0x58) == 4)) {

      FUN_0061b680(param_1,*(undefined4 *)(param_1 + 0x37e0),1,0,1);

      FUN_0061b620(param_1,*(int *)(param_1 + 0x37e0) + 0x38,0,1,5,0,2);

      FUN_0061b620(param_1,*(int *)(param_1 + 0x37e0) + 0x70,0,6,0x3f,0,2);

      FUN_0061b620(param_1,*(int *)(param_1 + 0x37e0) + 0xa8,0,1,0x3f,2,1);

      FUN_0061b680(param_1,*(int *)(param_1 + 0x37e0) + 0xe0,1,1,0);

      FUN_0061b620(param_1,*(int *)(param_1 + 0x37e0) + 0x118,0,1,0x3f,1,0);

      return 0;

    }

    if ((iVar1 == 2) && (*(int *)(param_1 + 0x58) == 0xff)) {

      FUN_0061b680(param_1,*(undefined4 *)(param_1 + 0x37e0),2,0,0);

      FUN_0061b620(param_1,*(int *)(param_1 + 0x37e0) + 0x38,0,1,5,0,0);

      FUN_0061b620(param_1,*(int *)(param_1 + 0x37e0) + 0x70,1,1,5,0,0);

      FUN_0061b620(param_1,*(int *)(param_1 + 0x37e0) + 0xa8,0,6,0x3f,0,0);

      FUN_0061b620(param_1,*(int *)(param_1 + 0x37e0) + 0xe0,1,6,0x3f,0,0);

      return 0;

    }

    if ((iVar1 == 3) && (*(int *)(param_1 + 0x58) == 3)) {

      FUN_0061b680(param_1,*(undefined4 *)(param_1 + 0x37e0),3,0,1);

      FUN_0061b620(param_1,*(int *)(param_1 + 0x37e0) + 0x38,0,1,5,0,2);

      FUN_0061b620(param_1,*(int *)(param_1 + 0x37e0) + 0x70,2,1,0x3f,0,1);

      FUN_0061b620(param_1,*(int *)(param_1 + 0x37e0) + 0xa8,1,1,0x3f,0,1);

      FUN_0061b620(param_1,*(int *)(param_1 + 0x37e0) + 0xe0,0,6,0x3f,0,2);

      FUN_0061b620(param_1,*(int *)(param_1 + 0x37e0) + 0x118,0,1,0x3f,2,1);

      FUN_0061b680(param_1,*(int *)(param_1 + 0x37e0) + 0x150,3,1,0);

      FUN_0061b620(param_1,*(int *)(param_1 + 0x37e0) + 0x188,2,1,0x3f,1,0);

      FUN_0061b620(param_1,*(int *)(param_1 + 0x37e0) + 0x1c0,1,1,0x3f,1,0);

      FUN_0061b620(param_1,*(int *)(param_1 + 0x37e0) + 0x1f8,0,1,0x3f,1,0);

      return 0;

    }

    if ((iVar1 == 3) && (*(int *)(param_1 + 0x58) == 1)) {

      FUN_0061b680(param_1,*(undefined4 *)(param_1 + 0x37e0),3,0,1);

      FUN_0061b620(param_1,*(int *)(param_1 + 0x37e0) + 0x38,0,1,5,0,0);

      FUN_0061b620(param_1,*(int *)(param_1 + 0x37e0) + 0x70,1,1,5,0,0);

      FUN_0061b620(param_1,*(int *)(param_1 + 0x37e0) + 0xa8,2,1,5,0,0);

      FUN_0061b680(param_1,*(int *)(param_1 + 0x37e0) + 0xe0,3,1,0);

      FUN_0061b620(param_1,*(int *)(param_1 + 0x37e0) + 0x118,0,6,0x3f,0,0);

      FUN_0061b620(param_1,*(int *)(param_1 + 0x37e0) + 0x150,1,6,0x3f,0,0);

      FUN_0061b620(param_1,*(int *)(param_1 + 0x37e0) + 0x188,2,6,0x3f,0,0);

      return 0;

    }

    if ((iVar1 == 3) && (*(int *)(param_1 + 0x58) == 0xff)) {

      FUN_0061b680(param_1,*(undefined4 *)(param_1 + 0x37e0),3,0,1);

      FUN_0061b620(param_1,*(int *)(param_1 + 0x37e0) + 0x38,0,1,5,0,0);

      FUN_0061b620(param_1,*(int *)(param_1 + 0x37e0) + 0x70,1,1,5,0,0);

      FUN_0061b620(param_1,*(int *)(param_1 + 0x37e0) + 0xa8,2,1,5,0,0);

      FUN_0061b680(param_1,*(int *)(param_1 + 0x37e0) + 0xe0,3,1,0);

      FUN_0061b620(param_1,*(int *)(param_1 + 0x37e0) + 0x118,0,6,0x3f,0,0);

      FUN_0061b620(param_1,*(int *)(param_1 + 0x37e0) + 0x150,1,6,0x3f,0,0);

      FUN_0061b620(param_1,*(int *)(param_1 + 0x37e0) + 0x188,2,6,0x3f,0,0);

      return 0;

    }

    if ((iVar1 == 4) && (*(int *)(param_1 + 0x58) == 5)) {

      FUN_0061b680(param_1,*(undefined4 *)(param_1 + 0x37e0),4,0,1);

      FUN_0061b620(param_1,*(int *)(param_1 + 0x37e0) + 0x38,0,1,5,0,0);

      FUN_0061b620(param_1,*(int *)(param_1 + 0x37e0) + 0x70,1,1,5,0,0);

      FUN_0061b620(param_1,*(int *)(param_1 + 0x37e0) + 0xa8,2,1,5,0,0);

      FUN_0061b620(param_1,*(int *)(param_1 + 0x37e0) + 0xe0,3,1,5,0,0);

      FUN_0061b680(param_1,*(int *)(param_1 + 0x37e0) + 0x118,4,1,0);

      FUN_0061b620(param_1,*(int *)(param_1 + 0x37e0) + 0x150,0,6,0x3f,0,0);

      FUN_0061b620(param_1,*(int *)(param_1 + 0x37e0) + 0x188,1,6,0x3f,0,0);

      FUN_0061b620(param_1,*(int *)(param_1 + 0x37e0) + 0x1c0,2,6,0x3f,0,0);

      FUN_0061b620(param_1,*(int *)(param_1 + 0x37e0) + 0x1f8,3,6,0x3f,0,0);

      return 0;

    }

    if ((iVar1 == 4) && (*(int *)(param_1 + 0x58) == 6)) {

      FUN_0061b680(param_1,*(undefined4 *)(param_1 + 0x37e0),4,0,1);

      FUN_0061b620(param_1,*(int *)(param_1 + 0x37e0) + 0x38,0,1,5,0,2);

      FUN_0061b620(param_1,*(int *)(param_1 + 0x37e0) + 0x70,2,1,0x3f,0,1);

      FUN_0061b620(param_1,*(int *)(param_1 + 0x37e0) + 0xa8,1,1,0x3f,0,1);

      FUN_0061b620(param_1,*(int *)(param_1 + 0x37e0) + 0xe0,3,1,0x3f,0,0);

      FUN_0061b620(param_1,*(int *)(param_1 + 0x37e0) + 0x118,0,6,0x3f,0,2);

      FUN_0061b620(param_1,*(int *)(param_1 + 0x37e0) + 0x150,0,1,0x3f,2,1);

      FUN_0061b680(param_1,*(int *)(param_1 + 0x37e0) + 0x188,4,1,0);

      FUN_0061b620(param_1,*(int *)(param_1 + 0x37e0) + 0x1c0,2,1,0x3f,1,0);

      FUN_0061b620(param_1,*(int *)(param_1 + 0x37e0) + 0x1f8,1,1,0x3f,1,0);

      FUN_0061b620(param_1,*(int *)(param_1 + 0x37e0) + 0x230,0,1,0x3f,1,0);

      return 0;

    }

    if ((iVar1 == 4) && (*(int *)(param_1 + 0x58) == 0xff)) {

      FUN_0061b680(param_1,*(undefined4 *)(param_1 + 0x37e0),4,0,1);

      FUN_0061b620(param_1,*(int *)(param_1 + 0x37e0) + 0x38,0,1,5,0,0);

      FUN_0061b620(param_1,*(int *)(param_1 + 0x37e0) + 0x70,1,1,5,0,0);

      FUN_0061b620(param_1,*(int *)(param_1 + 0x37e0) + 0xa8,2,1,5,0,0);

      FUN_0061b620(param_1,*(int *)(param_1 + 0x37e0) + 0xe0,3,1,5,0,0);

      FUN_0061b680(param_1,*(int *)(param_1 + 0x37e0) + 0x118,4,1,0);

      FUN_0061b620(param_1,*(int *)(param_1 + 0x37e0) + 0x150,0,6,0x3f,0,0);

      FUN_0061b620(param_1,*(int *)(param_1 + 0x37e0) + 0x188,1,6,0x3f,0,0);

      FUN_0061b620(param_1,*(int *)(param_1 + 0x37e0) + 0x1c0,2,6,0x3f,0,0);

      FUN_0061b620(param_1,*(int *)(param_1 + 0x37e0) + 0x1f8,3,6,0x3f,0,0);

      return 0;

    }

    iVar1 = -8;

  }

  if (0 < *param_2) {

    iVar2 = 0;

    iVar3 = 0;

    do {

      operator_delete(*(void **)(iVar2 + 0x34 + *(int *)(param_1 + 0x37e0)));

      iVar2 = iVar2 + 0x38;

      iVar3 = iVar3 + 1;

    } while (iVar3 < *param_2);

  }

  operator_delete(*(void **)(param_1 + 0x37e0));

  *(undefined4 *)(param_1 + 0x37e0) = 0;

  return iVar1;

}





// --- FUN_0061c930 at 0x0061C930 (size: 2510) ---


int FUN_0061c930(int *param_1)



{

  int iVar1;

  int iVar2;

  int iVar3;

  int iVar4;

  int iVar5;

  undefined1 local_9b4 [1028];

  undefined1 local_5b0 [1028];

  int local_1ac;

  int local_1a8;

  int local_1a4;

  int *local_1a0;

  int local_19c;

  int local_198;

  int local_194;

  int local_190;

  int local_18c;

  int local_188;

  int local_184;

  int local_180;

  int local_17c;

  int local_178;

  int local_174;

  int local_170;

  int local_16c;

  int local_168;

  int local_164;

  int local_160;

  int local_15c;

  undefined1 local_158 [16];

  undefined1 local_148 [256];

  undefined4 local_48;

  int local_38;

  int local_34;

  int local_30;

  int local_2c;

  int local_24;

  void *local_14;

  undefined *puStack_10;

  undefined *puStack_c;

  undefined4 local_8;

  

  puStack_c = &DAT_00908164;

  puStack_10 = &DAT_005df82c;

  local_14 = ExceptionList;

  local_1ac = 0;

  local_1a8 = 0;

  local_1a4 = 0;

  local_1a0 = param_1 + 0xdfa;

  local_19c = 0;

  local_8 = 0;

  iVar1 = 0;

  local_198 = 0;

  iVar2 = 0;

  local_194 = 0;

  if (0 < param_1[0xdf0]) {

    do {

      iVar2 = iVar2 + *(int *)(iVar1 * 0x10 + 4 + param_1[0xdf3]) *

                      *(int *)(iVar1 * 0x10 + 8 + param_1[0xdf3]);

      iVar1 = iVar1 + 1;

      local_198 = iVar1;

      local_194 = iVar2;

    } while (iVar1 < param_1[0xdf0]);

  }

  local_190 = param_1[0x1e] * param_1[0x1f];

  local_18c = local_194 * 0x40;

  local_188 = local_18c * local_190;

  ExceptionList = &local_14;

  iVar1 = FUN_005df0f5(local_188 * 2,local_9b4);

  param_1[0x1379] = iVar1;

  if (iVar1 == 0) {

    local_19c = -5;

    goto LAB_0061cddb;

  }

  if (param_1[0xdf8] == 0) {

    local_19c = FUN_0061b980(param_1,&local_1ac);

    if (local_19c != 0) {

      ExceptionList = local_14;

      return local_19c;

    }

    if (((*param_1 != 9) && (*param_1 != 8)) &&

       (local_19c = FUN_0064a8d0(local_1a0,local_9b4), local_19c != 0)) goto LAB_0061cddb;

    local_19c = 0;

    local_19c = FUN_0064ab60(local_1a0,param_1 + 0xde9);

    if ((local_19c != 0) ||

       ((param_1[0xdf4] != 0 && (local_19c = FUN_0064b9f0(param_1[0xdf4],local_1a0), local_19c != 0)

        ))) goto LAB_0061cddb;

    local_19c = 0;

    local_19c = FUN_00622a70(param_1,local_9b4);

    if (local_19c != 0) goto LAB_0061cddb;

    if (((int *)param_1[0x1377] == (int *)0x0) || (*(int *)param_1[0x1377] != 0)) {

      local_19c = FUN_0064c1a0(param_1,local_9b4);

      if (local_19c != 0) goto LAB_0061cddb;

      local_19c = 0;

    }

    else {

      local_18c = 0;

      iVar2 = 0;

      local_180 = 0;

      iVar1 = param_1[0xdf0];

      if (0 < iVar1) {

        do {

          local_18c = local_18c +

                      *(int *)(iVar2 * 0x10 + 8 + param_1[0xdf3]) *

                      *(int *)(iVar2 * 0x10 + 4 + param_1[0xdf3]);

          iVar2 = iVar2 + 1;

          local_180 = iVar2;

        } while (iVar2 < iVar1);

      }

      local_18c = local_18c * 0x40;

      iVar2 = param_1[0x1e];

      local_184 = local_18c * iVar2;

      local_38 = 0;

      local_17c = 0;

      iVar4 = param_1[0x1f];

      local_19c = 0;

      if (0 < iVar4) {

        do {

          local_34 = 0;

          local_178 = 0;

          local_17c = local_38;

          if (0 < iVar2) {

            do {

              iVar4 = local_38 * 2 * local_184 + param_1[0x1379] + local_34 * 2 * local_18c;

              local_174 = 0;

              local_1a8 = iVar4;

              if (0 < iVar1) {

                local_24 = param_1[0xdf3];

                local_178 = local_34;

                do {

                  local_2c = 0;

                  iVar5 = *(int *)(local_174 * 0x10 + 8 + local_24);

                  iVar3 = local_174;

                  if (0 < iVar5) {

                    iVar1 = *(int *)(local_174 * 0x10 + 4 + local_24);

                    do {

                      local_30 = 0;

                      if (0 < iVar1) {

                        do {

                          local_168 = iVar5 * local_38 * 0x80 * iVar2 * iVar1 +

                                      *(int *)(param_1[0x1377] + 4 + iVar3 * 4) +

                                      iVar2 * local_2c * 0x80 * iVar1 + iVar1 * local_34 * 0x10 +

                                      local_30 * 0x10;

                          local_164 = 0;

                          local_170 = local_2c;

                          local_16c = local_30;

                          local_160 = iVar4;

                          do {

                            (*DAT_008f85a8)(iVar4,local_168,0x10,local_9b4);

                            local_164 = local_164 + 1;

                            iVar2 = param_1[0x1e];

                            local_24 = param_1[0xdf3];

                            iVar1 = *(int *)(local_174 * 0x10 + 4 + local_24);

                            local_168 = iVar2 * 0x10 * iVar1 + local_168;

                            iVar4 = local_1a8 + 0x10;

                            local_1a8 = iVar4;

                          } while (local_164 < 8);

                          local_38 = local_17c;

                          local_34 = local_178;

                          iVar5 = *(int *)(local_174 * 0x10 + 8 + local_24);

                          local_2c = local_170;

                          local_30 = local_16c + 1;

                          iVar3 = local_174;

                        } while (local_30 < iVar1);

                      }

                      local_2c = local_2c + 1;

                    } while (local_2c < iVar5);

                    iVar1 = param_1[0xdf0];

                    local_16c = local_30;

                  }

                  local_174 = iVar3 + 1;

                  local_170 = local_2c;

                } while (local_174 < iVar1);

              }

              local_178 = local_34 + 1;

              local_34 = local_178;

            } while (local_178 < iVar2);

            iVar4 = param_1[0x1f];

          }

          local_17c = local_38 + 1;

          local_38 = local_17c;

        } while (local_17c < iVar4);

      }

    }

  }

  local_198 = 0;

  local_15c = 0;

  if (0 < local_1ac) {

    do {

      local_1a4 = local_198 * 0x38 + param_1[0xdf8];

      (*DAT_008f85a4)(local_9b4,0x404);

      (*DAT_008f85a4)(local_5b0,0x404);

      (*DAT_008f85a4)(local_158,0x10);

      (*DAT_008f85a4)(local_148,0x100);

      local_19c = FUN_0064c500(param_1,local_1a0,local_1a4,local_9b4);

      if (local_19c != 0) goto LAB_0061cddb;

      if ((*(int *)(local_1a4 + 8) == 0) && (*(int *)(local_1a4 + 0xc) == 0)) {

        if (*(int *)(local_1a4 + 0x10) == 0) {

          *(undefined4 *)(local_1a4 + 0x24) = 0;

          *(undefined4 *)(local_1a4 + 0x28) = 0;

          *(undefined4 *)(local_1a4 + 0x2c) = 0;

          *(undefined4 *)(local_1a4 + 0x30) = 0;

          local_48 = 0;

          FUN_0061eef0(local_9b4,local_158,local_148,local_9b4);

          local_19c = FUN_0061a4a0(local_158,local_148,param_1 + 0x749,local_9b4);

          if (local_19c != 0) goto LAB_0061cddb;

          param_1[0xdc1] = (int)(param_1 + 0x749);

          local_19c = FUN_0064ae70(local_1a0,local_158,local_148,0,0,local_9b4);

          if (local_19c != 0) goto LAB_0061cddb;

          if (param_1[0x15] != 1) {

            (*DAT_008f85a4)(local_158,0x10);

            (*DAT_008f85a4)(local_148,0x100);

            local_48 = 1;

            FUN_0061eef0(local_5b0,local_158,local_148,local_9b4);

            local_19c = FUN_0061a4a0(local_158,local_148,param_1 + 0x8e5,local_9b4);

            if (local_19c == 0) {

              param_1[0xdc2] = (int)(param_1 + 0x8e5);

              local_19c = FUN_0064ae70(local_1a0,local_158,local_148,0,1,local_9b4);

              goto joined_r0x0061cda8;

            }

            goto LAB_0061cddb;

          }

        }

      }

      else {

        if (**(int **)(local_1a4 + 0x34) == 0) {

          local_48 = 0;

          FUN_0061eef0(local_9b4,local_158,local_148,local_9b4);

          local_19c = FUN_0061a4a0(local_158,local_148,param_1 + 0xd9,local_9b4);

          if (local_19c != 0) goto LAB_0061cddb;

          param_1[0xdbd] = (int)(param_1 + 0xd9);

          local_19c = FUN_0064ae70(local_1a0,local_158,local_148,1,0,local_9b4);

        }

        else {

          local_48 = 1;

          FUN_0061eef0(local_5b0,local_158,local_148,local_9b4);

          local_19c = FUN_0061a4a0(local_158,local_148,param_1 + 0x275,local_9b4);

          if (local_19c != 0) goto LAB_0061cddb;

          param_1[0xdbe] = (int)(param_1 + 0x275);

          local_19c = FUN_0064ae70(local_1a0,local_158,local_148,1,1,local_9b4);

        }

joined_r0x0061cda8:

        if (local_19c != 0) goto LAB_0061cddb;

      }

      local_19c = 0;

      local_19c = FUN_0064b8a0(local_1a0,local_1a4,param_1 + 0xde8,param_1 + 0xde7);

      if ((local_19c != 0) ||

         (local_19c = FUN_0064cae0(param_1,local_1a0,local_1a4,local_9b4), local_19c < 0))

      goto LAB_0061cddb;

      local_15c = local_15c + 1;

      local_198 = local_198 + 1;

    } while (local_198 < local_1ac);

  }

  local_19c = FUN_0064a920(local_1a0,local_9b4);

  if ((local_19c == 0) && (local_19c = FUN_006229a0(local_1a0,local_9b4), local_19c == 0)) {

    local_8 = 0xffffffff;

  }

LAB_0061cddb:

  if (param_1[0xdf8] != 0) {

    local_198 = 0;

    if (0 < local_1ac) {

      do {

        operator_delete(*(void **)(local_198 * 0x38 + 0x34 + param_1[0xdf8]));

        iVar1 = local_198 * 0x38;

        local_198 = local_198 + 1;

        *(undefined4 *)(iVar1 + 0x34 + param_1[0xdf8]) = 0;

      } while (local_198 < local_1ac);

    }

    operator_delete((void *)param_1[0xdf8]);

    param_1[0xdf8] = 0;

  }

  ExceptionList = local_14;

  return local_19c;

}





// --- FUN_0061d320 at 0x0061D320 (size: 6) ---


undefined * FUN_0061d320(void)



{

  return &DAT_008332e0;

}





// --- FUN_0061d330 at 0x0061D330 (size: 192) ---


void FUN_0061d330(int param_1)



{

  int iVar1;

  int iVar2;

  int iVar3;

  undefined2 local_8c [66];

  

  if (*(short *)(param_1 + 0x7e) < 2) {

    *(undefined2 *)(param_1 + 0x7e) = 2;

  }

  iVar1 = 0;

  do {

    iVar2 = (int)*(short *)(param_1 + iVar1 * 2);

    iVar3 = (int)*(short *)(param_1 + 2 + iVar1 * 2);

    local_8c[iVar1] = (short)(((iVar2 >> 1) + (&DAT_00908220)[iVar1]) / iVar2);

    local_8c[iVar1 + 1] = (short)(((iVar3 >> 1) + (&DAT_00908224)[iVar1]) / iVar3);

    iVar1 = iVar1 + 2;

  } while (iVar1 < 0x40);

  iVar1 = 0;

  do {

    *(undefined2 *)(param_1 + (&DAT_00907ee0)[iVar1] * 2) = local_8c[iVar1];

    *(undefined2 *)(param_1 + (&DAT_00907ee4)[iVar1] * 2) = local_8c[iVar1 + 1];

    *(undefined2 *)(param_1 + (&DAT_00907ee8)[iVar1] * 2) = local_8c[iVar1 + 2];

    *(undefined2 *)(param_1 + (&DAT_00907eec)[iVar1] * 2) = local_8c[iVar1 + 3];

    iVar1 = iVar1 + 4;

  } while (iVar1 < 0x40);

  return;

}





// --- FUN_0061d7d0 at 0x0061D7D0 (size: 736) ---


/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */



void FUN_0061d7d0(int param_1)



{

  int *piVar1;

  double dVar2;

  int iVar3;

  uint uVar4;

  short sVar5;

  short local_c0 [64];

  uint local_40;

  uint local_28;

  uint uStack_24;

  

  iVar3 = 0;

  do {

    dVar2 = (double)(int)*(short *)(param_1 + iVar3 * 2) * (double)(&DAT_00908340)[iVar3] *

            _DAT_00908548 * _DAT_00908540 + _DAT_00908550;

    local_28 = SUB84(dVar2,0);

    uStack_24 = (uint)((ulonglong)dVar2 >> 0x20);

    uVar4 = uStack_24 >> 0x14 & 0x7ff;

    if (uVar4 < 0x3ff) {

      sVar5 = 0;

    }

    else {

      sVar5 = (short)((uStack_24 << 0xb | local_28 >> 0x15 | 0x80000000) >>

                     (0x1eU - (char)uVar4 & 0x1f));

      if ((longlong)dVar2 < 0) {

        sVar5 = -sVar5;

      }

    }

    local_c0[(&DAT_00907ee0)[iVar3]] = sVar5;

    dVar2 = (double)(int)*(short *)(param_1 + 2 + iVar3 * 2) * (double)(&DAT_00908348)[iVar3] *

            _DAT_00908548 * _DAT_00908540 + _DAT_00908550;

    local_28 = SUB84(dVar2,0);

    uStack_24 = (uint)((ulonglong)dVar2 >> 0x20);

    uVar4 = uStack_24 >> 0x14 & 0x7ff;

    if (uVar4 < 0x3ff) {

      sVar5 = 0;

    }

    else {

      sVar5 = (short)((uStack_24 << 0xb | local_28 >> 0x15 | 0x80000000) >>

                     (0x1eU - (char)uVar4 & 0x1f));

      if ((longlong)dVar2 < 0) {

        sVar5 = -sVar5;

      }

    }

    local_c0[(&DAT_00907ee4)[iVar3]] = sVar5;

    dVar2 = (double)(int)*(short *)(param_1 + 4 + iVar3 * 2) * (double)(&DAT_00908350)[iVar3] *

            _DAT_00908548 * _DAT_00908540 + _DAT_00908550;

    local_28 = SUB84(dVar2,0);

    uStack_24 = (uint)((ulonglong)dVar2 >> 0x20);

    uVar4 = uStack_24 >> 0x14 & 0x7ff;

    if (uVar4 < 0x3ff) {

      sVar5 = 0;

    }

    else {

      sVar5 = (short)((uStack_24 << 0xb | local_28 >> 0x15 | 0x80000000) >>

                     (0x1eU - (char)uVar4 & 0x1f));

      if ((longlong)dVar2 < 0) {

        sVar5 = -sVar5;

      }

    }

    local_c0[(&DAT_00907ee8)[iVar3]] = sVar5;

    dVar2 = (double)(int)*(short *)(param_1 + 6 + iVar3 * 2) * (double)(&DAT_00908358)[iVar3] *

            _DAT_00908548 * _DAT_00908540 + _DAT_00908550;

    local_28 = SUB84(dVar2,0);

    uStack_24 = (uint)((ulonglong)dVar2 >> 0x20);

    uVar4 = uStack_24 >> 0x14 & 0x7ff;

    if (uVar4 < 0x3ff) {

      local_40 = 0;

    }

    else {

      local_40 = (uStack_24 << 0xb | local_28 >> 0x15 | 0x80000000) >> (0x1eU - (char)uVar4 & 0x1f);

      if ((longlong)dVar2 < 0) {

        local_40 = -local_40;

      }

    }

    piVar1 = &DAT_00907eec + iVar3;

    iVar3 = iVar3 + 4;

    local_c0[*piVar1] = (short)local_40;

  } while (iVar3 < 0x40);

  iVar3 = 0;

  do {

    *(short *)(param_1 + iVar3 * 2) = local_c0[iVar3];

    *(short *)(param_1 + 2 + iVar3 * 2) = local_c0[iVar3 + 1];

    *(short *)(param_1 + 4 + iVar3 * 2) = local_c0[iVar3 + 2];

    *(short *)(param_1 + 6 + iVar3 * 2) = local_c0[iVar3 + 3];

    iVar3 = iVar3 + 4;

  } while (iVar3 < 0x40);

  *(undefined2 *)(param_1 + 0x80) = 0;

  *(undefined2 *)(param_1 + 0x82) = 0;

  *(undefined2 *)(param_1 + 0x84) = 0;

  *(undefined2 *)(param_1 + 0x86) = 0;

  *(undefined2 *)(param_1 + 0x88) = 0;

  *(undefined2 *)(param_1 + 0x8a) = 0;

  *(undefined2 *)(param_1 + 0x8c) = 0;

  *(undefined2 *)(param_1 + 0x8e) = 0;

  *(undefined2 *)(param_1 + 0x90) = 0;

  *(undefined2 *)(param_1 + 0x92) = 0;

  *(undefined2 *)(param_1 + 0x94) = 0;

  *(undefined2 *)(param_1 + 0x96) = 0;

  *(undefined2 *)(param_1 + 0x98) = 0;

  *(undefined2 *)(param_1 + 0x9a) = 0;

  *(undefined2 *)(param_1 + 0x9c) = 0;

  *(undefined2 *)(param_1 + 0x9e) = 0;

  return;

}





// --- FUN_0061e740 at 0x0061E740 (size: 192) ---


void FUN_0061e740(int param_1)



{

  short sVar1;

  short sVar2;

  int iVar3;

  undefined2 local_8c [66];

  

  iVar3 = 0;

  do {

    sVar1 = *(short *)(param_1 + 2 + iVar3 * 2);

    local_8c[iVar3] = (short)(0x8000 / (longlong)(int)*(short *)(param_1 + iVar3 * 2));

    sVar2 = *(short *)(param_1 + 4 + iVar3 * 2);

    local_8c[iVar3 + 1] = (short)(0x8000 / (longlong)(int)sVar1);

    sVar1 = *(short *)(param_1 + 6 + iVar3 * 2);

    local_8c[iVar3 + 2] = (short)(0x8000 / (longlong)(int)sVar2);

    local_8c[iVar3 + 3] = (short)(0x8000 / (longlong)(int)sVar1);

    iVar3 = iVar3 + 4;

  } while (iVar3 < 0x40);

  iVar3 = 0;

  do {

    *(undefined2 *)(param_1 + (&DAT_00907ee0)[iVar3] * 2) = local_8c[iVar3];

    *(undefined2 *)(param_1 + (&DAT_00907ee4)[iVar3] * 2) = local_8c[iVar3 + 1];

    *(undefined2 *)(param_1 + (&DAT_00907ee8)[iVar3] * 2) = local_8c[iVar3 + 2];

    *(undefined2 *)(param_1 + (&DAT_00907eec)[iVar3] * 2) = local_8c[iVar3 + 3];

    iVar3 = iVar3 + 4;

  } while (iVar3 < 0x40);

  return;

}





// --- FUN_0061eca0 at 0x0061ECA0 (size: 83) ---


undefined4 FUN_0061eca0(int param_1)



{

  int iVar1;

  undefined4 uVar2;

  int local_c;

  

  uVar2 = 0;

  iVar1 = FUN_00619550(*(undefined4 *)(param_1 + 0x3c),param_1 + 0x40,

                       *(int *)(param_1 + 0x10) - *(int *)(param_1 + 0x14),&local_c);

  if ((iVar1 == 0) || (local_c != 0x1000)) {

    uVar2 = 0xffffffe9;

  }

  else {

    *(undefined4 *)(param_1 + 0x10) = *(undefined4 *)(param_1 + 0x14);

  }

  return uVar2;

}





// --- FUN_0061ed00 at 0x0061ED00 (size: 215) ---


undefined4 FUN_0061ed00(uint *param_1,uint param_2,int param_3)



{

  undefined1 *puVar1;

  uint uVar2;

  uint uVar3;

  uint uVar4;

  undefined4 local_18;

  

  local_18 = 0;

  uVar2 = param_1[3];

  if ((int)uVar2 < param_3) {

    uVar3 = *param_1;

    while( true ) {

      param_1[7] = param_1[7] + 1;

      param_3 = param_3 - uVar2;

      uVar3 = uVar3 | (int)param_2 >> ((byte)param_3 & 0x1f) & (1 << ((byte)uVar2 & 0x1f)) - 1U;

      puVar1 = (undefined1 *)param_1[4];

      if ((undefined1 *)param_1[6] <= puVar1) break;

      param_1[4] = (uint)(puVar1 + 1);

      *puVar1 = (char)uVar3;

      if (uVar3 == 0xff) {

        puVar1 = (undefined1 *)param_1[4];

        if ((undefined1 *)param_1[6] <= puVar1) {

          return 0xffffffe4;

        }

        param_1[4] = (uint)(puVar1 + 1);

        *puVar1 = 0;

        param_1[7] = param_1[7] + 1;

      }

      uVar3 = 0;

      uVar4 = 0;

      uVar2 = 8;

      if (param_3 < 9) goto LAB_0061edb7;

      param_1[3] = 8;

      *param_1 = 0;

      param_1[1] = 0;

    }

    local_18 = 0xffffffe4;

  }

  else {

    uVar3 = *param_1;

    uVar4 = param_1[1];

LAB_0061edb7:

    param_1[3] = uVar2 - param_3;

    uVar2 = (param_2 & (1 << ((byte)param_3 & 0x1f)) - 1U) << ((byte)(uVar2 - param_3) & 0x1f);

    *param_1 = uVar3 | uVar2;

    param_1[1] = uVar4 | (int)uVar2 >> 0x1f;

  }

  return local_18;

}





// --- FUN_0061ede0 at 0x0061EDE0 (size: 253) ---


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



{

  int iVar1;

  uint uVar2;

  undefined1 *puVar3;

  uint uVar4;

  uint uVar5;

  

  uVar2 = param_1[3];

  if ((int)uVar2 < param_3) {

    while( true ) {

      puVar3 = (undefined1 *)param_1[4];

      if ((undefined1 *)param_1[6] <= puVar3) {

        iVar1 = FUN_0061eca0(param_1);

        if (iVar1 != 0) {

          return iVar1;

        }

        uVar2 = param_1[3];

        puVar3 = (undefined1 *)param_1[4];

      }

      param_3 = param_3 - uVar2;

      uVar2 = (int)param_2 >> ((byte)param_3 & 0x1f) & (1 << ((byte)uVar2 & 0x1f)) - 1U | *param_1;

      param_1[4] = (uint)(puVar3 + 1);

      *puVar3 = (char)uVar2;

      param_1[7] = param_1[7] + 1;

      if ((uVar2 & 0xff) == 0xff) {

        puVar3 = (undefined1 *)param_1[4];

        if ((undefined1 *)param_1[6] <= puVar3) {

          iVar1 = FUN_0061eca0(param_1);

          if (iVar1 != 0) {

            return iVar1;

          }

          puVar3 = (undefined1 *)param_1[4];

        }

        param_1[4] = (uint)(puVar3 + 1);

        *puVar3 = 0;

        param_1[7] = param_1[7] + 1;

      }

      uVar2 = 8;

      if (param_3 < 9) break;

      param_1[3] = 8;

      *param_1 = 0;

      param_1[1] = 0;

    }

    uVar4 = 0;

    uVar5 = 0;

  }

  else {

    uVar4 = *param_1;

    uVar5 = param_1[1];

  }

  param_1[3] = uVar2 - param_3;

  uVar2 = (param_2 & (1 << ((byte)param_3 & 0x1f)) - 1U) << ((byte)(uVar2 - param_3) & 0x1f);

  *param_1 = uVar4 | uVar2;

  param_1[1] = uVar5 | (int)uVar2 >> 0x1f;

  return 0;

}





// --- FUN_0061eef0 at 0x0061EEF0 (size: 963) ---


void FUN_0061eef0(undefined4 param_1,undefined4 param_2,int param_3)



{

  int iVar1;

  int iVar2;

  int iVar3;

  int iVar4;

  char cVar5;

  int iVar6;

  char *pcVar7;

  int local_c5c [260];

  int aiStack_84c [260];

  int aiStack_43c [256];

  char acStack_39 [16];

  char acStack_29 [25];

  

  (*DAT_008f85a8)(local_c5c,param_1,0x404);

  (*DAT_008f85a4)(aiStack_84c,0x404);

  (*DAT_008f85a4)(acStack_39 + 1,0x21);

  iVar2 = 0;

  do {

    iVar3 = iVar2;

    aiStack_43c[iVar3] = -1;

    aiStack_43c[iVar3 + 1] = -1;

    aiStack_43c[iVar3 + 2] = -1;

    aiStack_43c[iVar3 + 3] = -1;

    aiStack_43c[iVar3 + 4] = -1;

    aiStack_43c[iVar3 + 5] = -1;

    iVar2 = iVar3 + 6;

  } while (iVar2 < 0xfb);

  aiStack_43c[iVar2] = -1;

  aiStack_43c[iVar3 + 7] = -1;

  aiStack_43c[iVar3 + 8] = -1;

  aiStack_43c[iVar3 + 9] = -1;

  aiStack_43c[iVar3 + 10] = -1;

  local_c5c[0x100] = 1;

  while( true ) {

    iVar2 = -1;

    iVar3 = 1000000000;

    iVar6 = 0;

    do {

      iVar4 = iVar6;

      iVar6 = local_c5c[iVar4];

      if ((iVar6 != 0) && (iVar6 <= iVar3)) {

        iVar3 = iVar6;

        iVar2 = iVar4;

      }

      iVar6 = local_c5c[iVar4 + 1];

      if ((iVar6 != 0) && (iVar6 <= iVar3)) {

        iVar2 = iVar4 + 1;

        iVar3 = iVar6;

      }

      iVar6 = local_c5c[iVar4 + 2];

      if ((iVar6 != 0) && (iVar6 <= iVar3)) {

        iVar2 = iVar4 + 2;

        iVar3 = iVar6;

      }

      iVar6 = iVar4 + 3;

    } while (iVar6 < 0xfe);

    iVar1 = local_c5c[iVar6];

    if ((iVar1 != 0) && (iVar1 <= iVar3)) {

      iVar3 = iVar1;

      iVar2 = iVar6;

    }

    if ((local_c5c[iVar4 + 4] != 0) && (local_c5c[iVar4 + 4] <= iVar3)) {

      iVar2 = iVar4 + 4;

    }

    iVar3 = -1;

    iVar6 = 1000000000;

    iVar4 = 0;

    do {

      iVar1 = local_c5c[iVar4];

      if (((iVar1 != 0) && (iVar1 <= iVar6)) && (iVar4 != iVar2)) {

        iVar3 = iVar4;

        iVar6 = iVar1;

      }

      iVar1 = local_c5c[iVar4 + 1];

      if (((iVar1 != 0) && (iVar1 <= iVar6)) && (iVar4 + 1 != iVar2)) {

        iVar3 = iVar4 + 1;

        iVar6 = iVar1;

      }

      iVar4 = iVar4 + 2;

    } while (iVar4 < 0xff);

    if (((local_c5c[iVar4] != 0) && (local_c5c[iVar4] <= iVar6)) && (iVar4 != iVar2)) {

      iVar3 = iVar4;

    }

    if (iVar3 == -1) break;

    iVar6 = iVar3 << 2;

    local_c5c[iVar2] = local_c5c[iVar2] + local_c5c[iVar3];

    local_c5c[iVar3] = 0;

    do {

      iVar4 = iVar2;

      aiStack_84c[iVar4] = aiStack_84c[iVar4] + 1;

      iVar2 = aiStack_43c[iVar4];

    } while (aiStack_43c[iVar4] != -1);

    aiStack_43c[iVar4] = iVar3;

    while( true ) {

      *(int *)((int)aiStack_84c + iVar6) = *(int *)((int)aiStack_84c + iVar6) + 1;

      if (*(int *)((int)aiStack_43c + iVar6) == -1) break;

      iVar6 = *(int *)((int)aiStack_43c + iVar6) * 4;

    }

  }

  iVar2 = 0;

  do {

    iVar3 = iVar2;

    iVar2 = aiStack_84c[iVar3];

    if (iVar2 != 0) {

      acStack_39[iVar2 + 1] = acStack_39[iVar2 + 1] + '\x01';

    }

    iVar2 = aiStack_84c[iVar3 + 1];

    if (iVar2 != 0) {

      acStack_39[iVar2 + 1] = acStack_39[iVar2 + 1] + '\x01';

    }

    iVar2 = aiStack_84c[iVar3 + 2];

    if (iVar2 != 0) {

      acStack_39[iVar2 + 1] = acStack_39[iVar2 + 1] + '\x01';

    }

    iVar2 = iVar3 + 3;

  } while (iVar2 < 0xfe);

  iVar2 = aiStack_84c[iVar2];

  if (iVar2 != 0) {

    acStack_39[iVar2 + 1] = acStack_39[iVar2 + 1] + '\x01';

  }

  iVar2 = aiStack_84c[iVar3 + 4];

  if (iVar2 != 0) {

    acStack_39[iVar2 + 1] = acStack_39[iVar2 + 1] + '\x01';

  }

  iVar2 = 0x1f;

  iVar3 = 0x20;

  while( true ) {

    while (iVar6 = iVar2, iVar2 = iVar6, acStack_39[iVar3 + 1] != '\0') {

      do {

        iVar4 = iVar2;

        iVar2 = iVar4 + -1;

      } while (acStack_39[iVar4] == '\0');

      acStack_39[iVar3 + 1] = acStack_39[iVar3 + 1] + -2;

      acStack_39[iVar6 + 1] = acStack_39[iVar6 + 1] + '\x01';

      acStack_39[iVar4 + 1] = acStack_39[iVar4 + 1] + '\x02';

      acStack_39[iVar4] = acStack_39[iVar4] + -1;

      iVar2 = iVar6;

    }

    if (iVar6 == 0xf) break;

    iVar2 = iVar6 + -1;

    iVar3 = iVar6;

  }

  pcVar7 = acStack_29;

  if (acStack_29[0] == '\0') {

    iVar2 = 0xf;

    do {

      pcVar7 = acStack_39 + iVar2;

      acStack_29[0] = acStack_39[iVar2];

      iVar2 = iVar2 + -1;

    } while (acStack_29[0] == '\0');

  }

  *pcVar7 = acStack_29[0] + -1;

  (*DAT_008f85a8)(param_2,acStack_39 + 1,0x10);

  iVar3 = 1;

  iVar2 = 0;

  do {

    iVar6 = 0;

    cVar5 = '\x01';

    do {

      if (iVar3 == aiStack_84c[iVar6]) {

        *(char *)(iVar2 + param_3) = (char)iVar6;

        iVar2 = iVar2 + 1;

      }

      if (iVar3 == aiStack_84c[iVar6 + 1]) {

        *(char *)(iVar2 + param_3) = cVar5;

        iVar2 = iVar2 + 1;

      }

      cVar5 = cVar5 + '\x02';

      iVar6 = iVar6 + 2;

    } while (iVar6 < 0x100);

    iVar3 = iVar3 + 1;

  } while (iVar3 < 0x21);

  return;

}





// --- FUN_0061fab0 at 0x0061FAB0 (size: 63) ---


void FUN_0061fab0(int param_1,int *param_2,short *param_3,int param_4,byte param_5)



{

  int *piVar1;

  short sVar2;

  int iVar3;

  

  if (param_4 == 0) {

    iVar3 = *param_2;

    sVar2 = (short)((int)*param_3 >> (param_5 & 0x1f));

    *param_2 = (int)sVar2;

    iVar3 = FUN_0061fe70(sVar2 - (short)iVar3);

    piVar1 = (int *)(param_1 + iVar3 * 4);

    *piVar1 = *piVar1 + 1;

  }

  return;

}





// --- FUN_0061faf0 at 0x0061FAF0 (size: 315) ---


void FUN_0061faf0(int param_1,int param_2,int *param_3,short *param_4,int param_5,byte param_6)



{

  undefined2 uVar1;

  undefined4 uVar2;

  int iVar3;

  int iVar4;

  int iVar5;

  

  if (param_5 == 0) {

    iVar4 = (int)*param_4 >> (param_6 & 0x1f);

    iVar5 = iVar4 - *param_3;

    *param_3 = (int)(short)iVar4;

    if (iVar5 < 0) {

      if (iVar5 < -0xff) {

        iVar4 = (char)(&DAT_00908560)[-iVar5 >> 8] + 8;

      }

      else {

        iVar4 = (int)(char)(&DAT_00908560)[-iVar5];

      }

      iVar5 = iVar5 + -1;

    }

    else if (iVar5 < 0x100) {

      iVar4 = (int)(char)(&DAT_00908560)[iVar5];

    }

    else {

      iVar4 = (char)(&DAT_00908560)[iVar5 >> 8] + 8;

    }

    uVar1 = *(undefined2 *)(param_2 + 0x408 + iVar4 * 2);

    uVar2 = *(undefined4 *)(param_2 + 8 + iVar4 * 4);

    if (*(int *)(param_1 + 0x3c) == 0) {

      iVar3 = FUN_0061ed00(param_1,uVar1,uVar2);

    }

    else {

      iVar3 = FUN_0061ede0(param_1,uVar1,uVar2);

    }

    if (iVar3 == 0) {

      if (*(int *)(param_1 + 0x3c) == 0) {

        FUN_0061ed00(param_1,iVar5,iVar4);

        return;

      }

      FUN_0061ede0(param_1,iVar5,iVar4);

      return;

    }

  }

  else {

    iVar4 = (int)*param_4 >> (param_6 & 0x1f);

    if (*(int *)(param_1 + 0x3c) == 0) {

      FUN_0061ed00(param_1,iVar4,1);

      return;

    }

    FUN_0061ede0(param_1,iVar4,1);

  }

  return;

}





// --- FUN_0061fc30 at 0x0061FC30 (size: 88) ---


void FUN_0061fc30(int param_1,int *param_2)



{

  int iVar1;

  

  iVar1 = *(int *)(param_1 + 0x28);

  if (iVar1 != 0) {

    if (iVar1 == 1) {

      *param_2 = *param_2 + 1;

    }

    else {

      if (0x7fff < iVar1) {

        param_2[0xe0] = param_2[0xe0] + 1;

        iVar1 = *(int *)(param_1 + 0x28) + -0x7fff;

        *(int *)(param_1 + 0x28) = iVar1;

      }

      iVar1 = FUN_0061fea0(iVar1);

      param_2[iVar1 * 0x10] = param_2[iVar1 * 0x10] + 1;

    }

    *(undefined4 *)(param_1 + 0x28) = 0;

    return;

  }

  return;

}





// --- FUN_0061fc90 at 0x0061FC90 (size: 369) ---


void FUN_0061fc90(int param_1,int param_2)



{

  undefined2 uVar1;

  undefined4 uVar2;

  int iVar3;

  int iVar4;

  

  iVar3 = *(int *)(param_1 + 0x28);

  if (iVar3 == 0) {

    return;

  }

  if (iVar3 == 1) {

    if (*(int *)(param_1 + 0x3c) == 0) {

      iVar3 = FUN_0061ed00(param_1,*(undefined2 *)(param_2 + 0x408),*(undefined4 *)(param_2 + 8));

    }

    else {

      iVar3 = FUN_0061ede0(param_1,*(undefined2 *)(param_2 + 0x408),*(undefined4 *)(param_2 + 8));

    }

  }

  else {

    if (0x7fff < iVar3) {

      if (*(int *)(param_1 + 0x3c) == 0) {

        iVar3 = FUN_0061ed00(param_1,*(undefined2 *)(param_2 + 0x5c8),

                             *(undefined4 *)(param_2 + 0x388));

      }

      else {

        iVar3 = FUN_0061ede0(param_1,*(undefined2 *)(param_2 + 0x5c8),

                             *(undefined4 *)(param_2 + 0x388));

      }

      if (iVar3 != 0) {

        return;

      }

      if (*(int *)(param_1 + 0x3c) == 0) {

        iVar3 = FUN_0061ed00(param_1,*(undefined4 *)(param_1 + 0x28),0xe);

      }

      else {

        iVar3 = FUN_0061ede0(param_1,*(undefined4 *)(param_1 + 0x28),0xe);

      }

      if (iVar3 != 0) {

        return;

      }

      iVar3 = *(int *)(param_1 + 0x28) + -0x7fff;

      *(int *)(param_1 + 0x28) = iVar3;

    }

    iVar3 = FUN_0061fea0(iVar3);

    uVar1 = *(undefined2 *)(param_2 + 0x408 + iVar3 * 0x20);

    uVar2 = *(undefined4 *)(param_2 + 8 + iVar3 * 0x40);

    if (*(int *)(param_1 + 0x3c) == 0) {

      iVar4 = FUN_0061ed00(param_1,uVar1,uVar2);

    }

    else {

      iVar4 = FUN_0061ede0(param_1,uVar1,uVar2);

    }

    if (iVar4 != 0) {

      return;

    }

    if (*(int *)(param_1 + 0x3c) == 0) {

      iVar3 = FUN_0061ed00(param_1,*(undefined4 *)(param_1 + 0x28),iVar3);

    }

    else {

      iVar3 = FUN_0061ede0(param_1,*(undefined4 *)(param_1 + 0x28),iVar3);

    }

  }

  if (iVar3 == 0) {

    *(undefined4 *)(param_1 + 0x28) = 0;

  }

  return;

}





// --- FUN_0061fe10 at 0x0061FE10 (size: 84) ---


void FUN_0061fe10(int param_1,int param_2,int *param_3)



{

  int iVar1;

  

  if (*(int *)(param_1 + 0x3c) == 0) {

    iVar1 = FUN_0061ed00(param_1,*(undefined2 *)(param_2 + 0x5e8),*(undefined4 *)(param_2 + 0x3c8));

  }

  else {

    iVar1 = FUN_0061ede0(param_1,*(undefined2 *)(param_2 + 0x5e8),*(undefined4 *)(param_2 + 0x3c8));

  }

  if (iVar1 == 0) {

    *param_3 = *param_3 + -0x10;

  }

  return;

}





// --- FUN_0061fe70 at 0x0061FE70 (size: 39) ---


int FUN_0061fe70(short param_1)



{

  int iVar1;

  uint uVar2;

  

  uVar2 = (int)param_1 >> 0x1f;

  iVar1 = ((int)param_1 ^ uVar2) - uVar2;

  if (iVar1 < 0x100) {

    return (int)(char)(&DAT_00908560)[iVar1];

  }

  return (char)(&DAT_00908560)[iVar1 >> 8] + 8;

}





// --- FUN_0061fea0 at 0x0061FEA0 (size: 33) ---


int FUN_0061fea0(int param_1)



{

  if (param_1 < 0x100) {

    return (int)(char)(&DAT_00908660)[param_1];

  }

  return (char)(&DAT_00908660)[param_1 >> 8] + 8;

}





// --- FUN_0061fed0 at 0x0061FED0 (size: 108) ---


void FUN_0061fed0(int param_1,undefined1 *param_2,int *param_3)



{

  int iVar1;

  

  iVar1 = *param_3;

  if (iVar1 != 0) {

    while (0 < iVar1) {

      if (*(int *)(param_1 + 0x3c) == 0) {

        iVar1 = FUN_0061ed00(param_1,*param_2,1);

      }

      else {

        iVar1 = FUN_0061ede0(param_1,*param_2,1);

      }

      if (iVar1 != 0) {

        return;

      }

      param_2 = param_2 + 1;

      iVar1 = *param_3 + -1;

      *param_3 = iVar1;

    }

  }

  return;

}





// --- FUN_0061ff40 at 0x0061FF40 (size: 295) ---


int FUN_0061ff40(int param_1,int param_2,int param_3,int param_4,byte param_5,int param_6)



{

  int *piVar1;

  int iVar2;

  int iVar3;

  int iVar4;

  

  iVar3 = 0;

  iVar2 = param_2;

  if (param_3 <= param_4) {

    param_3 = param_3 * 4;

    do {

      iVar2 = *(int *)((int)&DAT_00907ee0 + param_3);

      iVar4 = (int)*(short *)(param_2 + iVar2 * 2);

      param_3 = param_3 + 4;

      if (iVar4 == 0) {

        iVar3 = iVar3 + 1;

      }

      else {

        if (iVar4 < 0) {

          iVar4 = -iVar4 >> (param_5 & 0x1f);

        }

        else {

          iVar4 = iVar4 >> (param_5 & 0x1f);

        }

        if (iVar4 == 0) {

          iVar3 = iVar3 + 1;

        }

        else {

          FUN_0061fc30(param_1,param_6);

          if (0xf < iVar3) {

            if (iVar3 + -0xf < 0x60) {

              iVar2 = *(int *)(param_6 + 0x3c0);

            }

            else {

              iVar2 = *(int *)(param_6 + 0x3c0);

              do {

                iVar2 = iVar2 + 5;

                iVar3 = iVar3 + -0x50;

              } while (0x6e < iVar3);

            }

            do {

              iVar2 = iVar2 + 1;

              iVar3 = iVar3 + -0x10;

            } while (0xf < iVar3);

            *(int *)(param_6 + 0x3c0) = iVar2;

          }

          iVar2 = 1;

          while (iVar4 = iVar4 >> 1, iVar4 != 0) {

            iVar2 = iVar2 + 1;

          }

          piVar1 = (int *)(iVar3 * 0x40 + param_6 + iVar2 * 4);

          *piVar1 = *piVar1 + 1;

          iVar3 = 0;

        }

      }

    } while (param_3 <= param_4 * 4);

    if (0 < iVar3) {

      iVar2 = *(int *)(param_1 + 0x28) + 1;

      *(int *)(param_1 + 0x28) = iVar2;

      if (iVar2 == 0x7fff) {

        iVar2 = FUN_0061fc30(param_1,param_6);

      }

    }

  }

  return iVar2;

}





